Commit e265dc14 authored by Aurel's avatar Aurel

fix way to retrieve selection name


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18830 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51dc446d
...@@ -427,6 +427,7 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -427,6 +427,7 @@ 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
if sort_on is None: if sort_on is None:
listbox_id, sort_on = REQUEST.form["setSelectionQuickSortOrder"].split(".", 1) listbox_id, sort_on = REQUEST.form["setSelectionQuickSortOrder"].split(".", 1)
...@@ -436,14 +437,13 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -436,14 +437,13 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
form_id = REQUEST.form['dialog_id'] form_id = REQUEST.form['dialog_id']
else: else:
form_id = REQUEST.form['form_id'] form_id = REQUEST.form['form_id']
if selection_name is None:
if REQUEST.form.has_key('selection_name'): if listbox_id is not None:
selection_name_key = "%s_list_selection_name" %listbox_id
selection_name = REQUEST.form[selection_name_key]
elif selection_name is None:
selection_name = REQUEST.form['selection_name'] selection_name = REQUEST.form['selection_name']
else:
object_path = REQUEST.form['object_path']
o = self.restrictedTraverse(object_path)
form = getattr(o, form_id)
selection_name = form[listbox_id].get_value('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:
current_sort_on = self.getSelectionSortOrder(selection_name) current_sort_on = self.getSelectionSortOrder(selection_name)
......
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