diff --git a/webgui/js/app/windows/AdminGroups.js b/webgui/js/app/windows/AdminGroups.js index 0c637fc2454eb6617888777e9039a0c6cf9ad16f..d950de3123e2d2dfa7178e21a34c437c17c52361 100644 --- a/webgui/js/app/windows/AdminGroups.js +++ b/webgui/js/app/windows/AdminGroups.js @@ -18,14 +18,42 @@ function showAdminGroupWindow() { // Inline toolbars tbar: [ { - text:'Add/Edit', - tooltip:'Add or edit group', + text:'Add', + tooltip:'Add group', iconCls:'add', handler: function() { - showAdminGroupEditWindow(); + showAdminGroupAddEditWindow(); } }, '-', + { + text:'Edit', + tooltip:'Edit group', + iconCls:'edit', + handler: function() { + var selectedItem = AdminGroupWindow.getComponent('gridpanel').getSelectionModel().getSelected(); + // Check if we have selected item + if (selectedItem) { + // If so display window + showAdminGroupAddEditWindow(selectedItem.data.ID); + } else { + AdminGroupWindow.getEl().mask(); + + // Display error + Ext.Msg.show({ + title: "Nothing selected", + msg: "No group selected", + icon: Ext.MessageBox.ERROR, + buttons: Ext.Msg.CANCEL, + modal: false, + fn: function() { + AdminGroupWindow.getEl().unmask(); + } + }); + } + } + }, + '-', { text:'Remove', tooltip:'Remove group', @@ -169,7 +197,7 @@ function showAdminGroupWindow() { // Display edit/add form -function showAdminGroupEditWindow(id) { +function showAdminGroupAddEditWindow(id) { var submitAjaxConfig;