Commit a0a28f5f authored by Aurel's avatar Aurel

fix in prev, next, last and first, the update of selection which was done each time

we call those actions and which generate wring selections


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5795 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3139217b
...@@ -113,7 +113,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -113,7 +113,7 @@ class SelectionTool( UniqueObject, SimpleItem ):
""" """
if not REQUEST: if not REQUEST:
REQUEST = get_request() REQUEST = get_request()
if not hasattr(self, 'selection_data'): if not hasattr(self, 'selection_data'):
self.selection_data = PersistentMapping() self.selection_data = PersistentMapping()
user_id = self.portal_membership.getAuthenticatedMember().getUserName() user_id = self.portal_membership.getAuthenticatedMember().getUserName()
...@@ -416,8 +416,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -416,8 +416,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection: if selection:
method = self.unrestrictedTraverse(selection.method_path) method = self.unrestrictedTraverse(selection.method_path)
selection = selection(method = method, context=self, REQUEST=REQUEST) selection_list = selection(method = method, context=self, REQUEST=REQUEST)
o = selection[0] o = selection_list[0]
url = o.absolute_url() url = o.absolute_url()
else: else:
url = REQUEST.url url = REQUEST.url
...@@ -434,8 +434,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -434,8 +434,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection: if selection:
method = self.unrestrictedTraverse(selection.method_path) method = self.unrestrictedTraverse(selection.method_path)
selection = selection(method = method, context=self, REQUEST=REQUEST) selection_list = selection(method = method, context=self, REQUEST=REQUEST)
o = selection[-1] o = selection_list[-1]
url = o.absolute_url() url = o.absolute_url()
else: else:
url = REQUEST.url url = REQUEST.url
...@@ -452,8 +452,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -452,8 +452,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection: if selection:
method = self.unrestrictedTraverse(selection.method_path) method = self.unrestrictedTraverse(selection.method_path)
selection = selection(method = method, context=self, REQUEST=REQUEST) selection_list = selection(method = method, context=self, REQUEST=REQUEST)
o = selection[(int(selection_index) + 1) % len(selection)] o = selection_list[(int(selection_index) + 1) % len(selection_list)]
url = o.absolute_url() url = o.absolute_url()
else: else:
url = REQUEST.url url = REQUEST.url
...@@ -470,8 +470,8 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -470,8 +470,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
selection = self.getSelectionFor(selection_name, REQUEST=REQUEST) selection = self.getSelectionFor(selection_name, REQUEST=REQUEST)
if selection: if selection:
method = self.unrestrictedTraverse(selection.method_path) method = self.unrestrictedTraverse(selection.method_path)
selection = selection(method = method, context=self, REQUEST=REQUEST) selection_list = selection(method = method, context=self, REQUEST=REQUEST)
o = selection[(int(selection_index) - 1) % len(selection)] o = selection_list[(int(selection_index) - 1) % len(selection_list)]
url = o.absolute_url() url = o.absolute_url()
else: else:
url = REQUEST.url url = REQUEST.url
...@@ -835,7 +835,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -835,7 +835,7 @@ class SelectionTool( UniqueObject, SimpleItem ):
if isinstance(v,DateTime): if isinstance(v,DateTime):
del kw[k] del kw[k]
# XXX End of the part to remove # XXX End of the part to remove
LOG('SelectionTool.getPickle, kw',0,kw) #LOG('SelectionTool.getPickle, kw',0,kw)
pickle_string = pickle.dumps(kw) pickle_string = pickle.dumps(kw)
msg = MIMEBase('application','octet-stream') msg = MIMEBase('application','octet-stream')
msg.set_payload(pickle_string) msg.set_payload(pickle_string)
......
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