Commit 6cfd77d4 authored by Nicolas Delaby's avatar Nicolas Delaby

- get rid of getToolByName

- access tools from portal itself



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44064 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 490b8f5f
...@@ -127,10 +127,10 @@ def DCWorkflowDefinition_listGlobalActions(self, info): ...@@ -127,10 +127,10 @@ def DCWorkflowDefinition_listGlobalActions(self, info):
return None return None
def _listGlobalActions(user=None, id=None, portal_path=None): def _listGlobalActions(user=None, id=None, portal_path=None):
portal_url = getToolByName(self, 'portal_url') portal = self._getPortalRoot()
portal_url = portal.portal_url
portal_url = portal_url() portal_url = portal_url()
sm = getSecurityManager() sm = getSecurityManager()
portal = self._getPortalRoot()
res = [] res = []
fmt_data = None fmt_data = None
# We want to display some actions depending on the current date # We want to display some actions depending on the current date
...@@ -216,8 +216,9 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info, ...@@ -216,8 +216,9 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info,
if not self.worklists: if not self.worklists:
return None return None
portal = self.getPortalObject()
def getPortalTypeListForWorkflow(workflow_id): def getPortalTypeListForWorkflow(workflow_id):
workflow_tool = getToolByName(self, 'portal_workflow') workflow_tool = portal.portal_workflow
result = [] result = []
append = result.append append = result.append
for type_info in workflow_tool._listTypeInfo(): for type_info in workflow_tool._listTypeInfo():
...@@ -233,7 +234,7 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info, ...@@ -233,7 +234,7 @@ def DCWorkflowDefinition_getWorklistVariableMatchDict(self, info,
return None return None
variable_match_dict = {} variable_match_dict = {}
security_manager = getSecurityManager() security_manager = getSecurityManager()
portal = self.getPortalObject() workflow_tool = portal.portal_workflow
workflow_id = self.id workflow_id = self.id
workflow_title = self.title workflow_title = self.title
for worklist_id, worklist_definition in self.worklists.items(): for worklist_id, worklist_definition in self.worklists.items():
......
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