Commit da611485 authored by Rafael Monnerat's avatar Rafael Monnerat

Some typo improved.

Show the report root without start and stop date too.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13581 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ee46a276
...@@ -810,27 +810,27 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -810,27 +810,27 @@ class PlanningBoxWidget(Widget.Widget):
required=0) required=0)
title_line = fields.StringField('title_line', title_line = fields.StringField('title_line',
title="specific method which fetches the title of each line", title="Specific method which fetches the title of each line",
description=("specific method for inserting title in line"), description=("Method for inserting title in line"),
default='', default='',
required=0) required=0)
x_start_bloc = fields.StringField('x_start_bloc', x_start_bloc = fields.StringField('x_start_bloc',
title='specific property to get start of blocks (ex. start_date)', title='Specific property to get start of blocks (ex. start_date)',
description=('Property for building X-Axis such as start_date\ description=('Property for building X-Axis such as start_date\
objects'), objects'),
default='start_date', default='start_date',
required=0) required=0)
x_stop_bloc = fields.StringField('x_stop_bloc', x_stop_bloc = fields.StringField('x_stop_bloc',
title='specific property to get stop of blocks (ex. stop_date)', title='Specific property to get stop of blocks (ex. stop_date)',
description=('Property for building X-Axis such as stop_date\ description=('Property for building X-Axis such as stop_date\
objects'), objects'),
default='stop_date', default='stop_date',
required=0) required=0)
y_size_block = fields.StringField('y_size_block', y_size_block = fields.StringField('y_size_block',
title='specific property to get height of blocks (ex.quantity)', title='Specific property to get height of blocks (ex.quantity)',
description=('Method for building height of blocks objects'), description=('Method for building height of blocks objects'),
default='quantity', default='quantity',
required=0) required=0)
...@@ -842,25 +842,25 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -842,25 +842,25 @@ class PlanningBoxWidget(Widget.Widget):
required=1) required=1)
stat_method = fields.StringField('stat_method', stat_method = fields.StringField('stat_method',
title="name of script generating statistics", title="Name of script generating statistics",
description=("script for statistics"), description=("script for statistics"),
default='', default='',
required=0) required=0)
split_method = fields.StringField('split_method', split_method = fields.StringField('split_method',
title='name of script splitting activities into blocks', title='Name of script splitting activities into blocks',
description=("script for splitting activities into multiple blocks"), description=("script for splitting activities into multiple blocks"),
default='', default='',
required=0) required=0)
color_script = fields.StringField('color_script', color_script = fields.StringField('color_script',
title='name of script colorizing blocks', title='Name of script colorizing blocks',
description=('script for block colors object'), description=('script for block colors object'),
default='', default='',
required=0) required=0)
round_script = fields.StringField('round_script', round_script = fields.StringField('round_script',
title='name of script rounding blocks during validation (ex.\ title='Name of script rounding blocks during validation (ex.\
Planning_roundBoundToDay)', Planning_roundBoundToDay)',
description=('script for block bounds rounding when validating'), description=('script for block bounds rounding when validating'),
default='', default='',
...@@ -868,14 +868,14 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -868,14 +868,14 @@ class PlanningBoxWidget(Widget.Widget):
sec_axis_script = fields.StringField('sec_axis_script', sec_axis_script = fields.StringField('sec_axis_script',
title='name of script building secondary axis (ex.\ title='Name of script building secondary axis (ex.\
Planning_generateAxis)', Planning_generateAxis)',
description=('script for building secondary axis'), description=('Script for building secondary axis'),
default='Planning_generateAxis', default='Planning_generateAxis',
required=1) required=1)
info_center = fields.StringField('info_center', info_center = fields.StringField('info_center',
title='specific method of data called for inserting info in\ title='Specific method of data called for inserting info in\
block center', block center',
description=('Method for displaying info in the center of a\ description=('Method for displaying info in the center of a\
block object'), block object'),
...@@ -883,7 +883,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -883,7 +883,7 @@ class PlanningBoxWidget(Widget.Widget):
required=0) required=0)
info_topright = fields.StringField('info_topright', info_topright = fields.StringField('info_topright',
title='specific method of data called for inserting info in\ title='Specific method of data called for inserting info in\
block topright', block topright',
description=('Method for displaying info in the topright of a block\ description=('Method for displaying info in the topright of a block\
object'), object'),
...@@ -891,7 +891,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -891,7 +891,7 @@ class PlanningBoxWidget(Widget.Widget):
required=0) required=0)
info_topleft = fields.StringField('info_topleft', info_topleft = fields.StringField('info_topleft',
title='specific method of data called for inserting info in\ title='Specific method of data called for inserting info in\
block topleft', block topleft',
description=('Method for displaying info in the topleft corner\ description=('Method for displaying info in the topleft corner\
of a block object'), of a block object'),
...@@ -899,7 +899,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -899,7 +899,7 @@ class PlanningBoxWidget(Widget.Widget):
required=0) required=0)
info_backleft = fields.StringField('info_backleft', info_backleft = fields.StringField('info_backleft',
title='specific method of data called for inserting info in\ title='Specific method of data called for inserting info in\
block backleft', block backleft',
description=('Method for displaying info in the backleft of a\ description=('Method for displaying info in the backleft of a\
block object'), block object'),
...@@ -907,7 +907,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -907,7 +907,7 @@ class PlanningBoxWidget(Widget.Widget):
required=0) required=0)
info_backright = fields.StringField('info_backright', info_backright = fields.StringField('info_backright',
title='specific method of data called for inserting info in\ title='Specific method of data called for inserting info in\
block backright', block backright',
description=('Method for displaying info in the backright of a\ description=('Method for displaying info in the backright of a\
block object'), block object'),
...@@ -915,7 +915,7 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -915,7 +915,7 @@ class PlanningBoxWidget(Widget.Widget):
required=0) required=0)
security_index = fields.IntegerField('security_index', security_index = fields.IntegerField('security_index',
title='variable depending on the type of web browser :', title='Variable depending on the type of web browser :',
description=("This variable is used because the rounds of each\ description=("This variable is used because the rounds of each\
web browser seem to work differently"), web browser seem to work differently"),
default=2, default=2,
...@@ -1046,7 +1046,9 @@ class BasicStructure: ...@@ -1046,7 +1046,9 @@ 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='',
title_line='', 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
self.field = field self.field = field
...@@ -1062,17 +1064,15 @@ class BasicStructure: ...@@ -1062,17 +1064,15 @@ class BasicStructure:
self.basic_group_list = None self.basic_group_list = None
self.report_groups= '' # needed to generate groups self.report_groups= '' # needed to generate groups
self.list_error = list_error self.list_error = list_error
self.secondary_axis_occurence = [] self.secondary_axis_occurence = []
self.render_format = '' # 'list' in case output is a list containing the self.render_format = '' # 'list' in case output is a list containing the
# full planning structure without any selection # full planning structure without any selection
self.main_axis_info = {} self.main_axis_info = {}
self.secondary_axis_info = {} self.secondary_axis_info = {}
def build(self): def build(self):
""" """
build BasicStructure from given parameters, and for that do the Build BasicStructure from given parameters, and for that do the
specified processes : specified processes :
1 - define variables 1 - define variables
2 - building query 2 - building query
...@@ -1235,8 +1235,6 @@ class BasicStructure: ...@@ -1235,8 +1235,6 @@ class BasicStructure:
# now iterating through report_tree_list # now iterating through report_tree_list
for object_tree_line in report_tree_list: for object_tree_line in report_tree_list:
# prepare query by defining selection report object # prepare query by defining selection report object
# defining info_dict, holding all information about the current object. # defining info_dict, holding all information about the current object.
info_dict = None info_dict = None
info_dict = {} info_dict = {}
...@@ -1541,17 +1539,17 @@ class BasicStructure: ...@@ -1541,17 +1539,17 @@ class BasicStructure:
axis_dict['bound_end'] == None) and occurence[1] != None: axis_dict['bound_end'] == None) and occurence[1] != None:
axis_dict['bound_end'] = occurence[1] axis_dict['bound_end'] = occurence[1]
if axis_dict['bound_end']==None or axis_dict['bound_begin']==None: if axis_dict['bound_end']== None or axis_dict['bound_begin'] == None:
# ERROR # ERROR
# no bounds over the secondary axis have been defined # no bounds over the secondary axis have been defined
# can append if bad property has been selected # can append if bad property has been selected
message = 'can not find secondary axis bounds for planning view :\ message = 'can not find secondary axis bounds for planning view :\
No object has good start & stop properties, please check your objects \ No object has good start & stop properties, please check your objects \
and their corresponding properties' and their corresponding properties'
return [(Message(domain=None, message=message,mapping=None))] return 1 #[(Message(domain=None, message=message,mapping=None))]
axis_dict['bound_range'] = axis_dict['bound_end']-axis_dict['bound_begin'] axis_dict['bound_range'] = axis_dict['bound_end'] - axis_dict['bound_begin']
# now start and stop have the extreme values of the second axis bound. # now start and stop have the extreme values of the second axis bound.
# this represents in fact the size of the Planning's secondary axis # this represents in fact the size of the Planning's secondary axis
...@@ -1651,7 +1649,6 @@ class BasicStructure: ...@@ -1651,7 +1649,6 @@ class BasicStructure:
report_group_objects returned from the ERP5 request. report_group_objects returned from the ERP5 request.
""" """
position = 0 position = 0
# iterating each element # iterating each element
for (report_group_object, object_list, property_dict) in \ for (report_group_object, object_list, property_dict) in \
self.report_groups: self.report_groups:
...@@ -1691,6 +1688,7 @@ class BasicStructure: ...@@ -1691,6 +1688,7 @@ class BasicStructure:
secondary_axis_bounds['bound_stop'] = group_stop secondary_axis_bounds['bound_stop'] = group_stop
else: else:
secondary_axis_bounds = self.secondary_axis_info secondary_axis_bounds = self.secondary_axis_info
child_group = BasicGroup(title=title, name=name, url=url, child_group = BasicGroup(title=title, name=name, url=url,
constraints=None, depth=depth, constraints=None, depth=depth,
position=position, field =self.field, position=position, field =self.field,
...@@ -1752,7 +1750,7 @@ class BasicGroup: ...@@ -1752,7 +1750,7 @@ class BasicGroup:
def setBasicActivities(self,activity_list, list_error,secondary_axis_info): def setBasicActivities(self,activity_list, list_error,secondary_axis_info):
""" """
link a list of activities to the current object. Link a list of activities to the current object.
*Recover group properties. Used in case activity is built from Group *Recover group properties. Used in case activity is built from Group
itself itself
*create a BasicActivity for each activity referenced in the list if *create a BasicActivity for each activity referenced in the list if
...@@ -1877,7 +1875,6 @@ class BasicGroup: ...@@ -1877,7 +1875,6 @@ class BasicGroup:
info['info_botright']=str(info_botright_method()) info['info_botright']=str(info_botright_method())
title = info['info_center'] title = info['info_center']
color_script = getattr(activity_content.getObject(), color_script = getattr(activity_content.getObject(),
self.field.get_value('color_script'),None) self.field.get_value('color_script'),None)
# calling color script if exists to set up activity_color # calling color script if exists to set up activity_color
...@@ -1925,8 +1922,6 @@ class BasicGroup: ...@@ -1925,8 +1922,6 @@ class BasicGroup:
# group (used for Activity naming) # group (used for Activity naming)
indic += 1 indic += 1
else: else:
# specific color script # specific color script
color_script = getattr(self.object.getObject(), color_script = getattr(self.object.getObject(),
...@@ -2082,7 +2077,6 @@ class PlanningStructure: ...@@ -2082,7 +2077,6 @@ class PlanningStructure:
self.X.name = 'axis_x' self.X.name = 'axis_x'
self.Y.name = 'axis_y' self.Y.name = 'axis_y'
# recovering secondary_axis_ bounds # recovering secondary_axis_ bounds
# Used in case of non calendar mode # Used in case of non calendar mode
self.secondary_axis.start = \ self.secondary_axis.start = \
...@@ -2090,9 +2084,7 @@ class PlanningStructure: ...@@ -2090,9 +2084,7 @@ class PlanningStructure:
self.secondary_axis.stop = \ self.secondary_axis.stop = \
basic_structure.secondary_axis_info['bound_stop'] basic_structure.secondary_axis_info['bound_stop']
self.main_axis.size = self.buildGroups(basic_structure=basic_structure) self.main_axis.size = self.buildGroups(basic_structure=basic_structure)
# call method to build secondary axis structure # call method to build secondary axis structure
# need start_bound, stop_bound and number of groups to build # need start_bound, stop_bound and number of groups to build
# used in non calendar mode # used in non calendar mode
...@@ -2116,7 +2108,6 @@ class PlanningStructure: ...@@ -2116,7 +2108,6 @@ class PlanningStructure:
# everything is fine, returning 'true' flag. # everything is fine, returning 'true' flag.
return 1 return 1
def buildSecondaryAxis(self,basic_structure, field): def buildSecondaryAxis(self,basic_structure, field):
""" """
build secondary axis structure build secondary axis structure
...@@ -2188,9 +2179,7 @@ class PlanningStructure: ...@@ -2188,9 +2179,7 @@ class PlanningStructure:
return 1 return 1
def completeAxis(self):
def completeAxis (self):
""" """
complete axis infomations (and more precisely axis position objects) thanks complete axis infomations (and more precisely axis position objects) thanks
to the actual planning structure to the actual planning structure
...@@ -2230,20 +2219,18 @@ class PlanningStructure: ...@@ -2230,20 +2219,18 @@ class PlanningStructure:
# returning 'true' flag at the end of the process # returning 'true' flag at the end of the process
return 1 return 1
def buildGroups(self, basic_structure=None):
def buildGroups (self, basic_structure=None):
""" """
build groups from activities saved in the structure groups. Build groups from activities saved in the structure groups.
""" """
axis_group_number = 0 axis_group_number = 0
axis_element_already_present=0 axis_element_already_present=0
for basic_group_object in basic_structure.basic_group_list: for basic_group_object in basic_structure.basic_group_list:
axis_group_number += 1
if basic_structure.calendar_mode == 1: if basic_structure.calendar_mode == 1:
secondary_axis_range = basic_structure.calendar_range secondary_axis_range = basic_structure.calendar_range
else: else:
secondary_axis_range = None secondary_axis_range = None
axis_group_number += 1
axis_group= AxisGroup(name='Group_' + str(axis_group_number), axis_group= AxisGroup(name='Group_' + str(axis_group_number),
title=basic_group_object.title, title=basic_group_object.title,
object=basic_group_object.object, object=basic_group_object.object,
...@@ -2256,6 +2243,7 @@ class PlanningStructure: ...@@ -2256,6 +2243,7 @@ class PlanningStructure:
secondary_axis_stop = basic_group_object.secondary_axis_stop, secondary_axis_stop = basic_group_object.secondary_axis_stop,
secondary_axis_range = secondary_axis_range, secondary_axis_range = secondary_axis_range,
property_dict = basic_group_object.property_dict) property_dict = basic_group_object.property_dict)
if self.calendar_view == 0: if self.calendar_view == 0:
axis_group.position_y = axis_group.position_main axis_group.position_y = axis_group.position_main
axis_group.position_x = axis_group.position_secondary axis_group.position_x = axis_group.position_secondary
...@@ -2270,8 +2258,8 @@ class PlanningStructure: ...@@ -2270,8 +2258,8 @@ class PlanningStructure:
axis_group.fixProperties(form_id = basic_structure.form.id, axis_group.fixProperties(form_id = basic_structure.form.id,
selection_name = basic_structure.selection_name) selection_name = basic_structure.selection_name)
# updating start value # updating start value
axis_group.axis_element_start = axis_element_already_present + 1
activity_number = 0 activity_number = 0
axis_group.axis_element_start = axis_element_already_present + 1
if basic_group_object.basic_activity_list != None: if basic_group_object.basic_activity_list != None:
# need to check if activity list is not empty : possible in case zoom # need to check if activity list is not empty : possible in case zoom
# selection is used over the secondary axis # selection is used over the secondary axis
...@@ -2281,7 +2269,7 @@ class PlanningStructure: ...@@ -2281,7 +2269,7 @@ class PlanningStructure:
for basic_activity_object in basic_group_object.basic_activity_list: for basic_activity_object in basic_group_object.basic_activity_list:
activity_number += 1 activity_number += 1
# create new activity in the PlanningStructure # create new activity in the PlanningStructure
activity=Activity(name='Group_%s_Activity_%s' %( activity=Activity(name='Group_%s_Activity_%s' % (
str(axis_group_number), str(axis_group_number),
str(activity_number)), str(activity_number)),
title=basic_activity_object.title, title=basic_activity_object.title,
...@@ -2831,13 +2819,13 @@ class AxisGroup: ...@@ -2831,13 +2819,13 @@ class AxisGroup:
self.info_title.link = 'foldReport?report_url=' + \ self.info_title.link = 'foldReport?report_url=' + \
'%s&form_id=%s&list_selection_name=%s' %( '%s&form_id=%s&list_selection_name=%s' %(
self.url, form_id, selection_name) self.url, form_id, selection_name)
self.info_title.info = '[-] ' + self.info_title.info self.info_title.info = '[-] ' + str(self.info_title.info)
else: else:
# current report is fold, action 'unfold' # current report is fold, action 'unfold'
self.info_title.link = 'unfoldReport?report_url=' + \ self.info_title.link = 'unfoldReport?report_url=' + \
'%s&form_id=%s&list_selection_name=%s' %( '%s&form_id=%s&list_selection_name=%s' %(
self.url, form_id, selection_name) self.url, form_id, selection_name)
self.info_title.info = '[+] ' + self.info_title.info self.info_title.info = '[+] ' + str(self.info_title.info)
#for i in range(self.depth): #for i in range(self.depth):
# self.title = '| ' + self.title # self.title = '| ' + self.title
......
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