[Erp5-report] r17008 - in /erp5/trunk/bt5/erp5_ods_style: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Oct 15 18:25:39 CEST 2007


Author: jerome
Date: Mon Oct 15 18:25:38 2007
New Revision: 17008

URL: http://svn.erp5.org?rev=17008&view=rev
Log:
generate valid ODF for most cases
simplify the style for report section title (and support more than 3 levels)
drop support for getTranslatedTitle (use title instead)

Modified:
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_list.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/listbox_ods_macro.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml
    erp5/trunk/bt5/erp5_ods_style/bt/revision

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_list.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_list.xml?rev=17008&r1=17007&r2=17008&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_list.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_list.xml Mon Oct 15 18:25:38 2007
@@ -64,19 +64,25 @@
   <office:body>\n
     <office:spreadsheet>\n
       <table:table table:style-name=\'ta1\' table:print=\'false\' tal:attributes="table:name here/getTitle" >\n
-        <tal:block metal:define-macro="form_layout" tal:define="dummy python: request.set(\'here\', here); listbox python:form.get_fields_in_group(\'bottom\')[0]">\n
+        <tal:block metal:define-macro="form_layout"\n
+                    tal:define="dummy python: request.set(\'here\', here);\n
+                                listbox form/listbox">\n
             <tal:block metal:use-macro="here/listbox_ods_macro/macros/listbox">\n
               <tal:block metal:fill-slot="list_header">\n
+                <tal:block tal:repeat="column_item listboxline/getColumnItemList"> \n
+                  <tal:block tal:define="column_property python: column_item[1]; column_id python: column_item[0]">\n
+                    <table:table-column table:style-name=\'co2\' table:default-cell-style-name=\'report-column-title\'/>\n
+                  </tal:block>\n
+                </tal:block>\n
                 <table:table-header-rows>\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\' table:number-columns-spanned=\'1\' office:value-type=\'string\' >\n
                         <tal:block tal:condition="listboxline/getSectionName">\n
-                          <text:p  tal:content="python: here.Localozer.erp5_ui.gettext(listboxline/getSectionName).encode(\'utf-8\')"/>\n
+                          <text:p  tal:content="python: here.Localizer.erp5_ui.gettext(listboxline.getSectionName()).encode(\'utf-8\')"/>\n
                         </tal:block>\n
                       </table:table-cell>\n
                     </tal:block>\n
-                    <table:table-column table:style-name="co2"/>\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]; column_id python: column_item[0]">\n

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml?rev=17008&r1=17007&r2=17008&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/form_view.xml Mon Oct 15 18:25:38 2007
@@ -64,7 +64,12 @@
   <tal:block metal:use-macro="here/style_macros/macros/style_macro"/>\n
 <office:body>\n
   <office:spreadsheet>\n
+    <!-- at least one table-column element is required for ODF to validate -->\n
+    <table:table-column\n
+          table:style-name=\'co2\'\n
+          table:default-cell-style-name=\'report-column-title\'/>\n
 \n
+    <!-- calculate max column len -->\n
     <tal:block tal:define="field_list python:form.get_fields_in_group(\'bottom\')">\n
       <tal:block tal:define="global column_len python:3"/>\n
       <tal:block tal:condition=\'field_list\'>\n
@@ -84,7 +89,6 @@
               <tal:block tal:condition="python: field_list not in [None, []]">\n
                 <tal:block tal:repeat="field field_list">\n
                   <tal:block tal:condition="python:field.meta_type != \'HiddenStringField\'">\n
-                    <table:table-column table:style-name="co2"/>\n
                     <table:table-row table:style-name=\'ro2\'>\n
                       <table:table-cell table:number-rows-spanned=\'1\' table:style-name=\'report-column-title\' table:number-columns-spanned=\'1\' office:value-type=\'string\'>\n
                         <text:p tal:content="python:here.Localizer.erp5_ui.gettext(field.get_value (\'title\')).encode(\'utf-8\')"></text:p>\n
@@ -97,14 +101,14 @@
                             <text:p tal:condition="item_list" tal:content="python: [i[0] for i in item_list if i[1] == item][0]"></text:p>\n
                           </tal:block>\n
                         </tal:block>\n
-                        <tal:block tal:condition="python: (not (same_type(value, []) or same_type(value, ()))) and value != None">\n
+                        <tal:block tal:condition="python: (not (same_type(value, []) or same_type(value, ()))) and value is not None">\n
                           <text:p tal:condition="not:item_list" tal:content="python: str(value)">\n
                           </text:p>\n
                           <tal:block tal:condition="python:value != \'\'">\n
-                            <text:p tal:condition="item_list" disable-output-escapint="yes" tal:content="python: [i[0].replace(\'&amp;\', \'\') for i in item_list if i[1] == value][0]">\n
+                            <text:p tal:condition="item_list" tal:content="python: [i[0].replace(\'&amp;\', \'\') for i in item_list if i[1] == value][0]">\n
                             </text:p>\n
                           </tal:block>\n
-                          <tal:block tal:condition="python: value == None">\n
+                          <tal:block tal:condition="python: value is None">\n
                             <text:p table:style="Default" tal:content="python: \' \'" />\n
                           </tal:block>\n
                         </tal:block>\n

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/listbox_ods_macro.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/listbox_ods_macro.xml?rev=17008&r1=17007&r2=17008&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/listbox_ods_macro.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/listbox_ods_macro.xml Mon Oct 15 18:25:38 2007
@@ -72,7 +72,6 @@
         <tal:block tal:condition="python: len(listboxline_list) > 1">\n
           <tal:block tal:condition="python: is_domain_tree_mode">\n
             <tal:block tal:define="domain_list python: selection.getDomainList()" tal:condition="python: len(domain_list) > 0">\n
