Commit 5423d566 authored by iv's avatar iv

ERP5Workflow: use ActionInformation property sheet in Worklists

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