Commit 2d7356d7 authored by Sebastien Robin's avatar Sebastien Robin

2008-01-17 Seb

* add listbox_line_ods_macro
* in report tree, enable the tree structure in the ods document

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18768 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 40d6239d
<?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 encoding="cdata"><![CDATA[
structure = {}\n
structure[\'line\'] = None\n
structure[\'line_list\'] = []\n
\n
def order_line_list(line_list, current_structure, depth=0, index=0, last_dict=None):\n
if index < len(line_list):\n
listbox_line = line_list[index]\n
section_depth = listbox_line.getSectionDepth()\n
if listbox_line.isDataLine():\n
section_depth += 1\n
if section_depth == (depth +1):\n
last_dict = {\'line\':listbox_line, \'line_list\':[]}\n
current_structure[\'line_list\'].append(last_dict)\n
index += 1\n
elif section_depth == (depth +2):\n
new_depth = section_depth\n
new_structure = {\'line\':listbox_line, \'line_list\':[]}\n
last_dict[\'line_list\'].append(new_structure)\n
index += 1\n
index = order_line_list(line_list, new_structure, depth=new_depth, index=index, last_dict=last_dict)\n
elif section_depth > (depth +2):\n
raise ValueError, "A depth is missing"\n
else:\n
return index\n
if index < len(line_list):\n
index = order_line_list(line_list, current_structure, depth=depth, index=index, last_dict=last_dict)\n
return index\n
\n
\n
order_line_list(listbox_line_list, structure, depth=-1, index=0)\n
\n
return structure\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>listbox_line_list=None</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>listbox_line_list</string>
<string>structure</string>
<string>None</string>
<string>_write_</string>
<string>order_line_list</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Listbox_getReportTreeStructure</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -63,84 +63,13 @@ ...@@ -63,84 +63,13 @@
editable_columns python: listbox.get_value(\'editable_columns\', REQUEST=request);\n editable_columns python: listbox.get_value(\'editable_columns\', REQUEST=request);\n
editable_fields python: dict([(column[0], getattr(listbox.aq_parent, \'listbox_%s\' % column[0], None)) for column in editable_columns]);\n editable_fields python: dict([(column[0], getattr(listbox.aq_parent, \'listbox_%s\' % column[0], None)) for column in editable_columns]);\n
selection python: here.portal_selections.getSelectionFor(selection_name, REQUEST=request);\n selection python: here.portal_selections.getSelectionFor(selection_name, REQUEST=request);\n
is_domain_tree_mode selection/domain_tree_mode | nothing;\n listbox_line_structure python: here.Listbox_getReportTreeStructure(listbox_line_list=listboxline_list);\n
is_report_tree_mode selection/report_tree_mode | nothing;" i18n:domain="ui">\n is_report_tree_mode selection/report_tree_mode | nothing;\n
max_section_depth python: max([x.getSectionDepth() for x in listboxline_list]) + int(is_report_tree_mode);\n
is_domain_tree_mode selection/domain_tree_mode | nothing;" i18n:domain="ui">\n
\n \n
<tal:block tal:condition="python: len(listboxline_list) > 1">\n <tal:block metal:use-macro="here/listbox_line_ods_macro/macros/listbox_line"/>\n
<tal:block tal:condition="python: is_domain_tree_mode">\n
<tal:block tal:define="domain_list python: selection.getDomainList()"\n
tal:condition="domain_list">\n
<table:table-row>\n
<table:table-cell office:value-type=\'string\'>\n
<text:p tal:content="python: domain_list[-1]"/>\n
</table:table-cell>\n
</table:table-row>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:repeat="listboxline python: listboxline_list">\n
<tal:block metal:define-slot="for_form_list"\n
tal:condition="listboxline/isTitleLine | is_report_tree_mode">\n
<tal:block metal:define-slot="list_header">\n
<table:table-row table:style-name=\'ro4\'>\n
<tal:block tal:condition="python: is_report_tree_mode">\n
<table:table-cell table:style-name=\'report-column-title\'\n
table:number-columns-spanned=\'1\'\n
office:value-type=\'string\'>\n
<tal:block tal:condition="listboxline/getSectionName">\n
<text:p tal:content="listboxline/getSectionName"/>\n
</tal:block>\n
</table:table-cell>\n
</tal:block>\n
\n
<tal:block tal:condition="listboxline/isTitleLine">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1];\n
column_id python: column_item[0]">\n
<table:table-cell table:number-rows-spanned=\'1\' \n
table:style-name=\'report-column-title\'\n
table:number-columns-spanned=\'1\'\n
office:value-type=\'string\'>\n
<text:p i18n:translate="" i18n:domain="ui" \n
tal:content="python: column_property or \'\'">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</tal:block>\n
</tal:block>\n
\n
<tal:block tal:condition="not:listboxline/isTitleLine">\n
<table:table-row>\n
<tal:block tal:condition="python: listboxline.isDataLine() or listboxline.isSummaryLine()">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1];\n
value column_property;\n
column_id python: column_item[0];\n
style_prefix string:;\n
field python: editable_fields.get(column_id, None);">\n
<tal:block metal:use-macro="here/field_ods_macro/macros/cell_value"/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
\n
<tal:block tal:condition="python: listboxline.isStatLine() or listboxline.isSummaryLine()">\n
<tal:block tal:repeat="column_item python: listboxline.getColumnItemList()">\n
<tal:block tal:define="column_property python: column_item[1];\n
value column_property;\n
column_id python: column_item[0];\n
style_prefix string:stat-;\n
field python: editable_fields.get(column_id, None);">\n
<tal:block metal:use-macro="here/field_ods_macro/macros/cell_value"/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</tal:block>\n
</tal:block>\n
\n \n
\n
<table:table-row metal:define-slot="table_bottom_line">\n <table:table-row metal:define-slot="table_bottom_line">\n
<tal:block tal:repeat="listboxline python: listboxline_list">\n <tal:block tal:repeat="listboxline python: listboxline_list">\n
<tal:block tal:condition="listboxline/isTitleLine">\n <tal:block tal:condition="listboxline/isTitleLine">\n
...@@ -156,7 +85,6 @@ ...@@ -156,7 +85,6 @@
</table:table-row>\n </table:table-row>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n
</office:spreadsheet>\n </office:spreadsheet>\n
</office:body>\n </office:body>\n
</tal:block>\n </tal:block>\n
......
2008-01-17 Seb
* add listbox_line_ods_macro
* in report tree, enable the tree structure in the ods document
2007-09-04 rie 2007-09-04 rie
*modifies your_format *modifies your_format
*change ods sheet's title of report_view and of form_list *change ods sheet's title of report_view and of form_list
......
114 116
\ 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