Commit c6be1b26 authored by iv's avatar iv Committed by iv

ERP5Workflow: erp5_property_sheets and Transition actbox -> action_box

get workflow-related property sheets back to erp5_property_sheets bt5
rename actbox_* properties to action_box_*
parent ed259c59
...@@ -83,9 +83,9 @@ def getWorkflowGraph(workflow):\n ...@@ -83,9 +83,9 @@ def getWorkflowGraph(workflow):\n
dict(_class=\'workflow.transition\',\n dict(_class=\'workflow.transition\',\n
source=state.getId(),\n source=state.getId(),\n
destination=transition.getDestinationId(),\n destination=transition.getDestinationId(),\n
name=transition.getActboxName() or transition.getTitleOrId(),\n name=transition.getActionBoxName() or transition.getTitleOrId(),\n
description=transition.getDescription(),\n description=transition.getDescription(),\n
actbox_url=transition.getActboxUrl(),\n actbox_url=transition.getActionBoxUrl(),\n
transition_id=transition.getId() # used for edition.\n transition_id=transition.getId() # used for edition.\n
))\n ))\n
else:\n else:\n
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>action_box_category</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
...@@ -22,7 +26,7 @@ ...@@ -22,7 +26,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>actbox_icon_property</string> </value> <value> <string>action_box_category_property</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
...@@ -30,7 +34,9 @@ ...@@ -30,7 +34,9 @@
</item> </item>
<item> <item>
<key> <string>storage_id</string> </key> <key> <string>storage_id</string> </key>
<value> <string>actbox_icon</string> </value> <value>
<none/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>action_box_icon</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
...@@ -22,22 +26,18 @@ ...@@ -22,22 +26,18 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>actbox_url_property</string> </value> <value> <string>action_box_icon_property</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value> <value> <string>Standard Property</string> </value>
</item> </item>
<item> <item>
<key> <string>property_default</string> </key> <key> <string>storage_id</string> </key>
<value> <value>
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>storage_id</string> </key>
<value> <string>actbox_url</string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>action_box_name</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
...@@ -22,7 +26,7 @@ ...@@ -22,7 +26,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>actbox_category_property</string> </value> <value> <string>action_box_name_property</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
...@@ -30,7 +34,9 @@ ...@@ -30,7 +34,9 @@
</item> </item>
<item> <item>
<key> <string>storage_id</string> </key> <key> <string>storage_id</string> </key>
<value> <string>actbox_category</string> </value> <value>
<none/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
</tuple> </tuple>
</value> </value>
</item> </item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>action_box_url</string> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
...@@ -22,15 +26,23 @@ ...@@ -22,15 +26,23 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>actbox_name_property</string> </value> <value> <string>action_box_url_property</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value> <value> <string>Standard Property</string> </value>
</item> </item>
<item>
<key> <string>property_default</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>storage_id</string> </key> <key> <string>storage_id</string> </key>
<value> <string>actbox_name</string> </value> <value>
<none/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>elementary_type/multiple selection</string> <string>elementary_type/multiple_selection</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>elementary_type/multiple selection</string> <string>elementary_type/multiple_selection</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
</item> </item>
<item> <item>
<key> <string>storage_id</string> </key> <key> <string>storage_id</string> </key>
<value> <string>trigger_type</string> </value> <value>
<none/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -154,6 +154,7 @@ SortIndex ...@@ -154,6 +154,7 @@ SortIndex
SQLIdGenerator SQLIdGenerator
StandardBT5ConfiguratorItem StandardBT5ConfiguratorItem
StandardProperty StandardProperty
State
StockCapacity StockCapacity
SupplyLine SupplyLine
SupplyLink SupplyLink
...@@ -175,6 +176,7 @@ TradeOrderLine ...@@ -175,6 +176,7 @@ TradeOrderLine
TradePreference TradePreference
Transformation Transformation
TransformedResource TransformedResource
Transition
TranslatableProperty TranslatableProperty
Url Url
Variable Variable
...@@ -184,7 +186,13 @@ Version ...@@ -184,7 +186,13 @@ Version
VcsPreference VcsPreference
WebSection WebSection
WebSite WebSite
Workflow
XMLObject XMLObject
AttributeBlacklistedConstraint AttributeBlacklistedConstraint
CaptchaPreference CaptchaPreference
GeographicalPoint GeographicalPoint
Interaction
InteractionWorkflow
WorkflowConfigurator
WorkflowScript
Worklist
\ No newline at end of file
...@@ -69,9 +69,9 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject): ...@@ -69,9 +69,9 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
# these attributes are definded in old interaction but no evidence that # these attributes are definded in old interaction but no evidence that
# they are in use # they are in use
actbox_name = '' action_box_name = ''
actbox_url = '' action_box_url = ''
actbox_category = 'workflow' action_box_category = 'workflow'
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
......
...@@ -405,11 +405,13 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow): ...@@ -405,11 +405,13 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
# 1. Interaction as XML # 1. Interaction as XML
interaction_reference_list = [] interaction_reference_list = []
interaction_list = self.objectValues(portal_type='Interaction') interaction_list = self.objectValues(portal_type='Interaction')
interaction_prop_id_to_show = sorted(['actbox_category', 'actbox_url', 'actbox_name', interaction_prop_id_to_show = sorted(['action_box_category', 'action_box_url',
'activate_script_name', 'after_script_name', 'before_commit_script_name', 'action_box_name', 'activate_script_name', 'after_script_name',
'description', 'groups', 'roles', 'expr', 'permissions', 'method_id', 'before_commit_script_name', 'description', 'groups', 'roles', 'expr',
'once_per_transaction', 'portal_type_filter', 'portal_type_group_filter', 'permissions', 'method_id', 'once_per_transaction', 'portal_type_filter',
'script_name', 'temporary_document_disallowed', 'trigger_type']) 'portal_type_group_filter','script_name', 'temporary_document_disallowed',
'trigger_type'])
for tdef in interaction_list: for tdef in interaction_list:
interaction_reference_list.append(tdef.getReference()) interaction_reference_list.append(tdef.getReference())
interactions = SubElement(interaction_workflow, 'interactions', attrib=dict( interactions = SubElement(interaction_workflow, 'interactions', attrib=dict(
...@@ -433,7 +435,8 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow): ...@@ -433,7 +435,8 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
property_value = tdef.getExpression() property_value = tdef.getExpression()
sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration')) sub_object = SubElement(guard, property_id, attrib=dict(type='guard configuration'))
# no-property definded action box configuration # no-property definded action box configuration
elif property_id in ['actbox_name', 'actbox_url', 'actbox_category', 'trigger_type']: elif property_id in ['action_box_name', 'action_box_url', 'action_box_category',
'trigger_type']:
property_value = getattr(tdef, property_id, None) property_value = getattr(tdef, property_id, None)
sub_object = SubElement(interaction, property_id, attrib=dict(type='string')) sub_object = SubElement(interaction, property_id, attrib=dict(type='string'))
elif property_id in ['activate_script_name', 'after_script_name', 'before_commit_script_name', elif property_id in ['activate_script_name', 'after_script_name', 'before_commit_script_name',
......
...@@ -61,10 +61,10 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject): ...@@ -61,10 +61,10 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
isRADContent = 1 isRADContent = 1
trigger_type = TRIGGER_USER_ACTION #zwj: type is int 0, 1, 2 trigger_type = TRIGGER_USER_ACTION #zwj: type is int 0, 1, 2
guard = None guard = None
actbox_name = '' action_box_name = ''
actbox_url = '' action_box_url = ''
actbox_icon = '' action_box_icon = ''
actbox_category = 'workflow' action_box_category = 'workflow'
var_exprs = None # A mapping. var_exprs = None # A mapping.
default_reference = '' default_reference = ''
# Declarative security # Declarative security
......
...@@ -314,18 +314,18 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -314,18 +314,18 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for tid in sdef.getDestinationIdList(): for tid in sdef.getDestinationIdList():
tdef = self._getOb(id=tid) tdef = self._getOb(id=tid)
if tdef is not None and tdef.getTriggerType() == TRIGGER_USER_ACTION and \ if tdef is not None and tdef.getTriggerType() == TRIGGER_USER_ACTION and \
tdef.getActboxName() and self._checkTransitionGuard(tdef, document): tdef.getActionBoxName() and self._checkTransitionGuard(tdef, document):
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({'transition_id': tdef.getReference()}) fmt_data._push({'transition_id': tdef.getReference()})
res.append((tid, { res.append((tid, {
'id': tdef.getReference(), 'id': tdef.getReference(),
'name': tdef.getActboxName() % fmt_data, 'name': tdef.getActionBoxName() % fmt_data,
'url': str(tdef.getActboxUrl()) % fmt_data, 'url': str(tdef.getActionBoxUrl()) % fmt_data,
'icon': str(tdef.getActboxIcon()) % fmt_data, 'icon': str(tdef.getActionBoxIcon()) % fmt_data,
'permissions': (), # Predetermined. 'permissions': (), # Predetermined.
'category': tdef.getActboxCategory(), 'category': tdef.getActionBoxCategory(),
'transition': tdef})) 'transition': tdef}))
fmt_data._pop() fmt_data._pop()
res.sort() res.sort()
...@@ -360,7 +360,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -360,7 +360,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
workflow_id = self.getId() workflow_id = self.getId()
workflow_title = self.getTitle() workflow_title = self.getTitle()
for worklist_definition in self.getWorklistValueList(): for worklist_definition in self.getWorklistValueList():
action_box_name = worklist_definition.getActboxName() action_box_name = worklist_definition.getActionBoxName()
guard = worklist_definition.getGuard() guard = worklist_definition.getGuard()
if action_box_name: if action_box_name:
variable_match = {} variable_match = {}
...@@ -408,8 +408,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -408,8 +408,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
'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_box_url': worklist_definition.getActionBoxUrl(),
'action_box_category': worklist_definition.getActboxCategory()} 'action_box_category': worklist_definition.getActionBoxCategory()}
variable_match_dict[worklist_id] = variable_match variable_match_dict[worklist_id] = variable_match
...@@ -833,8 +833,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -833,8 +833,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
transition_reference_list = [] transition_reference_list = []
transition_list = self.objectValues(portal_type='Transition') transition_list = self.objectValues(portal_type='Transition')
transition_prop_id_to_show = ['description', 'new_state_id', transition_prop_id_to_show = ['description', 'new_state_id',
'trigger_type', 'script_name', 'after_script_name', 'actbox_category', 'trigger_type', 'script_name', 'after_script_name', 'action_box_category',
'actbox_icon', 'actbox_name', 'actbox_url', 'roles', 'groups', 'action_box_icon', 'action_box_name', 'action_box_url', 'roles', 'groups',
'permissions', 'expr', 'transition_variable'] 'permissions', 'expr', 'transition_variable']
for tdef in self.objectValues(portal_type='Transition'): for tdef in self.objectValues(portal_type='Transition'):
transition_reference_list.append(tdef.getReference()) transition_reference_list.append(tdef.getReference())
...@@ -935,8 +935,8 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject): ...@@ -935,8 +935,8 @@ 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_box_category', 'action_box_name', 'action_box_url',
'roles', 'groups', 'permissions', 'expr'] 'action_box_icon', '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())
worklists = SubElement(workflow, 'worklists', attrib=dict(worklist_list=str(worklist_reference_list), worklists = SubElement(workflow, 'worklists', attrib=dict(worklist_list=str(worklist_reference_list),
......
...@@ -57,10 +57,10 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject): ...@@ -57,10 +57,10 @@ 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 = '' action_box_name = ''
actbox_url = '' action_box_url = ''
actbox_icon = '' action_box_icon = ''
actbox_category = 'global' action_box_category = 'global'
guard = None guard = None
default_reference = '' default_reference = ''
# Declarative security # Declarative security
......
...@@ -300,10 +300,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -300,10 +300,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
transition.setTitle(tdef.title) transition.setTitle(tdef.title)
transition.setReference(tdef.id) transition.setReference(tdef.id)
transition.setTriggerType(tdef.trigger_type) transition.setTriggerType(tdef.trigger_type)
transition.setActboxCategory(tdef.actbox_category) transition.setActionBoxCategory(tdef.actbox_category)
transition.setActboxIcon(tdef.actbox_icon) transition.setActionBoxIcon(tdef.actbox_icon)
transition.setActboxName(tdef.actbox_name) transition.setActionBoxName(tdef.actbox_name)
transition.setActboxUrl(tdef.actbox_url) transition.setActionBoxUrl(tdef.actbox_url)
transition.setDescription(tdef.description) transition.setDescription(tdef.description)
if tdef.after_script_name is not None: if tdef.after_script_name is not None:
# check after script is a Transion or a Script: # check after script is a Transion or a Script:
...@@ -412,10 +412,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool): ...@@ -412,10 +412,10 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
else: else:
worklist_variable_value.setVariableValue(values[0]) #to be changed? worklist_variable_value.setVariableValue(values[0]) #to be changed?
worklist.setActboxUrl(qdef.actbox_url) worklist.setActionBoxUrl(qdef.actbox_url)
worklist.setActboxCategory(qdef.actbox_category) worklist.setActionBoxCategory(qdef.actbox_category)
worklist.setActboxIcon(qdef.actbox_icon) worklist.setActionBoxIcon(qdef.actbox_icon)
worklist.setActboxName(qdef.actbox_name) worklist.setActionBoxName(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