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