Commit 3fa32ce9 authored by Nicolas Delaby's avatar Nicolas Delaby

Avoid using ERP5Site_getModuleItemList to list modules which doesn't work in...

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.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24501 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ce4144ca
......@@ -60,13 +60,21 @@ request = container.REQUEST\n
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 @@ return line_list\n
<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>
......
461
\ No newline at end of file
462
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment