Commit 3f333a66 authored by Romain Courteaud's avatar Romain Courteaud

Define render_prefix for each report section.

Fix popReport call.
Improve XML indentation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25098 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3022df94
...@@ -57,7 +57,8 @@ ...@@ -57,7 +57,8 @@
<table:table table:style-name=\'ta1\' table:print=\'false\' tal:attributes="table:name here/getTitle" >\n <table:table table:style-name=\'ta1\' table:print=\'false\' tal:attributes="table:name here/getTitle" >\n
<tal:block metal:define-macro="form_layout"\n <tal:block metal:define-macro="form_layout"\n
tal:define="dummy python: request.set(\'here\', here);\n tal:define="dummy python: request.set(\'here\', here);\n
listbox form/listbox">\n listbox form/listbox | nothing;">\n
<tal:block tal:condition="listbox">\n
<tal:block metal:use-macro="here/listbox_ods_macro/macros/listbox">\n <tal:block metal:use-macro="here/listbox_ods_macro/macros/listbox">\n
<tal:block metal:fill-slot="list_header">\n <tal:block metal:fill-slot="list_header">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList"> \n <tal:block tal:repeat="column_item listboxline/getColumnItemList"> \n
...@@ -100,6 +101,7 @@ ...@@ -100,6 +101,7 @@
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n
</table:table>\n </table:table>\n
</office:spreadsheet>\n </office:spreadsheet>\n
</office:body>\n </office:body>\n
......
...@@ -172,7 +172,7 @@ dQEAAAAA</string> </value> ...@@ -172,7 +172,7 @@ dQEAAAAA</string> </value>
<draw:frame draw:z-index="0" draw:style-name="gr1" svg:x="0.2cm" svg:y="0.2cm" svg:width="7.996cm" svg:height="6.999cm"\n <draw:frame draw:z-index="0" draw:style-name="gr1" svg:x="0.2cm" svg:y="0.2cm" svg:width="7.996cm" svg:height="6.999cm"\n
tal:attributes="svg:height python:height;\n tal:attributes="svg:height python:height;\n
svg:width python:width">\n svg:width python:width">\n
<tal:block tal:replace="structure python: field.render_odf()"/>\n <tal:block tal:replace="structure python: field.render_odf(render_prefix=render_prefix)"/>\n
</draw:frame>\n </draw:frame>\n
</table:table-cell>\n </table:table-cell>\n
</table:table-row>\n </table:table-row>\n
......
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
<office:spreadsheet>\n <office:spreadsheet>\n
\n \n
<tal:block metal:define-macro="listbox">\n <tal:block metal:define-macro="listbox">\n
<tal:block tal:define="listboxline_list python: listbox.get_value(\'default\', render_format=\'list\', REQUEST=request);\n <tal:block tal:define="render_prefix render_prefix | nothing;\n
listboxline_list python: listbox.get_value(\'default\', render_format=\'list\', REQUEST=request, render_prefix=render_prefix);\n
DateTime nocall: modules/DateTime/DateTime;\n DateTime nocall: modules/DateTime/DateTime;\n
selection_name python: listbox.get_value(\'selection_name\', REQUEST=request);\n selection_name python: listbox.get_value(\'selection_name\', REQUEST=request);\n
editable_columns python: listbox.get_value(\'editable_columns\', REQUEST=request);\n editable_columns python: listbox.get_value(\'editable_columns\', REQUEST=request);\n
......
...@@ -57,60 +57,62 @@ ...@@ -57,60 +57,62 @@
global column_len python: 5">\n global column_len python: 5">\n
<!-- TODO: calculate column_len based on the first listbox (or selection_column if exists)-->\n <!-- TODO: calculate column_len based on the first listbox (or selection_column if exists)-->\n
\n \n
<tal:block tal:define="portal_object here/portal_url/getPortalObject">\n <tal:block tal:define="portal_object here/portal_url/getPortalObject">\n
<tal:block tal:condition="not: sheet_per_reportsection">\n <tal:block tal:condition="not: sheet_per_reportsection">\n
<table:table tal:attributes="table:name python:unicode(here.getProperty(\'title\'), \'utf8\')">\n <table:table tal:attributes="table:name python:unicode(here.getProperty(\'title\'), \'utf8\')">\n
<!-- at least one table-column element is required for ODF to validate -->\n <!-- at least one table-column element is required for ODF to validate -->\n
<table:table-column\n <table:table-column\n
table:style-name=\'co2\'\n table:style-name=\'co2\'\n
table:default-cell-style-name=\'report-column-title\'/>\n table:default-cell-style-name=\'report-column-title\'/>\n
\n \n
<tal:block metal:use-macro="here/form_view/macros/form_layout"/>\n <tal:block metal:use-macro="here/form_view/macros/form_layout"/>\n
\n \n
<!-- if we are called with a rendered_report_item_list, just insert the rendered text here. -->\n <!-- if we are called with a rendered_report_item_list, just insert the rendered text here. -->\n
<tal:block tal:condition="rendered_report_item_list">\n <tal:block tal:condition="rendered_report_item_list">\n
<tal:block tal:repeat="report_item report_item_list">\n <tal:block tal:repeat="report_item report_item_list">\n
<tal:block tal:replace="structure report_item"/>\n <tal:block tal:replace="structure report_item"/>\n
</tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n
\n \n
<tal:block tal:condition="not: rendered_report_item_list">\n <tal:block tal:condition="not: rendered_report_item_list">\n
\n \n
<tal:block tal:repeat="report_item report_item_list">\n <tal:block tal:repeat="report_item report_item_list">\n
<tal:block metal:define-macro="make_report_item_table"\n <tal:block metal:define-macro="make_report_item_table"\n
tal:define="here python:report_item.getObject(portal_object);\n tal:define="here python:report_item.getObject(portal_object);\n
dummy python:report_item.pushReport(portal_object)">\n render_prefix python: \'x%s\' % (repeat[\'report_item\'].index, );\n
<tal:block metal:define-macro="render_report_section">\n dummy python:report_item.pushReport(portal_object,\n
<tal:block tal:condition="report_item/getTitle">\n render_prefix=render_prefix)">\n
<table:table-row table:style-name=\'ro2\'>\n <tal:block metal:define-macro="render_report_section">\n
<tal:block tal:condition="report_item/getTitle" tal:define="level report_item/getLevel;\n <tal:block tal:condition="report_item/getTitle">\n
column_len column_len | python: 5">\n <table:table-row table:style-name=\'ro2\'>\n
<table:table-cell table:style-name="report-title"\n <tal:block tal:condition="report_item/getTitle" tal:define="level report_item/getLevel;\n
tal:attributes="table:number-columns-spanned python: column_len;\n column_len column_len | python: 5">\n
table:style-name python:test(level&gt;1, \'report-title%s\' % level, \'report-title\');" \n <table:table-cell table:style-name="report-title"\n
office:value-type=\'string\'\n tal:attributes="table:number-columns-spanned python: column_len;\n
table:number-rows-spanned=\'1\'>\n table:style-name python:test(level&gt;1, \'report-title%s\' % level, \'report-title\');" \n
<text:p tal:content="report_item/getTitle" ></text:p>\n office:value-type=\'string\'\n
</table:table-cell>\n table:number-rows-spanned=\'1\'>\n
</tal:block>\n <text:p tal:content="report_item/getTitle" ></text:p>\n
</table:table-row>\n </table:table-cell>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="report_item/getFormId">\n </table:table-row>\n
<tal:block tal:define="form python:getattr(here,report_item.getFormId())">\n
<tal:block tal:condition="python: form.pt == \'form_view\'">\n
<tal:block metal:use-macro="form/form_view/macros/form_layout"/>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="python:form.pt == \'form_list\'">\n <tal:block tal:condition="report_item/getFormId">\n
<tal:block metal:use-macro="form/form_list/macros/form_layout"/>\n <tal:block tal:define="form python:getattr(here,report_item.getFormId())">\n
<tal:block tal:condition="python: form.pt == \'form_view\'">\n
<tal:block metal:use-macro="form/form_view/macros/form_layout"/>\n
</tal:block>\n
<tal:block tal:condition="python:form.pt == \'form_list\'">\n
<tal:block metal:use-macro="form/form_list/macros/form_layout"/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block tal:define="portal_object here/portal_url/getPortalObject;\n
dummy python:report_item.popReport(portal_object, render_prefix=render_prefix)"/>\n
</tal:block>\n </tal:block>\n
<tal:block tal:define="portal_object here/portal_url/getPortalObject;\n
dummy python:report_item.popReport(portal_object)"/>\n
</tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n
</table:table>\n </table:table>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="sheet_per_reportsection">\n <tal:block tal:condition="sheet_per_reportsection">\n
......
173 175
\ 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