Commit 140b69cf authored by Jérome Perrin's avatar Jérome Perrin

Add methods to control the 'invert_mode' status of the selection



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11000 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f87e5216
......@@ -313,6 +313,24 @@ class SelectionTool( UniqueObject, SimpleItem ):
return selection.getListUrl()
else:
return None
security.declareProtected(ERP5Permissions.View, 'getSelectionInvertModeFor')
def getSelectionInvertModeFor(self, selection_name, REQUEST=None):
"""Get the 'invert_mode' parameter of a selection.
"""
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is not None:
return selection.isInvertMode()
return 0
security.declareProtected(ERP5Permissions.View, 'setSelectionInvertModeFor')
def setSelectionInvertModeFor(self, selection_name,
invert_mode, REQUEST=None):
"""Change the 'invert_mode' parameter of a selection.
"""
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection is not None:
selection.edit(invert_mode=invert_mode)
security.declareProtected(ERP5Permissions.View, 'setSelectionToIds')
def setSelectionToIds(self, selection_name, selection_uids, REQUEST=None):
......
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