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): ...@@ -39,7 +39,7 @@ def getPoralTypeListForWorkflow(self, workflow):
return portal_type_list 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 return a dict containing portal_type and all informations about work_list
of workflow : of workflow :
...@@ -56,11 +56,17 @@ def getPortalTypeWorklistDictForWorkflow(self, 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 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: if workflow is not None:
worklist_dict = workflow.worklists._mapping worklist_dict = workflow.worklists._mapping
...@@ -73,7 +79,8 @@ def getPortalTypeWorklistDictForWorkflow(self, workflow): ...@@ -73,7 +79,8 @@ def getPortalTypeWorklistDictForWorkflow(self, workflow):
if state is None: if state is None:
continue continue
result = self.getPortalObject().portal_catalog(portal_type=portal_type, result = self.getPortalObject().portal_catalog(\
portal_type=portal_type,
local_roles=local_role_list, local_roles=local_role_list,
validation_state=state) validation_state=state)
if not len(result): if not len(result):
......
...@@ -70,7 +70,7 @@ Description:\n ...@@ -70,7 +70,7 @@ Description:\n
\n \n
\n \n
<tal:block tal:define="global portal_type_dict python:\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 <ul tal:condition="python: portal_type_dict">\n
<li tal:repeat="portal_type python: portal_type_dict.keys()">\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 <span class ="portal_type" tal:content="portal_type" i18n:domain="ui" i18n:translate="">portal_type</span>\n
...@@ -150,6 +150,12 @@ Description:\n ...@@ -150,6 +150,12 @@ Description:\n
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
256 258
\ No newline at end of file \ 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