Commit c43dead8 authored by Jérome Perrin's avatar Jérome Perrin

fix workflow implementation, so that logic is performed in after script


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5483 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6ad1e978
......@@ -66,11 +66,10 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
pref = sci.object\n
<value> <string>pref = sci.object\n
portal = sci.getPortal()\n
LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n
N_ = context.Base_translateString\n
\n
# deactivate all other preferences of the same level \n
for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
......@@ -82,12 +81,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
p.getPriority() == pref.getPriority() :\n
p.portal_workflow.doActionFor(p,\n
\'disable_action\',\n
wf_id=\'preference_workflow\')\n
wf_id=\'preference_workflow\', \n
comment=N_(\'automatically disabled when enabling ${preference_title}\',\n
mapping={\'preference_title\': context.getTitle()}) )\n
LOG(\'Deactivated %s\'%p)\n
except \'Unauthorized\', a :\n
LOG("not authorized to deactivate %s"%p)\n
\n
# vim: syntax=python\n
</string> </value>
</item>
<item>
......@@ -141,12 +140,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
<value>
<tuple>
<string>sci</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getattr_</string>
<string>pref</string>
<string>portal</string>
<string>LOG</string>
<string>context</string>
<string>N_</string>
<string>_getiter_</string>
<string>p</string>
<string>a</string>
......
......@@ -41,7 +41,7 @@
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
......@@ -67,27 +67,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -32,7 +32,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
<value> <string>disableOtherPreferences</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -41,7 +41,7 @@
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<none/>
</value>
</item>
<item>
......@@ -67,27 +67,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string>disableOtherPreferences</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -84,6 +84,7 @@
<value>
<tuple>
<string>Owner</string>
<string>Manager</string>
</tuple>
</value>
</item>
......
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