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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Nov 15 13:25:02 CET 2006


Author: jerome
Date: Wed Nov 15 13:25:00 2006
New Revision: 11308

URL: http://svn.erp5.org?rev=11308&view=rev
Log:
listbox_pdf_macro : use render_pdf on editable fields

ListBox_getColumnWithDict : make column larger if property is a number (this is
actually a hack to make 1 234,56 style fit the column size)


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=11308&r1=11307&r2=11308&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 Wed Nov 15 13:25:00 2006
@@ -136,13 +136,17 @@
 min_column_width = 1\n
 \n
 max_line_len = {}\n
+number = (int, float, long)\n
 for listboxline in listboxline_list:\n
   line_width = 0\n
   col_count = 0\n
   for column_id, column_property in listboxline.getColumnItemList():\n
-    string_property = str(column_property or \'\')\n
+    if isinstance(column_property, number):\n
+      string_property = "%s+++" % (column_property)\n
+    else:\n
+      string_property = str(column_property or \'\')\n
     if listboxline.isStatLine():\n
-      string_property = "%s longer" % string_property\n
+      string_property = "%s+++++" % string_property\n
     elif listboxline.isTitleLine():\n
       string_property = str(N_(string_property))\n
     line_width += len(string_property)\n
@@ -231,9 +235,13 @@
                             <string>total_col_width</string>
                             <string>_getitem_</string>
                             <string>max_line_len</string>
+                            <string>int</string>
+                            <string>float</string>
+                            <string>long</string>
+                            <string>number</string>
+                            <string>isinstance</string>
                             <string>new_column_max_len</string>
                             <string>update_dict</string>
-                            <string>float</string>
                             <string>sum</string>
                             <string>total_max_len</string>
                             <string>max_len</string>

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=11308&r1=11307&r2=11308&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 Wed Nov 15 13:25:00 2006
@@ -66,6 +66,8 @@
 \n
   <tal:block tal:define="listboxline_list python:listbox.get_value(\'default\', render_format=\'list\', REQUEST=request);\n
                  selection_name python:listbox.get_value(\'selection_name\', REQUEST=request);\n
+                 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
                  is_domain_tree_mode python:selection.domain_tree_mode;\n
                  is_report_tree_mode python:selection.report_tree_mode;" >\n
@@ -128,9 +130,14 @@
                 <tal:block tal:define="column_property python: column_item[1];\n
                                        column_id python: column_item[0]">\n
                   <tal:block tal:condition="python: column_property is not None">\n
-                    <td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])">\n
-                      <para  style="TableStandard" tal:content="string:${column_property}"\n
-                             tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableStandardRightAligned\' or \'TableStandardLeftAligned\'" />\n
+                    <td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])"\n
+                        tal:define="field python: editable_fields.get(column_id, None)" >\n
+                      <para tal:condition="python: field is None"\n
+                            style="TableStandard" tal:content="string:${column_property}"\n
+                            tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableStandardRightAligned\' or \'TableStandardLeftAligned\'" />\n
+                      <para tal:condition="python: field is not None"\n
+                            style="TableStandard" tal:content="python:field.render_pdf(column_property)"\n
+                            tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableStandardRightAligned\' or \'TableStandardLeftAligned\'" />\n
                     </td>\n
                   </tal:block>\n
                   <tal:block tal:condition="python: column_property is None">\n
@@ -147,8 +154,13 @@
                 <tal:block tal:define="column_property python: column_item[1];\n
                                        column_id python: column_item[0]">\n
                   <tal:block tal:condition="python: column_property is not None">\n
-                    <td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])">\n
-                      <para  style="TableLastLine" tal:content="string:${column_property}"\n
+                    <td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])"\n
+                        tal:define="field python: editable_fields.get(column_id, None)">\n
+                      <para  tal:condition="python: field is None"\n
+                             style="TableLastLine" tal:content="string:${column_property}"\n
+                             tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableLastLineRightAligned\' or \'TableLastLineLeftAligned\'" />\n
+                      <para  tal:condition="python: field is not None"\n
+                             style="TableLastLine" tal:content="python: field.render_pdf(column_property)"\n
                              tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableLastLineRightAligned\' or \'TableLastLineLeftAligned\'" />\n
                     </td>\n
                   </tal:block>\n

Modified: erp5/trunk/bt5/erp5_pdf_style/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_pdf_style/bt/revision?rev=11308&r1=11307&r2=11308&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_pdf_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_pdf_style/bt/revision Wed Nov 15 13:25:00 2006
@@ -1,1 +1,1 @@
-10
+12




More information about the Erp5-report mailing list