Commit 91354e04 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Fixed next / previous on discrete lists


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@364 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fbae6898
...@@ -371,7 +371,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -371,7 +371,7 @@ 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.selection_method_path) method = self.unrestrictedTraverse(selection.selection_method_path)
selection = selection(selection_method = method, REQUEST=REQUEST) selection = selection(selection_method = method, context=self, REQUEST=REQUEST)
o = selection[0] o = selection[0]
url = o.absolute_url() url = o.absolute_url()
else: else:
...@@ -389,7 +389,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -389,7 +389,7 @@ 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.selection_method_path) method = self.unrestrictedTraverse(selection.selection_method_path)
selection = selection(selection_method = method, REQUEST=REQUEST) selection = selection(selection_method = method, context=self, REQUEST=REQUEST)
o = selection[-1] o = selection[-1]
url = o.absolute_url() url = o.absolute_url()
else: else:
...@@ -407,7 +407,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -407,7 +407,7 @@ 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.selection_method_path) method = self.unrestrictedTraverse(selection.selection_method_path)
selection = selection(selection_method = method, REQUEST=REQUEST) selection = selection(selection_method = method, context=self, REQUEST=REQUEST)
o = selection[(int(selection_index) + 1) % len(selection)] o = selection[(int(selection_index) + 1) % len(selection)]
url = o.absolute_url() url = o.absolute_url()
else: else:
...@@ -425,7 +425,7 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -425,7 +425,7 @@ 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.selection_method_path) method = self.unrestrictedTraverse(selection.selection_method_path)
selection = selection(selection_method = method, REQUEST=REQUEST) selection = selection(selection_method = method, context=self, REQUEST=REQUEST)
o = selection[(int(selection_index) - 1) % len(selection)] o = selection[(int(selection_index) - 1) % len(selection)]
url = o.absolute_url() url = o.absolute_url()
else: else:
......
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