Commit a4b1b703 authored by Rafael Monnerat's avatar Rafael Monnerat

Added Date Zoom feature at Planning Box.

Added Frozen Blocs Configuration.

The Planning Box was partially refactored in some parts by me (and also Romain) these lasts months, this commit was the initial  ones.


The tests and documentation update will come soon.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15883 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dd4e8e68
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</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[
# Define the condition for the bloc is frozen or not.\n
# The Bloc is frozen when:\n
# - it\'s a Simulation Movement\n
# - The user is not allowed to edit it\n
# - it\'s a part of a block \n
# - the object is one Calendar Period\n
\n
frozen_portal_type_list = context.getPortalCalendarPeriodTypeList() + (\'Simulation Movement\',\'Presence Request Period\')\n
\n
return (not context.portal_membership.checkPermission(\'Modify portal content\', block.parent_activity.object)) or \\\n
(block.parent_activity.object.getPortalType() in frozen_portal_type_list ) or \\\n
(not ((block.position_x.relative_begin > 0) and \\\n
(block.position_x.relative_end < 1) and \\\n
(block.property_dict[\'stat\'] == 0)))\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>block</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>block</string>
<string>_getattr_</string>
<string>context</string>
<string>frozen_portal_type_list</string>
<string>_getitem_</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>PlanningBox_isFrozenBlock</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -79,12 +79,12 @@ PlaningBox. The process is based on the strucutre passed in parameter (i.e optio
Beware this only generates the HTML code, no CSS generation is done in this script\n
-->\n
\n
<tal:block tal:define="basic options/basic;\n
<tal:block tal:define=" basic options/basic;\n
planning options/planning;\n
address python:basic.context.getUrl()">\n
\n
<!-- hidden fields holding some usefull data-->\n
<input type="hidden" name="list_selection_name" value="PLanningView" tal:attributes="value python:basic.field.get_value(\'selection_name\')"/>\n
<input type="hidden" name="list_selection_name" value="PlanningView" tal:attributes="value python:basic.field.get_value(\'selection_name\')"/>\n
<!-- setPage needs \'listbox_uid:list\'-->\n
<input type="hidden" name="listbox_uid:list"/>\n
<!-- block_moved_list -->\n
......@@ -97,9 +97,10 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
\n
<table>\n
<tr>\n
<td>\n
<h3><span tal:replace="structure python:basic.field.get_value(\'title\')"/></h3>\n
</td>\n
<td>\n
<h3 i18n:translate="" i18n:domain="ui">\n
<tal:block tal:replace="structure python:basic.field.get_value(\'title\')"/> </h3>\n
</td>\n
<b tal:replace="nothing"><!-- report path selection --></b>\n
<td>\n
<select name="report_root_url" onChange="submitAction(this.form,\'/setReportRoot\')"\n
......@@ -111,13 +112,13 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
<tal:block tal:repeat="report_root_element python:basic.report_root_list">\n
<tal:block tal:condition="python:report_root_element[0]==selection_report_path">\n
<b tal:replace="nothing">actual value is selected</b>\n
<option selected="selected" value="None"\n
<option i18n:translate="" i18n:domain="ui" selected="selected" value="None"\n
tal:attributes="value python:report_root_element[0]"\n
tal:content="structure python:report_root_element[1]">_</option>\n
</tal:block>\n
<tal:block tal:condition="python:report_root_element[0]!=selection_report_path">\n
<b tal:replace="nothing">actual value is not selected</b>\n
<option value="None"\n
<option i18n:translate="" i18n:domain="ui" value="None"\n
tal:attributes="value python:report_root_element[0]"\n
tal:content="structure python:report_root_element[1]">_</option>\n
</tal:block>\n
......@@ -130,10 +131,10 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
&nbsp;\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis == planning.Y">\n
Y Axis\n
<tal:block i18n:translate="" i18n:domain="ui"> Y Axis </tal:block>\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis != planning.Y">\n
X Axis\n
<tal:block i18n:translate="" i18n:domain="ui"> X Axis </tal:block>\n
</tal:block>\n
<tal:block tal:repeat="nb python:range(1)">\n
&nbsp;\n
......@@ -178,20 +179,17 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
tal:attributes="src string:${address}/images/1rightarrowv.png;\n
name string:${address}/nextPage:method"/>\n
</tal:block>\n
\n
</td>\n
\n
\n
\n
<td>\n
<tal:block tal:repeat="nb python:range(8)">\n
&nbsp;\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis == planning.Y">\n
X Axis\n
<tal:block i18n:translate="" i18n:domain="ui"> X Axis </tal:block>\n
</tal:block>\n
<tal:block tal:condition="python:planning.main_axis != planning.Y">\n
Y Axis\n
<tal:block i18n:translate="" i18n:domain="ui"> Y Axis </tal:block>\n
</tal:block>\n
<tal:block tal:repeat="nb python:range(1)">\n
&nbsp;\n
......@@ -203,66 +201,57 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
<select name="zoom_level" title="Change Zoom Level" size="1"\n
onChange=""\n
tal:attributes="onChange string:submitAction(this.form,\'${address}/setZoomLevel\')">\n
<tal:block tal:repeat="current_zoom_level python:[0.25,0.5,1,2,3,4,8]">\n
<tal:block tal:condition="python:current_zoom_level==basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is selected </b>\n
<option selected="selected" value="None"\n
<tal:block tal:condition="python:not basic.field.get_value(\'use_date_zoom\')">\n
<tal:block tal:repeat="current_zoom_level python:[0.1,0.25,0.5,1,2,3,4,8,12,16,32,64]">\n
<tal:block tal:condition="python:current_zoom_level==basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is selected </b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:current_zoom_level"\n
tal:content="structure python:\'Zoom \' + str(current_zoom_level) + \'x\'">Zoom level</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_zoom_level!=basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is not selected </b>\n
<option value="None"\n
tal:content="structure python:\'Zoom %sx\' % current_zoom_level">Zoom level</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_zoom_level!=basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is not selected </b>\n
<option value="None"\n
tal:attributes="value python:current_zoom_level"\n
tal:content="structure python:\'Zoom \' + str(current_zoom_level) + \'x\'">Zoom level</option>\n
tal:content="structure python:\'Zoom %sx\' % current_zoom_level">Zoom level</option>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</select>\n
\n
\n
<!-- previous Zoom page-->\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=0">\n
<b tal:replace="nothing"> previous page exists </b>\n
<input type="image" src="/images/1leftarrowv.png" title="Previous Zoom Page" name="" border="0"\n
tal:attributes="src string:${address}/images/1leftarrowv.png;\n
name string:${address}/previousZoom:method"/>\n
</tal:block>\n
\n
<!-- pocessing zoom page selection widgets -->\n
<select name="zoom_start" title="Change Zoom Page" size="1"\n
onChange=""\n
tal:condition="python:basic.secondary_axis_info[\'zoom_level\'] > 1"\n
tal:attributes="onChange string:submitAction(this.form,\'${address}/setZoom\')">\n
<tal:block tal:repeat="current_zoom_page_number python:range(basic.secondary_axis_info[\'zoom_level\'])">\n
<tal:block tal:condition="python:current_zoom_page_number == basic.secondary_axis_info[\'zoom_start\']">\n
<b tal:replace="nothing"> actual zoom page is selected </b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:current_zoom_page_number"\n
tal:content="structure python:str(current_zoom_page_number + 1) + \'of \' + str(max(int(float(basic.secondary_axis_info[\'zoom_level\'])),1))">Zoom page</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_zoom_page_number != basic.secondary_axis_info[\'zoom_start\']">\n
<b tal:replace="nothing"> actual zoom page is not selected </b>\n
<option value="None"\n
tal:attributes="value python:current_zoom_page_number"\n
tal:content="structure python:str(current_zoom_page_number + 1) + \'of \' + str(max(int(float(basic.secondary_axis_info[\'zoom_level\'])),1))">Zoom page</option>\n
<tal:block tal:condition="python:basic.field.get_value(\'use_date_zoom\')">\n
<!-- Defining Date Zoom Level -->\n
<!-- XXX This part has to be improved -->\n
<tal:block tal:repeat="current_zoom_level python:[[\'Day\',1],[\'Week\',7],[\'Month\',30],[\'Year\',365]]">\n
<tal:block tal:condition="python:current_zoom_level[1]==basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is selected </b>\n
<option selected="selected" value="None"\n
tal:attributes="value python:current_zoom_level[1]"\n
i18n:translate="" i18n:domain="ui"\n
tal:content="structure python:str(current_zoom_level[0])">Zoom level</option>\n
</tal:block>\n
<tal:block tal:condition="python:current_zoom_level[1]!=basic.secondary_axis_info[\'zoom_level\']">\n
<b tal:replace="nothing"> current zoom level is not selected </b>\n
<option value="None"\n
tal:attributes="value python:current_zoom_level[1]"\n
i18n:translate="" i18n:domain="ui"\n
tal:content="structure python:str(current_zoom_level[0])">Zoom level</option>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</select>\n
\n
\n
<!-- next Zoom Page-->\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=(basic.secondary_axis_info[\'zoom_level\'] - 1) and basic.secondary_axis_info[\'zoom_level\'] > 1">\n
<b tal:replace="nothing"> next page exists </b>\n
<input type="image" src="/images/1rightarrowv.png" title="Next Zoom Page" name="" border="0"\n
tal:attributes="src string:${address}/images/1rightarrowv.png;\n
name string:${address}/nextZoom:method"/>\n
</tal:block>\n
<tal:block tal:condition="python:basic.field.get_value(\'use_date_zoom\')"\n
tal:define="form_id python:\'%s\' % (basic.form.id);\n
selection_name python:basic.field.get_value(\'selection_name\');\n
zoom_level python:basic.secondary_axis_info[\'zoom_level\'];\n
today python:\'%s/%s/%s\' % (str(DateTime().year()), str(DateTime().month()),str(DateTime().day()))">\n
<a tal:attributes="href python: \'%s/setZoomLevel?form_id=%s&list_selection_name=%s&zoom_date_start=%s\'\n
% (context.absolute_url(), form_id,selection_name,today)">\n
<img src="/images/jump.png" title="Jump to Current Day" name="JumpToCurrentDay" \n
tal:attributes="src string:${address}/images/jump.png;" />\n
</a> \n
</tal:block> \n
</td>\n
</tr>\n
</table>\n
\n
\n
\n
</table>\n
\n
<!-- div class="planning_box" -->\n
<!-- planning structure (axis and group representation)-->\n
......@@ -270,13 +259,12 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
tal:attributes="id python:axis.name">\n
<!-- groups of the current axis-->\n
<tal:block tal:repeat="axis_group python:axis.axis_group">\n
\n
<div tal:attributes="id python:axis_group.name;\n
title python:axis_group.tooltip">\n
<!-- title of the current group-->\n
<a tal:attributes="href python:axis_group.info_title.link;\n
id python:axis_group.name + \'_info\'"\n
tal:content="python:axis_group.info_title.info">\n
id python:axis_group.name + \'_info\'">\n
<tal:block tal:content="python:axis_group.info_title.title" />\n
</a>\n
</div>\n
\n
......@@ -285,7 +273,6 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
tal:attributes="id python: axis_group.name + \'_depth_\' + str(depth)">\n
</div>\n
</tal:block>\n
\n
\n
<tal:condition tal:condition="python:axis==planning.X">\n
<tal:block tal:define="global previous_src string:${address}/images/1leftarrowv.png;\n
......@@ -297,7 +284,6 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
global next_src string:${address}/images/1bottomarrow.png">\n
</tal:block>\n
</tal:condition>\n
\n
\n
<!-- widgets of the current axis -->\n
<tal:block tal:condition="python:axis==planning.main_axis">\n
......@@ -316,8 +302,6 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
name string:${address}/nextPage:method;\n
id python:axis.name + \'_next\'"/>\n
</tal:block>\n
\n
\n
\n
<!-- inserting depth widget -->\n
<div tal:condition= "python:axis==planning.X"\n
......@@ -341,35 +325,29 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
0\n
</a>\n
</div>\n
\n
\n
\n
\n
\n
</tal:block>\n
<tal:block tal:condition="python:axis==planning.secondary_axis">\n
<!-- Zoom page-->\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=0">\n
<!-- tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=0" -->\n
<!-- previous page exists -->\n
<input type="image" src="/images/1leftarrowv.png" title="Previous Zoom Page" name="" border="0"\n
tal:attributes="src previous_src;\n
name string:${address}/previousZoom:method;\n
id python:axis.name + \'_previous\'"/>\n
</tal:block>\n
<tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=(basic.secondary_axis_info[\'zoom_level\'] - 1) and basic.secondary_axis_info[\'zoom_level\'] > 1">\n
<!-- /tal:block -->\n
<!-- tal:block tal:condition="python:basic.secondary_axis_info[\'zoom_start\']!=(basic.secondary_axis_info[\'zoom_level\'] - 1) and basic.secondary_axis_info[\'zoom_level\'] > 1" -->\n
<!-- next page exists -->\n
<input type="image" src="/images/1rightarrowv.png" title="Next Zoom Page" name="" border="0"\n
tal:attributes="src next_src;\n
name string:${address}/nextZoom:method;\n
id python:axis.name + \'_next\'"/>\n
</tal:block>\n
<!-- /tal:block -->\n
</tal:block>\n
\n
</div>\n
\n
<!-- planning content-->\n
<div class="planning_content">\n
\n
<!-- display main axis lines -->\n
<tal:block tal:repeat="axis_group python:planning.main_axis.axis_group">\n
<div tal:attributes="id python:axis_group.name + \'_line\'"></div>\n
......
......@@ -166,7 +166,7 @@ else:\n
planning_dict= {\n
\'position\': \'relative\',\n
\'border-style\': \'solid\',\n
\'border-color\': \'#000000\',\n
\'border-color\': \'#d5e6de\',\n
\'border-width\': 0,\n
\'background\': \'#d5e6de\',\n
\'width\': size_planning_width + size_border_width_left + size_y_axis_width + size_y_axis_space + 20,\n
......@@ -583,9 +583,10 @@ for block_object in planning.content:\n
block_dict = {\n
\'position\': \'absolute\',\n
\'border-style\': \'solid\',\n
\'border-color\': \'#53676e\',\n
\'border-color\': \'#53676e\',\n
\'border-width\': 1,\n
}\n
\n
if block_object.error == 1: # task has error (not validated)\n
block_dict[\'background\'] = \'#e4c4da\'\n
elif block_object.warning == 1: # other bloc in the same task has error\n
......@@ -598,7 +599,10 @@ for block_object in planning.content:\n
else: # default color\n
block_dict[\'background\'] = \'#bdd2e7\'\n
\n
\n
# XXX Define the frozen Blocs\n
if context.PlanningBox_isFrozenBlock(block=block_object):\n
block_dict[\'border-width\'] = 0\n
\n
block_dict[\'width\'] = block_object.position_x.relative_range * size_planning_width\n
block_dict[\'height\'] = block_object.position_y.relative_range * size_planning_height\n
block_dict[\'margin-left\'] = block_object.position_x.relative_begin * size_planning_width\n
......@@ -608,10 +612,11 @@ for block_object in planning.content:\n
# the whole following process is aimed to take care of the non-stat blocks\n
\n
if planning.main_axis == planning.Y and block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# Y axis is main axis\n
# adapt Y block size\n
block_dict[\'height\'] = block_dict[\'height\'] - 10\n
block_dict[\'margin-top\'] = block_dict[\'margin-top\'] + 5\n
if block_object.parent_activity.object.getUid() not in basic.sec_layer_uid_list:\n
# Y axis is main axis\n
# adapt Y block size\n
block_dict[\'height\'] = block_dict[\'height\'] - 10\n
block_dict[\'margin-top\'] = block_dict[\'margin-top\'] + 5\n
elif block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# X axis is main axis\n
# adapt X block size\n
......@@ -831,6 +836,7 @@ return properties_structure\n
<string>content_dict</string>
<string>block_object</string>
<string>block_dict</string>
<string>context</string>
<string>top_string</string>
<string>top_list</string>
<string>bot_string</string>
......
......@@ -94,13 +94,15 @@ This script builds a string with all necessary data to allow block\n
moving and resizing\n
"""\n
\n
returned_string = "<script type=\\"text/javascript\\">SET_DHTML("\n
for block in planning.content:\n
if block.property_dict[\'stat\'] == 0:\n
returned_string += \'"%s",\' % block.name\n
returned_string += "\\"top\\"+CURSOR_N_RESIZE+VERTICAL, \\"right\\"+CURSOR_E_RESIZE+HORIZONTAL, \\"bottom\\"+CURSOR_S_RESIZE+VERTICAL, \\"left\\"+CURSOR_W_RESIZE+HORIZONTAL);</script>"\n
block_string = \',\'.join([\'"%s"\' % block.name for block in planning.content if \\\n
not context.PlanningBox_isFrozenBlock(block=block)])\n
\n
return returned_string\n
return \'<script type="text/javascript">SET_DHTML(%s,\' \\\n
\'"top"+CURSOR_N_RESIZE+VERTICAL, \' \\\n
\'"right"+CURSOR_E_RESIZE+HORIZONTAL, \' \\\n
\'"bottom"+CURSOR_S_RESIZE+VERTICAL, \' \\\n
\'"left"+CURSOR_W_RESIZE+HORIZONTAL\' \\\n
\');</script>\' % block_string\n
]]></string> </value>
......@@ -152,11 +154,13 @@ return returned_string\n
<value>
<tuple>
<string>planning</string>
<string>returned_string</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>block</string>
<string>_getitem_</string>
<string>context</string>
<string>block_string</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</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[
# Define the Two dates (Start date and stop date ) that will be \n
# used by Planning Box at secondary axis and also used as SQL params\n
# at list method.\n
#\n
# Returned a list with 2 dates which is normalized as;\n
#\n
# - Days always starts at 0H and finish at 0h of the next day.\n
# \n
# - Weeks always starts at 0H of the last Sunday and finish at 0h of\n
# the next sunday.\n
#\n
# - 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
# - 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
\n
# Normalize Day.\n
bound_start = DateTime(DateTime(bound_begin).strftime("%Y/%m/%d"))\n
bound_stop = bound_start\n
if int(zoom_level) == 1:\n
bound_start = bound_start + zoom_variation\n
bound_stop = bound_start + 1\n
\n
if int(zoom_level) == 7:\n
# Normalize Week.\n
while bound_start.Day() is not \'Sunday\':\n
bound_start = bound_start - 1\n
bound_start = bound_start + 7 * zoom_variation\n
bound_stop = bound_start + 7\n
\n
if int(zoom_level) == 30:\n
# Normalize Month.\n
month = bound_start.month() + zoom_variation\n
year = bound_start.year() + (month - 1) / 12\n
month = month % 12\n
if month == 0:\n
month = 12\n
bound_start = DateTime(year, month, 1)\n
if month >= 12:\n
year = year + 1\n
month = 1\n
else:\n
month = month + 1\n
bound_stop = DateTime(year, month, 1)\n
\n
if int(zoom_level) == 365:\n
# Normalize Year.\n
year = bound_start.year() + zoom_variation\n
bound_start = DateTime(year, 1, 1)\n
bound_stop = DateTime(year+1, 1, 1)\n
\n
return [bound_start , bound_stop]\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>bound_begin=None, zoom_level=1,zoom_variation=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>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>bound_begin</string>
<string>zoom_level</string>
<string>zoom_variation</string>
<string>DateTime</string>
<string>_getattr_</string>
<string>bound_start</string>
<string>bound_stop</string>
<string>int</string>
<string>month</string>
<string>year</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<int>1</int>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>planning_validate_date_list</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>
<tuple>
<string>OFS.Image</string>
<string>Image</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>planningbox.png</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="base64">iVBORw0KGgoAAAANSUhEUgAAABgAAAAaCAMAAACaYWzBAAACtVBMVEX///8zM2YAZgDq6u/CwtGy
srL+goQkJEeHh5LR0d2jo6fw8PT6+vuxsbIAM5j5+//8/f8AOZ4AOJ0AN5wANpsANZoAJmwAP6IA
PaEAPJ8AO58AK3AARKYAQqUAQKP1+f8AS6wASaoASKgARqgARqcAM3b4+/8AUbAAUK8AT64ATq0A
TawAS6unrLL0+f8AV7UAVrQAVbMAUrEAO3yVo7KXpLLb7P/d7f+apbHf7v6ep7Ho8//q9P/p8/6j
qrLs9f+lq7Lw9/8AXroAXbkAW7cAWbYAQoPK5P7N5f6QobLP5v7Q5/7U6f/T6P6TorHV6v+Vo7HX
6v7Z6/6YpbKXpLHd7v+ZpbGbprHg7/7i8P6eqLLk8f6gqbLn8/+hqbHp9P/v9//x+P+orbKnrLGq
rrKprbH1+v+sr7L5/P/9/v8AZb8AYr0AYb06jds9kN1Bk95ElN9JmN9LmeBPnOFXoeNao+WOoLGQ
obHg8P+cp7GeqLHl8v6hqrLt9v4AbcYAbcUAa8MAacMAaMEAZ8EAS4pTn+JepuVhqeZlq+hprumi
qrGlrLKkq7Hy+f8AdcwAdMsAc8oAcskAcckAcMcAb8cAUo+prrKrr7L2+/8Af9QAfdIAfNEAe9EA
es8Aec8Ad80AWJP6/f8AgdUAf9P3/P+rr7GvsbKtsLH7/v/+//8ARwAjghc2vSQrhx1DxSw0jSNP
zTQ8kyha1DxEmC1m3URMnTNx5ExUojh861JbpzyG8Vn+6Ff+6Fj+6Vv+6lz+61/+62D+7GP+4UD+
4UL+40b+40j+5U3+51H+5lKYZgD+NAD+MwD+NAL+Nwb+OAj+Og3+PBD+PxX+QRf+RB7+RiD+TCn+
Sif+UDH+UjT+Vzz+WD/+XUf+X0r+ZFP+Zlb+bF7+bmL+c2v+dW7+e3eYAABqAAD+fHvBmcM/AAAA
AXRSTlMAQObYZgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cHGRIZH1V0kcEAAAKVSURB
VCgVAYoCdf0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAABAQAAAQEAAAEBAAABAQAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAA
AAAAAAAADg4ODg4ODg4OAAAAAAAAAQAAAAAAAAAAAA5ucHKFdYeJDgAAAAAAAAEAAAAAAAAAAAAO
bW9xc3SGiA4AAAAAAAABAAAAAAAAAAAADg4ODg4ODg4OAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAEAAAACAgICAgICAgICAAAAAAAAAAAAAAABAAAAAqyusLK0tri6AgAAAAAAAAAAAAAA
AQAAAAKsrrCytLa4ugIAAAAAAAAAAAAAAAEAAAACAgICAgICAgICAAAAAAAAAAAAAAABAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAeXl5eXl5eXl5eXl5eXl5eUAAAAAAAAAAAHLys3P0dPW19nb3d/h
4wbkAAAAAAAAAAABy8vMztDS1NXY2tze4OLm5AAAAAAAAAAAAeTk5OTk5OTk5OTk5OTk5OQAAAAA
AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAMnJycnJycnJyckAAAAAAQAA
AAAAAAAAAADJw8XGyLy+wMHJAAAAAAEAAAAAAAAAAAAAycLExse7vb/ByQAAAAABAAAAAAAAAAAA
AMnJycnJycnJyckAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGjeaP2+IkgrAAAAAElFTkSuQmCC</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>26</int> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <long>1476</long> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>24</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2007-08-18 yo
* ERP5Site does not have getPortalType, so avoid calling getPortalType if not present.
2007-08-29 Rafael
* Updated Planning Box related stuff
2007-07-02 Yusei
* Fixed a invalid xhtml template.
......
417
\ No newline at end of file
421
\ 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