[Erp5-report] r24501 - in /erp5/trunk/bt5/erp5_base: SkinTemplateItem/portal_skins/erp5_bas...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 5 17:26:39 CET 2008


Author: nicolas
Date: Wed Nov  5 17:26:28 2008
New Revision: 24501

URL: http://svn.erp5.org?rev=24501&view=rev
Log:
Avoid using ERP5Site_getModuleItemList to list modules which doesn't work in virtual_hosting environment.
Avoid use allowedContentType on module to list portal_types. if user can not add them he will miss them.

Modified:
    erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.xml
    erp5/trunk/bt5/erp5_base/bt/revision

Modified: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.xml?rev=24501&r1=24500&r2=24501&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.xml [utf8] Wed Nov  5 17:26:28 2008
@@ -60,13 +60,21 @@
 from_date = request.get(\'from_date\', None)\n
 to_date = request.get(\'at_date\', None)\n
 aggregation_level = request.get(\'aggregation_level\', None)\n
+portal = context.getPortalObject()\n
+module_list = []\n
+for module_id in portal.objectIds(spec=(\'ERP5 Folder\',)):\n
+    module = portal.restrictedTraverse(module_id, None)\n
+    if module is not None:\n
+      if portal.portal_membership.checkPermission(\'View\', module):\n
+        module_list.append(module)\n
+module_list.sort(key=lambda x: x.getTitle())\n
 \n
 # build document portal type list\n
 portal_type_list = []\n
 extend = portal_type_list.extend\n
-for title, path in context.ERP5Site_getModuleItemList():\n
-  document_type_list = context.restrictedTraverse(path).allowedContentTypes()\n
-  extend([x.id for x in document_type_list])\n
+for module in module_list:\n
+  document_type_list = [r.getPortalType() for r in module.searchFolder(group_by=\'portal_type\', limit=None)]\n
+  extend(document_type_list)\n
 \n
 # compute sql params, we group and order by date and portal type\n
 if aggregation_level == "year":\n
@@ -203,16 +211,18 @@
                             <string>from_date</string>
                             <string>to_date</string>
                             <string>aggregation_level</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>module_list</string>
+                            <string>_getiter_</string>
+                            <string>module_id</string>
+                            <string>module</string>
                             <string>portal_type_list</string>
                             <string>extend</string>
-                            <string>_getiter_</string>
-                            <string>context</string>
-                            <string>title</string>
-                            <string>path</string>
-                            <string>document_type_list</string>
                             <string>append</string>
                             <string>$append0</string>
-                            <string>x</string>
+                            <string>r</string>
+                            <string>document_type_list</string>
                             <string>sql_format</string>
                             <string>params</string>
                             <string>query</string>

Modified: erp5/trunk/bt5/erp5_base/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/revision?rev=24501&r1=24500&r2=24501&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_base/bt/revision [utf8] Wed Nov  5 17:26:28 2008
@@ -1,1 +1,1 @@
-461
+462




More information about the Erp5-report mailing list