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 @@
</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 = [ (\'person_career_reference\', \'Employee Number\'),\n
<value> <string>column_item_list = [ (\'person_career_reference\', \'Employee Number\'),\n
(\'person_title\', \'Name\'), ]\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
resource_list.sort(lambda a,b: cmp(a[1], b[1]))\n
result_list.extend(resource_list)\n
non_translatable_column_item_list = context\\\n
.PersonModule_getLeaveRequestReportListboxUntranslatableColumnList()\n
non_translatable_column_item_list.sort(lambda a,b: cmp(a[1], b[1]))\n
\n
result_list.append((\'total\', \'Total\'))\n
return result_list\n
column_item_list.extend(non_translatable_column_item_list)\n
column_item_list.append((\'total\', \'Total\'))\n
return column_item_list\n
</string> </value>
</item>
<item>
......@@ -136,21 +118,10 @@ return result_list\n
<value>
<tuple>
<string>kw</string>
<string>Products.PythonScripts.standard</string>
<string>Object</string>
<string>column_item_list</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>
<string>non_translatable_column_item_list</string>
</tuple>
</value>
</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 @@
<string>list_method</string>
<string>stat_method</string>
<string>selection_name</string>
<string>untranslatable_columns</string>
</list>
</value>
</item>
......@@ -81,6 +82,10 @@
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>stat_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
......@@ -89,6 +94,12 @@
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -124,7 +135,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
......@@ -134,7 +145,7 @@
<item>
<key> <string>stat_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
......@@ -145,6 +156,12 @@
<key> <string>title</string> </key>
<value> <string>Leave Requests Report</string> </value>
</item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
......@@ -168,6 +185,22 @@
</pickle>
</record>
<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>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
......@@ -183,7 +216,7 @@
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
......
349
\ No newline at end of file
350
\ 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