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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 22 14:03:23 CEST 2008


Author: thibaut
Date: Fri Aug 22 14:03:19 2008
New Revision: 23110

URL: http://svn.erp5.org?rev=23110&view=rev
Log:
thibaut
Add a new style in the ods render when we have an editable date field in the listbox.
Now you have two styles, the default style (ie: day/month/year) and the new style named  date_with_time. This style displays the date  In the following way : day/month/year hours:minutes:seconds.

Modified:
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml
    erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml
    erp5/trunk/bt5/erp5_ods_style/bt/revision

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml?rev=23110&r1=23109&r2=23110&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/field_ods_macro.xml Fri Aug 22 14:03:19 2008
@@ -113,19 +113,42 @@
           </tal:block>\n
           <tal:block tal:condition="not: is_float">\n
             <tal:block tal:condition="python: isinstance(value, DateTime)">\n
-             <table:table-cell tal:define="field python: editable_fields.get(column_id, None);"\n
-                               tal:attributes="office:date-value python: value.strftime(\'%Y-%m-%dT%H:%M:%S\');\n
-                                               table:style-name string:${style_prefix}date"\n
-                               table:style-name="date"\n
-                               office:value-type="date">\n
-\n
-              <text:p tal:condition="python: field is None"\n
-                      tal:content="python: value"/>\n
-              <text:p tal:condition="python: field is not None"\n
-                      tal:content="python: field.render_pdf(value)">\n
-              </text:p>\n
-             </table:table-cell>\n
-            </tal:block>\n
+              <tal:block tal:define="field python: editable_fields.get(column_id, None);">\n
+                <tal:block tal:condition="python: field is None">\n
+                  <table:table-cell tal:attributes="office:date-value python: value.strftime(\'%Y-%m-%dT%H:%M:%S\');\n
+                                                    table:style-name string:${style_prefix}date;"\n
+                                    table:style-name="date"\n
+                                    office:value-type="date">\n
+                    <text:p tal:content="python: value"/>\n
+                  </table:table-cell>\n
+                </tal:block>\n
+                <tal:block tal:condition="python: field is not None">\n
+                  <tal:block tal:condition="python:field.meta_type==\'DateTimeField\' and field.get_value(\'date_only\')"> \n
+                    <table:table-cell tal:attributes="office:date-value python: value.strftime(\'%Y-%m-%dT%H:%M:%S\');\n
+                                      table:style-name string:${style_prefix}date;"\n
+                                      table:style-name="date"\n
+                                      office:value-type="date">\n
+                      <text:p tal:content="python: field.render_pdf(value)"/>\n
+                    </table:table-cell>\n
+                  </tal:block>\n
+                  <tal:block tal:condition="python:field.meta_type==\'DateTimeField\' and field.get_value(\'date_only\')==0">\n
+                    <table:table-cell tal:attributes="office:date-value python: value.strftime(\'%Y-%m-%dT%H:%M:%S\');\n
+                                      table:style-name string:${style_prefix}date_with_time;"\n
+                                      table:style-name="date_with_time"\n
+                                      office:value-type="date">\n
+                      <text:p tal:content="python: field.render_pdf(value)"/>\n
+                    </table:table-cell>\n
+                  </tal:block>\n
+                  <tal:block tal:condition="python:field.meta_type!=\'DateTimeField\'">\n
+                    <table:table-cell tal:attributes="table:style-name string:${style_prefix}string;"\n
+                                      table:style-name="string"\n
+                                      office:value-type="string">\n
+                      <text:p>Error: field is not a DateTimeField</text:p>\n
+                    </table:table-cell>\n
+                  </tal:block>\n
+                </tal:block>\n
+              </tal:block>\n
+            </tal:block>            \n
             <tal:block tal:condition="python:not isinstance(value, DateTime)">\n
              <table:table-cell tal:define="field python: editable_fields.get(column_id, None)"\n
                                tal:attributes="table:style-name string:${style_prefix}text"\n

Modified: erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml?rev=23110&r1=23109&r2=23110&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml (original)
+++ erp5/trunk/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/style_macros.xml Fri Aug 22 14:03:19 2008
@@ -130,6 +130,22 @@
       <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border=\'none\'/>\n
       <style:paragraph-properties fo:text-align=\'center\' fo:margin-left=\'0cm\'/>\n
     </style:style>\n
+    <number:date-style style:name="date_style" number:automatic-order="true">\n
+      <number:day number:style="long"/>\n
+      <number:text>/</number:text>\n
+      <number:month number:style="long"/>\n
+      <number:text>/</number:text>\n
+      <number:year number:style="long"/>\n
+      <number:text> </number:text>\n
+      <number:hours number:style="long"/>\n
+      <number:text>:</number:text>\n
+      <number:minutes number:style="long"/>\n
+      <number:text>:</number:text>\n
+      <number:seconds number:style="long"/>\n
+    </number:date-style>\n
+    <style:style style:name="date_with_time" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="date_style">\n
+      <style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
+    </style:style>\n
   </office:automatic-styles>\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=23110&r1=23109&r2=23110&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_ods_style/bt/revision (original)
+++ erp5/trunk/bt5/erp5_ods_style/bt/revision Fri Aug 22 14:03:19 2008
@@ -1,1 +1,1 @@
-141
+146




More information about the Erp5-report mailing list