Commit 3e4e980f authored by Jérome Perrin's avatar Jérome Perrin

Add a new button to reorder actions using their priorities.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10288 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0683b83
...@@ -634,6 +634,15 @@ class ERP5TypeInformation( FactoryTypeInformation, ...@@ -634,6 +634,15 @@ class ERP5TypeInformation( FactoryTypeInformation,
, manage_tabs_message=manage_tabs_message , manage_tabs_message=manage_tabs_message
) )
def reorderActions(self, REQUEST=None):
"""Reorder actions according to their priorities."""
new_actions = self._cloneActions()
new_actions.sort(lambda x,y: cmp(x.getPriority(), y.getPriority()))
self._actions = tuple( new_actions )
if REQUEST is not None:
return self.manage_editActionsForm(REQUEST,
manage_tabs_message='Actions reordered.')
InitializeClass( ERP5TypeInformation ) InitializeClass( ERP5TypeInformation )
......
...@@ -181,6 +181,7 @@ ...@@ -181,6 +181,7 @@
<td><input type="submit" name="deleteActions:method" value="Delete" /></td> <td><input type="submit" name="deleteActions:method" value="Delete" /></td>
<td><input type="submit" name="moveUpActions:method" value="Move up" /></td> <td><input type="submit" name="moveUpActions:method" value="Move up" /></td>
<td><input type="submit" name="moveDownActions:method" value="Move down" /></td> <td><input type="submit" name="moveDownActions:method" value="Move down" /></td>
<td><input type="submit" name="reorderActions:method" value="Reorder actions by priority" /></td>
</tr> </tr>
</table> </table>
</div> </div>
......
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