Commit 7601551e authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5Type.patches.DCWorkflow: Balance _push and _pop.

Otherwise fmt_data lookups becomes slower on each iteration.
Also, reword patch comments to be still descriptive when moved a bit
further from involved code.
parent 032b87dc
...@@ -176,17 +176,19 @@ def DCWorkflowDefinition_listGlobalActions(self, info): ...@@ -176,17 +176,19 @@ def DCWorkflowDefinition_listGlobalActions(self, info):
if fmt_data is None: if fmt_data is None:
fmt_data = TemplateDict() fmt_data = TemplateDict()
fmt_data._push(info) fmt_data._push(info)
fmt_data._push({'count': searchres_len}) # Patches for ERP5 by JP Smets:
# Patch for ERP5 by JP Smets in order to # - add "portal_type" to filter per portal type more easily
# filter per portal type more easily (ie. without # (ie. without hardcoding it all)
# hardcoding it all) # - "local_roles" to allow filtering by local roles
fmt_data._push({'portal_type': '&portal_type='.join(dict['portal_type'])}) if 'local_roles' in dict:
# Patch for ERP5 by JP Smets in order local_roles = '&local_roles='.join(dict['local_roles'])
# to implement worklists and search of local roles
if dict.has_key('local_roles'):
fmt_data._push({'local_roles': '&local_roles='.join(dict['local_roles'])})
else: else:
fmt_data._push({'local_roles': ''}) local_roles = ''
fmt_data._push({
'count': searchres_len,
'portal_type': '&portal_type='.join(dict['portal_type']),
'local_roles': local_roles,
})
res.append((id, {'name': qdef.actbox_name % fmt_data, res.append((id, {'name': qdef.actbox_name % fmt_data,
'url': '%s/%s' % (portal_url, qdef.actbox_url % fmt_data), 'url': '%s/%s' % (portal_url, qdef.actbox_url % fmt_data),
'worklist_id': id, 'worklist_id': id,
......
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