Commit 98591510 authored by Sebastien Robin's avatar Sebastien Robin

added selectionHasChanged


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@721 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 966cb758
...@@ -37,6 +37,9 @@ from AccessControl import ClassSecurityInfo ...@@ -37,6 +37,9 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions as ERP5Permissions from Products.ERP5Type import Permissions as ERP5Permissions
from Products.ERP5Form import _dtmldir from Products.ERP5Form import _dtmldir
from Selection import Selection from Selection import Selection
from xml.sax.saxutils import escape
from copy import copy
import md5
from zLOG import LOG from zLOG import LOG
...@@ -695,4 +698,16 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -695,4 +698,16 @@ class SelectionTool( UniqueObject, SimpleItem ):
value_list = self.getSelectionSelectedValueList(selection_name, REQUEST=REQUEST, selection_method=selection_method, context=context) value_list = self.getSelectionSelectedValueList(selection_name, REQUEST=REQUEST, selection_method=selection_method, context=context)
return value_list return value_list
security.declareProtected(ERP5Permissions.View, 'selectionHasChanged')
def selectionHasChanged(self, md5_string, object_uid_list):
"""
We want to be sure that the selection did not change
"""
sorted_object_uid_list = copy(object_uid_list)
sorted_object_uid_list.sort()
new_md5_string = escape(md5.new(str(sorted_object_uid_list)).hexdigest())
if md5_string != new_md5_string:
return True
return False
InitializeClass( SelectionTool ) 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