From 7915bfd5b25defd6e93fc4a3d70c17dfd196db96 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 3 May 2019 16:13:05 -0600 Subject: [PATCH] Add documentation tab to deleting ACL --- admin/inc/class.admin_acl.inc.php | 1 - admin/js/app.js | 50 +++++++++++++++++++++++--- admin/templates/default/acl.delete.xet | 18 ++++++++++ 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 admin/templates/default/acl.delete.xet diff --git a/admin/inc/class.admin_acl.inc.php b/admin/inc/class.admin_acl.inc.php index 0e2a025387..8c2819360b 100644 --- a/admin/inc/class.admin_acl.inc.php +++ b/admin/inc/class.admin_acl.inc.php @@ -481,7 +481,6 @@ class admin_acl 'onExecute' => 'javaScript:app.admin.acl', ), 'delete' => array( - 'confirm' => 'Delete this access control', 'caption' => 'Delete', 'disableClass' => 'rowNoEdit', 'onExecute' => 'javaScript:app.admin.acl', diff --git a/admin/js/app.js b/admin/js/app.js index b7635e3825..3aa060d8c6 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -481,11 +481,7 @@ app.classes.admin = AppJS.extend( switch(_action.id) { case 'delete': - var app = egw.app_name(); // can be either admin or preferences! - if (app != 'admin') app = 'preferences'; - var className = app+'_acl'; - var request = egw.json(className+'::ajax_change_acl', [ids], this._acl_callback,this,false,this) - .sendRequest(); + this._acl_delete(ids); break; case 'add': @@ -499,6 +495,50 @@ app.classes.admin = AppJS.extend( } }, + _acl_delete: function(ids) + { + var app = egw.app_name(); // can be either admin or preferences! + if (app != 'admin') app = 'preferences'; + var className = app+'_acl'; + var callback = function(_button_id, _value) { + if(_button_id != et2_dialog.OK_BUTTON) return; + + var request = egw.json(className+'::ajax_change_acl', [ids,null,_value], this._acl_callback,this,false,this) + .sendRequest(); + }.bind(this); + + var modifications = {}; + var dialog_options = { + callback: callback, + title: this.egw.lang('Delete'), + buttons: et2_dialog.BUTTONS_OK_CANCEL, + value: { + content: {}, + sel_options: {}, + modifications: modifications, + readonlys: {} + }, + template: egw.webserverUrl+'/admin/templates/default/acl.delete.xet' + }; + + // Handle policy documentation tab here + if(this.egw.user('apps').policy) + { + dialog_options['width'] = 550; + dialog_options['height'] = 350, + modifications.tabs = { + add_tabs: true, + tabs: [{ + label: egw.lang('Documentation'), + template: 'policy.admin_cmd', + prepend: false + }] + }; + } + // Create the dialog + this.acl_dialog = et2_createWidget("dialog", dialog_options, et2_dialog._create_parent(app)); + }, + /** * Create the ACL edit dialog, including defaults & fetching what can be found * diff --git a/admin/templates/default/acl.delete.xet b/admin/templates/default/acl.delete.xet new file mode 100644 index 0000000000..de6a0257f3 --- /dev/null +++ b/admin/templates/default/acl.delete.xet @@ -0,0 +1,18 @@ + + + + + +