Commit 98f07c99 authored by Vincent Pelletier's avatar Vincent Pelletier

checkAll and uncheckAll apply to displayed listbox, and so they should use...

checkAll and uncheckAll apply to displayed listbox, and so they should use "list_selection_name" instead of "selection_name". "selection_name" is the name of module-level selection.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20914 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd8534e9
...@@ -309,12 +309,12 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -309,12 +309,12 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
return [] return []
security.declareProtected(ERP5Permissions.View, 'checkAll') security.declareProtected(ERP5Permissions.View, 'checkAll')
def checkAll(self, selection_name, listbox_uid=[], REQUEST=None, def checkAll(self, list_selection_name, listbox_uid=[], REQUEST=None,
query_string=None, form_id=None): query_string=None, form_id=None):
""" """
Check uids in a given listbox_uid list for a given selection_name Check uids in a given listbox_uid list for a given list_selection_name
""" """
selection_object = self.getSelectionFor(selection_name, REQUEST) selection_object = self.getSelectionFor(list_selection_name, REQUEST)
if selection_object: if selection_object:
selection_uid_dict = {} selection_uid_dict = {}
for uid in selection_object.checked_uids: for uid in selection_object.checked_uids:
...@@ -324,18 +324,18 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -324,18 +324,18 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
selection_uid_dict[int(uid)] = 1 selection_uid_dict[int(uid)] = 1
except ValueError: except ValueError:
selection_uid_dict[uid] = 1 selection_uid_dict[uid] = 1
self.setSelectionCheckedUidsFor(selection_name, selection_uid_dict.keys(), REQUEST=REQUEST) self.setSelectionCheckedUidsFor(list_selection_name, selection_uid_dict.keys(), REQUEST=REQUEST)
if REQUEST is not None: if REQUEST is not None:
return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id, return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
query_string=query_string, no_reset=True) query_string=query_string, no_reset=True)
security.declareProtected(ERP5Permissions.View, 'uncheckAll') security.declareProtected(ERP5Permissions.View, 'uncheckAll')
def uncheckAll(self, selection_name, listbox_uid=[], REQUEST=None, def uncheckAll(self, list_selection_name, listbox_uid=[], REQUEST=None,
query_string=None, form_id=None): query_string=None, form_id=None):
""" """
Uncheck uids in a given listbox_uid list for a given selection_name Uncheck uids in a given listbox_uid list for a given list_selection_name
""" """
selection_object = self.getSelectionFor(selection_name, REQUEST) selection_object = self.getSelectionFor(list_selection_name, REQUEST)
if selection_object: if selection_object:
selection_uid_dict = {} selection_uid_dict = {}
for uid in selection_object.checked_uids: for uid in selection_object.checked_uids:
...@@ -345,7 +345,7 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ): ...@@ -345,7 +345,7 @@ class SelectionTool( BaseTool, UniqueObject, SimpleItem ):
if selection_uid_dict.has_key(int(uid)): del selection_uid_dict[int(uid)] if selection_uid_dict.has_key(int(uid)): del selection_uid_dict[int(uid)]
except ValueError: except ValueError:
if selection_uid_dict.has_key(uid): del selection_uid_dict[uid] if selection_uid_dict.has_key(uid): del selection_uid_dict[uid]
self.setSelectionCheckedUidsFor(selection_name, selection_uid_dict.keys(), REQUEST=REQUEST) self.setSelectionCheckedUidsFor(list_selection_name, selection_uid_dict.keys(), REQUEST=REQUEST)
if REQUEST is not None: if REQUEST is not None:
return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id, return self._redirectToOriginalForm(REQUEST=REQUEST, form_id=form_id,
query_string=query_string, no_reset=True) query_string=query_string, no_reset=True)
......
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