Commit c4dd2876 authored by Rafael Monnerat's avatar Rafael Monnerat

Added one parameter to filter the portal type in the list method.

This commit should only effect the Planning Box.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13445 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ef755d6
...@@ -1003,7 +1003,6 @@ class PlanningBoxWidget(Widget.Widget): ...@@ -1003,7 +1003,6 @@ class PlanningBoxWidget(Widget.Widget):
params = selection.getParams() params = selection.getParams()
except (AttributeError,KeyError): except (AttributeError,KeyError):
params = {} params = {}
###### 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)
self.basic = BasicStructure(here=here,form=form, field=field, self.basic = BasicStructure(here=here,form=form, field=field,
...@@ -1204,6 +1203,8 @@ class BasicStructure: ...@@ -1204,6 +1203,8 @@ class BasicStructure:
selection_name=self.selection_name, selection_name=self.selection_name,
report_depth=report_depth, report_depth=report_depth,
list_method=self.list_method, list_method=self.list_method,
filtered_portal_types= \
self.filtered_portal_types,
is_report_opened=is_report_opened, is_report_opened=is_report_opened,
sort_on=self.selection.sort_on, sort_on=self.selection.sort_on,
form_id=self.form.id) form_id=self.form.id)
...@@ -1664,6 +1665,7 @@ class BasicStructure: ...@@ -1664,6 +1665,7 @@ 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
title = report_group_object.getObject().getTitle() title = report_group_object.getObject().getTitle()
name = report_group_object.getObject().getTitle() name = report_group_object.getObject().getTitle()
depth = report_group_object.getDepth() depth = report_group_object.getDepth()
...@@ -2122,7 +2124,6 @@ class PlanningStructure: ...@@ -2122,7 +2124,6 @@ class PlanningStructure:
axis_stop = (self.secondary_axis.stop) axis_stop = (self.secondary_axis.stop)
axis_start = (self.secondary_axis.start) axis_start = (self.secondary_axis.start)
axis_script=getattr(basic_structure.here, axis_script=getattr(basic_structure.here,
basic_structure.field.get_value('sec_axis_script'),None) basic_structure.field.get_value('sec_axis_script'),None)
if axis_script == None: if axis_script == None:
......
...@@ -114,7 +114,6 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -114,7 +114,6 @@ class SelectionTool( UniqueObject, SimpleItem ):
if query_string is not None: if query_string is not None:
LOG('SelectionTool', 0, 'DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.') LOG('SelectionTool', 0, 'DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.')
context = REQUEST['PARENTS'][0] context = REQUEST['PARENTS'][0]
form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', 'view') form_id = dialog_id or REQUEST.get('dialog_id', None) or form_id or REQUEST.get('form_id', 'view')
return getattr(context, form_id)() return getattr(context, form_id)()
...@@ -1318,7 +1317,7 @@ class TreeListLine: ...@@ -1318,7 +1317,7 @@ class TreeListLine:
def makeTreeList(here, form, root_dict, report_path, base_category, def makeTreeList(here, form, root_dict, report_path, base_category,
depth, unfolded_list, form_id, selection_name, depth, unfolded_list, form_id, selection_name,
report_depth, is_report_opened=1, list_method=None, report_depth, is_report_opened=1, list_method=None,
sort_on = (('id', 'ASC'),)): filtered_portal_types=[] ,sort_on = (('id', 'ASC'),)):
""" """
(object, is_pure_summary, depth, is_open, select_domain_dict) (object, is_pure_summary, depth, is_open, select_domain_dict)
...@@ -1374,7 +1373,7 @@ def makeTreeList(here, form, root_dict, report_path, base_category, ...@@ -1374,7 +1373,7 @@ def makeTreeList(here, form, root_dict, report_path, base_category,
# If this is a folder, try to browse the hierarchy # If this is a folder, try to browse the hierarchy
object_list = root.searchFolder(sort_on=sort_on) object_list = root.searchFolder(sort_on=sort_on)
elif hasattr(aq_base(root), list_method.__name__ ): elif hasattr(aq_base(root), list_method.__name__ ):
object_list = list_method() object_list = list_method(portal_type=filtered_portal_types)
else: else:
object_list = [] object_list = []
for zo in object_list: for zo in object_list:
......
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