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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 19 15:36:56 CEST 2006


Author: romain
Date: Tue Sep 19 15:36:52 2006
New Revision: 10169

URL: http://svn.erp5.org?rev=10169&view=rev
Log:
Check allowedContentTypes on the parent level, instead of raising a error.

Added:
    erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/short_title
Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createNewDocument.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_createNewDocument.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createNewDocument.xml?rev=10169&r1=10168&r2=10169&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createNewDocument.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_createNewDocument.xml Tue Sep 19 15:36:52 2006
@@ -76,13 +76,18 @@
 \n
 # XXX May be this need to be changed in order to get something else than\n
 # the permission "Add portal content"\n
-new_id = parent.generateNewId()\n
-context.portal_types.constructContent(type_name=context.portal_type,\n
+if not parent.allowedContentTypes():\n
+  return context.ERP5XhtmlStyle_redirect(\'%s/%s/view\' % (parent.getUrl(), context.getId()), \n
+                                         keep_items={\'portal_status_message\': N_("You are not allowed to add new content in this context.")})\n
+  \n
+else:\n
+  new_id = parent.generateNewId()\n
+  context.portal_types.constructContent(type_name=context.portal_type,\n
                         container=parent,\n
                         id=str(new_id),\n
                         RESPONSE=REQUEST.RESPONSE)\n
-\n
-return context.ERP5XhtmlStyle_redirect(\'%s/%s/view\' % (parent.getUrl(), new_id), keep_items={\'portal_status_message\': N_("Object Created.")})\n
+  return context.ERP5XhtmlStyle_redirect(\'%s/%s/view\' % (parent.getUrl(), new_id), \n
+                                         keep_items={\'portal_status_message\': N_("Object Created.")})\n
 </string> </value>
         </item>
         <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=10169&r1=10168&r2=10169&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/revision Tue Sep 19 15:36:52 2006
@@ -1,1 +1,1 @@
-208
+209

Added: erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/short_title
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/short_title?rev=10169&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/short_title (added)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_xhtml_style/bt/short_title Tue Sep 19 15:36:52 2006
@@ -1,0 +1,1 @@
+None




More information about the Erp5-report mailing list