Commit 32df5fb0 authored by Rafael Monnerat's avatar Rafael Monnerat

Improved bloc urls.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14997 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9af03071
...@@ -1249,9 +1249,9 @@ class BasicStructure: ...@@ -1249,9 +1249,9 @@ class BasicStructure:
select_expression = '' select_expression = ''
# now iterating through report_tree_list # now iterating through report_tree_list
# LOG('PlanningBox, build', 0, 'report_tree_list %s' % len(report_tree_list)) # LOG('PlanningBox, build', 0, 'report_tree_list %s' % len(report_tree_list))
for object_tree_line in report_tree_list: for object_tree_line in report_tree_list:
# LOG('PlanningBox, build', 0, 'object_tree_line %s' % str(object_tree_line)) # LOG('PlanningBox, build', 0, 'object_tree_line %s' % str(object_tree_line))
# 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
...@@ -1754,7 +1754,6 @@ class BasicGroup: ...@@ -1754,7 +1754,6 @@ class BasicGroup:
*BasicGroup instance itself can hold other BasicGroups in case of *BasicGroup instance itself can hold other BasicGroups in case of
ReportTree mode to handle child groups. ReportTree mode to handle child groups.
""" """
def __init__ (self, title='', name='',url='', constraints='', depth=0, def __init__ (self, title='', name='',url='', constraints='', depth=0,
position=0, field = None, object = None, is_open=0, position=0, field = None, object = None, is_open=0,
is_pure_summary=1, secondary_axis_start=None, is_pure_summary=1, secondary_axis_start=None,
...@@ -1929,7 +1928,14 @@ class BasicGroup: ...@@ -1929,7 +1928,14 @@ class BasicGroup:
stat_context.absolute_url = \ stat_context.absolute_url = \
lambda x: activity_content.getObject().absolute_url() lambda x: activity_content.getObject().absolute_url()
object = stat_context.getObject() object = stat_context.getObject()
url = object.getUrl() # Defining bloc url
if getattr(object, 'isMovement', 0) and \
getattr(object, 'getExplanationValue', 0):
explanation = object.getExplanationValue()
else:
explanation = object
if explanation is not None:
url = '%s/view' % (explanation.getUrl())
# XXX should define height of block here # XXX should define height of block here
height = None height = None
...@@ -1943,8 +1949,7 @@ class BasicGroup: ...@@ -1943,8 +1949,7 @@ class BasicGroup:
color=current_color, info_dict=info, color=current_color, info_dict=info,
error=error, error=error,
property_dict=self.property_dict) property_dict=self.property_dict)
# adding new activity to personal group activity list # adding new activity to personal group activity list
try: try:
self.basic_activity_list.append(activity) self.basic_activity_list.append(activity)
...@@ -2022,7 +2027,14 @@ class BasicGroup: ...@@ -2022,7 +2027,14 @@ class BasicGroup:
height = None height = None
# get object url, not group url # get object url, not group url
url = self.object.getObject().getUrl() object = self.object.getObject()
if getattr(object, 'isMovement', 0) and \
getattr(object, 'getExplanationValue', 0):
explanation = object.getExplanationValue()
else:
explanation = object
if explanation is not None:
url = '%s/view' % (explanation.getUrl())
# creating new activity instance # creating new activity instance
activity=BasicActivity(title=info['info_center'], name=name, activity=BasicActivity(title=info['info_center'], name=name,
...@@ -2042,9 +2054,10 @@ class BasicGroup: ...@@ -2042,9 +2054,10 @@ class BasicGroup:
self.basic_activity_list.append(activity) self.basic_activity_list.append(activity)
class BasicActivity: class BasicActivity:
""" Represents an activity, a task, in the group it belongs to. Beware """
nothing about multitask rendering. """ Represents an activity, a task, in the group it belongs to. Beware
nothing about multitask rendering.
"""
def __init__ (self, title='', name='',object = None, url='', def __init__ (self, title='', name='',object = None, url='',
absolute_begin=None, absolute_end=None, absolute_start=None, absolute_begin=None, absolute_end=None, absolute_start=None,
absolute_stop=None, height=None, constraints='', color=None, absolute_stop=None, height=None, constraints='', color=None,
......
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