Commit 84147044 authored by Jérome Perrin's avatar Jérome Perrin

This report uses resource titles as columns, so it should use the new...

This report uses resource titles as columns, so it should use the new "untranslatable columns" feature of listbox.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23532 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 195a0701
...@@ -65,34 +65,16 @@ ...@@ -65,34 +65,16 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.PythonScripts.standard import Object\n <value> <string>column_item_list = [ (\'person_career_reference\', \'Employee Number\'),\n
request = container.REQUEST\n (\'person_title\', \'Name\'), ]\n
portal = context.getPortalObject()\n
stool = portal.portal_simulation\n
\n \n
from_date = request[\'from_date\']\n non_translatable_column_item_list = context\\\n
to_date = request[\'to_date\']\n .PersonModule_getLeaveRequestReportListboxUntranslatableColumnList()\n
non_translatable_column_item_list.sort(lambda a,b: cmp(a[1], b[1]))\n
\n \n
result_list = [ (\'person_career_reference\', \'Employee Number\'),\n column_item_list.extend(non_translatable_column_item_list)\n
(\'person_title\', \'Name\'), ]\n column_item_list.append((\'total\', \'Total\'))\n
\n return column_item_list\n
# get all resources used for leave requests\n
resource_list = []\n
for inventory in stool.getInventoryList(\n
from_date=from_date,\n
to_date=to_date,\n
portal_type=\'Leave Request Period\',\n
group_by_resource=1):\n
resource_list.append(\n
(inventory.resource_relative_url,\n
portal.portal_categories.restrictedTraverse(\n
inventory.resource_relative_url).getTitle()))\n
\n
resource_list.sort(lambda a,b: cmp(a[1], b[1]))\n
result_list.extend(resource_list)\n
\n
result_list.append((\'total\', \'Total\'))\n
return result_list\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -136,21 +118,10 @@ return result_list\n ...@@ -136,21 +118,10 @@ return result_list\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>Products.PythonScripts.standard</string> <string>column_item_list</string>
<string>Object</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>container</string>
<string>request</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>non_translatable_column_item_list</string>
<string>stool</string>
<string>_getitem_</string>
<string>from_date</string>
<string>to_date</string>
<string>result_list</string>
<string>resource_list</string>
<string>_getiter_</string>
<string>inventory</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.PythonScripts.standard import Object\n
request = container.REQUEST\n
portal = context.getPortalObject()\n
stool = portal.portal_simulation\n
\n
from_date = request[\'from_date\']\n
to_date = request[\'to_date\']\n
\n
result_list = [ ]\n
\n
# get all resources used for leave requests\n
resource_list = []\n
for inventory in stool.getInventoryList(\n
from_date=from_date,\n
to_date=to_date,\n
portal_type=\'Leave Request Period\',\n
group_by_resource=1):\n
resource_list.append(\n
(inventory.resource_relative_url,\n
portal.portal_categories.restrictedTraverse(\n
inventory.resource_relative_url).getTitle()))\n
\n
return result_list\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>Products.PythonScripts.standard</string>
<string>Object</string>
<string>_getattr_</string>
<string>container</string>
<string>request</string>
<string>context</string>
<string>portal</string>
<string>stool</string>
<string>_getitem_</string>
<string>from_date</string>
<string>to_date</string>
<string>result_list</string>
<string>resource_list</string>
<string>_getiter_</string>
<string>inventory</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PersonModule_getLeaveRequestReportListboxUntranslatableColumnList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<string>list_method</string> <string>list_method</string>
<string>stat_method</string> <string>stat_method</string>
<string>selection_name</string> <string>selection_name</string>
<string>untranslatable_columns</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -60,7 +61,7 @@ ...@@ -60,7 +61,7 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
...@@ -74,11 +75,15 @@ ...@@ -74,11 +75,15 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>stat_method</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -86,9 +91,15 @@ ...@@ -86,9 +91,15 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -103,7 +114,7 @@ ...@@ -103,7 +114,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
...@@ -122,19 +133,19 @@ ...@@ -122,19 +133,19 @@
<value> <string>Base_viewFieldLibrary</string> </value> <value> <string>Base_viewFieldLibrary</string> </value>
</item> </item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>leave_request_report_selection</string> </value> <value> <string>leave_request_report_selection</string> </value>
</item> </item>
<item> <item>
<key> <string>stat_method</string> </key> <key> <string>stat_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -142,9 +153,15 @@ ...@@ -142,9 +153,15 @@
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Leave Requests Report</string> </value> <value> <string>Leave Requests Report</string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -168,6 +185,22 @@ ...@@ -168,6 +185,22 @@
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/PersonModule_getLeaveRequestReportListboxUntranslatableColumnList</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
...@@ -183,7 +216,7 @@ ...@@ -183,7 +216,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
......
349 350
\ 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