[Erp5-report] r20504 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Apr 14 17:38:23 CEST 2008
Author: rafael
Date: Mon Apr 14 17:38:21 2008
New Revision: 20504
URL: http://svn.erp5.org?rev=20504&view=rev
Log:
Added new parameter to round scripts. This is usefull to round that values in a different way for begin and the end of the block.
See: http://www.erp5.org/Discussion/DateRange
Modified:
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToDay.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToInt.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToMinute.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToDay.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToDay.xml?rev=20504&r1=20503&r2=20504&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToDay.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToDay.xml Mon Apr 14 17:38:21 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.PythonScripts.PythonScript</string>
- <string>PythonScript</string>
- </tuple>
- <none/>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -74,11 +71,18 @@
Script used by PlanningBox validator to round the bound dates to the\n
closest full day.\n
"""\n
+if axis == \'begin\':\n
+ if full_date.hour() > 12: \n
+ return DateTime(full_date.Date()) + 1\n
+ else:\n
+ return DateTime(full_date.Date())\n
\n
-if full_date.hour() > 12:\n
- return DateTime(full_date.Date()) + 1\n
-else:\n
- return DateTime(full_date.Date())\n
+if axis == \'end\':\n
+ # round to 23:59:59\n
+ if full_date.hour() > 12:\n
+ return DateTime(full_date.Date()) + 1 - (1.0/(24*3600))\n
+ else:\n
+ return DateTime(full_date.Date()) - (1.0/(24*3600))\n
]]></string> </value>
@@ -103,7 +107,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>full_date</string> </value>
+ <value> <string>full_date, axis=\'begin\'</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -123,13 +127,14 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>1</int> </value>
+ <value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>full_date</string>
+ <string>axis</string>
<string>_getattr_</string>
<string>DateTime</string>
</tuple>
@@ -143,12 +148,18 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
- <none/>
+ <tuple>
+ <string>begin</string>
+ </tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Planning_roundBoundToDay</string> </value>
+ </item>
+ <item>
+ <key> <string>isIndexable</string> </key>
+ <value> <int>0</int> </value>
</item>
<item>
<key> <string>warnings</string> </key>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToInt.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToInt.xml?rev=20504&r1=20503&r2=20504&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToInt.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToInt.xml Mon Apr 14 17:38:21 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.PythonScripts.PythonScript</string>
- <string>PythonScript</string>
- </tuple>
- <none/>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -95,7 +92,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>value</string> </value>
+ <value> <string>value, axis=\'begin\'</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -115,13 +112,14 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>1</int> </value>
+ <value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>value</string>
+ <string>axis</string>
<string>int</string>
</tuple>
</value>
@@ -134,12 +132,18 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
- <none/>
+ <tuple>
+ <string>begin</string>
+ </tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Planning_roundBoundToInt</string> </value>
+ </item>
+ <item>
+ <key> <string>isIndexable</string> </key>
+ <value> <int>0</int> </value>
</item>
<item>
<key> <string>warnings</string> </key>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToMinute.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToMinute.xml?rev=20504&r1=20503&r2=20504&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToMinute.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Planning_roundBoundToMinute.xml Mon Apr 14 17:38:21 2008
@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
- <tuple>
- <string>Products.PythonScripts.PythonScript</string>
- <string>PythonScript</string>
- </tuple>
- <none/>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
</tuple>
</pickle>
<pickle>
@@ -104,7 +101,7 @@
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>full_date</string> </value>
+ <value> <string>full_date, axis=\'begin\'</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -124,13 +121,14 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>1</int> </value>
+ <value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>full_date</string>
+ <string>axis</string>
<string>_getattr_</string>
<string>DateTime</string>
</tuple>
@@ -144,12 +142,18 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
- <none/>
+ <tuple>
+ <string>begin</string>
+ </tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Planning_roundBoundToMinute</string> </value>
+ </item>
+ <item>
+ <key> <string>isIndexable</string> </key>
+ <value> <int>0</int> </value>
</item>
<item>
<key> <string>warnings</string> </key>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=20504&r1=20503&r2=20504&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Mon Apr 14 17:38:21 2008
@@ -1,1 +1,1 @@
-790
+792
More information about the Erp5-report
mailing list