[Erp5-report] r11784 - in /erp5/trunk/bt5/erp5_pdf_style: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Dec 22 17:41:08 CET 2006


Author: jerome
Date: Fri Dec 22 17:40:58 2006
New Revision: 11784

URL: http://svn.erp5.org?rev=11784&view=rev
Log:
if REQUEST.other contains ${form_id}/${listbox_id}/ListBox_getColumnWithDict magic key, this will be used as column width, instead of calculating.
This hack can be used for optimisation, or forcing column size of the same listbox rendered multiple times.


Modified:
    erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml
    erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml
    erp5/trunk/bt5/erp5_pdf_style/bt/revision

Modified: erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml?rev=11784&r1=11783&r2=11784&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml (original)
+++ erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml Fri Dec 22 17:40:58 2006
@@ -68,7 +68,16 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>N_ = context.Base_translateString\n
+            <value> <string># if REQUEST.other contains ${form_id}/${listbox_id}/ListBox_getColumnWithDict\n
+# magic key, this will be used as column width, instead of calculating.\n
+if listbox is not None:\n
+  cache = context.REQUEST.other.get(\n
+        \'%s/%s/ListBox_getColumnWithDict\' % (\n
+            listbox.aq_parent.getId(), listbox.getId()), None)\n
+  if cache is not None:\n
+    return cache\n
+\n
+N_ = context.Base_translateString\n
 \n
 # XXX this is just a copy / paste of the old implementation\n
 # dirty code : if we are in domain or report tree, just use the old one, otherwise\n
@@ -183,7 +192,7 @@
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width = 19.0, section_width = 4.0</string> </value>
+            <value> <string>listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=19.0, section_width=4.0, listbox=None</string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -203,7 +212,7 @@
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>5</int> </value>
+                        <value> <int>6</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
@@ -214,8 +223,11 @@
                             <string>is_report_tree_mode</string>
                             <string>frame_width</string>
                             <string>section_width</string>
+                            <string>listbox</string>
+                            <string>None</string>
                             <string>_getattr_</string>
                             <string>context</string>
+                            <string>cache</string>
                             <string>N_</string>
                             <string>result</string>
                             <string>min_column_width</string>
@@ -224,7 +236,6 @@
                             <string>line_width</string>
                             <string>col_count</string>
                             <string>column_property</string>
-                            <string>None</string>
                             <string>string_property</string>
                             <string>str</string>
                             <string>len</string>
@@ -259,6 +270,7 @@
               <tuple>
                 <float>19.0</float>
                 <float>4.0</float>
+                <none/>
               </tuple>
             </value>
         </item>

Modified: erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml?rev=11784&r1=11783&r2=11784&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml (original)
+++ erp5/trunk/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml Fri Dec 22 17:40:58 2006
@@ -89,7 +89,7 @@
       </tal:block>\n
 \n
 \n
-      <tal:block tal:define="global column_width python:here.ListBox_getColumnWithDict(listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=frame_width)"/>\n
+      <tal:block tal:define="global column_width python:here.ListBox_getColumnWithDict(listboxline_list, is_domain_tree_mode, is_report_tree_mode, frame_width=frame_width, listbox=listbox)"/>\n
 \n
       <table  splitbyrow="1" repeatrows="1" repeatcols="0"  style="StandardTableWithGrid">\n
 \n

Modified: erp5/trunk/bt5/erp5_pdf_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_pdf_style/bt/revision?rev=11784&r1=11783&r2=11784&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_pdf_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_pdf_style/bt/revision Fri Dec 22 17:40:58 2006
@@ -1,1 +1,1 @@
-15
+16




More information about the Erp5-report mailing list