Commit 406ccd0b authored by Jean-Paul Smets's avatar Jean-Paul Smets

convertToMixedCase moved to transition execution


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2100 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 163b262a
...@@ -624,7 +624,7 @@ class ERP5DCWorkflowDefinition (DCWorkflowDefinition): ...@@ -624,7 +624,7 @@ class ERP5DCWorkflowDefinition (DCWorkflowDefinition):
LOG('_executeTransition', 0, 'new_sdef.transitions = %s' % (repr(new_sdef.transitions))) LOG('_executeTransition', 0, 'new_sdef.transitions = %s' % (repr(new_sdef.transitions)))
if tdef.after_script_name in filter(lambda k: self.transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD, if tdef.after_script_name in filter(lambda k: self.transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD,
new_sdef.transitions): new_sdef.transitions):
script = getattr(ob, tdef.after_script_name) script = getattr(ob, convertToMixedCase(tdef.after_script_name))
script() script()
else: else:
script = self.scripts[tdef.after_script_name] script = self.scripts[tdef.after_script_name]
...@@ -648,13 +648,12 @@ DCWorkflowDefinition._executeTransition = ERP5DCWorkflowDefinition._executeTrans ...@@ -648,13 +648,12 @@ DCWorkflowDefinition._executeTransition = ERP5DCWorkflowDefinition._executeTrans
# as well as workflow inheritance. This way, different user actions and dialogs can be specified easliy # as well as workflow inheritance. This way, different user actions and dialogs can be specified easliy
# For now, we split UI transitions and logics transitions so that UI can be different and logics the same # For now, we split UI transitions and logics transitions so that UI can be different and logics the same
from Products.DCWorkflow.Transitions import TransitionDefinition from Products.DCWorkflow.Transitions import TransitionDefinition
from Products.ERP5Type.Utils import convertToMixedCase
class ERP5TransitionDefinition (TransitionDefinition): class ERP5TransitionDefinition (TransitionDefinition):
def getAvailableScriptIds(self): def getAvailableScriptIds(self):
return self.getWorkflow().scripts.keys() + map(lambda tid: convertToMixedCase(tid), filter( return self.getWorkflow().scripts.keys() + filter(
lambda k: self.getWorkflow().transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD, self.getWorkflow().transitions.keys())) lambda k: self.getWorkflow().transitions[k].trigger_type == TRIGGER_WORKFLOW_METHOD, self.getWorkflow().transitions.keys())
TransitionDefinition.getAvailableScriptIds = ERP5TransitionDefinition.getAvailableScriptIds TransitionDefinition.getAvailableScriptIds = ERP5TransitionDefinition.getAvailableScriptIds
......
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