Commit 5423d566 authored by iv's avatar iv

ERP5Workflow: use ActionInformation property sheet in Worklists

parent 90a8918e
......@@ -95,10 +95,10 @@
<string>my_matched_simulation_state_list</string>
<string>my_matched_validation_state_list</string>
<string>my_matched_causality_state</string>
<string>my_actbox_name</string>
<string>my_actbox_url</string>
<string>my_actbox_icon</string>
<string>my_actbox_category</string>
<string>my_action_name</string>
<string>my_action</string>
<string>my_icon</string>
<string>my_action_type</string>
</list>
</value>
</item>
......
......@@ -18,7 +18,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_actbox_url</string> </value>
<value> <string>my_action</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -17,7 +17,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_actbox_name</string> </value>
<value> <string>my_action_name</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -17,7 +17,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_actbox_category</string> </value>
<value> <string>my_action_type</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -17,7 +17,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_actbox_icon</string> </value>
<value> <string>my_icon</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actbox_category_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actbox_icon_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actbox_name_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/string</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actbox_url_property</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>storage_id</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -355,13 +355,13 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
security_manager = getSecurityManager()
workflow_id = self.getId()
workflow_title = self.getTitle()
for worklist_definition in self.getWorklistValueList():
action_box_name = worklist_definition.getActboxName()
guard = worklist_definition.getGuard()
for worklist_value in self.getWorklistValueList():
action_box_name = worklist_value.getActionName()
guard = worklist_value.getGuard()
if action_box_name:
variable_match = {}
for key in worklist_definition.getVarMatchKeys():
var = worklist_definition.getVarMatch(key)
for key in worklist_value.getVarMatchKeys():
var = worklist_value.getVarMatch(key)
if isinstance(var, Expression):
evaluated_value = var(createExprContext(StateChangeInfo(portal,
self, kwargs=info.__dict__.copy())))
......@@ -397,15 +397,15 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
fmt_data._push({k: ('&%s:list=' % k).join(v) for\
k, v in variable_match.iteritems()})
worklist_id = worklist_definition.getReference()
worklist_id = worklist_value.getReference()
variable_match[WORKLIST_METADATA_KEY] = {
'format_data': fmt_data,
'worklist_title': action_box_name,
'worklist_id': worklist_id,
'workflow_title': workflow_title,
'workflow_id': workflow_id,
'action_box_url': worklist_definition.getActboxUrl(),
'action_box_category': worklist_definition.getActboxCategory()}
'action': worklist_value.getAction(),
'action_type': worklist_value.getActionType()}
variable_match_dict[worklist_id] = variable_match
......@@ -931,7 +931,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
worklist_list = self.objectValues(portal_type='Worklist')
worklist_prop_id_to_show = ['description', 'matched_portal_type_list',
'matched_validation_state_list', 'matched_simulation_state_list',
'actbox_category', 'actbox_name', 'actbox_url', 'actbox_icon',
'action_type', 'action_name', 'action', 'icon',
'roles', 'groups', 'permissions', 'expr']
for qdef in worklist_list:
worklist_reference_list.append(qdef.getReference())
......
......@@ -57,10 +57,6 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
description = ''
var_matches = [] # Compared with catalog when set.
matched_portal_type = ''
actbox_name = ''
actbox_url = ''
actbox_icon = ''
actbox_category = 'global'
guard = None
default_reference = ''
# Declarative security
......@@ -76,6 +72,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
PropertySheet.Reference,
PropertySheet.Worklist,
PropertySheet.Guard,
PropertySheet.ActionInformation,
)
def getGuardSummary(self):
......
......@@ -425,10 +425,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
else:
worklist_variable_value.setVariableValue(values[0]) #XXX(WORKFLOW): to be changed
worklist.setActboxUrl(qdef.actbox_url)
worklist.setActboxCategory(qdef.actbox_category)
worklist.setActboxIcon(qdef.actbox_icon)
worklist.setActboxName(qdef.actbox_name)
worklist.setAction(qdef.actbox_url)
worklist.setActionType(qdef.actbox_category)
worklist.setIcon(qdef.actbox_icon)
worklist.setActionName(qdef.actbox_name)
# configure guard
if qdef.guard:
worklist.guard = qdef.guard
......
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