Commit 3127f835 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

small optimisation.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23833 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f102f8c0
This diff is collapsed.
...@@ -154,12 +154,13 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -154,12 +154,13 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
if REQUEST is None: if REQUEST is None:
return return
if no_reset and REQUEST.form.has_key('reset'): form = REQUEST.form
REQUEST.form['noreset'] = REQUEST.form['reset'] # Kept for compatibility - might no be used anymore if no_reset and form.has_key('reset'):
del REQUEST.form['reset'] form['noreset'] = form['reset'] # Kept for compatibility - might no be used anymore
if no_report_depth and REQUEST.form.has_key('report_depth'): del form['reset']
REQUEST.form['noreport_depth'] = REQUEST.form['report_depth'] # Kept for compatibility - might no be used anymore if no_report_depth and form.has_key('report_depth'):
del REQUEST.form['report_depth'] form['noreport_depth'] = form['report_depth'] # Kept for compatibility - might no be used anymore
del form['report_depth']
if query_string is not None: if query_string is not None:
warnings.warn('DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.', warnings.warn('DEPRECATED: _redirectToOriginalForm got called with a query_string. The variables must be passed in REQUEST.form.',
...@@ -440,21 +441,22 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -440,21 +441,22 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
# selection_name, sort_on and form_id params are kept only for bacward compatibilty # selection_name, sort_on and form_id params are kept only for bacward compatibilty
# as some test call setSelectionQuickSortOrder in url with these params # as some test call setSelectionQuickSortOrder in url with these params
listbox_id = None listbox_id = None
form = REQUEST.form
if sort_on is None: if sort_on is None:
listbox_id, sort_on = REQUEST.form["setSelectionQuickSortOrder"].split(".", 1) listbox_id, sort_on = form["setSelectionQuickSortOrder"].split(".", 1)
if form_id is None: if form_id is None:
if REQUEST is not None: if REQUEST is not None:
if REQUEST.form.has_key('dialog_id'): if form.has_key('dialog_id'):
form_id = REQUEST.form['dialog_id'] form_id = form['dialog_id']
else: else:
form_id = REQUEST.form['form_id'] form_id = form['form_id']
if listbox_id is not None: if listbox_id is not None:
selection_name_key = "%s_list_selection_name" %listbox_id selection_name_key = "%s_list_selection_name" %listbox_id
selection_name = REQUEST.form[selection_name_key] selection_name = form[selection_name_key]
elif selection_name is None: elif selection_name is None:
selection_name = REQUEST.form['selection_name'] selection_name = form['selection_name']
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is not None: if selection is not None:
...@@ -477,8 +479,8 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -477,8 +479,8 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
selection.edit(sort_on=new_sort_on) selection.edit(sort_on=new_sort_on)
if REQUEST is not None: if REQUEST is not None:
if REQUEST.form.has_key('listbox_uid') and \ if form.has_key('listbox_uid') and \
REQUEST.form.has_key('uids'): form.has_key('uids'):
self.uncheckAll(selection_name, REQUEST.get('listbox_uid')) self.uncheckAll(selection_name, REQUEST.get('listbox_uid'))
self.checkAll(selection_name, REQUEST.get('uids')) self.checkAll(selection_name, REQUEST.get('uids'))
......
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