Commit 178518f6 authored by Aurel's avatar Aurel

make button "Reorder actions by priority" on action tool work


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37898 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 159ef57a
...@@ -110,3 +110,16 @@ def listFilteredActionsFor(self, object=None): ...@@ -110,3 +110,16 @@ def listFilteredActionsFor(self, object=None):
return filtered_actions return filtered_actions
ActionsTool.listFilteredActionsFor = listFilteredActionsFor ActionsTool.listFilteredActionsFor = listFilteredActionsFor
def reorderActions(self, REQUEST=None):
"""Reorder actions according to their priorities."""
new_actions = self._cloneActions()
new_actions.sort(key=lambda x: x.getPriority())
self._actions = tuple( new_actions )
if REQUEST is not None:
return self.manage_editActionsForm(REQUEST,
manage_tabs_message='Actions reordered.')
ActionsTool.reorderActions = reorderActions
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