diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml index 9a4ff1fa7a5842952080c65b2477b1ad6449709b..fb36f988aaf124921b4de7c079f47de7d22b4203 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/ListBox_getColumnWithDict.xml @@ -136,13 +136,17 @@ if is_domain_tree_mode or is_report_tree_mode : \n 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 @@ return result\n <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> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml index 2b0bc9a40b9e30a054fe01505cf4ce7a3454eecc..4db5b4078a54c46da762b7589afad4697879fa8d 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml @@ -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 diff --git a/bt5/erp5_pdf_style/bt/revision b/bt5/erp5_pdf_style/bt/revision index 9a037142aa3c1b4c490e1a38251620f113465330..3cacc0b93c9c9c03a72da624ca28a09ba5c1336f 100644 --- a/bt5/erp5_pdf_style/bt/revision +++ b/bt5/erp5_pdf_style/bt/revision @@ -1 +1 @@ -10 \ No newline at end of file +12 \ No newline at end of file