Commit aedcfbdf authored by Rafael Monnerat's avatar Rafael Monnerat

Small typo fixes in Planning Box.

The modification in SelectionTool should not modify any 
other result in ERP5, just The PlanningBox.

Basically you can pass another list_method as parameter 
instead use only searchFolder. searchFolder was kept as default.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13227 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 84c8a0c3
This diff is collapsed.
...@@ -615,7 +615,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -615,7 +615,7 @@ class SelectionTool( UniqueObject, SimpleItem ):
# PlanningBox related methods # PlanningBox related methods
security.declareProtected(ERP5Permissions.View, 'setZoomLevel') security.declareProtected(ERP5Permissions.View, 'setZoomLevel')
def setZoomLevel(self, uids=None, REQUEST=None): def setZoomLevel(self, uids=None, REQUEST=None, form_id=None, query_string=None):
""" """
Set graphic zoom level in PlanningBox Set graphic zoom level in PlanningBox
""" """
...@@ -634,10 +634,11 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -634,10 +634,11 @@ class SelectionTool( UniqueObject, SimpleItem ):
params['zoom_start'] = zoom_start params['zoom_start'] = zoom_start
selection.edit(params= params) selection.edit(params= params)
if REQUEST is not None: if REQUEST is not None:
return self._redirectToOriginalForm(REQUEST=REQUEST) return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
query_string=query_string)
security.declareProtected(ERP5Permissions.View, 'setZoom') security.declareProtected(ERP5Permissions.View, 'setZoom')
def setZoom(self, uids=None, REQUEST=None): def setZoom(self, uids=None, REQUEST=None, form_id=None, query_string=None):
""" """
Set graphic zoom in PlanningBox Set graphic zoom in PlanningBox
""" """
...@@ -651,10 +652,11 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -651,10 +652,11 @@ class SelectionTool( UniqueObject, SimpleItem ):
params['zoom_start'] = zoom_start params['zoom_start'] = zoom_start
selection.edit(params= params) selection.edit(params= params)
if REQUEST is not None: if REQUEST is not None:
return self._redirectToOriginalForm(REQUEST=REQUEST) return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
query_string=query_string)
security.declareProtected(ERP5Permissions.View, 'nextZoom') security.declareProtected(ERP5Permissions.View, 'nextZoom')
def nextZoom(self, uids=None, REQUEST=None): def nextZoom(self, uids=None, REQUEST=None, form_id=None, query_string=None):
""" """
Set next graphic zoom start in PlanningBox Set next graphic zoom start in PlanningBox
""" """
...@@ -668,10 +670,11 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -668,10 +670,11 @@ class SelectionTool( UniqueObject, SimpleItem ):
params['zoom_start'] = int(zoom_start) + 1 params['zoom_start'] = int(zoom_start) + 1
selection.edit(params= params) selection.edit(params= params)
if REQUEST is not None: if REQUEST is not None:
return self._redirectToOriginalForm(REQUEST=REQUEST) return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
query_string=query_string)
security.declareProtected(ERP5Permissions.View, 'previousZoom') security.declareProtected(ERP5Permissions.View, 'previousZoom')
def previousZoom(self, uids=None, REQUEST=None): def previousZoom(self, uids=None, REQUEST=None, form_id=None, query_string=None):
""" """
Set previous graphic zoom in PlanningBox Set previous graphic zoom in PlanningBox
""" """
...@@ -685,7 +688,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -685,7 +688,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
params['zoom_start'] = int(zoom_start) - 1 params['zoom_start'] = int(zoom_start) - 1
selection.edit(params= params) selection.edit(params= params)
if REQUEST is not None: if REQUEST is not None:
return self._redirectToOriginalForm(REQUEST=REQUEST) return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
query_string=query_string)
security.declareProtected(ERP5Permissions.View, 'setDomainRoot') security.declareProtected(ERP5Permissions.View, 'setDomainRoot')
def setDomainRoot(self, REQUEST, form_id=None, query_string=None): def setDomainRoot(self, REQUEST, form_id=None, query_string=None):
...@@ -1278,7 +1282,10 @@ class TreeListLine: ...@@ -1278,7 +1282,10 @@ class TreeListLine:
return self.exception_uid_list return self.exception_uid_list
def makeTreeList(here, form, root_dict, report_path, base_category, depth, unfolded_list, form_id, selection_name, report_depth, is_report_opened=1, sort_on = (('id', 'ASC'),)): def makeTreeList(here, form, root_dict, report_path, base_category,
depth, unfolded_list, form_id, selection_name,
report_depth, is_report_opened=1, list_method=None,
sort_on = (('id', 'ASC'),)):
""" """
(object, is_pure_summary, depth, is_open, select_domain_dict) (object, is_pure_summary, depth, is_open, select_domain_dict)
...@@ -1326,30 +1333,44 @@ def makeTreeList(here, form, root_dict, report_path, base_category, depth, unfol ...@@ -1326,30 +1333,44 @@ def makeTreeList(here, form, root_dict, report_path, base_category, depth, unfol
tree_list = [] tree_list = []
if root is None: return tree_list if root is None: return tree_list
if base_category == 'parent': if base_category == 'parent':
if hasattr(aq_base(root), 'objectValues'): # Use searchFolder as default
# If this is a folder, try to browse the hierarchy if list_method is None:
for zo in root.searchFolder(sort_on=sort_on): if hasattr(aq_base(root), 'objectValues'):
o = zo.getObject() # If this is a folder, try to browse the hierarchy
if o is not None: object_list = root.searchFolder(sort_on=sort_on)
new_root_dict = root_dict.copy() elif hasattr(aq_base(root), list_method.__name__ ):
new_root_dict[None] = new_root_dict[base_category] = o object_list = list_method()
else:
selection_domain = DomainSelection(domain_dict = new_root_dict) object_list = []
if (report_depth is not None and depth <= (report_depth - 1)) or o.getRelativeUrl() in unfolded_list: for zo in object_list:
exception_uid_list = [] # Object we do not want to display o = zo.getObject()
if o is not None:
for sub_zo in o.searchFolder(sort_on=sort_on): new_root_dict = root_dict.copy()
sub_o = sub_zo.getObject() new_root_dict[None] = new_root_dict[base_category] = o
if sub_o is not None and hasattr(aq_base(root), 'objectValues'):
exception_uid_list.append(sub_o.getUid()) selection_domain = DomainSelection(domain_dict = new_root_dict)
tree_list += [TreeListLine(o, 1, depth, 1, selection_domain, exception_uid_list)] # Summary (open) if (report_depth is not None and depth <= (report_depth - 1)) or \
if is_report_opened : o.getRelativeUrl() in unfolded_list:
tree_list += [TreeListLine(o, 0, depth, 0, selection_domain, exception_uid_list)] # List (contents, closed, must be strict selection) exception_uid_list = [] # Object we do not want to display
tree_list += makeTreeList(here, form, new_root_dict, report_path, base_category, depth + 1, unfolded_list, form_id, selection_name, report_depth, is_report_opened=is_report_opened, sort_on=sort_on)
else: for sub_zo in o.searchFolder(sort_on=sort_on):
tree_list += [TreeListLine(o, 1, depth, 0, selection_domain, ())] # Summary (closed) sub_o = sub_zo.getObject()
if sub_o is not None and hasattr(aq_base(root), 'objectValues'):
exception_uid_list.append(sub_o.getUid())
# Summary (open)
tree_list += [TreeListLine(o, 1, depth, 1, selection_domain, exception_uid_list)]
if is_report_opened :
# List (contents, closed, must be strict selection)
tree_list += [TreeListLine(o, 0, depth, 0, selection_domain, exception_uid_list)]
tree_list += makeTreeList(here, form, new_root_dict, report_path,
base_category, depth + 1, unfolded_list, form_id,
selection_name, report_depth,
is_report_opened=is_report_opened, sort_on=sort_on)
else:
tree_list += [TreeListLine(o, 1, depth, 0, selection_domain, ())] # Summary (closed)
else: else:
# process to recover objects in case a generation script is used # process to recover objects in case a generation script is used
if hasattr(root,'getChildDomainValueList'): if hasattr(root,'getChildDomainValueList'):
......
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