Commit 36ad052d authored by Jérome Perrin's avatar Jérome Perrin

Folder_getContentListAsODSReportSectionList: honor checked uid; don't translate object title.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18159 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 116519cb
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -83,21 +80,26 @@ def getReportSectionListForObject(doc):\n ...@@ -83,21 +80,26 @@ def getReportSectionListForObject(doc):\n
report_section_list = []\n report_section_list = []\n
doc = doc.getObject()\n doc = doc.getObject()\n
title = doc.getTitle()\n title = doc.getTitle()\n
title = translate(title)\n report_section_list.append(ReportSection(level = 1,\n
report_section_list.append(ReportSection(level = 1, \n title = title,\n
title = title, \n
form_id = None))\n form_id = None))\n
for action in portal.portal_actions.listFilteredActionsFor(doc)[\'object_view\']:\n for action in portal.portal_actions.listFilteredActionsFor(doc)[\'object_view\']:\n
form_id = action[\'url\'].split(\'/\')[-1].split(\'?\')[0]\n form_id = action[\'url\'].split(\'/\')[-1].split(\'?\')[0]\n
action_title = action[\'title\'] \n action_title = action[\'title\']\n
if action_title != \'History\' and action_title != \'Metadata\':\n if action_title != \'History\' and action_title != \'Metadata\':\n
report_section_list.append(ReportSection(path = doc.getPath(), \n report_section_list.append(ReportSection(path = doc.getPath(),\n
form_id = form_id, \n form_id = form_id,\n
level = 2, \n level = 2,\n
title = \'%s - %s\' % (title, translate(action_title))))\n title = \'%s - %s\' % (title, translate(action_title))))\n
return report_section_list\n return report_section_list\n
\n \n
if selection_name is not None:\n if selection_name is not None:\n
checked_uid_list = portal.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
if checked_uid_list:\n
getObject = portal.portal_catalog.getObject\n
for uid in checked_uid_list:\n
report_section_list.extend(getReportSectionListForObject(getObject(doc)))\n
else:\n
# get all documents in the selection\n # get all documents in the selection\n
for doc in portal.portal_selections.callSelectionFor(selection_name, context=form):\n for doc in portal.portal_selections.callSelectionFor(selection_name, context=form):\n
report_section_list.extend(getReportSectionListForObject(doc))\n report_section_list.extend(getReportSectionListForObject(doc))\n
...@@ -162,7 +164,10 @@ return report_section_list\n ...@@ -162,7 +164,10 @@ return report_section_list\n
<string>selection_name</string> <string>selection_name</string>
<string>translate</string> <string>translate</string>
<string>getReportSectionListForObject</string> <string>getReportSectionListForObject</string>
<string>checked_uid_list</string>
<string>getObject</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>uid</string>
<string>doc</string> <string>doc</string>
</tuple> </tuple>
</value> </value>
......
92 93
\ No newline at end of file \ 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