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 @@ ...@@ -66,11 +66,10 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n <value> <string>pref = sci.object\n
\n
pref = sci.object\n
portal = sci.getPortal()\n portal = sci.getPortal()\n
LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n LOG = lambda msg: pref.log("PreferenceWorkflow.disableOtherPreferences on %s"%pref, msg)\n
N_ = context.Base_translateString\n
\n \n
# deactivate all other preferences of the same level \n # deactivate all other preferences of the same level \n
for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\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 ...@@ -82,12 +81,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
p.getPriority() == pref.getPriority() :\n p.getPriority() == pref.getPriority() :\n
p.portal_workflow.doActionFor(p,\n p.portal_workflow.doActionFor(p,\n
\'disable_action\',\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 LOG(\'Deactivated %s\'%p)\n
except \'Unauthorized\', a :\n except \'Unauthorized\', a :\n
LOG("not authorized to deactivate %s"%p)\n LOG("not authorized to deactivate %s"%p)\n
\n
# vim: syntax=python\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -141,12 +140,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n ...@@ -141,12 +140,12 @@ for p in portal.portal_preferences.searchFolder(spec=(\'ERP5 Preference\',)) :\n
<value> <value>
<tuple> <tuple>
<string>sci</string> <string>sci</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>pref</string> <string>pref</string>
<string>portal</string> <string>portal</string>
<string>LOG</string> <string>LOG</string>
<string>context</string>
<string>N_</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>p</string> <string>p</string>
<string>a</string> <string>a</string>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<item> <item>
<key> <string>guard</string> </key> <key> <string>guard</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <none/>
</value> </value>
</item> </item>
<item> <item>
...@@ -67,27 +67,4 @@ ...@@ -67,27 +67,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</item> </item>
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>after_script_name</string> </key>
<value> <string></string> </value> <value> <string>disableOtherPreferences</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<item> <item>
<key> <string>guard</string> </key> <key> <string>guard</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <none/>
</value> </value>
</item> </item>
<item> <item>
...@@ -67,27 +67,4 @@ ...@@ -67,27 +67,4 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string>disableOtherPreferences</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
<value> <value>
<tuple> <tuple>
<string>Owner</string> <string>Owner</string>
<string>Manager</string>
</tuple> </tuple>
</value> </value>
</item> </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