Commit ee68b186 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Revert the previous change that selection_columns is set to

the default value if empty. This was annoying when developing
skins.

Delete query from selection params when changing the display mode.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1204 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47cf2c46
...@@ -341,11 +341,9 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -341,11 +341,9 @@ class SelectionTool( UniqueObject, SimpleItem ):
if columns is None: columns = [] if columns is None: columns = []
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is not None: if selection is not None:
if len(selection.selection_columns) == 0: if len(selection.selection_columns) > 0:
self.setSelectionColumns(selection_name, columns, REQUEST=REQUEST) return selection.selection_columns
return selection.selection_columns return columns
else:
return columns
security.declareProtected(ERP5Permissions.View, 'setSelectionStats') security.declareProtected(ERP5Permissions.View, 'setSelectionStats')
...@@ -616,10 +614,14 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -616,10 +614,14 @@ class SelectionTool( UniqueObject, SimpleItem ):
domain_tree_mode = 0 domain_tree_mode = 0
report_tree_mode = 1 report_tree_mode = 1
selection.edit(flat_list_mode=flat_list_mode,domain_tree_mode=domain_tree_mode, selection.edit(flat_list_mode=flat_list_mode,domain_tree_mode=domain_tree_mode,
report_tree_mode=report_tree_mode) report_tree_mode=report_tree_mode)
# It is better to reset the query when changing the display mode.
params = selection.getSelectionParams()
if 'query' in params: del params['query']
selection.edit(params = params)
referer = request['HTTP_REFERER'] referer = request['HTTP_REFERER']
referer = referer.replace('reset=', 'noreset=') referer = referer.replace('reset=', 'noreset=')
referer = referer.replace('reset:int=', 'noreset:int=') referer = referer.replace('reset:int=', 'noreset:int=')
......
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