Commit 1f13a62a authored by wenjie.zheng's avatar wenjie.zheng

patches/WorkflowTool.py: Load worklist in Action Box.

parent 63f1674c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
############################################################################## ##############################################################################
# #
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved. # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2002,2005 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2002,2005,2015 Nexedi SARL and Contributors. All Rights Reserved.
# #
# This software is subject to the provisions of the Zope Public License, # This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
...@@ -461,15 +461,11 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False): ...@@ -461,15 +461,11 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
worklist_dict = {} worklist_dict = {}
document = info.object document = info.object
#LOG('zwj: Object is %s'%document.getId(), WARNING, ' in Workflow tool.')
#LOG('zwj: Object url is %s'%info.object_url, WARNING, ' in Workflow tool.')
#LOG('zwj: Context is %s'%self.getId(), WARNING, ' in Workflow tool.')
#LOG('zwj: folder url is %s'%info.portal_url, WARNING, ' in Workflow tool.')
### zwj: following part is for ERP5Workflow actions
if document is not None: if document is not None:
document_pt = document.getTypeInfo() document_pt = document.getTypeInfo()
if document_pt is not None: if document_pt is not None:
#LOG('zwj: document is %s, pt is %s'%(document.getId(), document_pt.getId()), WARNING, ' in WorkflowTool.py.')
workflow_list = document_pt.getTypeERP5WorkflowList() workflow_list = document_pt.getTypeERP5WorkflowList()
if (workflow_list is not None) and (workflow_list is not []): if (workflow_list is not None) and (workflow_list is not []):
LOG('zwj: ERP5Workflow_list is %s'%str(workflow_list), WARNING, ' in Workflow tool.') LOG('zwj: ERP5Workflow_list is %s'%str(workflow_list), WARNING, ' in Workflow tool.')
...@@ -480,12 +476,21 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False): ...@@ -480,12 +476,21 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
raise NotImplementedError ("Can not find workflow: %s, please check if the workflow exists."%wf_id) raise NotImplementedError ("Can not find workflow: %s, please check if the workflow exists."%wf_id)
a = wf.listObjectActions(info) a = wf.listObjectActions(info)
if a is not None: if a is not None:
#LOG('zwj: action is %s'%a.get('id', None), WARNING, ' in Workflow tool.')
actions.extend(a) actions.extend(a)
a = wf.getWorklistVariableMatchDict(info) """
a = wf.listGlobalActions(info)
if a is not None:
actions.extend(a)
"""
a = wf.getWorklistVariableMatchDict(info) ### zwj: replace listGlobalActions(info)
if a is not None:
actions.extend(a)
### zwj: ???
if a is not None: if a is not None:
worklist_dict[wf_id] = a worklist_dict[wf_id] = a
### ==========================================================================
### zwj: following part is for DCWorkflow actions
for wf_id in chain: for wf_id in chain:
did[wf_id] = None did[wf_id] = None
wf = self.getWorkflowById(wf_id) wf = self.getWorkflowById(wf_id)
...@@ -506,6 +511,7 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False): ...@@ -506,6 +511,7 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
a = wf.getWorklistVariableMatchDict(info) a = wf.getWorklistVariableMatchDict(info)
if a is not None: if a is not None:
worklist_dict[wf_id] = a worklist_dict[wf_id] = a
### ==========================================================================
if worklist_dict: if worklist_dict:
portal = self.getPortalObject() portal = self.getPortalObject()
......
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