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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 5 16:10:47 CET 2008


Author: jerome
Date: Tue Feb  5 16:10:47 2008
New Revision: 19060

URL: http://svn.erp5.org?rev=19060&view=rev
Log:
Only build a hierarchical structure for line list when we are in report_tree_mode or domain_tree_mode.
Don't fail if selection is not initialized

Added:
    erp5/trunk/bt5/erp5_ods_style/bt/template_catalog_scriptable_key_list
Modified:
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Listbox_getReportTreeStructure.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/listbox_ods_macro.xml
    erp5/trunk/bt5/erp5_ods_style/bt/revision

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Listbox_getReportTreeStructure.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Listbox_getReportTreeStructure.xml?rev=19060&r1=19059&r2=19060&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Listbox_getReportTreeStructure.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Listbox_getReportTreeStructure.xml Tue Feb  5 16:10:47 2008
@@ -71,6 +71,12 @@
 structure[\'line\'] = None\n
 structure[\'line_list\'] = []\n
 \n
+if not (is_report_tree_mode or is_domain_tree_mode):\n
+  # When this is not a report tree, return the "plain structure"\n
+  structure[\'line\'] = None\n
+  structure[\'line_list\'] = [dict(line=x, line_list=[]) for x in listbox_line_list]\n
+  return structure\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
@@ -95,7 +101,6 @@
     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
@@ -117,7 +122,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>listbox_line_list=None</string> </value>
+            <value> <string>listbox_line_list=None, is_report_tree_mode, is_domain_tree_mode</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -137,16 +142,23 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>3</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
                             <string>listbox_line_list</string>
+                            <string>is_report_tree_mode</string>
+                            <string>is_domain_tree_mode</string>
                             <string>structure</string>
                             <string>None</string>
                             <string>_write_</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>x</string>
+                            <string>dict</string>
                             <string>order_line_list</string>
                           </tuple>
                         </value>
@@ -160,6 +172,7 @@
             <key> <string>func_defaults</string> </key>
             <value>
               <tuple>
+                <none/>
                 <none/>
               </tuple>
             </value>

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=19060&r1=19059&r2=19060&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 Tue Feb  5 16:10:47 2008
@@ -63,10 +63,11 @@
                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
                selection python: here.portal_selections.getSelectionFor(selection_name, REQUEST=request);\n
-               listbox_line_structure python: here.Listbox_getReportTreeStructure(listbox_line_list=listboxline_list);\n
-               is_report_tree_mode selection/report_tree_mode | nothing;\n
+               is_report_tree_mode selection/report_tree_mode | python: 0;\n
+               is_domain_tree_mode selection/domain_tree_mode | python: 0;\n
+               listbox_line_structure python: here.Listbox_getReportTreeStructure(listbox_line_list=listboxline_list, is_report_tree_mode=is_report_tree_mode, is_domain_tree_mode=is_domain_tree_mode);\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
+               " i18n:domain="ui">\n
 \n
         <tal:block metal:use-macro="here/listbox_line_ods_macro/macros/listbox_line"/>\n
 \n

Modified: erp5/trunk/bt5/erp5_ods_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/bt/revision?rev=19060&r1=19059&r2=19060&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_ods_style/bt/revision Tue Feb  5 16:10:47 2008
@@ -1,1 +1,1 @@
-116
+118

Added: erp5/trunk/bt5/erp5_ods_style/bt/template_catalog_scriptable_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/bt/template_catalog_scriptable_key_list?rev=19060&view=auto
==============================================================================
    (empty)




More information about the Erp5-report mailing list