Commit c39da357 authored by iv's avatar iv

ERP5Workflow: use ActionInformation property sheet instead of actbox_xxx properties

parent 30f37bb6
......@@ -90,10 +90,10 @@
<string>my_id</string>
<string>my_reference</string>
<string>my_title</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>
<string>my_trigger_type</string>
<string>my_destination</string>
</list>
......
......@@ -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>
......
......@@ -14,6 +14,10 @@
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>action_name</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......@@ -22,18 +26,12 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>actbox_icon_property</string> </value>
<value> <string>action_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>
......
<?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_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>
......@@ -61,10 +61,6 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
isRADContent = 1
trigger_type = TRIGGER_USER_ACTION #zwj: type is int 0, 1, 2
guard = None
actbox_name = ''
actbox_url = ''
actbox_icon = ''
actbox_category = 'workflow'
var_exprs = None # A mapping.
default_reference = ''
# Declarative security
......@@ -80,6 +76,7 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
PropertySheet.Reference,
PropertySheet.Transition,
PropertySheet.Guard,
PropertySheet.ActionInformation,
)
def getGuardSummary(self):
......
......@@ -310,18 +310,18 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for tid in sdef.getDestinationIdList():
tdef = self._getOb(id=tid)
if tdef is not None and tdef.getTriggerType() == TRIGGER_USER_ACTION and \
tdef.getActboxName() and self._checkTransitionGuard(tdef, document):
tdef.getActionName() and self._checkTransitionGuard(tdef, document):
if fmt_data is None:
fmt_data = TemplateDict()
fmt_data._push(info)
fmt_data._push({'transition_id': tdef.getReference()})
res.append((tid, {
'id': tdef.getReference(),
'name': tdef.getActboxName() % fmt_data,
'url': str(tdef.getActboxUrl()) % fmt_data,
'icon': str(tdef.getActboxIcon()) % fmt_data,
'name': tdef.getActionName() % fmt_data,
'url': str(tdef.getAction()) % fmt_data,
'icon': str(tdef.getIcon()) % fmt_data,
'permissions': (), # Predetermined.
'category': tdef.getActboxCategory(),
'category': tdef.getActionType(),
'transition': tdef}))
fmt_data._pop()
res.sort()
......
......@@ -318,10 +318,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
transition.setTitle(tdef.title)
transition.setReference(tdef.id)
transition.setTriggerType(tdef.trigger_type)
transition.setActboxCategory(tdef.actbox_category)
transition.setActboxIcon(tdef.actbox_icon)
transition.setActboxName(tdef.actbox_name)
transition.setActboxUrl(tdef.actbox_url)
transition.setActionType(tdef.actbox_category)
transition.setIcon(tdef.actbox_icon)
transition.setActionName(tdef.actbox_name)
transition.setAction(tdef.actbox_url)
transition.setDescription(tdef.description)
before_script_path = getERP5ScriptPath(workflow, dc_workflow,
......
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