[Erp5-report] r19838 - in /erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style: SkinTemplat...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Mar 13 11:45:57 CET 2008
Author: romain
Date: Thu Mar 13 11:45:56 2008
New Revision: 19838
URL: http://svn.erp5.org?rev=19838&view=rev
Log:
Add a batch_mode parameter to Base_createCloneDocument to prevent redirection (if called from another python script for example)
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml
erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml?rev=19838&r1=19837&r2=19838&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml Thu Mar 13 11:45:56 2008
@@ -85,10 +85,13 @@
parent = context.getParentValue()\n
allowed_type_list = parent.getVisibleAllowedContentTypeList()\n
if portal_type not in allowed_type_list:\n
- return context.ERP5Site_redirect(\'%s/%s/view\' % (\n
- parent.getUrl(), context.getId()),\n
- keep_items={\'portal_status_message\':\n
- translateString("You are not allowed to clone this object.")})\n
+ if batch_mode:\n
+ return None\n
+ else:\n
+ return context.ERP5Site_redirect(\'%s/%s/view\' % (\n
+ parent.getUrl(), context.getId()),\n
+ keep_items={\'portal_status_message\':\n
+ translateString("You are not allowed to clone this object.")})\n
\n
# prepare query params\n
kw = {\'portal_type\' : translateString(portal_type)}\n
@@ -105,12 +108,15 @@
new_object = directory[paste_result[0][\'new_id\']]\n
message_kind = \'Clone\'\n
\n
-if not editable_mode: \n
- form_id = \'view\'\n
-msg = translateString("Created %s ${portal_type}." % message_kind, mapping = kw)\n
-return new_object.Base_redirect(form_id, \n
- editable_mode=1,\n
- keep_items={\'portal_status_message\': msg})\n
+if batch_mode:\n
+ return new_object\n
+else:\n
+ if not editable_mode: \n
+ form_id = \'view\'\n
+ msg = translateString("Created %s ${portal_type}." % message_kind, mapping = kw)\n
+ return new_object.Base_redirect(form_id, \n
+ editable_mode=1,\n
+ keep_items={\'portal_status_message\': msg})\n
</string> </value>
</item>
<item>
@@ -127,7 +133,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>clone=1, form_id, editable_mode=0</string> </value>
+ <value> <string>clone=1, form_id, editable_mode=0, batch_mode=0</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
@@ -153,7 +159,7 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>3</int> </value>
+ <value> <int>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
@@ -162,6 +168,7 @@
<string>clone</string>
<string>form_id</string>
<string>editable_mode</string>
+ <string>batch_mode</string>
<string>_getattr_</string>
<string>context</string>
<string>translateString</string>
@@ -170,9 +177,9 @@
<string>_getitem_</string>
<string>parent</string>
<string>allowed_type_list</string>
+ <string>None</string>
<string>kw</string>
<string>getattr</string>
- <string>None</string>
<string>directory</string>
<string>original_id</string>
<string>clipboard</string>
@@ -195,6 +202,7 @@
<int>1</int>
<none/>
<int>0</int>
+ <int>0</int>
</tuple>
</value>
</item>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision?rev=19838&r1=19837&r2=19838&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision Thu Mar 13 11:45:56 2008
@@ -1,1 +1,1 @@
-502
+503
More information about the Erp5-report
mailing list