Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
4fbb8f94
Commit
4fbb8f94
authored
Jul 05, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: idem, change getScriptValueDict and getWorklistValueDict
parent
4e77594b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
37 deletions
+31
-37
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
...Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
+1
-1
product/ERP5/Extensions/CheckSkins.py
product/ERP5/Extensions/CheckSkins.py
+4
-4
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+5
-2
product/ERP5Type/patches/DCWorkflow.py
product/ERP5Type/patches/DCWorkflow.py
+8
-8
product/ERP5Type/patches/Expression.py
product/ERP5Type/patches/Expression.py
+2
-1
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+3
-6
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+8
-15
No files found.
bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_toolbox/ERP5Site_getToBeTranslatedMessageListFromEntireSystemAsPot.py
View file @
4fbb8f94
...
@@ -134,7 +134,7 @@ for i in context.portal_workflow.objectValues():
...
@@ -134,7 +134,7 @@ for i in context.portal_workflow.objectValues():
add_message
(
msg_id
,
portal_url
.
getRelativeContentURL
(
t
))
add_message
(
msg_id
,
portal_url
.
getRelativeContentURL
(
t
))
# also use transition title as msg_id for compatibility
# also use transition title as msg_id for compatibility
add_message
(
t
.
title
,
portal_url
.
getRelativeContentURL
(
t
))
add_message
(
t
.
title
,
portal_url
.
getRelativeContentURL
(
t
))
for
worklist
in
i
.
getWorklistValue
Dict
().
values
():
for
worklist
in
i
.
getWorklistValue
List
():
add_message
(
worklist
.
actbox_name
,
portal_url
.
getRelativeContentURL
(
worklist
))
add_message
(
worklist
.
actbox_name
,
portal_url
.
getRelativeContentURL
(
worklist
))
...
...
product/ERP5/Extensions/CheckSkins.py
View file @
4fbb8f94
...
@@ -322,19 +322,19 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
...
@@ -322,19 +322,19 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
transition
.
actbox_url
=
text
transition
.
actbox_url
=
text
break
break
# Worklists.
# Worklists.
for
id
,
worklist
in
wf
.
getWorklistValueDict
().
items
():
for
worklist
in
wf
.
getWorklistValueList
():
text
=
worklist
.
actbox_url
text
=
worklist
.
actbox_url
for
info
in
info_list
:
for
info
in
info_list
:
if
info
.
regexp
.
search
(
text
)
is
not
None
:
if
info
.
regexp
.
search
(
text
)
is
not
None
:
text
=
info
.
regexp
.
sub
(
info
.
new_name
,
text
)
text
=
info
.
regexp
.
sub
(
info
.
new_name
,
text
)
line
=
'Worklist %s of %s is modified for %s'
%
(
id
,
'portal_workflow/'
+
wf
.
id
,
info
.
name
)
line
=
'Worklist %s of %s is modified for %s'
%
(
worklist
.
getReference
()
,
'portal_workflow/'
+
wf
.
id
,
info
.
name
)
LOG
(
'fixSkinNames'
,
0
,
line
)
LOG
(
'fixSkinNames'
,
0
,
line
)
msg
+=
'%s
\
n
'
%
line
msg
+=
'%s
\
n
'
%
line
if
not
dry_run
:
if
not
dry_run
:
worklist
.
actbox_url
=
text
worklist
.
actbox_url
=
text
break
break
# Scripts.
# Scripts.
for
id
,
script
in
wf
.
getScriptValueDict
().
items
():
for
script
in
wf
.
getScriptValueList
():
text
=
script
.
manage_FTPget
()
text
=
script
.
manage_FTPget
()
name_list
=
[]
name_list
=
[]
for
info
in
info_list
:
for
info
in
info_list
:
...
@@ -342,7 +342,7 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
...
@@ -342,7 +342,7 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
text
=
info
.
regexp
.
sub
(
info
.
new_name
,
text
)
text
=
info
.
regexp
.
sub
(
info
.
new_name
,
text
)
name_list
.
append
(
info
.
name
)
name_list
.
append
(
info
.
name
)
if
len
(
name_list
)
>
0
:
if
len
(
name_list
)
>
0
:
line
=
'Script %s of %s is modified for %s'
%
(
id
,
'portal_workflow/'
+
wf
.
id
,
', '
.
join
(
name_list
))
line
=
'Script %s of %s is modified for %s'
%
(
script
.
getReference
()
,
'portal_workflow/'
+
wf
.
id
,
', '
.
join
(
name_list
))
LOG
(
'fixSkinNames'
,
0
,
line
)
LOG
(
'fixSkinNames'
,
0
,
line
)
msg
+=
'%s
\
n
'
%
line
msg
+=
'%s
\
n
'
%
line
if
not
dry_run
:
if
not
dry_run
:
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
4fbb8f94
...
@@ -111,8 +111,11 @@ class TypesTool(TypeProvider):
...
@@ -111,8 +111,11 @@ class TypesTool(TypeProvider):
except
AttributeError
:
except
AttributeError
:
pass
pass
try
:
try
:
script
=
self
.
getPortalObject
().
portal_workflow
\
worflow_tool
=
self
.
getPortalObject
().
portal_workflow
.
dynamic_class_generation_interaction_workflow
.
getScriptValueDict
()
\
workflow
=
workflow_tool
.
dynamic_class_generation_interaction_workflow
script_dict
=
{
script
.
getReference
():
script
for
script
in
workflow
.
getScriptValueList
()}
script
=
script_dict
\
.
DynamicClassGeneration_resetDynamicDocuments
.
DynamicClassGeneration_resetDynamicDocuments
new
=
'.resetDynamicDocumentsOnceAtTransactionBoundary('
new
=
'.resetDynamicDocumentsOnceAtTransactionBoundary('
if
new
not
in
script
.
_body
:
if
new
not
in
script
.
_body
:
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
4fbb8f94
...
@@ -827,20 +827,20 @@ def DCWorkflowDefinition_getTransitionIdList(self):
...
@@ -827,20 +827,20 @@ def DCWorkflowDefinition_getTransitionIdList(self):
if
self
.
transitions
is
not
None
:
if
self
.
transitions
is
not
None
:
return
self
.
transitions
.
objectIds
()
return
self
.
transitions
.
objectIds
()
return
[]
return
[]
def
DCWorkflowDefinition_getWorklistValue
Dic
t
(
self
):
def
DCWorkflowDefinition_getWorklistValue
Lis
t
(
self
):
if
self
.
worklists
is
not
None
:
if
self
.
worklists
is
not
None
:
return
self
.
worklists
return
self
.
worklists
.
values
()
return
{}
return
[]
def
DCWorkflowDefinition_getWorklistIdList
(
self
):
def
DCWorkflowDefinition_getWorklistIdList
(
self
):
if
self
.
worklists
is
not
None
:
if
self
.
worklists
is
not
None
:
return
self
.
worklists
.
objectIds
()
return
self
.
worklists
.
objectIds
()
return
[]
return
[]
def
DCWorkflowDefinition_propertyIds
(
self
):
def
DCWorkflowDefinition_propertyIds
(
self
):
return
sorted
(
self
.
__dict__
.
keys
())
return
sorted
(
self
.
__dict__
.
keys
())
def
DCWorkflowDefinition_getScriptValue
Dic
t
(
self
):
def
DCWorkflowDefinition_getScriptValue
Lis
t
(
self
):
if
self
.
scripts
is
not
None
:
if
self
.
scripts
is
not
None
:
return
self
.
scripts
return
self
.
scripts
.
values
()
return
{}
return
[]
def
StateDefinition_getDestinationIdList
(
self
):
def
StateDefinition_getDestinationIdList
(
self
):
return
self
.
transitions
return
self
.
transitions
def
DCWorkflowDefinition_getPortalType
(
self
):
def
DCWorkflowDefinition_getPortalType
(
self
):
...
@@ -1097,8 +1097,8 @@ DCWorkflowDefinition.getStateValueById = DCWorkflowDefinition_getStateValueById
...
@@ -1097,8 +1097,8 @@ DCWorkflowDefinition.getStateValueById = DCWorkflowDefinition_getStateValueById
DCWorkflowDefinition
.
getStateValueList
=
DCWorkflowDefinition_getStateValueList
DCWorkflowDefinition
.
getStateValueList
=
DCWorkflowDefinition_getStateValueList
DCWorkflowDefinition
.
getTransitionValueById
=
DCWorkflowDefinition_getTransitionValueById
DCWorkflowDefinition
.
getTransitionValueById
=
DCWorkflowDefinition_getTransitionValueById
DCWorkflowDefinition
.
getTransitionValueList
=
DCWorkflowDefinition_getTransitionValueList
DCWorkflowDefinition
.
getTransitionValueList
=
DCWorkflowDefinition_getTransitionValueList
DCWorkflowDefinition
.
getWorklistValue
Dict
=
DCWorkflowDefinition_getWorklistValueDic
t
DCWorkflowDefinition
.
getWorklistValue
List
=
DCWorkflowDefinition_getWorklistValueLis
t
DCWorkflowDefinition
.
getScriptValue
Dict
=
DCWorkflowDefinition_getScriptValueDic
t
DCWorkflowDefinition
.
getScriptValue
List
=
DCWorkflowDefinition_getScriptValueLis
t
DCWorkflowDefinition
.
getVariableIdList
=
DCWorkflowDefinition_getVariableIdList
DCWorkflowDefinition
.
getVariableIdList
=
DCWorkflowDefinition_getVariableIdList
DCWorkflowDefinition
.
getStateIdList
=
DCWorkflowDefinition_getStateIdList
DCWorkflowDefinition
.
getStateIdList
=
DCWorkflowDefinition_getStateIdList
DCWorkflowDefinition
.
getTransitionIdList
=
DCWorkflowDefinition_getTransitionIdList
DCWorkflowDefinition
.
getTransitionIdList
=
DCWorkflowDefinition_getTransitionIdList
...
...
product/ERP5Type/patches/Expression.py
View file @
4fbb8f94
...
@@ -36,7 +36,8 @@ def _createExprContext(sci):
...
@@ -36,7 +36,8 @@ def _createExprContext(sci):
'''
'''
ob
=
sci
.
object
ob
=
sci
.
object
wf
=
sci
.
workflow
wf
=
sci
.
workflow
script_dict
=
wf
.
getScriptValueDict
()
script_dict
=
{
script
.
getReference
():
script
for
script
in
wf
.
getScriptValueList
()}
container
=
aq_parent
(
aq_inner
(
ob
))
container
=
aq_parent
(
aq_inner
(
ob
))
data
=
{
data
=
{
'here'
:
ob
,
'here'
:
ob
,
...
...
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
4fbb8f94
...
@@ -187,12 +187,9 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -187,12 +187,9 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
def
_getWorkflowStateOf
(
self
,
ob
,
id_only
=
0
):
def
_getWorkflowStateOf
(
self
,
ob
,
id_only
=
0
):
return
None
return
None
security
.
declarePrivate
(
'getScriptValueDict'
)
security
.
declarePrivate
(
'getScriptValueList'
)
def
getScriptValueDict
(
self
):
def
getScriptValueList
(
self
):
scripts
=
{}
return
self
.
objectValues
(
portal_type
=
'Workflow Script'
)
for
script
in
self
.
objectValues
(
portal_type
=
'Workflow Script'
):
scripts
[
script
.
getReference
()]
=
script
return
scripts
security
.
declarePrivate
(
'getTransitionValueById'
)
security
.
declarePrivate
(
'getTransitionValueById'
)
def
getTransitionValueById
(
self
,
transition_id
):
def
getTransitionValueById
(
self
,
transition_id
):
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
4fbb8f94
...
@@ -359,7 +359,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -359,7 +359,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
security_manager
=
getSecurityManager
()
security_manager
=
getSecurityManager
()
workflow_id
=
self
.
getId
()
workflow_id
=
self
.
getId
()
workflow_title
=
self
.
getTitle
()
workflow_title
=
self
.
getTitle
()
for
worklist_
id
,
worklist_definition
in
self
.
getWorklistValueDict
().
items
():
for
worklist_
definition
in
self
.
getWorklistValueList
():
action_box_name
=
worklist_definition
.
getActboxName
()
action_box_name
=
worklist_definition
.
getActboxName
()
guard
=
worklist_definition
.
getGuard
()
guard
=
worklist_definition
.
getGuard
()
if
action_box_name
:
if
action_box_name
:
...
@@ -401,6 +401,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -401,6 +401,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
fmt_data
.
_push
({
k
:
(
'&%s:list='
%
k
).
join
(
v
)
for
\
fmt_data
.
_push
({
k
:
(
'&%s:list='
%
k
).
join
(
v
)
for
\
k
,
v
in
variable_match
.
iteritems
()})
k
,
v
in
variable_match
.
iteritems
()})
worklist_id
=
worklist_definition
.
getReference
()
variable_match
[
WORKLIST_METADATA_KEY
]
=
{
variable_match
[
WORKLIST_METADATA_KEY
]
=
{
'format_data'
:
fmt_data
,
'format_data'
:
fmt_data
,
'worklist_title'
:
action_box_name
,
'worklist_title'
:
action_box_name
,
...
@@ -502,11 +503,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -502,11 +503,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
id_list
.
append
(
ob
.
getReference
())
id_list
.
append
(
ob
.
getReference
())
return
id_list
return
id_list
def
getWorklistValueDict
(
self
):
def
getWorklistValueList
(
self
):
worklist_dict
=
{}
return
self
.
objectValues
(
portal_type
=
"Worklist"
)
for
qdef
in
self
.
objectValues
(
portal_type
=
"Worklist"
):
worklist_dict
[
qdef
.
getReference
()]
=
qdef
return
worklist_dict
def
getWorklistIdList
():
def
getWorklistIdList
():
id_list
=
[]
id_list
=
[]
...
@@ -522,16 +520,11 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
...
@@ -522,16 +520,11 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
return
self
.
objectValues
(
portal_type
=
"Transition"
)
return
self
.
objectValues
(
portal_type
=
"Transition"
)
def
getTransitionIdList
(
self
):
def
getTransitionIdList
(
self
):
id_list
=
[]
return
[
ob
.
getReference
()
for
ob
for
ob
in
self
.
objectValues
(
portal_type
=
"Transition"
):
in
self
.
objectValues
(
portal_type
=
"Transition"
)]
id_list
.
append
(
ob
.
getReference
())
return
id_list
def
getScriptValueDict
(
self
):
def
getScriptValueList
(
self
):
scripts
=
{}
return
self
.
objectValues
(
portal_type
=
'Workflow Script'
)
for
script
in
self
.
objectValues
(
portal_type
=
'Workflow Script'
):
scripts
[
script
.
getReference
()]
=
script
return
scripts
def
notifyWorkflowMethod
(
self
,
ob
,
transition_list
,
args
=
None
,
kw
=
None
):
def
notifyWorkflowMethod
(
self
,
ob
,
transition_list
,
args
=
None
,
kw
=
None
):
""" Execute workflow methods.
""" Execute workflow methods.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment