Commit 17d73176 authored by Rafael Monnerat's avatar Rafael Monnerat

Commit New domains for Planning Box

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18279 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3e4ae71b
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Type.Document.Category</string>
<string>Category</string>
</tuple>
<none/>
<global name="BaseDomain" module="Products.ERP5Type.Document.BaseDomain"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -19,60 +16,38 @@
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<dictionary/>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<dictionary/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>zoom/first_zoom_level</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateDayDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>first_zoom_level</string> </value>
<value> <string>base_day_domain</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>1</int> </value>
<key> <string>last_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -87,44 +62,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>BTrees.Length</string>
<string>Length</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Type.Document.Category</string>
<string>Category</string>
</tuple>
<none/>
<global name="BaseDomain" module="Products.ERP5Type.Document.BaseDomain"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -19,35 +16,15 @@
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<key> <string>_identity_criterion</string> </key>
<value>
<tuple>
<string>zoom/third_zoom_level</string>
</tuple>
<dictionary/>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<key> <string>_range_criterion</string> </key>
<value>
<none/>
<dictionary/>
</value>
</item>
<item>
......@@ -57,12 +34,12 @@
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>third_zoom_level</string> </value>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateMonthDomain</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>30</int> </value>
<key> <string>id</string> </key>
<value> <string>base_month_domain</string> </value>
</item>
<item>
<key> <string>last_id</string> </key>
......@@ -70,13 +47,7 @@
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -91,44 +62,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>BTrees.Length</string>
<string>Length</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Type.Document.Category</string>
<string>Category</string>
</tuple>
<none/>
<global name="BaseDomain" module="Products.ERP5Type.Document.BaseDomain"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -19,60 +16,38 @@
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<dictionary/>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<dictionary/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>zoom/second_zoom_level</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateWeekDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>second_zoom_level</string> </value>
<value> <string>base_week_domain</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>7</int> </value>
<key> <string>last_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -87,44 +62,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>BTrees.Length</string>
<string>Length</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
......@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Type.Document.Category</string>
<string>Category</string>
</tuple>
<none/>
<global name="BaseDomain" module="Products.ERP5Type.Document.BaseDomain"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -19,61 +16,38 @@
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<dictionary/>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<dictionary/>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>zoom/fourth_zoom_level</string>
<string>zoom/fourth_zoom_level</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<key> <string>domain_generator_method_id</string> </key>
<value> <string>Base_generateYearDomain</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>fourth_zoom_level</string> </value>
<value> <string>base_year_domain</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>365</int> </value>
<key> <string>last_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
<value> <string>Base Domain</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -88,44 +62,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>BTrees.Length</string>
<string>Length</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<tuple>
<string>BTrees.OOBTree</string>
<string>OOBTree</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?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[
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
portal_object = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
\n
selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(\n
selection_name, request)\n
\n
params = selection.getParams()\n
bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n
bound_start = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n
\n
bound_start = bound_start + params.get(\'bound_variation\', 0)\n
bound_stop = bound_start + 1\n
\n
# Definning date order using user Preference Options\n
try:\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n
date_order = \'ymd\'\n
except AttributeError:\n
date_order = \'ymd\'\n
\n
category_list = []\n
if depth == 0:\n
current_date = bound_start\n
# This zoom will show one day divided in columns that represents 3 hours.\n
# 0.125 means 3 hours in DateTime float format\n
while current_date < bound_stop:\n
# Create one Temp Object\n
o = newTempBase(portal_object, id=\'year\' ,uid=\'new_%s\' % zfill(\'year\',4))\n
# Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n
o.setProperty(\'stop\', current_date + 0.125)\n
o.setProperty(\'relative_position\', int(current_date))\n
\n
# Seting delimiter\n
if current_date.hour() == 12:\n
o.setProperty(\'delimiter_type\', 1)\n
else:\n
o.setProperty(\'delimiter_type\', 0)\n
\n
# defining date order\n
date_order_list = []\n
for i in date_order:\n
if i == \'d\': date_order_list.append(current_date.day())\n
if i == \'m\': date_order_list.append(current_date.month())\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
tp = \'%s %s\' % (Message(domain=\'erp5_ui\', message=current_date.Day(),mapping=None), str(current_date))\n
o.setProperty(\'tooltip\', tp) \n
\n
category_list.append(o) \n
\n
current_date = current_date + 0.125\n
\n
else:\n
return domain_list\n
\n
for category in category_list:\n
domain = parent.generateTempDomain(id = \'sub\' + category.getProperty(\'id\'))\n
domain.edit(title = category.getTitle(),\n
membership_criterion_base_category = (\'parent\', ), \n
membership_criterion_category = (category,),\n
domain_generator_method_id = script.id,\n
uid = category.getUid())\n
\n
domain_list.append(domain)\n
\n
context.log("%s on %s" % (script.getId(), context.getPath()), "%d objects domain" % len(domain_list))\n
return domain_list\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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</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>depth</string>
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_object</string>
<string>request</string>
<string>domain_list</string>
<string>selection_name</string>
<string>selection</string>
<string>params</string>
<string>DateTime</string>
<string>bound_start</string>
<string>bound_stop</string>
<string>date_order</string>
<string>None</string>
<string>AttributeError</string>
<string>category_list</string>
<string>current_date</string>
<string>o</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>tp</string>
<string>category</string>
<string>domain</string>
<string>script</string>
<string>len</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateDayDomain</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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[
# - Months always starts at 0h of the current month\'s first day and \n
# finish 0h of the next month\'s first day.\n
\n
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
portal_object = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
\n
form_id=request.get(\'form_id\')\n
selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(selection_name, request)\n
\n
params = selection.getParams()\n
zoom_variation = params.get(\'bound_variation\', 0)\n
bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n
zoom_begin = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n
\n
# Normalize Month.\n
month = zoom_begin.month() + zoom_variation\n
year = zoom_begin.year() + (month - 1) / 12\n
month = month % 12\n
if month == 0:\n
month = 12\n
current_date = DateTime(year, month, 1)\n
if month >= 12:\n
year = year + 1\n
month = 1\n
else:\n
month = month + 1\n
axis_stop = DateTime(year, month, 1)\n
\n
\n
default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n
form_id, selection_name)\n
\n
# Definning date order using user Preference Options\n
try:\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n
context.log("%s on %s" % (script.getId(), context.getPath()), "%s" % date_order)\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n
date_order = \'ymd\'\n
except AttributeError:\n
# no Enabled preferences found.\n
date_order = \'ymd\'\n
\n
\n
category_list = []\n
if depth == 0: \n
# recovering first date displayed, without time:\n
while current_date < axis_stop: \n
# Create one Temp Object\n
o = newTempBase(portal_object, id=str(current_date.Day()) ,uid=\'new_%s\' % zfill(\'year\',4))\n
\n
# Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n
o.setProperty(\'stop\',current_date+3)\n
o.setProperty(\'relative_position\', int(current_date))\n
\n
# Seting delimiter \n
if current_date.day() == 15:\n
o.setProperty(\'delimiter_type\', 1)\n
else:\n
o.setProperty(\'delimiter_type\', 0)\n
\n
date_order_list = []\n
for i in date_order:\n
if i == \'d\': date_order_list.append(current_date.day())\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
link = \'%s&bound_start=%s&lane_path=base_week_domain\' % ( default_link_url, current_date)\n
o.setProperty(\'link\', link) \n
\n
category_list.append(o) \n
\n
# go to next date\n
current_date = current_date + 3\n
else:\n
return domain_list \n
\n
for category in category_list:\n
domain = parent.generateTempDomain(id = \'sub\' + category.getProperty(\'id\'))\n
domain.edit(title = category.getTitle(),\n
membership_criterion_base_category = (\'parent\', ), \n
membership_criterion_category = (category,),\n
domain_generator_method_id = script.id,\n
uid = category.getUid())\n
\n
domain_list.append(domain)\n
\n
#context.log("%s on %s" % (script.getId(), context.getPath()), "%d objects domain" % len(domain_list))\n
return domain_list\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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</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>depth</string>
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_object</string>
<string>request</string>
<string>domain_list</string>
<string>form_id</string>
<string>selection_name</string>
<string>selection</string>
<string>params</string>
<string>zoom_variation</string>
<string>DateTime</string>
<string>bound_start</string>
<string>zoom_begin</string>
<string>month</string>
<string>year</string>
<string>current_date</string>
<string>axis_stop</string>
<string>default_link_url</string>
<string>date_order</string>
<string>script</string>
<string>None</string>
<string>AttributeError</string>
<string>category_list</string>
<string>str</string>
<string>o</string>
<string>int</string>
<string>date_order_list</string>
<string>_getiter_</string>
<string>i</string>
<string>_getitem_</string>
<string>tp</string>
<string>link</string>
<string>category</string>
<string>domain</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateMonthDomain</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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[
# - Weeks always starts at 0H of the last Sunday and finish at 0h of\n
# the next sunday.\n
\n
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
\n
portal_object = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
form_id=request.get(\'form_id\')\n
\n
selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(\n
selection_name, request)\n
\n
params = selection.getParams()\n
bound_variation = params.get(\'bound_variation\', 0)\n
bound_start = DateTime(params.get(\'bound_start\', DateTime()))\n
bound_start = DateTime(bound_start.year() , bound_start.month() , bound_start.day()) \n
\n
# Normalize Week.\n
while bound_start.Day() is not \'Sunday\':\n
bound_start = bound_start - 1\n
current_date = bound_start + 7 * bound_variation\n
bound_stop = current_date + 7\n
\n
default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n
form_id, selection_name)\n
\n
# Definning date order using user Preference Options\n
try:\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n
date_order = \'ymd\'\n
except AttributeError:\n
date_order = \'ymd\'\n
\n
category_list = []\n
if depth == 0: \n
# This case show Seven days\n
while current_date < bound_stop:\n
# Create one Temp Object\n
o = newTempBase(portal_object, id=\'week\' ,uid=\'new_%s\' % zfill(\'week\',4))\n
# Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n
o.setProperty(\'stop\', current_date+1)\n
o.setProperty(\'relative_position\', int(current_date))\n
\n
# Seting delimiter \n
if current_date.day() == 1:\n
o.setProperty(\'delimiter_type\', 2)\n
elif current_date.day() == 15:\n
o.setProperty(\'delimiter_type\', 1)\n
else:\n
o.setProperty(\'delimiter_type\', 0)\n
\n
# defining date order\n
date_order_list = []\n
for i in date_order:\n
if i == \'d\': date_order_list.append(current_date.day())\n
if i == \'m\': date_order_list.append(current_date.month())\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
\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
# Defining Link (Optional)\n
link = \'%s&bound_start=%s&lane_path=base_day_domain\' % ( default_link_url, current_date)\n
o.setProperty(\'link\', link) \n
\n
category_list.append(o) \n
current_date = current_date + 1\n
else:\n
return domain_list\n
\n
for category in category_list:\n
domain = parent.generateTempDomain(id = \'sub\' + category.getProperty(\'id\'))\n
domain.edit(title = category.getTitle(),\n
membership_criterion_base_category = (\'parent\', ), \n
membership_criterion_category = (category,),\n
domain_generator_method_id = script.id,\n
uid = category.getUid())\n
\n
domain_list.append(domain)\n
\n
return domain_list\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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</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>depth</string>
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_object</string>
<string>request</string>
<string>domain_list</string>
<string>form_id</string>
<string>selection_name</string>
<string>selection</string>
<string>params</string>
<string>bound_variation</string>
<string>DateTime</string>
<string>bound_start</string>
<string>current_date</string>
<string>bound_stop</string>
<string>default_link_url</string>
<string>date_order</string>
<string>None</string>
<string>AttributeError</string>
<string>category_list</string>
<string>o</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>tp</string>
<string>link</string>
<string>category</string>
<string>domain</string>
<string>script</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateWeekDomain</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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[
# - Years always starts at 0h of the current year\'s first day and \n
# finish 0h of the next year\'s first day.\n
\n
from Products.ERP5Type.Message import Message\n
from Products.ERP5Type.Document import newTempBase\n
from string import zfill\n
\n
portal_object = context.getPortalObject()\n
request = context.REQUEST\n
domain_list = []\n
form_id=request.get(\'form_id\')\n
\n
selection_name = request.get(\'selection_name\')\n
selection = context.portal_selections.getSelectionFor(\n
selection_name, request)\n
\n
params = selection.getParams()\n
zoom_begin = DateTime(params.get(\'bound_start\', DateTime()))\n
year = zoom_begin.year() + params.get(\'bound_variation\', 0)\n
current_date = DateTime(year, 1, 1)\n
\n
default_link_url =\'setLanePath?form_id=%s&list_selection_name=%s\' %(\n
form_id, selection_name)\n
\n
# Definning date order using user Preference Options\n
try:\n
date_order = context.portal_preferences.getActivePreference().getPreferredDateOrder()\n
if (date_order is None) or date_order not in [ \'dmy\', \'ymd\' , \'mdy\' ]:\n
date_order = \'ymd\'\n
except AttributeError:\n
date_order = \'ymd\'\n
\n
\n
category_list = []\n
if depth == 0: \n
# getting list of months\n
count = 0\n
while count < 12:\n
# Create one Temp Object\n
o = newTempBase(portal_object, id=\'year\' ,uid=\'new_%s\' % zfill(\'year\',4))\n
# Seting delimiter \n
if current_date.month() in [1, 7]:\n
o.setProperty(\'delimiter_type\', 1)\n
else:\n
o.setProperty(\'delimiter_type\', 0)\n
\n
# Setting Axis Dates start and stop\n
o.setProperty(\'start\',current_date)\n
if current_date.month() != 12:\n
stop_date = DateTime(current_date.year(),current_date.month() +1,1)\n
else:\n
stop_date = DateTime(year+1, 1, 1)\n
o.setProperty(\'stop\', stop_date)\n
\n
o.setProperty(\'relative_position\', int(current_date))\n
\n
date_order_list = []\n
for i in date_order:\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\', str(date_order_list[0]) + \'/\' + str(date_order_list[1]))\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
# Defining Link\n
link = \'%s&bound_start=%s&lane_path=base_month_domain\' % ( default_link_url, current_date)\n
o.setProperty(\'link\', link) \n
\n
category_list.append(o) \n
current_date = DateTime(str(current_date.year()) + \'/\' + str((current_date.month() +1)) + \'/1\')\n
count += 1\n
else:\n
return domain_list\n
\n
for category in category_list:\n
domain = parent.generateTempDomain(id = \'sub\' + category.getProperty(\'id\'))\n
domain.edit(title = category.getTitle(),\n
membership_criterion_base_category = (\'parent\', ), \n
membership_criterion_category = (category,),\n
domain_generator_method_id = script.id,\n
uid = category.getUid())\n
\n
domain_list.append(domain)\n
\n
return domain_list\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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</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>depth</string>
<string>parent</string>
<string>kw</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>Products.ERP5Type.Document</string>
<string>newTempBase</string>
<string>string</string>
<string>zfill</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_object</string>
<string>request</string>
<string>domain_list</string>
<string>form_id</string>
<string>selection_name</string>
<string>selection</string>
<string>params</string>
<string>DateTime</string>
<string>zoom_begin</string>
<string>year</string>
<string>current_date</string>
<string>default_link_url</string>
<string>date_order</string>
<string>None</string>
<string>AttributeError</string>
<string>category_list</string>
<string>count</string>
<string>o</string>
<string>stop_date</string>
<string>int</string>
<string>date_order_list</string>
<string>_getiter_</string>
<string>i</string>
<string>str</string>
<string>_getitem_</string>
<string>tp</string>
<string>link</string>
<string>_inplacevar_</string>
<string>category</string>
<string>domain</string>
<string>script</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateYearDomain</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
638
\ No newline at end of file
640
\ No newline at end of file
......@@ -11,5 +11,8 @@ portal_caches/erp5_ui_medium
portal_caches/erp5_ui_medium/default_ram_cache
portal_caches/erp5_ui_short
portal_caches/erp5_ui_short/default_ram_cache
portal_categories/zoom/**
portal_domains/base_day_domain
portal_domains/base_month_domain
portal_domains/base_week_domain
portal_domains/base_year_domain
portal_preferences/default_site_preference
\ 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