Commit 63ebb7b6 authored by Arnaud Fontaine's avatar Arnaud Fontaine

squash! ERP5Workflow: DC Workflows are now ERP5 objects (!1378).

parent 5aa717e5
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
</item> </item>
<item> <item>
<key> <string>init_script</string> </key> <key> <string>init_script</string> </key>
<value> <value> <string>WorkflowScript_init</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>permission</string> </key> <key> <string>permission</string> </key>
......
...@@ -15,8 +15,6 @@ for portal_type in context.allowedContentTypes(): ...@@ -15,8 +15,6 @@ for portal_type in context.allowedContentTypes():
state_list = workflow.getStateValueList() state_list = workflow.getStateValueList()
if len(state_list) > 1: if len(state_list) > 1:
state_var = workflow.getStateVariable() state_var = workflow.getStateVariable()
if state_var is None:
state_var = 'state'
workflow_id = workflow.getId() workflow_id = workflow.getId()
workflow_translated_title_dict[workflow_id] = translateString(workflow.title) workflow_translated_title_dict[workflow_id] = translateString(workflow.title)
type_state_variable_workflow_dict[(portal_type_id, state_var)] = workflow_id type_state_variable_workflow_dict[(portal_type_id, state_var)] = workflow_id
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kwargs</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WorkflowScript_init</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -2,7 +2,7 @@ workflow_list = kw.get('workflow_list') ...@@ -2,7 +2,7 @@ workflow_list = kw.get('workflow_list')
selected_workflow_list = [] selected_workflow_list = []
selected_workflow_id_list = [] selected_workflow_id_list = []
if batch_mode == False and workflow_id_list is None: if not batch_mode and workflow_id_list is None:
if workflow_list: if workflow_list:
for workflow in workflow_list: for workflow in workflow_list:
if workflow.get('listbox_selected'): if workflow.get('listbox_selected'):
...@@ -18,6 +18,9 @@ else: ...@@ -18,6 +18,9 @@ else:
for workflow in selected_workflow_list: for workflow in selected_workflow_list:
if workflow is not None and not workflow.isTempObject() and workflow.getPortalType() in ('Workflow', 'Interaction Workflow'): if workflow is not None and not workflow.isTempObject() and workflow.getPortalType() in ('Workflow', 'Interaction Workflow'):
if batch:
raise RuntimeError('Workflow(s) already exist.')
else:
return context.Base_redirect( return context.Base_redirect(
'WorkflowTool_viewWorkflowConversionDialog', 'WorkflowTool_viewWorkflowConversionDialog',
keep_items=dict(portal_status_message='Workflow(s) already exist.')) keep_items=dict(portal_status_message='Workflow(s) already exist.'))
...@@ -27,10 +30,8 @@ for workflow in selected_workflow_list: ...@@ -27,10 +30,8 @@ for workflow in selected_workflow_list:
context.reassignWorkflow(new_workflow.getId()) context.reassignWorkflow(new_workflow.getId())
selected_workflow_id_list.append(new_workflow.getId()) selected_workflow_id_list.append(new_workflow.getId())
if batch_mode: if not batch_mode:
return return context.Base_redirect(
return context.Base_redirect(
'view', 'view',
keep_items=dict(portal_status_message="Workflows converted: %s" % keep_items=dict(portal_status_message="Workflows converted: %s" %
' '.join(selected_workflow_id_list))) ' '.join(selected_workflow_id_list)))
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list> <list>
<string>WorkflowScripts</string> <string>listbox</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>WorkflowScripts</string> </value> <value> <string>listbox</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
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