[Erp5-report] r20447 - /experimental/Experimental/patches/ERP5Form_ListField_with_jump.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 11 14:51:38 CEST 2008


Author: bartek
Date: Fri Apr 11 14:51:37 2008
New Revision: 20447

URL: http://svn.erp5.org?rev=20447&view=rev
Log:
check if the base category contains anything (a bit weird way to tell if this cat is meant to be a tree, or a base for relations)

Modified:
    experimental/Experimental/patches/ERP5Form_ListField_with_jump.py

Modified: experimental/Experimental/patches/ERP5Form_ListField_with_jump.py
URL: http://svn.erp5.org/experimental/Experimental/patches/ERP5Form_ListField_with_jump.py?rev=20447&r1=20446&r2=20447&view=diff
==============================================================================
--- experimental/Experimental/patches/ERP5Form_ListField_with_jump.py (original)
+++ experimental/Experimental/patches/ERP5Form_ListField_with_jump.py Fri Apr 11 14:51:37 2008
@@ -106,6 +106,13 @@
   # check if user can not add categories
   if not user.has_permission('Add portal content', base_category_value):
     return '' 
+  # check if the category is not empty
+  # (the issue is that there is no way to tell if a category is used as a tree, or as a base
+  # for relations, while we don't want to present a jump to base categories like source_section
+  # so we assume that on a real system if a category is a tree then it contains something;
+  # anyway, this tool is not for developers)
+  if len(base_category_value.searchFolder(limit=1)) == 0:
+    return ''
   portal_url = getToolByName(here, 'portal_url')
   portal_url_string = portal_url()
   html_string += '<a href="%s/view">' \




More information about the Erp5-report mailing list