Commit 6dc2151f authored by Jean-Paul Smets's avatar Jean-Paul Smets

*** empty log message ***


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1182 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7cca32e1
...@@ -34,14 +34,10 @@ from Products.CMFCore.CMFCorePermissions import ManagePortal ...@@ -34,14 +34,10 @@ from Products.CMFCore.CMFCorePermissions import ManagePortal
from Products.DCWorkflow.ContainerTab import ContainerTab from Products.DCWorkflow.ContainerTab import ContainerTab
from Products.DCWorkflow.Guard import Guard from Products.DCWorkflow.Guard import Guard
from Products.DCWorkflow.Expression import Expression from Products.DCWorkflow.Expression import Expression
from Products.DCWorkflow.Transitions import TRIGGER_AUTOMATIC, TRIGGER_WORKFLOW_METHOD
from Products.ERP5 import _dtmldir from Products.ERP5 import _dtmldir
TRIGGER_AUTOMATIC = 0
TRIGGER_USER_ACTION = 1 # useless for interaction
TRIGGER_WORKFLOW_METHOD = 2
class InteractionDefinition (SimpleItem): class InteractionDefinition (SimpleItem):
meta_type = 'Workflow Interaction' meta_type = 'Workflow Interaction'
...@@ -51,14 +47,16 @@ class InteractionDefinition (SimpleItem): ...@@ -51,14 +47,16 @@ class InteractionDefinition (SimpleItem):
title = '' title = ''
description = '' description = ''
new_state_id = '' new_state_id = ''
trigger_type = TRIGGER_USER_ACTION trigger_type = TRIGGER_WORKFLOW_METHOD
guard = None guard = None
actbox_name = '' actbox_name = ''
actbox_url = '' actbox_url = ''
actbox_category = 'workflow' actbox_category = 'workflow'
var_exprs = None # A mapping. var_exprs = None # A mapping.
script_name = None # Executed before transition script_name = () # Executed before transition
after_script_name = None # Executed after transition after_script_name = () # Executed after transition
activate_script_name = () # Executed as activity
method_id = None
manage_options = ( manage_options = (
{'label': 'Properties', 'action': 'manage_properties'}, {'label': 'Properties', 'action': 'manage_properties'},
...@@ -115,20 +113,29 @@ class InteractionDefinition (SimpleItem): ...@@ -115,20 +113,29 @@ class InteractionDefinition (SimpleItem):
manage_tabs_message=manage_tabs_message, manage_tabs_message=manage_tabs_message,
) )
def setProperties(self, title, new_state_id, def setProperties(self, title,
trigger_type=TRIGGER_USER_ACTION, script_name='', portal_type_filter=None,
after_script_name='', trigger_type=TRIGGER_AUTOMATIC,
script_name=(),
after_script_name=(),
activate_script_name=(),
actbox_name='', actbox_url='', actbox_name='', actbox_url='',
actbox_category='workflow', actbox_category='workflow',
method_id=None,
props=None, REQUEST=None, description=''): props=None, REQUEST=None, description=''):
''' '''
Update transition properties
XXX - then make sure that method_id is WorkflowMethod for portal_type_filter
XXX - this will likely require dynamic
''' '''
self.method_id = method_id
self.portal_type_filter = portal_type_filter
self.title = str(title) self.title = str(title)
self.description = str(description) self.description = str(description)
self.new_state_id = str(new_state_id)
self.trigger_type = int(trigger_type) self.trigger_type = int(trigger_type)
self.script_name = str(script_name) self.script_name = map(lambda x: str(x), script_name)
self.after_script_name = str(after_script_name) self.after_script_name = map(lambda x: str(x), after_script_name)
self.activate_script_name = map(lambda x: str(x), activate_script_name)
g = Guard() g = Guard()
if g.changeFromProperties(props or REQUEST): if g.changeFromProperties(props or REQUEST):
self.guard = g self.guard = g
......
This diff is collapsed.
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