Commit 4de98a76 authored by Yoshinori Okuji's avatar Yoshinori Okuji

New methods, getSelectionSelectedValueList, getSelectionCheckedValueList and getSelectionValueList.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@542 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ce30a9c8
......@@ -659,6 +659,32 @@ class SelectionTool( UniqueObject, SimpleItem ):
return self.setListboxDisplayMode(REQUEST=REQUEST,listbox_display_mode='ReportTreeMode')
security.declareProtected(ERP5Permissions.View, 'getSelectionSelectedValueList')
def getSelectionSelectedValueList(self, selection_name, REQUEST=None, selection_method=None, context=None):
"""
Get the list of values selected for 'selection_name'
"""
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
return selection(selection_method=selection_method, context=context, REQUEST=REQUEST)
security.declareProtected(ERP5Permissions.View, 'getSelectionCheckedValueList')
def getSelectionCheckedValueList(self, selection_name, REQUEST=None):
"""
Get the list of values checked for 'selection_name'
"""
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
uid_list = selection.getSelectionCheckedUids()
value_list = self.portal_catalog.getObjectList(uid_list)
return value_list
security.declareProtected(ERP5Permissions.View, 'getSelectionValueList')
def getSelectionValueList(self, selection_name, REQUEST=None, selection_method=None, context=None):
"""
Get the list of values checked or selected for 'selection_name'
"""
value_list = self.getSelectionCheckedValueList(selection_name, REQUEST=REQUEST)
if len(value_list) == 0:
value_list = self.getSelectionSelectedValueList(selection_name, REQUEST=REQUEST, selection_method=selection_method, context=context)
return value_list
InitializeClass( SelectionTool )
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