Commit b6851534 authored by Jérome Perrin's avatar Jérome Perrin

report_view is now a macro to form_view

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20257 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cb4463d4
...@@ -104,6 +104,12 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value> ...@@ -104,6 +104,12 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
</object> </object>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
...@@ -214,6 +220,9 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value> ...@@ -214,6 +220,9 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
<style:background-image/>\n <style:background-image/>\n
</style:table-cell-properties>\n </style:table-cell-properties>\n
</style:style>\n </style:style>\n
<style:style style:name="inline-graphic" style:family="graphic" style:parent-style-name="Graphics">\n
<style:graphic-properties style:run-through="foreground" style:wrap="none" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:horizontal-pos="center" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/>\n
</style:style>\n
</office:automatic-styles>\n </office:automatic-styles>\n
<office:body>\n <office:body>\n
<office:text>\n <office:text>\n
...@@ -230,84 +239,14 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value> ...@@ -230,84 +239,14 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
<tal:block tal:define="rendered_report_item_list rendered_report_item_list | python:[];\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 report_method();">\n
\n \n
<tal:block tal:define="dummy python: request.set(\'here\',here); "> \n <tal:block tal:define="dummy python: request.set(\'here\', here); "/> \n
<text:p text:style-name=\'report-title\'\n <text:p text:style-name=\'report-title\'\n
tal:content="python: here.Localizer.erp5_ui.gettext(form.getProperty(\'title\', \'\')).encode(\'utf-8\')"> report title </text:p>\n i18n:domain="ui" i18n:translate=""\n
<text:p></text:p> \n tal:content="python: form.getProperty(\'title\', \'\')"/>\n
<tal:block tal:repeat="group python: [g for g in form.get_groups() if g not in (\'bottom\', \'hidden\')]">\n <text:p></text:p>\n
<tal:block tal:define="field_list python: form.get_fields_in_group(group)">\n <tal:block metal:use-macro="here/form_view/macros/form_layout"/>\n
<tal:block tal:condition="field_list">\n
<!-- TODO: make this a macro for field rendering -->\n
<table:table table:style-name=\'field-table\' table:name=\'field-table\' >\n
<table:table-column table:style-name=\'field-table.A\' table:number-columns-repeated=\'2\'/>\n
<tal:block tal:repeat="field field_list">\n
<tal:block tal:condition="python:field.meta_type != \'HiddenStringField\'">\n
<table:table-row>\n
<table:table-cell table:style-name=\'field-table.A1\' office:value-type=\'string\'>\n
<text:p text:style-name=\'field-label\' tal:content="python: here.Localizer.erp5_ui.gettext(field.get_value(\'title\')).encode(\'utf-8\')" />\n
</table:table-cell>\n
<table:table-cell table:style-name=\'field-table.B1\' office:value-type=\'string\'\n
tal:define="value python: field.get_value(\'default\')">\n
<tal:block tal:condition="python: same_type(value,[]) or same_type(value,())">\n
<tal:block tal:condition="python: field.has_value(\'items\')">\n
<tal:block tal:define="field_item_dict python:dict([(x[1], x[0]) for x in field.get_value(\'items\')]);">\n
<tal:block tal:repeat="item value">\n
<text:p text:style-name=\'field-content\'\n
tal:content="python: field_item_dict.get(item, \'??? (%s)\' % item)"/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="python: not field.has_value(\'items\')">\n
<!-- XXX render_odf for list fields ? using TAL structure ? -->\n
<tal:block tal:repeat="item value">\n
<text:p text:style-name=\'field-content\' tal:content="item" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="python: not (same_type(value, []) or same_type(value, ()))">\n
<tal:block tal:condition="python: field.has_value(\'items\')">\n
<tal:block tal:define="field_item_dict python:dict([(x[1], x[0]) for x in field.get_value(\'items\')]);"> \n
<text:p text:style-name=\'field-content\' tal:content="python: field_item_dict.get(value, \'??? (%s)\' % value)"/>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="python: not field.has_value(\'items\')">\n
<text:p text:style-name=\'field-content\' tal:content="python: field.render_pdf(value)" />\n
</tal:block>\n
</tal:block>\n
</table:table-cell>\n
</table:table-row>\n
</tal:block>\n
</tal:block>\n
</table:table>\n
<!-- TODO: use styles instead of empty lines -->\n
<tal:block tal:condition="form/get_fields">\n <tal:block tal:condition="form/get_fields">\n
<text:p/>\n <text:p/><text:p/><text:p/><text:p/>\n
<text:p/>\n
<text:p/>\n
<text:p/></tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<!-- TODO: another macro for bottom field rendering -->\n
<tal:block tal:define="field_list python: form.get_fields_in_group(\'bottom\')">\n
<tal:block tal:condition="field_list">\n
<tal:block tal:repeat="field field_list">\n
<tal:block tal:condition="python: field.meta_type == \'MatrixBox\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'MatrixBox\')">\n
<tal:block tal:define="matrixbox python:field;">\n
<div metal:use-macro="here/matrixbox_odt_macro/macros/matrixbox" />\n
</tal:block>\n
</tal:block>\n
<tal:block tal:condition="python: field.meta_type == \'ListBox\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'ListBox\')">\n
<tal:block tal:define="listbox python:field;" >\n
<div metal:use-macro="here/listbox_odt_macro/macros/listbox" />\n
</tal:block>\n
<text:p/>\n
<text:p/>\n
<text:p/>\n
<text:p/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n </tal:block>\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
...@@ -332,8 +271,6 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value> ...@@ -332,8 +271,6 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
\n \n
<tal:block tal:condition="report_item/getFormId">\n <tal:block tal:condition="report_item/getFormId">\n
<tal:block tal:define="form python:getattr(here, report_item.getFormId())" >\n <tal:block tal:define="form python:getattr(here, report_item.getFormId())" >\n
<!-- TODO: define a macro for multiple prints, for\n
actions using an odt print action. -->\n
<tal:block tal:condition="python:form.pt == \'form_view\'">\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 metal:use-macro="form/form_view/macros/form_layout"/>\n
</tal:block>\n </tal:block>\n
...@@ -348,7 +285,6 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value> ...@@ -348,7 +285,6 @@ bWxQSwUGAAAAAAIAAgCeAAAAhwwAAAAA</string> </value>
</tal:block>\n </tal:block>\n
\n \n
</tal:block>\n </tal:block>\n
</tal:block>\n
</office:text>\n </office:text>\n
</office:body>\n </office:body>\n
</office:document-content>\n </office:document-content>\n
......
35 36
\ 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