Commit 23685d16 authored by Fabien Morin's avatar Fabien Morin

enable worklist displaying on another workflow

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23258 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3be25e2b
......@@ -39,7 +39,7 @@ def getPoralTypeListForWorkflow(self, workflow):
return portal_type_list
def getPortalTypeWorklistDictForWorkflow(self, workflow):
def getPortalTypeWorklistDictForWorkflow(self, workflow_list):
"""
return a dict containing portal_type and all informations about work_list
of workflow :
......@@ -56,11 +56,17 @@ def getPortalTypeWorklistDictForWorkflow(self, workflow):
.....
}
"""
portal_type_list = self.getPoralTypeListForWorkflow(self, workflow=workflow)
portal_type_worklist_dict = {}
portal_workflow = self.getPortalObject().portal_workflow
workflow = getattr(portal_workflow, workflow, None)
portal_type_worklist_dict = {}
if not isinstance(workflow_list, list):
workflow = [workflow_list]
for workflow in workflow_list:
portal_type_list = self.getPoralTypeListForWorkflow(self,
workflow=workflow)
workflow = getattr(portal_workflow, workflow, None)
if workflow is not None:
worklist_dict = workflow.worklists._mapping
......@@ -73,7 +79,8 @@ def getPortalTypeWorklistDictForWorkflow(self, workflow):
if state is None:
continue
result = self.getPortalObject().portal_catalog(portal_type=portal_type,
result = self.getPortalObject().portal_catalog(\
portal_type=portal_type,
local_roles=local_role_list,
validation_state=state)
if not len(result):
......
......@@ -70,7 +70,7 @@ Description:\n
\n
\n
<tal:block tal:define="global portal_type_dict python:\n
here.getPortalTypeWorklistDictForWorkflow(context, workflow=\'egov_universal_workflow\')" />\n
here.getPortalTypeWorklistDictForWorkflow(context, workflow_list=[\'egov_universal_workflow\', \'egov_anonymous_workflow\'])" />\n
<ul tal:condition="python: portal_type_dict">\n
<li tal:repeat="portal_type python: portal_type_dict.keys()">\n
<span class ="portal_type" tal:content="portal_type" i18n:domain="ui" i18n:translate="">portal_type</span>\n
......@@ -150,6 +150,12 @@ Description:\n
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
256
\ No newline at end of file
258
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment