Commit f5830ba3 authored by Julien Muchembled's avatar Julien Muchembled

Fix generation of ODT reports:

* Do not store objects in selections.
* ReportSection requires listboxes to be named 'listbox'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25544 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6f3c3119
......@@ -61,12 +61,9 @@
def compareId(a, b):\n
return cmp(normalise(a.id), normalise(b.id))\n
\n
class_method_list = kw["class_method_list"]\n
obj = kw["obj"]\n
\n
result = map(\n
lambda x: obj.asContext(id=x),\n
class_method_list \n
lambda x: context.asContext(id=x),\n
class_method_list\n
)\n
result.sort(compareId)\n
return result\n
......@@ -80,7 +77,7 @@ return result\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>class_method_list, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -100,18 +97,16 @@ return result\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>class_method_list</string>
<string>kw</string>
<string>normalise</string>
<string>compareId</string>
<string>_getitem_</string>
<string>class_method_list</string>
<string>obj</string>
<string>map</string>
<string>result</string>
<string>_getattr_</string>
......
......@@ -61,13 +61,9 @@
def compareId(a, b):\n
return cmp(normalise(a.id), normalise(b.id))\n
\n
property_sheet_list = kw["property_sheet_list"]\n
\n
obj = kw["obj"]\n
\n
result = map(\n
lambda x: obj.asContext(id=x),\n
property_sheet_list \n
lambda x: context.asContext(id=x),\n
property_sheet_list\n
)\n
result.sort(compareId)\n
return result\n
......@@ -81,7 +77,7 @@ return result\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>property_sheet_list, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -101,18 +97,16 @@ return result\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>property_sheet_list</string>
<string>kw</string>
<string>normalise</string>
<string>compareId</string>
<string>_getitem_</string>
<string>property_sheet_list</string>
<string>obj</string>
<string>map</string>
<string>result</string>
<string>_getattr_</string>
......
......@@ -259,9 +259,11 @@ if portal_skin is not None and portal_skin=="ODT":\n
)\n
result.append(\n
ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n
method_id=\'getDocumentationHelper\',\n
param_list=(section.getClassName(), uri),\n
form_id=\'PortalTypeDocumentationHelperAppendixClassMethod_view\',\n
selection_params=dict(class_method_list=classmethod, obj=uri_object),\n
selection_name=\'class_method_selection\',\n
selection_params=dict(class_method_list=classmethod),\n
listbox_display_mode=\'FlatListMode\')\n
)\n
if propertysheet.keys() != []:\n
......@@ -283,9 +285,11 @@ if portal_skin is not None and portal_skin=="ODT":\n
)\n
result.append(\n
ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n
method_id=\'getDocumentationHelper\',\n
param_list=(section.getClassName(), uri),\n
form_id=\'PortalTypeDocumentationHelperAppendixPropertySheet_view\',\n
selection_params=dict(property_sheet_list=propertysheet.keys(), obj=uri_object),\n
selection_name=\'property_sheet_selection\',\n
selection_params=dict(property_sheet_list=propertysheet.keys()),\n
listbox_display_mode=\'FlatListMode\')\n
)\n
class_name = \'PortalTypePropertySheetDocumentationHelper\'\n
......
......@@ -68,7 +68,7 @@
<key> <string>bottom</string> </key>
<value>
<list>
<string>class_method_listbox</string>
<string>listbox</string>
</list>
</value>
</item>
......
......@@ -21,7 +21,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>class_method_listbox</string> </value>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -68,7 +68,7 @@
<key> <string>bottom</string> </key>
<value>
<list>
<string>property_sheet_listbox</string>
<string>listbox</string>
</list>
</value>
</item>
......
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>property_sheet_listbox</string> </value>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
163
\ No newline at end of file
165
\ 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