Commit 8c1d244c authored by Romain Courteaud's avatar Romain Courteaud

Data are not saved on the widget anymore.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14889 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69f2db88
...@@ -79,9 +79,8 @@ PlaningBox. The process is based on the strucutre passed in parameter (i.e optio ...@@ -79,9 +79,8 @@ 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 Beware this only generates the HTML code, no CSS generation is done in this script\n
-->\n -->\n
\n \n
<tal:block tal:define="struct options/struct">\n <tal:block tal:define="basic options/basic;\n
<tal:block tal:define="basic python:struct.basic;\n planning options/planning;\n
planning python:struct.planning;\n
address python:basic.here.getUrl()">\n address python:basic.here.getUrl()">\n
\n \n
<!-- hidden fields holding some usefull data-->\n <!-- hidden fields holding some usefull data-->\n
......
...@@ -122,16 +122,16 @@ margin = 5 \n ...@@ -122,16 +122,16 @@ margin = 5 \n
\n \n
\n \n
\n \n
size_planning_width = widget_instance.basic.field.get_value(\'size_planning_width\')\n size_planning_width = basic.field.get_value(\'size_planning_width\')\n
size_x_axis_height = widget_instance.basic.field.get_value(\'size_x_axis_height\')\n size_x_axis_height = basic.field.get_value(\'size_x_axis_height\')\n
size_x_axis_space = widget_instance.basic.field.get_value(\'size_x_axis_space\')\n size_x_axis_space = basic.field.get_value(\'size_x_axis_space\')\n
size_border_width_left = widget_instance.basic.field.get_value(\'size_border_width_left\')\n size_border_width_left = basic.field.get_value(\'size_border_width_left\')\n
size_header_height = widget_instance.basic.field.get_value(\'size_header_height\')\n size_header_height = basic.field.get_value(\'size_header_height\')\n
size_planning_height = widget_instance.basic.field.get_value(\'size_planning_height\')\n size_planning_height = basic.field.get_value(\'size_planning_height\')\n
size_y_axis_width = widget_instance.basic.field.get_value(\'size_y_axis_width\')\n size_y_axis_width = basic.field.get_value(\'size_y_axis_width\')\n
size_y_axis_space = widget_instance.basic.field.get_value(\'size_y_axis_space\')\n size_y_axis_space = basic.field.get_value(\'size_y_axis_space\')\n
y_axis_position = widget_instance.basic.field.get_value(\'y_axis_position\')\n y_axis_position = basic.field.get_value(\'y_axis_position\')\n
x_axis_position = widget_instance.basic.field.get_value(\'x_axis_position\')\n x_axis_position = basic.field.get_value(\'x_axis_position\')\n
\n \n
\n \n
properties_structure = {\n properties_structure = {\n
...@@ -146,21 +146,21 @@ properties_structure = {\n ...@@ -146,21 +146,21 @@ properties_structure = {\n
\n \n
\n \n
# getting number of elements to display on the main axis\n # getting number of elements to display on the main axis\n
if widget_instance.planning.main_axis.size != widget_instance.basic.main_axis_info[\'bound_axis_groups\']:\n if planning.main_axis.size != basic.main_axis_info[\'bound_axis_groups\']:\n
# number of groups to display over the main axis is different from the expected\n # number of groups to display over the main axis is different from the expected\n
# value : updating planning size to fit exactly the number of groups \n # value : updating planning size to fit exactly the number of groups \n
if widget_instance.planning.main_axis == widget_instance.planning.Y:\n if planning.main_axis == planning.Y:\n
# updating Y axis\n # updating Y axis\n
main_axis_step = float(size_planning_height) / float(widget_instance.basic.main_axis_info[\'bound_axis_groups\'])\n main_axis_step = float(size_planning_height) / float(basic.main_axis_info[\'bound_axis_groups\'])\n
size_planning_height = main_axis_step * widget_instance.planning.main_axis.size\n size_planning_height = main_axis_step * planning.main_axis.size\n
else:\n else:\n
main_axis_step = float(size_planning_width) / float(widget_instance.basic.main_axis_info[\'bound_axis_groups\'])\n main_axis_step = float(size_planning_width) / float(basic.main_axis_info[\'bound_axis_groups\'])\n
size_planning_width = main_axis_step * widget_instance.planning.main_axis.size\n size_planning_width = main_axis_step * planning.main_axis.size\n
else:\n else:\n
if widget_instance.planning.main_axis == widget_instance.planning.Y:\n if planning.main_axis == planning.Y:\n
main_axis_step = float(size_planning_height) / float(widget_instance.basic.main_axis_info[\'bound_axis_groups\'])\n main_axis_step = float(size_planning_height) / float(basic.main_axis_info[\'bound_axis_groups\'])\n
else:\n else:\n
main_axis_step = float(size_planning_width) / float(widget_instance.basic.main_axis_info[\'bound_axis_groups\'])\n main_axis_step = float(size_planning_width) / float(basic.main_axis_info[\'bound_axis_groups\'])\n
\n \n
# defining planning area CSS class\n # defining planning area CSS class\n
planning_dict= {\n planning_dict= {\n
...@@ -181,7 +181,7 @@ properties_structure[\'base\'][\'planning_box\'] = planning_dict\n ...@@ -181,7 +181,7 @@ properties_structure[\'base\'][\'planning_box\'] = planning_dict\n
\n \n
\n \n
# recovering axis CSS class informations\n # recovering axis CSS class informations\n
for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n for axis in (planning.Y, planning.X):\n
axis_depth = None\n axis_depth = None\n
axis_dict= {\n axis_dict= {\n
\'position\': \'absolute\',\n \'position\': \'absolute\',\n
...@@ -199,7 +199,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n ...@@ -199,7 +199,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n
\'position\': \'absolute\',\n \'position\': \'absolute\',\n
\'border-width\': 0,\n \'border-width\': 0,\n
}\n }\n
if axis == widget_instance.planning.X:\n if axis == planning.X:\n
# current axis is X axis\n # current axis is X axis\n
# positionning it\n # positionning it\n
axis_dict[\'width\'] = size_planning_width\n axis_dict[\'width\'] = size_planning_width\n
...@@ -218,7 +218,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n ...@@ -218,7 +218,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n
axis_next[\'margin-left\'] = axis_dict[\'width\'] + 5\n axis_next[\'margin-left\'] = axis_dict[\'width\'] + 5\n
axis_next[\'margin-top\'] = axis_previous[\'margin-top\']\n axis_next[\'margin-top\'] = axis_previous[\'margin-top\']\n
\n \n
if axis == widget_instance.planning.main_axis:\n if axis == planning.main_axis:\n
# current axis is main axis : need to implement depth widget\n # current axis is main axis : need to implement depth widget\n
axis_depth = {\n axis_depth = {\n
\'margin-left\': -10,\n \'margin-left\': -10,\n
...@@ -247,7 +247,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n ...@@ -247,7 +247,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n
axis_previous[\'margin-top\'] = -20\n axis_previous[\'margin-top\'] = -20\n
axis_next[\'margin-left\'] = axis_previous[\'margin-left\']\n axis_next[\'margin-left\'] = axis_previous[\'margin-left\']\n
axis_next[\'margin-top\'] = axis_dict[\'height\'] + 5\n axis_next[\'margin-top\'] = axis_dict[\'height\'] + 5\n
if axis == widget_instance.planning.main_axis:\n if axis == planning.main_axis:\n
axis_depth = {\n axis_depth = {\n
\'margin-left\': 0,\n \'margin-left\': 0,\n
\'bottom\': \'100%\',\n \'bottom\': \'100%\',\n
...@@ -266,7 +266,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n ...@@ -266,7 +266,7 @@ for axis in (widget_instance.planning.Y, widget_instance.planning.X):\n
\n \n
# now processing groups over the main axis, including their info object\n # now processing groups over the main axis, including their info object\n
# at the same time generating line to separate each group\n # at the same time generating line to separate each group\n
for axis_group in widget_instance.planning.main_axis.axis_group:\n for axis_group in planning.main_axis.axis_group:\n
axis_group_dict={\n axis_group_dict={\n
\'position\': \'absolute\',\n \'position\': \'absolute\',\n
\'border-style\': \'solid\',\n \'border-style\': \'solid\',\n
...@@ -287,7 +287,7 @@ for axis_group in widget_instance.planning.main_axis.axis_group:\n ...@@ -287,7 +287,7 @@ for axis_group in widget_instance.planning.main_axis.axis_group:\n
\'border-style\': \'solid\',\n \'border-style\': \'solid\',\n
\'border-width\': 0,\n \'border-width\': 0,\n
}\n }\n
if widget_instance.planning.main_axis == widget_instance.planning.X:\n if planning.main_axis == planning.X:\n
# current axis is X axis\n # current axis is X axis\n
axis_group_dict[\'width\'] = float(axis_group.axis_element_number) * main_axis_step\n axis_group_dict[\'width\'] = float(axis_group.axis_element_number) * main_axis_step\n
axis_group_dict[\'margin-left\'] = float( axis_group.axis_element_start -1) * main_axis_step\n axis_group_dict[\'margin-left\'] = float( axis_group.axis_element_start -1) * main_axis_step\n
...@@ -454,7 +454,7 @@ for axis_group in widget_instance.planning.main_axis.axis_group:\n ...@@ -454,7 +454,7 @@ for axis_group in widget_instance.planning.main_axis.axis_group:\n
\n \n
\n \n
# processing secondary_axis_group\n # processing secondary_axis_group\n
for sec_axis_group in widget_instance.planning.secondary_axis.axis_group:\n for sec_axis_group in planning.secondary_axis.axis_group:\n
sec_axis_group_dict={\n sec_axis_group_dict={\n
\'position\': \'absolute\',\n \'position\': \'absolute\',\n
\'border-color\': \'#53676e\',\n \'border-color\': \'#53676e\',\n
...@@ -479,7 +479,7 @@ for sec_axis_group in widget_instance.planning.secondary_axis.axis_group:\n ...@@ -479,7 +479,7 @@ for sec_axis_group in widget_instance.planning.secondary_axis.axis_group:\n
sec_axis_line_dict[\'border-style\'] = \'solid\'\n sec_axis_line_dict[\'border-style\'] = \'solid\'\n
sec_axis_line_dict[\'border-right-width\'] = 0\n sec_axis_line_dict[\'border-right-width\'] = 0\n
sec_axis_line_dict[\'border-bottom-width\'] = 0\n sec_axis_line_dict[\'border-bottom-width\'] = 0\n
if widget_instance.planning.main_axis == widget_instance.planning.Y:\n if planning.main_axis == planning.Y:\n
# current axis is X axis\n # current axis is X axis\n
sec_axis_group_dict[\'width\'] = sec_axis_group.position_secondary.absolute_range * size_planning_width\n sec_axis_group_dict[\'width\'] = sec_axis_group.position_secondary.absolute_range * size_planning_width\n
sec_axis_group_dict[\'margin-left\'] = sec_axis_group.position_secondary.absolute_begin * size_planning_width\n sec_axis_group_dict[\'margin-left\'] = sec_axis_group.position_secondary.absolute_begin * size_planning_width\n
...@@ -579,7 +579,7 @@ properties_structure[\'frame\'][\'planning_content\'] = content_dict\n ...@@ -579,7 +579,7 @@ properties_structure[\'frame\'][\'planning_content\'] = content_dict\n
\n \n
\n \n
# processing blocks in the planning content\n # processing blocks in the planning content\n
for block_object in widget_instance.planning.content:\n for block_object in planning.content:\n
block_dict = {\n block_dict = {\n
\'position\': \'absolute\',\n \'position\': \'absolute\',\n
\'border-style\': \'solid\',\n \'border-style\': \'solid\',\n
...@@ -607,7 +607,7 @@ for block_object in widget_instance.planning.content:\n ...@@ -607,7 +607,7 @@ for block_object in widget_instance.planning.content:\n
if block_object.parent_activity.property_dict[\'stat\'] == 0:\n if block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# the whole following process is aimed to take care of the non-stat blocks\n # the whole following process is aimed to take care of the non-stat blocks\n
\n \n
if widget_instance.planning.main_axis == widget_instance.planning.Y and block_object.parent_activity.property_dict[\'stat\'] == 0:\n if planning.main_axis == planning.Y and block_object.parent_activity.property_dict[\'stat\'] == 0:\n
# Y axis is main axis\n # Y axis is main axis\n
# adapt Y block size\n # adapt Y block size\n
block_dict[\'height\'] = block_dict[\'height\'] - 10\n block_dict[\'height\'] = block_dict[\'height\'] - 10\n
...@@ -752,7 +752,7 @@ return properties_structure\n ...@@ -752,7 +752,7 @@ return properties_structure\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>widget_instance</string> </value> <value> <string>basic, planning</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -772,13 +772,14 @@ return properties_structure\n ...@@ -772,13 +772,14 @@ return properties_structure\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>widget_instance</string> <string>basic</string>
<string>planning</string>
<string>car_height</string> <string>car_height</string>
<string>car_width</string> <string>car_width</string>
<string>depth_width</string> <string>depth_width</string>
......
...@@ -100,7 +100,7 @@ done in this script.\n ...@@ -100,7 +100,7 @@ done in this script.\n
"""\n """\n
\n \n
\n \n
properties_structure = context.planning_coordinates(structure)\n properties_structure = context.planning_coordinates(basic, planning)\n
\n \n
"""\n """\n
- the properties_structure returned from the planning_coordinates script is somehow\n - the properties_structure returned from the planning_coordinates script is somehow\n
...@@ -114,7 +114,7 @@ special : it is a dict defined by the areas of data\n ...@@ -114,7 +114,7 @@ special : it is a dict defined by the areas of data\n
# This process is only usefull when displaying a planning that failed to\n # This process is only usefull when displaying a planning that failed to\n
# validate. In such a case the block properties are updated to match their\n # validate. In such a case the block properties are updated to match their\n
# last position.\n # last position.\n
block_string = structure.basic.REQUEST.get(\'previous_block_moved\',\'\')\n block_string = basic.REQUEST.get(\'previous_block_moved\',\'\')\n
if block_string != \'\':\n if block_string != \'\':\n
# block_list is not empty, need to recover porperties and update the blocks\n # block_list is not empty, need to recover porperties and update the blocks\n
# that need to be refreshed\n # that need to be refreshed\n
...@@ -203,7 +203,7 @@ return "\\n" + "".join(returned_list)\n ...@@ -203,7 +203,7 @@ return "\\n" + "".join(returned_list)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>structure</string> </value> <value> <string>basic=None, planning=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -223,13 +223,14 @@ return "\\n" + "".join(returned_list)\n ...@@ -223,13 +223,14 @@ return "\\n" + "".join(returned_list)\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>1</int> </value> <value> <int>2</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>structure</string> <string>basic</string>
<string>planning</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>properties_structure</string> <string>properties_structure</string>
...@@ -264,7 +265,10 @@ return "\\n" + "".join(returned_list)\n ...@@ -264,7 +265,10 @@ return "\\n" + "".join(returned_list)\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<none/>
<none/>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
387 388
\ 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