Commit b2abed4c authored by Rafael Monnerat's avatar Rafael Monnerat

Fix for editing using Base_edit.

Added support for Title Lines Method. Basically, the method used to define the title for each line is working now.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13507 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 927c6349
...@@ -584,10 +584,6 @@ class PlanningBoxValidator(Validator.StringBaseValidator): ...@@ -584,10 +584,6 @@ class PlanningBoxValidator(Validator.StringBaseValidator):
for axis_element in axis_group.axis_element_list: for axis_element in axis_group.axis_element_list:
for activity in axis_element.activity_list: for activity in axis_element.activity_list:
# for each activity, saving its properties into a dict # for each activity, saving its properties into a dict
if activity.link.startswith('/erp5'):
pass
else:
activity.link = '/erp5/' + activity.link
if activity.link in object_dict.keys(): if activity.link in object_dict.keys():
object_dict[activity.link].append( object_dict[activity.link].append(
{ 'activity_name' : activity.name, { 'activity_name' : activity.name,
...@@ -983,10 +979,13 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -983,10 +979,13 @@ class PlanningBoxWidget(Widget.Widget):
####### DATA DEFINITION ####### ####### DATA DEFINITION #######
self.build_error_list = None self.build_error_list = None
# recovering usefull planning properties # recovering usefull planning properties
form = field.aq_parent # getting form # getting form
list_method = field.get_value('list_method') # method used to list objects form = field.aq_parent
report_root_list = field.get_value('report_root_list') # list of domains list_method = field.get_value('list_method')
portal_types = field.get_value('portal_types') # Portal Types of objects title_line = field.get_value('title_line')
# list of domain
report_root_list = field.get_value('report_root_list')
portal_types = field.get_value('portal_types')
# selection name used to store selection params # selection name used to store selection params
selection_name = field.get_value('selection_name') selection_name = field.get_value('selection_name')
# getting sorting keys and order (list) # getting sorting keys and order (list)
...@@ -1009,6 +1008,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -1009,6 +1008,7 @@ class PlanningBoxWidget(Widget.Widget):
REQUEST=REQUEST, list_method=list_method, REQUEST=REQUEST, list_method=list_method,
selection=selection, params = params, selection=selection, params = params,
selection_name=selection_name, selection_name=selection_name,
title_line=title_line,
report_root_list=report_root_list, report_root_list=report_root_list,
portal_types=portal_types, sort=sort, portal_types=portal_types, sort=sort,
list_error=list_error) list_error=list_error)
...@@ -1045,7 +1045,7 @@ class BasicStructure: ...@@ -1045,7 +1045,7 @@ class BasicStructure:
def __init__ (self, here='', form='', field='', REQUEST='', list_method='', def __init__ (self, here='', form='', field='', REQUEST='', list_method='',
selection=None, params = '', selection_name='', report_root_list='', selection=None, params = '', selection_name='', report_root_list='',
portal_types='', sort=None, list_error=None): title_line='', portal_types='', sort=None, list_error=None):
""" init main internal parameters """ """ init main internal parameters """
self.here = here self.here = here
self.form = form self.form = form
...@@ -1055,6 +1055,7 @@ class BasicStructure: ...@@ -1055,6 +1055,7 @@ class BasicStructure:
self.selection = selection self.selection = selection
self.params = params self.params = params
self.list_method = list_method self.list_method = list_method
self.title_line = title_line
self.selection_name = selection_name self.selection_name = selection_name
self.report_root_list = report_root_list self.report_root_list = report_root_list
self.portal_types = portal_types self.portal_types = portal_types
...@@ -1646,7 +1647,7 @@ class BasicStructure: ...@@ -1646,7 +1647,7 @@ class BasicStructure:
def buildGroupStructure(self): def buildGroupStructure(self):
""" """
this procedure builds BasicGroup instances corresponding to the This procedure builds BasicGroup instances corresponding to the
report_group_objects returned from the ERP5 request. report_group_objects returned from the ERP5 request.
""" """
position = 0 position = 0
...@@ -1665,9 +1666,15 @@ class BasicStructure: ...@@ -1665,9 +1666,15 @@ class BasicStructure:
# updating position_informations # updating position_informations
position +=1 position +=1
# recovering usefull informations, basic_structure # recovering usefull informations, basic_structure
# XXX should be used title_lines method if self.title_line not in (None,''):
title = report_group_object.getObject().getTitle() title_line_method = getattr(report_group_object.getObject(), \
name = report_group_object.getObject().getTitle() self.title_line, None)
else:
title_line_method = getattr(report_group_object.getObject(), \
'getTitle', None)
if title_line_method is not None:
title = title_line_method()
name = title_line_method()
depth = report_group_object.getDepth() depth = report_group_object.getDepth()
is_open = report_group_object.getIsOpen() is_open = report_group_object.getIsOpen()
is_pure_summary = report_group_object.getIsPureSummary() is_pure_summary = report_group_object.getIsPureSummary()
...@@ -1693,7 +1700,6 @@ class BasicStructure: ...@@ -1693,7 +1700,6 @@ class BasicStructure:
secondary_axis_stop = group_stop, secondary_axis_stop = group_stop,
property_dict = property_dict) property_dict = property_dict)
if object_list != None: if object_list != None:
child_group.setBasicActivities(object_list,self.list_error, child_group.setBasicActivities(object_list,self.list_error,
secondary_axis_bounds) secondary_axis_bounds)
...@@ -2431,7 +2437,6 @@ class Activity: ...@@ -2431,7 +2437,6 @@ class Activity:
else: else:
return 2 return 2
def addBlocs(self, main_axis_start=None, main_axis_stop=None, def addBlocs(self, main_axis_start=None, main_axis_stop=None,
secondary_axis_start=None, secondary_axis_stop=None, secondary_axis_start=None, secondary_axis_stop=None,
secondary_axis_range=None, planning=None, warning=0, secondary_axis_range=None, planning=None, warning=0,
...@@ -2844,7 +2849,7 @@ class AxisGroup: ...@@ -2844,7 +2849,7 @@ class AxisGroup:
def addActivity(self, activity=None, axis_element_already_insered= 0): def addActivity(self, activity=None, axis_element_already_insered= 0):
""" """
Procedure that permits to add activity to the corresponding AxisElement in Procedure that permits to add activity to the corresponding AxisElement in
an AxisGroup. can create new Axis Element in the actual Axisgroup if an AxisGroup. This can create new Axis Element in the actual AxisGroup if
necessary. Permits representation of MULTITASKING necessary. Permits representation of MULTITASKING
""" """
...@@ -2853,7 +2858,6 @@ class AxisGroup: ...@@ -2853,7 +2858,6 @@ class AxisGroup:
try: try:
# iterating each axis_element of the axis_group # iterating each axis_element of the axis_group
for axis_element in self.axis_element_list: for axis_element in self.axis_element_list:
can_add = 1 can_add = 1
# recovering all activity properties of the actual axis_element and # recovering all activity properties of the actual axis_element and
# iterating through them to check if one of them crosses the new one # iterating through them to check if one of them crosses the new one
...@@ -3017,7 +3021,6 @@ class AxisGroup: ...@@ -3017,7 +3021,6 @@ class AxisGroup:
block.position_main.relative_range = final_range block.position_main.relative_range = final_range
return 1 return 1
class AxisElement: class AxisElement:
""" """
Represents a line in an item. In most cases, an AxisGroup element will Represents a line in an item. In most cases, an AxisGroup element will
...@@ -3053,7 +3056,7 @@ class Info: ...@@ -3053,7 +3056,7 @@ class Info:
security.declarePublic('edit') security.declarePublic('edit')
def edit(self, info=None): def edit(self, info=None):
""" """
special method allowing to update Info content from an external script Special method allowing to update Info content from an external script
""" """
self.info = info self.info = info
......
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