From 12759d78526b3ef4d9979eadcc0206accbe74075 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 8 Apr 2020 12:22:24 -0600 Subject: [PATCH] This was supposed to be part of 7462bd01773171aa8dbc9e7870be1f68f46f90e1 --- admin/js/app.js | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/admin/js/app.js b/admin/js/app.js index 4ddffb5bd6..7fb1c542a9 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -43,19 +43,19 @@ var AdminApp = /** @class */ (function (_super) { * @memberOf app.classes.admin */ function AdminApp() { - var _this = - // call parent - _super.call(this, 'admin') || this; - /** - * reference to iframe - * - * {et2_iframe} - */ - _this.iframe = null; - /** - * reference to nextmatch - * - * {et2_extension_nextmatch} + var _this = + // call parent + _super.call(this, 'admin') || this; + /** + * reference to iframe + * + * {et2_iframe} + */ + _this.iframe = null; + /** + * reference to nextmatch + * + * {et2_extension_nextmatch} */ _this.nm = null; /** @@ -562,6 +562,8 @@ var AdminApp = /** @class */ (function (_super) { // Load checkboxes & their values content.acl_rights = content.acl_rights ? parseInt(content.acl_rights) : null; jQuery.extend(content, { acl: [], right: [], label: [] }); + // Use this to make sure we get correct app translations + var app_egw = egw(content.acl_appname, window); for (var right in acl_rights[content.acl_appname]) { // only user himself is allowed to grant private (16) rights if (right == '16' && content['acl_account'] != egw.user('account_id')) { @@ -569,7 +571,7 @@ var AdminApp = /** @class */ (function (_super) { } content.acl.push(content.acl_rights & parseInt(right)); content.right.push(right); - content.label.push(egw.lang(acl_rights[content.acl_appname][right])); + content.label.push(app_egw.lang(acl_rights[content.acl_appname][right])); } } if (content.acl_account && !egw.user('apps')['admin']) { @@ -678,6 +680,17 @@ var AdminApp = /** @class */ (function (_super) { // Re-open the dialog this._acl_dialog(content); }; + /** + * Load the new application's lang files when the app filter is changed + */ + AdminApp.prototype.acl_app_change = function (event, nm) { + var appname = nm.getWidgetById('filter2').getValue() || ''; + if (appname) { + var app_egw = egw(appname); + app_egw.langRequireApp(window, appname); + nm.getRoot().setApiInstance(app_egw); + } + }; /** * Callback called on successfull call of serverside ACL handling * @@ -771,7 +784,7 @@ var AdminApp = /** @class */ (function (_super) { params.account_id = _senders[0].id.split('::').pop(); // get last :: separated part break; } - this.egw.open_link(this.egw.link('/index.php', params), 'admin', popup, 'admin'); + this.egw.open_link(this.egw.link('/index.php', params), 'admin', popup, 'admin'); }; /** * Submit statistic