-              <table:table-column table:style-name="co2"/>\n
               <table:table-row>\n
                 <table:table-cell office:value-type=\'string\'>\n
                   <text:p tal:content="python: domain_list[-1]"/>\n
@@ -81,8 +80,7 @@
             </tal:block>\n
           </tal:block>\n
           <tal:block tal:repeat="listboxline python: listboxline_list">\n
-            <table:table-column table:style-name=\'co2\'/>\n
-            <tal:block metal:define-slot="for_form_list" tal:condition="listboxline/isTitleLine | python: is_report_tree_mode">\n
+            <tal:block metal:define-slot="for_form_list" 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
@@ -93,7 +91,6 @@
                     </table:table-cell>\n
                   </tal:block>\n
 \n
-                  <table:table-column table:style-name="co2"/>\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]; column_id python: column_item[0]">\n
@@ -117,7 +114,6 @@
             </tal:block>\n
 \n
             <tal:block tal:condition="not:listboxline/isTitleLine">\n
-              <table:table-column table:style-name="co2"/>\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
@@ -170,14 +166,13 @@
               </table:table-row>\n
             </tal:block>\n
           </tal:block>\n
-          <table:table-column table:style-name="co2"/>\n
           <table:table-row metal:define-slot="table_bottom_line">\n
             <tal:block tal:repeat="listboxline python: listboxline_list">\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
                     <tal:block tal:condition="python: column_property is not None">\n
-                      <table:table-cell table:style-name=\'table-bottom-line\' table:number-columns-repeated=\'repeat/column_item/number\'/>\n
+                      <table:table-cell table:style-name=\'table-bottom-line\'/>\n
                     </tal:block>\n
                   </tal:block>\n
                 </tal:block>\n

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml?rev=17008&r1=17007&r2=17008&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/report_view.xml Mon Oct 15 18:25:38 2007
@@ -59,34 +59,36 @@
   <office:body>\n
     <office:spreadsheet>\n
 \n
-      <tal:block tal:define="report_item_list python:report_method(); field_errors python: request.get(\'field_errors,{}\'); dummy python: request.set(\'here\', here);global sheet_per_reportsection python: int(request.get(\'sheet_per_report_section\', 0));global column_len python:3">\n
+      <tal:block tal:define="report_item_list python:report_method();\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:define="portal_object here/portal_url/getPortalObject"> \n
         <tal:block tal:condition="not: sheet_per_reportsection">\n
           <table:table tal:attributes="table:name python:here.getProperty(\'title\')">\n
+          <!-- at least one table-column element is required for ODF to validate -->\n
+          <table:table-column\n
+                table:style-name=\'co2\'\n
+                table:default-cell-style-name=\'report-column-title\'/>\n
+\n
+          <tal:block metal:use-macro="here/form_view/macros/form_layout"/>\n
+\n
             <tal:block tal:repeat="report_item report_item_list">\n
-              <tal:block metal:define-macro="make_report_item_table" tal:define="here python:report_item.getObject(portal_object); dummy python:report_item.pushReport(portal_object)">\n
+              <tal:block metal:define-macro="make_report_item_table"\n
+                         tal:define="here python:report_item.getObject(portal_object);\n
+                                     dummy python:report_item.pushReport(portal_object)">\n
                 <tal:block tal:condition="report_item/getTitle | report_item/getTranslatedTitle">\n
                   <table:table-row table:style-name=\'ro2\'>\n
                     <tal:block tal:condition="report_item/getTitle" tal:define="level report_item/getLevel">\n
-                      <tal:block  tal:condition="python: level == 1">\n
-                        <table:table-cell table:style-name="report-title" tal:attributes="table:number-columns-spanned python:column_len"  office:value-type=\'string\' table:number-rows-spanned=\'1\'>\n
+                        <table:table-cell table:style-name="report-title"\n
+                                          tal:attributes="table:number-columns-spanned python:column_len;\n
+                                                          table:style-name python:test(level&gt;1, \'report-title%s\' % level, \'report-title\');" \n
+                                          office:value-type=\'string\'\n
+                                          table:number-rows-spanned=\'1\'>\n
                           <text:p tal:content="report_item/getTitle" ></text:p>\n
                         </table:table-cell>\n
-                      </tal:block>\n
-                      <tal:block tal:condition="python: level == 2">\n
-                        <table:table-cell table:style-name="report-title2" tal:attributes="table:number-columns-spanned python:column_len"  office:value-type=\'string\' table:number-rows-spanned=\'1\'>\n
-                          <text:p tal:content="report_item/getTitle" ></text:p>\n
-                        </table:table-cell>\n
-                      </tal:block>\n
-                      <tal:block tal:condition="python: level == 3">\n
-                        <table:table-cell table:style-name="report-title3" tal:attributes="table:number-columns-spanned python:column_len"  office:value-type=\'string\' table:number-rows-spanned=\'1\'>\n
-                          <text:p tal:content="report_item/getTitle"></text:p>\n
-                        </table:table-cell>\n
-                      </tal:block>\n
-                    </tal:block>\n
-                    <tal:block tal:condition="report_item/getTranslatedTitle">\n
-                      <text:p tal:content="report_item/getTranslatedTitle"></text:p>\n
                     </tal:block>\n
                   </table:table-row>\n
                 </tal:block>\n

Modified: erp5/trunk/bt5/erp5_ods_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/bt/revision?rev=17008&r1=17007&r2=17008&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_ods_style/bt/revision Mon Oct 15 18:25:38 2007
@@ -1,1 +1,1 @@
-83
+84




More information about the Erp5-report mailing list