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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
0e0bda0e
Commit
0e0bda0e
authored
Aug 05, 2015
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
administration: add parameters to control the output of the dump of workflow chains
parent
9cc0460e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
bt5/erp5_administration/ExtensionTemplateItem/portal_components/extension.erp5.ERP5Administration.py
...em/portal_components/extension.erp5.ERP5Administration.py
+23
-5
No files found.
bt5/erp5_administration/ExtensionTemplateItem/portal_components/extension.erp5.ERP5Administration.py
View file @
0e0bda0e
...
...
@@ -7,7 +7,8 @@ from Products.CMFActivity.ActiveResult import ActiveResult
from
Products.ERP5Type.Document
import
newTempOOoDocument
from
zLOG
import
LOG
,
INFO
def
dumpWorkflowChain
(
self
):
def
dumpWorkflowChain
(
self
,
ignore_default
=
False
,
ignore_id_set
=
None
,
keep_order
=
False
,
batch_mode
=
False
):
# This method outputs the workflow chain in the format that you can
# easily get diff like the following:
# ---
...
...
@@ -15,6 +16,13 @@ def dumpWorkflowChain(self):
# Account,edit_workflow
# ...
# ---
# Parameters :
# - ignore_id_set : a set with workflow ids to exclude
# - keep_order : set to True if you would like to keep original order,
# default is to sort alphabetically
# - batch_mode : used to directly return the sctructure instead of return string
if
ignore_id_set
is
None
:
ignore_id_set
=
set
()
workflow_tool
=
self
.
getPortalObject
().
portal_workflow
cbt
=
workflow_tool
.
_chains_by_type
ti
=
workflow_tool
.
_listTypeInfo
()
...
...
@@ -24,15 +32,25 @@ def dumpWorkflowChain(self):
title
=
t
.
Title
()
if
title
==
id_
:
title
=
None
chain
=
None
if
cbt
is
not
None
and
cbt
.
has_key
(
id_
):
chain
=
sorted
(
cbt
[
id_
])
cbt_list
=
[
x
for
x
in
cbt
[
id_
]
if
not
(
x
in
ignore_id_set
)]
if
keep_order
:
chain
=
cbt_list
else
:
chain
=
sorted
(
cbt_list
)
else
:
chain
=
[
'(Default)'
]
types_info
.
append
({
'id'
:
id_
,
if
not
(
ignore_default
):
chain
=
[
'(Default)'
]
if
chain
:
types_info
.
append
({
'id'
:
id_
,
'title'
:
title
,
'chain'
:
chain
})
types_info
.
sort
(
key
=
lambda
x
:
x
[
'id'
])
if
batch_mode
:
return
types_info
output
=
[]
for
i
in
sorted
(
types_info
,
key
=
lambda
x
:
x
[
'id'
])
:
for
i
in
types_info
:
for
chain
in
i
[
'chain'
]:
output
.
append
(
'%s,%s'
%
(
i
[
'id'
],
chain
))
return
'
\
n
'
.
join
(
output
)
...
...
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