Commit 69f2db88 authored by Romain Courteaud's avatar Romain Courteaud

Do not save data on the widget anymore.

This fix breaks edition for planning box.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14888 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7b39127
...@@ -916,18 +916,16 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -916,18 +916,16 @@ class PlanningBoxWidget(Widget.Widget):
# build structure # build structure
# render_structure will call all method necessary to build the entire # render_structure will call all method necessary to build the entire
# structure relative to the planning # structure relative to the planning
# XXX Conflict error
# creates and fill up self.basic, self.planning and self.build_error_list # creates and fill up self.basic, self.planning and self.build_error_list
self.render_structure(field=field, key=key, value=value, basic, planning = self.render_structure(field=field, key=key, value=value,
REQUEST=REQUEST, here=here) REQUEST=REQUEST, here=here)
# getting CSS script generator # getting CSS script generator
planning_css_method = getattr(REQUEST['here'], 'planning_css') planning_css_method = getattr(REQUEST['here'], 'planning_css')
# recover CSS data buy calling DTML document # recover CSS data buy calling DTML document
# XXX Bad parameter name, use planning_box_widget_instance instead CSS_data = planning_css_method(basic=basic, planning=planning)
CSS_data = planning_css_method(structure=self)
# saving structure inside the request for HTML render # saving structure inside the request for HTML render
# XXX Bad parameter name, use planning_box_widget_instance instead REQUEST.set('basic', basic)
REQUEST.set('structure', self) REQUEST.set('planning', planning)
return CSS_data return CSS_data
...@@ -941,12 +939,13 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -941,12 +939,13 @@ class PlanningBoxWidget(Widget.Widget):
# or list (to generated a PDF output or anything else). # or list (to generated a PDF output or anything else).
# recover structure # recover structure
widget_instance = REQUEST.get('structure') basic = REQUEST.get('basic')
planning = REQUEST.get('planning')
# getting HTML rendering Page Template # getting HTML rendering Page Template
planning_html_method = getattr(REQUEST['here'], 'planning_content') planning_html_method = getattr(REQUEST['here'], 'planning_content')
# recovering HTML data by calling Page Template document # recovering HTML data by calling Page Template document
HTML_data = planning_html_method(struct=widget_instance) HTML_data = planning_html_method(basic=basic, planning=planning)
# return HTML data # return HTML data
return HTML_data return HTML_data
...@@ -990,8 +989,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -990,8 +989,7 @@ class PlanningBoxWidget(Widget.Widget):
###### CALL CLASS METHODS TO BUILD BASIC STRUCTURE ###### ###### CALL CLASS METHODS TO BUILD BASIC STRUCTURE ######
# creating BasicStructure instance (and initializing its internal values) # creating BasicStructure instance (and initializing its internal values)
# XXX Conflict error basic = BasicStructure(here=here,
self.basic = BasicStructure(here=here,
form=form, field=field, form=form, field=field,
REQUEST=REQUEST, list_method=list_method, REQUEST=REQUEST, list_method=list_method,
selection=selection, params=params, selection=selection, params=params,
...@@ -1002,25 +1000,22 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -1002,25 +1000,22 @@ class PlanningBoxWidget(Widget.Widget):
sort=sort, sort=sort,
list_error=list_error) list_error=list_error)
# call build method to generate BasicStructure # call build method to generate BasicStructure
status = self.basic.build() status = basic.build()
if status != 1: if status != 1:
raise PlanningBoxError, status raise PlanningBoxError, status
###### CALL CLASS METHODS TO BUILD PLANNING STRUCTURE ###### ###### CALL CLASS METHODS TO BUILD PLANNING STRUCTURE ######
# creating PlanningStructure instance and initializing its internal values # creating PlanningStructure instance and initializing its internal values
# XXX Conflict error planning = PlanningStructure()
self.planning = PlanningStructure()
# call build method to generate final Planning Structure # call build method to generate final Planning Structure
status = self.planning.build(basic_structure=self.basic, status = planning.build(basic_structure=basic,
field=field, field=field,
REQUEST=REQUEST) REQUEST=REQUEST)
if status != 1: if status != 1:
# in case error during planning structure generation # in case error during planning structure generation
raise PlanningBoxError, status raise PlanningBoxError, status
# XXX widget is used to store data!! return basic, planning
# Remove this as soon as possible
return self
# instanciating class # instanciating class
PlanningBoxWidgetInstance = PlanningBoxWidget() PlanningBoxWidgetInstance = PlanningBoxWidget()
......
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