Commit f643020c authored by Yusuke Muraoka's avatar Yusuke Muraoka

update to support ReportBox.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28816 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 382e2726
......@@ -51,12 +51,22 @@
<office:spreadsheet>\n
\n
<tal:block tal:define="rendered_report_item_list rendered_report_item_list | python:[];\n
report_item_list python: rendered_report_item_list or report_method();\n
report_item_list python: rendered_report_item_list or [];\n
dummy python: request.set(\'here\', here);\n
global sheet_per_reportsection python: int(request.get(\'sheet_per_report_section\', 0));\n
global column_len python: 5">\n
<!-- TODO: calculate column_len based on the first listbox (or selection_column if exists)-->\n
\n
<tal:block tal:condition="not: report_item_list">\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Report\'">\n
<tal:block tal:define="dummy python: report_item_list.extend(report_method())" />\n
</tal:block>\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Form\'">\n
<tal:block tal:repeat="reportbox python: [field for field in form.get_fields()\n
if field.getRecursiveTemplateField().meta_type == \'ReportBox\']">\n
<tal:block tal:define="dummy python: report_item_list.extend(reportbox.render())" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:define="portal_object here/portal_url/getPortalObject">\n
<tal:block tal:condition="not: sheet_per_reportsection">\n
<table:table tal:attributes="table:name python:unicode(here.getProperty(\'title\'), \'utf8\')" i18n:attributes="table:name">\n
......
......@@ -225,9 +225,19 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
<!-- This template can be used to aggregate together some already rendered report sections.\n
In this case, "rendered_report_item_list" must be in the page template context. -->\n
<tal:block tal:define="rendered_report_item_list rendered_report_item_list | python:[];\n
report_item_list python: rendered_report_item_list or report_method();">\n
\n
<tal:block tal:define="dummy python: request.set(\'here\', here); "/> \n
report_item_list python: rendered_report_item_list or []">\n
<tal:block tal:condition="not: report_item_list">\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Report\'">\n
<tal:block tal:define="dummy python: report_item_list.extend(report_method())" />\n
</tal:block>\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Form\'">\n
<tal:block tal:repeat="reportbox python: [field for field in form.get_fields()\n
if field.getRecursiveTemplateField().meta_type == \'ReportBox\']">\n
<tal:block tal:define="dummy python: report_item_list.extend(reportbox.render())" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:define="dummy python: request.set(\'here\', here); "/> \n
<text:p text:style-name=\'report-title\'\n
i18n:domain="ui" i18n:translate=""\n
tal:content="python: form.getProperty(\'title\', \'\')"/>\n
......
......@@ -52,8 +52,19 @@
<subject>Print Example</subject>\n
<!-- This template can be used to aggregate together some already rendered report sections.\n
In this case, "rendered_report_item_list" must be in the page template context. -->\n
<tal:block tal:define="rendered_report_item_list rendered_report_item_list | python:[];\n
report_item_list python: rendered_report_item_list or report_method();">\n
<tal:block tal:define="rendered_report_item_list rendered_report_item_list | python: [];\n
report_item_list python: rendered_report_item_list or []">\n
<tal:block tal:condition="not: report_item_list">\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Report\'">\n
<tal:block tal:define="dummy python: report_item_list.extend(report_method())" />\n
</tal:block>\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Form\'">\n
<tal:block tal:repeat="reportbox python: [field for field in form.get_fields()\n
if field.getRecursiveTemplateField().meta_type == \'ReportBox\']">\n
<tal:block tal:define="dummy python: report_item_list.extend(reportbox.render())" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
\n
<content tal:define="dummy python: request.set(\'here\',here); ">\n
\n
......
......@@ -46,8 +46,18 @@
<tal:block metal:use-macro="here/view_main/macros/master">\n
<tal:block metal:fill-slot="main">\n
<tal:block metal:use-macro="here/form_render/macros/master" />\n
<tal:block tal:define="portal_object here/getPortalObject">\n
<tal:block tal:repeat="report_item report_method">\n
<tal:block tal:define="portal_object here/getPortalObject;\n
report_item_list python:[]">\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Report\'">\n
<tal:block tal:define="dummy python: report_item_list.extend(report_method())" />\n
</tal:block>\n
<tal:block tal:condition="python: form.meta_type == \'ERP5 Form\'">\n
<tal:block tal:repeat="reportbox python: [field for field in form.get_fields()\n
if field.getRecursiveTemplateField().meta_type == \'ReportBox\']">\n
<tal:block tal:define="dummy python: report_item_list.extend(reportbox.render())" />\n
</tal:block>\n
</tal:block>\n
<tal:block tal:repeat="report_item report_item_list">\n
<tal:block tal:define="here python: report_item.getObject(portal_object);\n
render_prefix python: \'x%s\' % (repeat[\'report_item\'].index, );\n
dummy python: report_item.pushReport(portal_object, render_prefix=render_prefix)">\n
......
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