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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 8 11:06:57 CET 2006


Author: jerome
Date: Fri Dec  8 11:06:54 2006
New Revision: 11643

URL: http://svn.erp5.org?rev=11643&view=rev
Log:
take into account hidden content types in Folder_create; if there is no visible and allowed content type nothing is created.


Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.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/Folder_create.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml?rev=11643&r1=11642&r2=11643&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Folder_create.xml Fri Dec  8 11:06:54 2006
@@ -69,18 +69,13 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>N_ = context.getPortalObject().Base_translateString\n
+allowed_type_list = context.getVisibleAllowedContentTypeList()\n
 \n
-# Add an object of the same type as the container\n
-# or if allowed content types is 1 add that type\n
-try:\n
-  new_object = context.newContent()\n
-except IndexError:\n
-  # return only a portal_status_message if the IndexError is raised because\n
-  # there are no elemnts in context.allowedContentTypes()\n
-  if not context.allowedContentTypes():\n
-    return context.ERP5Site_redirect(\'%s/view\' % (context.absolute_url(), ), keep_items={\'portal_status_message\': N_("You are not allowed to add new content in this context.")})\n
-  else:\n
-    raise\n
+if not allowed_type_list:\n
+  return context.ERP5Site_redirect(\'%s/view\' % (context.absolute_url(), ), keep_items={\'portal_status_message\': N_("You are not allowed to add new content in this context.")})\n
+\n
+# newContent will add the first allowed type when we do not specify portal_type=\n
+new_object = context.newContent()\n
 \n
 return context.ERP5Site_redirect(\'%s/view\' % (new_object.absolute_url(), ), keep_items={\'portal_status_message\': N_("Object Created.")})\n
 </string> </value>
@@ -134,8 +129,8 @@
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>N_</string>
+                            <string>allowed_type_list</string>
                             <string>new_object</string>
-                            <string>IndexError</string>
                           </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=11643&r1=11642&r2=11643&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision Fri Dec  8 11:06:54 2006
@@ -1,1 +1,1 @@
-307
+308




More information about the Erp5-report mailing list