[Erp5-report] r19531 - in /erp5/trunk/bt5/erp5_base: SkinTemplateItem/portal_skins/erp5_bas...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 26 18:55:15 CET 2008
Author: jerome
Date: Tue Feb 26 18:55:14 2008
New Revision: 19531
URL: http://svn.erp5.org?rev=19531&view=rev
Log:
2008-02-26 Jerome
* Add 2 utility scripts for persons: Person_getAge and Person_getCareerStartDate.
Added:
erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getAge.xml
erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.xml
erp5/trunk/bt5/erp5_base/bt/template_catalog_local_role_key_list
erp5/trunk/bt5/erp5_base/bt/template_catalog_role_key_list
Modified:
erp5/trunk/bt5/erp5_base/bt/change_log
erp5/trunk/bt5/erp5_base/bt/revision
Added: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getAge.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getAge.xml?rev=19531&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getAge.xml (added)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getAge.xml Tue Feb 26 18:55:14 2008
@@ -1,0 +1,178 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+"""Returns the age of the person at the current date or at the given `at_date`.\n
+If `year` is true, return the integer value, otherwise returns a translated\n
+string.\n
+"""\n
+from DateTime import DateTime\n
+from Products.ERP5Type.DateUtils import getIntervalBetweenDates\n
+N_ = context.Base_translateString\n
+\n
+birthday = context.getBirthday()\n
+if birthday is None:\n
+ return None\n
+\n
+if at_date is None:\n
+ at_date = DateTime()\n
+\n
+interval_dict = getIntervalBetweenDates(from_date=birthday,\n
+ to_date=at_date)\n
+if year:\n
+ return interval_dict[\'year\']\n
+\n
+# mapping contains year, month & day\n
+return N_("${year} Years Old", mapping=interval_dict)\n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>at_date=None, year=0</string> </value>
+ </item>
+ <item>
+ <key> <string>errors</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>2</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>at_date</string>
+ <string>year</string>
+ <string>DateTime</string>
+ <string>Products.ERP5Type.DateUtils</string>
+ <string>getIntervalBetweenDates</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>N_</string>
+ <string>birthday</string>
+ <string>None</string>
+ <string>interval_dict</string>
+ <string>_getitem_</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <none/>
+ <int>0</int>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>Person_getAge</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.xml?rev=19531&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.xml (added)
+++ erp5/trunk/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.xml Tue Feb 26 18:55:14 2008
@@ -1,0 +1,168 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string>all_career_step_list = context.contentValues(portal_type=\'Career\',\n
+ checked_permission=\'View\')\n
+\n
+career_step_list = []\n
+# only keep "active" career steps (and related to this organisation if given)\n
+for career_step in all_career_step_list :\n
+ if (subordination_relative_url is None or \\\n
+ career_step.getSubordination() == subordination_relative_url) and \\\n
+ career_step.getStartDate() and \\\n
+ career_step.getValidationState() not in (\'cancelled\', \'deleted\'):\n
+ career_step_list.append(career_step)\n
+ \n
+# sort them by start date\n
+career_step_list.sort( lambda x, y: cmp(x.getStartDate(), y.getStartDate()) )\n
+for career_step in career_step_list :\n
+ # TODO: take the first date of the last active career range.\n
+ # for now, we only return the first one.\n
+ return career_step.getStartDate()\n
+\n
+raise ValueError, \'No Career Step Defined.\'\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>subordination_relative_url=None</string> </value>
+ </item>
+ <item>
+ <key> <string>errors</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>1</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>subordination_relative_url</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>all_career_step_list</string>
+ <string>career_step_list</string>
+ <string>_getiter_</string>
+ <string>career_step</string>
+ <string>None</string>
+ <string>ValueError</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <none/>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>Person_getCareerStartDate</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_base/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/change_log?rev=19531&r1=19530&r2=19531&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_base/bt/change_log Tue Feb 26 18:55:14 2008
@@ -1,3 +1,6 @@
+2008-02-26 Jerome
+* Add 2 utility scripts for persons: Person_getAge and Person_getCareerStartDate.
+
2008-1-9 Yusei
* Hide document tab on organisation if erp5_dms is installed.
Modified: erp5/trunk/bt5/erp5_base/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/revision?rev=19531&r1=19530&r2=19531&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_base/bt/revision (original)
+++ erp5/trunk/bt5/erp5_base/bt/revision Tue Feb 26 18:55:14 2008
@@ -1,1 +1,1 @@
-275
+282
Added: erp5/trunk/bt5/erp5_base/bt/template_catalog_local_role_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/template_catalog_local_role_key_list?rev=19531&view=auto
==============================================================================
(empty)
Added: erp5/trunk/bt5/erp5_base/bt/template_catalog_role_key_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_base/bt/template_catalog_role_key_list?rev=19531&view=auto
==============================================================================
(empty)
More information about the Erp5-report
mailing list