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
Show 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():
add_message
(
msg_id
,
portal_url
.
getRelativeContentURL
(
t
))
# also use transition title as msg_id for compatibility
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
))
...
...
product/ERP5/Extensions/CheckSkins.py
View file @
4fbb8f94
...
...
@@ -322,19 +322,19 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
transition
.
actbox_url
=
text
break
# Worklists.
for
id
,
worklist
in
wf
.
getWorklistValueDict
().
items
():
for
worklist
in
wf
.
getWorklistValueList
():
text
=
worklist
.
actbox_url
for
info
in
info_list
:
if
info
.
regexp
.
search
(
text
)
is
not
None
:
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
)
msg
+=
'%s
\
n
'
%
line
if
not
dry_run
:
worklist
.
actbox_url
=
text
break
# Scripts.
for
id
,
script
in
wf
.
getScriptValueDict
().
items
():
for
script
in
wf
.
getScriptValueList
():
text
=
script
.
manage_FTPget
()
name_list
=
[]
for
info
in
info_list
:
...
...
@@ -342,7 +342,7 @@ def fixSkinNames(self, REQUEST=None, file=None, dry_run=0):
text
=
info
.
regexp
.
sub
(
info
.
new_name
,
text
)
name_list
.
append
(
info
.
name
)
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
)
msg
+=
'%s
\
n
'
%
line
if
not
dry_run
:
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
4fbb8f94
...
...
@@ -111,8 +111,11 @@ class TypesTool(TypeProvider):
except
AttributeError
:
pass
try
:
script
=
self
.
getPortalObject
().
portal_workflow
\
.
dynamic_class_generation_interaction_workflow
.
getScriptValueDict
()
\
worflow_tool
=
self
.
getPortalObject
().
portal_workflow
workflow
=
workflow_tool
.
dynamic_class_generation_interaction_workflow
script_dict
=
{
script
.
getReference
():
script
for
script
in
workflow
.
getScriptValueList
()}
script
=
script_dict
\
.
DynamicClassGeneration_resetDynamicDocuments
new
=
'.resetDynamicDocumentsOnceAtTransactionBoundary('
if
new
not
in
script
.
_body
:
...
...
product/ERP5Type/patches/DCWorkflow.py
View file @
4fbb8f94
...
...
@@ -827,20 +827,20 @@ def DCWorkflowDefinition_getTransitionIdList(self):
if
self
.
transitions
is
not
None
:
return
self
.
transitions
.
objectIds
()
return
[]
def
DCWorkflowDefinition_getWorklistValue
Dic
t
(
self
):
def
DCWorkflowDefinition_getWorklistValue
Lis
t
(
self
):
if
self
.
worklists
is
not
None
:
return
self
.
worklists
return
{}
return
self
.
worklists
.
values
()
return
[]
def
DCWorkflowDefinition_getWorklistIdList
(
self
):
if
self
.
worklists
is
not
None
:
return
self
.
worklists
.
objectIds
()
return
[]
def
DCWorkflowDefinition_propertyIds
(
self
):
return
sorted
(
self
.
__dict__
.
keys
())
def
DCWorkflowDefinition_getScriptValue
Dic
t
(
self
):
def
DCWorkflowDefinition_getScriptValue
Lis
t
(
self
):
if
self
.
scripts
is
not
None
:
return
self
.
scripts
return
{}
return
self
.
scripts
.
values
()
return
[]
def
StateDefinition_getDestinationIdList
(
self
):
return
self
.
transitions
def
DCWorkflowDefinition_getPortalType
(
self
):
...
...
@@ -1097,8 +1097,8 @@ DCWorkflowDefinition.getStateValueById = DCWorkflowDefinition_getStateValueById
DCWorkflowDefinition
.
getStateValueList
=
DCWorkflowDefinition_getStateValueList
DCWorkflowDefinition
.
getTransitionValueById
=
DCWorkflowDefinition_getTransitionValueById
DCWorkflowDefinition
.
getTransitionValueList
=
DCWorkflowDefinition_getTransitionValueList
DCWorkflowDefinition
.
getWorklistValue
Dict
=
DCWorkflowDefinition_getWorklistValueDic
t
DCWorkflowDefinition
.
getScriptValue
Dict
=
DCWorkflowDefinition_getScriptValueDic
t
DCWorkflowDefinition
.
getWorklistValue
List
=
DCWorkflowDefinition_getWorklistValueLis
t
DCWorkflowDefinition
.
getScriptValue
List
=
DCWorkflowDefinition_getScriptValueLis
t
DCWorkflowDefinition
.
getVariableIdList
=
DCWorkflowDefinition_getVariableIdList
DCWorkflowDefinition
.
getStateIdList
=
DCWorkflowDefinition_getStateIdList
DCWorkflowDefinition
.
getTransitionIdList
=
DCWorkflowDefinition_getTransitionIdList
...
...
product/ERP5Type/patches/Expression.py
View file @
4fbb8f94
...
...
@@ -36,7 +36,8 @@ def _createExprContext(sci):
'''
ob
=
sci
.
object
wf
=
sci
.
workflow
script_dict
=
wf
.
getScriptValueDict
()
script_dict
=
{
script
.
getReference
():
script
for
script
in
wf
.
getScriptValueList
()}
container
=
aq_parent
(
aq_inner
(
ob
))
data
=
{
'here'
:
ob
,
...
...
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
4fbb8f94
...
...
@@ -187,12 +187,9 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
def
_getWorkflowStateOf
(
self
,
ob
,
id_only
=
0
):
return
None
security
.
declarePrivate
(
'getScriptValueDict'
)
def
getScriptValueDict
(
self
):
scripts
=
{}
for
script
in
self
.
objectValues
(
portal_type
=
'Workflow Script'
):
scripts
[
script
.
getReference
()]
=
script
return
scripts
security
.
declarePrivate
(
'getScriptValueList'
)
def
getScriptValueList
(
self
):
return
self
.
objectValues
(
portal_type
=
'Workflow Script'
)
security
.
declarePrivate
(
'getTransitionValueById'
)
def
getTransitionValueById
(
self
,
transition_id
):
...
...
product/ERP5Workflow/Document/Workflow.py
View file @
4fbb8f94
...
...
@@ -359,7 +359,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
security_manager
=
getSecurityManager
()
workflow_id
=
self
.
getId
()
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
()
guard
=
worklist_definition
.
getGuard
()
if
action_box_name
:
...
...
@@ -401,6 +401,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
fmt_data
.
_push
({
k
:
(
'&%s:list='
%
k
).
join
(
v
)
for
\
k
,
v
in
variable_match
.
iteritems
()})
worklist_id
=
worklist_definition
.
getReference
()
variable_match
[
WORKLIST_METADATA_KEY
]
=
{
'format_data'
:
fmt_data
,
'worklist_title'
:
action_box_name
,
...
...
@@ -502,11 +503,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
id_list
.
append
(
ob
.
getReference
())
return
id_list
def
getWorklistValueDict
(
self
):
worklist_dict
=
{}
for
qdef
in
self
.
objectValues
(
portal_type
=
"Worklist"
):
worklist_dict
[
qdef
.
getReference
()]
=
qdef
return
worklist_dict
def
getWorklistValueList
(
self
):
return
self
.
objectValues
(
portal_type
=
"Worklist"
)
def
getWorklistIdList
():
id_list
=
[]
...
...
@@ -522,16 +520,11 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
return
self
.
objectValues
(
portal_type
=
"Transition"
)
def
getTransitionIdList
(
self
):
id_list
=
[]
for
ob
in
self
.
objectValues
(
portal_type
=
"Transition"
):
id_list
.
append
(
ob
.
getReference
())
return
id_list
return
[
ob
.
getReference
()
for
ob
in
self
.
objectValues
(
portal_type
=
"Transition"
)]
def
getScriptValueDict
(
self
):
scripts
=
{}
for
script
in
self
.
objectValues
(
portal_type
=
'Workflow Script'
):
scripts
[
script
.
getReference
()]
=
script
return
scripts
def
getScriptValueList
(
self
):
return
self
.
objectValues
(
portal_type
=
'Workflow Script'
)
def
notifyWorkflowMethod
(
self
,
ob
,
transition_list
,
args
=
None
,
kw
=
None
):
""" 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