[Erp5-report] r27203 - in /erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style: SkinTemplat...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 26 23:13:41 CEST 2009


Author: kazuhiko
Date: Tue May 26 23:13:40 2009
New Revision: 27203

URL: http://svn.erp5.org?rev=27203&view=rev
Log:
* respect original_container if specified, otherwise it does not work fine with erp5_web where a document is accessed through its reference.
* implement non-clone case logic that is required for erp5_web.

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=27203&r1=27202&r2=27203&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createCloneDocument.xml [utf8] Tue May 26 23:13:40 2009
@@ -67,8 +67,9 @@
 else:\n
   portal_type = form_data[\'clone_portal_type\']\n
 \n
-parent = context.getParentValue()\n
-allowed_type_list = parent.getVisibleAllowedContentTypeList()\n
+# We copy contents in place if possible\n
+directory = getattr(context, \'original_container\', None) or context.getParentValue()\n
+allowed_type_list = directory.getVisibleAllowedContentTypeList()\n
 if portal_type not in allowed_type_list:\n
   if batch_mode:\n
     return None\n
@@ -90,8 +91,6 @@
 \n
 # Standard cloning method\n
 if clone:\n
-  # We copy contents in place if possible\n
-  directory = getattr(context, \'original_container\', None) or context.getParentValue()\n
   # Copy and paste the object\n
   original_id = getattr(context, \'original_id\', None) or context.getId()\n
   # This is required for objects acquired in Web Section\n
@@ -99,6 +98,9 @@
   paste_result = directory.manage_pasteObjects(cb_copy_data=clipboard)\n
   new_object = directory[paste_result[0][\'new_id\']]\n
   message_kind = \'Clone\'\n
+else:\n
+  new_object = directory.newContent(portal_type=portal_type)\n
+  message_kind = \'New\'\n
 \n
 if web_mode:\n
   # Edit the objects with some properties\n
@@ -177,15 +179,14 @@
                             <string>form_data</string>
                             <string>portal_type</string>
                             <string>_getitem_</string>
-                            <string>parent</string>
+                            <string>getattr</string>
+                            <string>None</string>
+                            <string>directory</string>
                             <string>allowed_type_list</string>
-                            <string>None</string>
                             <string>kw</string>
-                            <string>getattr</string>
                             <string>script</string>
                             <string>_apply_</string>
                             <string>msg</string>
-                            <string>directory</string>
                             <string>original_id</string>
                             <string>clipboard</string>
                             <string>paste_result</string>

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=27203&r1=27202&r2=27203&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision [utf8] Tue May 26 23:13:40 2009
@@ -1,1 +1,1 @@
-758
+759




More information about the Erp5-report mailing list