Commit 86e5cdfc authored by Jérome Perrin's avatar Jérome Perrin

Use more Messages to allow finer grained translation of dates format

Use standard preference API and DateTime's strftime method for simplifications.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20013 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c3f8b39f
...@@ -70,28 +70,25 @@ ...@@ -70,28 +70,25 @@
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n from string import zfill\n
portal_object = context.getPortalObject()\n portal = context.getPortalObject()\n
request = context.REQUEST\n request = context.REQUEST\n
domain_list = []\n domain_list = []\n
\n \n
selection_name = request.get(\'selection_name\')\n selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(\n params = portal.portal_selections.getSelectionParamsFor(selection_name, request)\n
selection_name, request)\n
\n \n
params = selection.getParams()\n
bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n
bound_start = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n bound_start = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n
\n \n
bound_start = bound_start + params.get(\'bound_variation\', 0)\n bound_start = bound_start + params.get(\'bound_variation\', 0)\n
bound_stop = bound_start + 1\n bound_stop = bound_start + 1\n
\n \n
# Definning date order using user Preference Options\n \n
try:\n # Define date format using user Preferences\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n date_order = portal.portal_preferences.getPreferredDateOrder()\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n date_format = dict(ymd=\'%m/%d %H:00\',\n
date_order = \'ymd\'\n dmy=\'%d/%m %H:00\',\n
except AttributeError:\n mdy=\'%m/%d %H:00\').get(date_order, \'%Y/%m/%d %H:00\')\n
date_order = \'ymd\'\n
\n \n
category_list = []\n category_list = []\n
if depth == 0:\n if depth == 0:\n
...@@ -100,7 +97,7 @@ if depth == 0:\n ...@@ -100,7 +97,7 @@ if depth == 0:\n
# 0.125 means 3 hours in DateTime float format\n # 0.125 means 3 hours in DateTime float format\n
while current_date < bound_stop:\n while current_date < bound_stop:\n
# Create one Temp Object\n # Create one Temp Object\n
o = newTempBase(portal_object, id=\'year\' ,uid=\'new_%s\' % zfill(\'year\',4))\n o = newTempBase(portal, id=\'year\', uid=\'new_%s\' % zfill(\'year\',4))\n
# Setting Axis Dates start and stop\n # Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n o.setProperty(\'start\',current_date)\n
o.setProperty(\'stop\', current_date + 0.125)\n o.setProperty(\'stop\', current_date + 0.125)\n
...@@ -112,20 +109,16 @@ if depth == 0:\n ...@@ -112,20 +109,16 @@ if depth == 0:\n
else:\n else:\n
o.setProperty(\'delimiter_type\', 0)\n o.setProperty(\'delimiter_type\', 0)\n
\n \n
# defining date order\n title = Message(\'erp5_ui\',\n
date_order_list = []\n \'${day_name} ${date}\',\n
for i in date_order:\n mapping=dict(day_name=Message(\'erp5_ui\',\n
if i == \'d\': date_order_list.append(current_date.day())\n current_date.Day()),\n
if i == \'m\': date_order_list.append(current_date.month())\n date=current_date.strftime(date_format))).translate()\n
title = \'%s %s/%s %s:00\' % (Message(domain=\'erp5_ui\',message=current_date.Day(),\n
mapping=None),\n
str(date_order_list[0]), str(date_order_list[1]),\n
str(current_date.hour()))\n
o.setProperty(\'title\', title)\n o.setProperty(\'title\', title)\n
tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(),mapping=None), str(current_date))\n tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day()), str(current_date))\n
o.setProperty(\'tooltip\', tp) \n o.setProperty(\'tooltip\', tp)\n
\n \n
category_list.append(o) \n category_list.append(o)\n
\n \n
current_date = current_date + 0.125\n current_date = current_date + 0.125\n
\n \n
...@@ -142,7 +135,6 @@ for category in category_list:\n ...@@ -142,7 +135,6 @@ for category in category_list:\n
\n \n
domain_list.append(domain)\n domain_list.append(domain)\n
\n \n
context.log("%s on %s" % (script.getId(), context.getPath()), "%d objects domain" % len(domain_list))\n
return domain_list\n return domain_list\n
...@@ -160,6 +152,10 @@ return domain_list\n ...@@ -160,6 +152,10 @@ return domain_list\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_lazy_compilation</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>_owner</string> </key> <key> <string>_owner</string> </key>
<value> <value>
...@@ -205,33 +201,28 @@ return domain_list\n ...@@ -205,33 +201,28 @@ return domain_list\n
<string>zfill</string> <string>zfill</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_object</string> <string>portal</string>
<string>request</string> <string>request</string>
<string>domain_list</string> <string>domain_list</string>
<string>selection_name</string> <string>selection_name</string>
<string>selection</string>
<string>params</string> <string>params</string>
<string>DateTime</string> <string>DateTime</string>
<string>bound_start</string> <string>bound_start</string>
<string>bound_stop</string> <string>bound_stop</string>
<string>date_order</string> <string>date_order</string>
<string>None</string> <string>dict</string>
<string>AttributeError</string> <string>date_format</string>
<string>category_list</string> <string>category_list</string>
<string>current_date</string> <string>current_date</string>
<string>o</string> <string>o</string>
<string>int</string> <string>int</string>
<string>date_order_list</string>
<string>_getiter_</string>
<string>i</string>
<string>str</string>
<string>_getitem_</string>
<string>title</string> <string>title</string>
<string>str</string>
<string>tp</string> <string>tp</string>
<string>_getiter_</string>
<string>category</string> <string>category</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
<string>len</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -73,18 +73,17 @@ ...@@ -73,18 +73,17 @@
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n from string import zfill\n
portal_object = context.getPortalObject()\n portal = context.getPortalObject()\n
request = context.REQUEST\n request = context.REQUEST\n
domain_list = []\n domain_list = []\n
\n \n
form_id=request.get(\'form_id\')\n form_id=request.get(\'form_id\')\n
selection_name = request.get(\'selection_name\')\n selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(selection_name, request)\n params = portal.portal_selections.getSelectionParamsFor(selection_name, request)\n
\n \n
params = selection.getParams()\n
zoom_variation = params.get(\'bound_variation\', 0)\n zoom_variation = params.get(\'bound_variation\', 0)\n
bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n
zoom_begin = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n zoom_begin = DateTime(bound_start.year(), bound_start.month(), bound_start.day())\n
\n \n
# Normalize Month.\n # Normalize Month.\n
month = zoom_begin.month() + zoom_variation\n month = zoom_begin.month() + zoom_variation\n
...@@ -104,22 +103,19 @@ axis_stop = DateTime(year, month, 1)\n ...@@ -104,22 +103,19 @@ axis_stop = DateTime(year, month, 1)\n
default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n
form_id, selection_name)\n form_id, selection_name)\n
\n \n
# Definning date order using user Preference Options\n # Define date format using user Preferences\n
try:\n date_order = portal.portal_preferences.getPreferredDateOrder()\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n date_format = dict(ymd=\'%Y/%m/%d\',\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n dmy=\'%d/%m/%Y\',\n
date_order = \'ymd\'\n mdy=\'%m/%d/%Y\').get(date_order, \'%Y/%m/%d\')\n
except AttributeError:\n
# no Enabled preferences found.\n
date_order = \'ymd\'\n
\n
\n \n
category_list = []\n category_list = []\n
if depth == 0: \n if depth == 0:\n
# recovering first date displayed, without time:\n # recovering first date displayed, without time:\n
while current_date < axis_stop: \n while current_date < axis_stop: \n
# Create one Temp Object\n # Create one Temp Object\n
o = newTempBase(portal_object, id=str(current_date.Day()) ,uid=\'new_%s\' % zfill(\'year\',4))\n o = newTempBase(portal, id=str(current_date.Day()),\n
uid=\'new_%s\' % zfill(\'year\',4))\n
\n \n
# Setting Axis Dates start and stop\n # Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n o.setProperty(\'start\',current_date)\n
...@@ -132,15 +128,9 @@ if depth == 0: \n ...@@ -132,15 +128,9 @@ if depth == 0: \n
else:\n else:\n
o.setProperty(\'delimiter_type\', 0)\n o.setProperty(\'delimiter_type\', 0)\n
\n \n
date_order_list = []\n o.setProperty(\'title\', current_date.strftime(date_format))\n
for i in date_order:\n tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(), mapping=None), str(current_date))\n
if i == \'d\': date_order_list.append(current_date.day())\n o.setProperty(\'tooltip\', tp)\n
if i == \'m\': date_order_list.append(current_date.month())\n
if i == \'y\': date_order_list.append(current_date.year())\n
\n
o.setProperty(\'title\', \'%s/%s/%s\' % (str(date_order_list[0]), str(date_order_list[1]),str(date_order_list[2])))\n
tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(),mapping=None), str(current_date))\n
o.setProperty(\'tooltip\', tp) \n
\n \n
link = \'%s&bound_start=%s&lane_path=base_week_domain\' % ( default_link_url, current_date)\n link = \'%s&bound_start=%s&lane_path=base_week_domain\' % ( default_link_url, current_date)\n
o.setProperty(\'link\', link) \n o.setProperty(\'link\', link) \n
...@@ -162,7 +152,6 @@ for category in category_list:\n ...@@ -162,7 +152,6 @@ for category in category_list:\n
\n \n
domain_list.append(domain)\n domain_list.append(domain)\n
\n \n
#context.log("%s on %s" % (script.getId(), context.getPath()), "%d objects domain" % len(domain_list))\n
return domain_list\n return domain_list\n
...@@ -180,6 +169,10 @@ return domain_list\n ...@@ -180,6 +169,10 @@ return domain_list\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_lazy_compilation</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>_owner</string> </key> <key> <string>_owner</string> </key>
<value> <value>
...@@ -225,12 +218,11 @@ return domain_list\n ...@@ -225,12 +218,11 @@ return domain_list\n
<string>zfill</string> <string>zfill</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_object</string> <string>portal</string>
<string>request</string> <string>request</string>
<string>domain_list</string> <string>domain_list</string>
<string>form_id</string> <string>form_id</string>
<string>selection_name</string> <string>selection_name</string>
<string>selection</string>
<string>params</string> <string>params</string>
<string>zoom_variation</string> <string>zoom_variation</string>
<string>DateTime</string> <string>DateTime</string>
...@@ -242,18 +234,16 @@ return domain_list\n ...@@ -242,18 +234,16 @@ return domain_list\n
<string>axis_stop</string> <string>axis_stop</string>
<string>default_link_url</string> <string>default_link_url</string>
<string>date_order</string> <string>date_order</string>
<string>None</string> <string>dict</string>
<string>AttributeError</string> <string>date_format</string>
<string>category_list</string> <string>category_list</string>
<string>str</string> <string>str</string>
<string>o</string> <string>o</string>
<string>int</string> <string>int</string>
<string>date_order_list</string> <string>None</string>
<string>_getiter_</string>
<string>i</string>
<string>_getitem_</string>
<string>tp</string> <string>tp</string>
<string>link</string> <string>link</string>
<string>_getiter_</string>
<string>category</string> <string>category</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
......
...@@ -74,21 +74,19 @@ from Products.ERP5Type.Message import Message\n ...@@ -74,21 +74,19 @@ from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n from string import zfill\n
\n \n
portal_object = context.getPortalObject()\n portal = context.getPortalObject()\n
request = context.REQUEST\n request = context.REQUEST\n
domain_list = []\n domain_list = []\n
form_id=request.get(\'form_id\')\n form_id=request.get(\'form_id\')\n
\n \n
selection_name = request.get(\'selection_name\')\n selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(\n params = context.portal_selections.getSelectionParamsFor(selection_name, request)\n
selection_name, request)\n
\n \n
params = selection.getParams()\n
bound_variation = params.get(\'bound_variation\', 0)\n bound_variation = params.get(\'bound_variation\', 0)\n
bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n
bound_start = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n bound_start = DateTime(bound_start.year() , bound_start.month() , bound_start.day())\n
\n \n
# Normalize Week.\n # Normalize Week. XXX this should be in preferences as well\n
while bound_start.Day() is not \'Sunday\':\n while bound_start.Day() is not \'Sunday\':\n
bound_start = bound_start - 1\n bound_start = bound_start - 1\n
current_date = bound_start + 7 * bound_variation\n current_date = bound_start + 7 * bound_variation\n
...@@ -97,20 +95,18 @@ bound_stop = current_date + 7\n ...@@ -97,20 +95,18 @@ bound_stop = current_date + 7\n
default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n
form_id, selection_name)\n form_id, selection_name)\n
\n \n
# Definning date order using user Preference Options\n # Define date format using user Preferences\n
try:\n date_order = portal.portal_preferences.getPreferredDateOrder()\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n date_format = dict(ymd=\'%Y/%m/%d\',\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n dmy=\'%d/%m/%Y\',\n
date_order = \'ymd\'\n mdy=\'%m/%d/%Y\').get(date_order, \'%Y/%m/%d\')\n
except AttributeError:\n
date_order = \'ymd\'\n
\n \n
category_list = []\n category_list = []\n
if depth == 0: \n if depth == 0:\n
# This case show Seven days\n # This case show Seven days\n
while current_date < bound_stop:\n while current_date < bound_stop:\n
# Create one Temp Object\n # Create one Temp Object\n
o = newTempBase(portal_object, id=\'week\' ,uid=\'new_%s\' % zfill(\'week\',4))\n o = newTempBase(portal, id=\'week\', uid=\'new_%s\' % zfill(\'week\',4))\n
# Setting Axis Dates start and stop\n # Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n o.setProperty(\'start\',current_date)\n
o.setProperty(\'stop\', current_date+1)\n o.setProperty(\'stop\', current_date+1)\n
...@@ -124,28 +120,22 @@ if depth == 0: \n ...@@ -124,28 +120,22 @@ if depth == 0: \n
else:\n else:\n
o.setProperty(\'delimiter_type\', 0)\n o.setProperty(\'delimiter_type\', 0)\n
\n \n
# defining date order\n title = Message(\'erp5_ui\',\n
date_order_list = []\n \'${day_name} ${date}\',\n
for i in date_order:\n mapping=dict(day_name=Message(\'erp5_ui\',\n
if i == \'d\': date_order_list.append(current_date.day())\n current_date.Day()),\n
if i == \'m\': date_order_list.append(current_date.month())\n date=current_date.strftime(date_format))).translate()\n
if i == \'y\': date_order_list.append(current_date.year())\n
\n
title = \'%s %s/%s/%s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(), mapping=None),\n
str(date_order_list[0]), \n
str(date_order_list[1]),\n
str(date_order_list[2]))\n
o.setProperty(\'title\', title)\n o.setProperty(\'title\', title)\n
\n \n
# Defining ToolTip (Optional)\n # Defining ToolTip (Optional)\n
tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(),mapping=None), str(current_date))\n tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day()), str(current_date))\n
o.setProperty(\'tooltip\', tp) \n o.setProperty(\'tooltip\', tp)\n
\n \n
# Defining Link (Optional)\n # Defining Link (Optional)\n
link = \'%s&bound_start=%s&lane_path=base_day_domain\' % ( default_link_url, current_date)\n link = \'%s&bound_start=%s&lane_path=base_day_domain\' % ( default_link_url, current_date)\n
o.setProperty(\'link\', link) \n o.setProperty(\'link\', link)\n
\n \n
category_list.append(o) \n category_list.append(o)\n
current_date = current_date + 1\n current_date = current_date + 1\n
else:\n else:\n
return domain_list\n return domain_list\n
...@@ -177,6 +167,10 @@ return domain_list\n ...@@ -177,6 +167,10 @@ return domain_list\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_lazy_compilation</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>_owner</string> </key> <key> <string>_owner</string> </key>
<value> <value>
...@@ -222,12 +216,11 @@ return domain_list\n ...@@ -222,12 +216,11 @@ return domain_list\n
<string>zfill</string> <string>zfill</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_object</string> <string>portal</string>
<string>request</string> <string>request</string>
<string>domain_list</string> <string>domain_list</string>
<string>form_id</string> <string>form_id</string>
<string>selection_name</string> <string>selection_name</string>
<string>selection</string>
<string>params</string> <string>params</string>
<string>bound_variation</string> <string>bound_variation</string>
<string>DateTime</string> <string>DateTime</string>
...@@ -236,19 +229,16 @@ return domain_list\n ...@@ -236,19 +229,16 @@ return domain_list\n
<string>bound_stop</string> <string>bound_stop</string>
<string>default_link_url</string> <string>default_link_url</string>
<string>date_order</string> <string>date_order</string>
<string>None</string> <string>dict</string>
<string>AttributeError</string> <string>date_format</string>
<string>category_list</string> <string>category_list</string>
<string>o</string> <string>o</string>
<string>int</string> <string>int</string>
<string>date_order_list</string>
<string>_getiter_</string>
<string>i</string>
<string>str</string>
<string>_getitem_</string>
<string>title</string> <string>title</string>
<string>str</string>
<string>tp</string> <string>tp</string>
<string>link</string> <string>link</string>
<string>_getiter_</string>
<string>category</string> <string>category</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
......
...@@ -74,16 +74,14 @@ from Products.ERP5Type.Message import Message\n ...@@ -74,16 +74,14 @@ from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n from string import zfill\n
\n \n
portal_object = context.getPortalObject()\n portal = context.getPortalObject()\n
request = context.REQUEST\n request = context.REQUEST\n
domain_list = []\n domain_list = []\n
form_id=request.get(\'form_id\')\n form_id=request.get(\'form_id\')\n
\n \n
selection_name = request.get(\'selection_name\')\n selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(\n params = portal.portal_selections.getSelectionParamsFor(selection_name, request)\n
selection_name, request)\n
\n \n
params = selection.getParams()\n
zoom_begin = DateTime(params.get(\'bound_start\', DateTime()))\n zoom_begin = DateTime(params.get(\'bound_start\', DateTime()))\n
year = zoom_begin.year() + params.get(\'bound_variation\', 0)\n year = zoom_begin.year() + params.get(\'bound_variation\', 0)\n
current_date = DateTime(year, 1, 1)\n current_date = DateTime(year, 1, 1)\n
...@@ -91,22 +89,19 @@ current_date = DateTime(year, 1, 1)\n ...@@ -91,22 +89,19 @@ current_date = DateTime(year, 1, 1)\n
default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n
form_id, selection_name)\n form_id, selection_name)\n
\n \n
# Definning date order using user Preference Options\n # Define date format using user Preferences\n
try:\n date_order = portal.portal_preferences.getPreferredDateOrder()\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n date_format = dict(ymd=\'%m/%d\',\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n dmy=\'%d/%m\',\n
date_order = \'ymd\'\n mdy=\'%m/%d\').get(date_order, \'%m/%d\')\n
except AttributeError:\n
date_order = \'ymd\'\n
\n
\n \n
category_list = []\n category_list = []\n
if depth == 0: \n if depth == 0:\n
# getting list of months\n # getting list of months\n
count = 0\n count = 0\n
while count < 12:\n while count < 12:\n
# Create one Temp Object\n # Create one Temp Object\n
o = newTempBase(portal_object, id=\'year\' ,uid=\'new_%s\' % zfill(\'year\',4))\n o = newTempBase(portal, id=\'year\' ,uid=\'new_%s\' % zfill(\'year\',4))\n
# Seting delimiter \n # Seting delimiter \n
if current_date.month() in [1, 7]:\n if current_date.month() in [1, 7]:\n
o.setProperty(\'delimiter_type\', 1)\n o.setProperty(\'delimiter_type\', 1)\n
...@@ -123,22 +118,18 @@ if depth == 0: \n ...@@ -123,22 +118,18 @@ if depth == 0: \n
\n \n
o.setProperty(\'relative_position\', int(current_date))\n o.setProperty(\'relative_position\', int(current_date))\n
\n \n
date_order_list = []\n title = Message(\'erp5_ui\',\n
for i in date_order:\n \'${month_name} ${year}\',\n
if i == \'m\': date_order_list.append(current_date.month())\n mapping=dict(month_name=Message(\'erp5_ui\',\n
if i == \'y\': date_order_list.append(current_date.year())\n current_date.Month()),\n
\n year=str(current_date.year()))).translate()\n
o.setProperty(\'title\', str(date_order_list[0]) + \'/\' + str(date_order_list[1]))\n o.setProperty(\'title\', title)\n
\n
# Defining ToolTip (Optional)\n
tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(),mapping=None), str(current_date))\n
o.setProperty(\'tooltip\', tp)\n
\n \n
# Defining Link\n # Defining Link\n
link = \'%s&bound_start=%s&lane_path=base_month_domain\' % ( default_link_url, current_date)\n link = \'%s&bound_start=%s&lane_path=base_month_domain\' % ( default_link_url, current_date)\n
o.setProperty(\'link\', link) \n o.setProperty(\'link\', link)\n
\n \n
category_list.append(o) \n category_list.append(o)\n
current_date = DateTime(str(current_date.year()) + \'/\' + str((current_date.month() +1)) + \'/1\')\n current_date = DateTime(str(current_date.year()) + \'/\' + str((current_date.month() +1)) + \'/1\')\n
count += 1\n count += 1\n
else:\n else:\n
...@@ -171,6 +162,10 @@ return domain_list\n ...@@ -171,6 +162,10 @@ return domain_list\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_lazy_compilation</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>_owner</string> </key> <key> <string>_owner</string> </key>
<value> <value>
...@@ -216,12 +211,11 @@ return domain_list\n ...@@ -216,12 +211,11 @@ return domain_list\n
<string>zfill</string> <string>zfill</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_object</string> <string>portal</string>
<string>request</string> <string>request</string>
<string>domain_list</string> <string>domain_list</string>
<string>form_id</string> <string>form_id</string>
<string>selection_name</string> <string>selection_name</string>
<string>selection</string>
<string>params</string> <string>params</string>
<string>DateTime</string> <string>DateTime</string>
<string>zoom_begin</string> <string>zoom_begin</string>
...@@ -229,21 +223,18 @@ return domain_list\n ...@@ -229,21 +223,18 @@ return domain_list\n
<string>current_date</string> <string>current_date</string>
<string>default_link_url</string> <string>default_link_url</string>
<string>date_order</string> <string>date_order</string>
<string>None</string> <string>dict</string>
<string>AttributeError</string> <string>date_format</string>
<string>category_list</string> <string>category_list</string>
<string>count</string> <string>count</string>
<string>o</string> <string>o</string>
<string>stop_date</string> <string>stop_date</string>
<string>int</string> <string>int</string>
<string>date_order_list</string>
<string>_getiter_</string>
<string>i</string>
<string>str</string> <string>str</string>
<string>_getitem_</string> <string>title</string>
<string>tp</string>
<string>link</string> <string>link</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>_getiter_</string>
<string>category</string> <string>category</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
......
752 753
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment