From a71df0cff6641c8a897c216e8fed913a6c71275f Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 20 Nov 2020 09:52:54 +0200 Subject: [PATCH 1/4] fix layout --- client/src/views/admin/layouts/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/views/admin/layouts/index.js b/client/src/views/admin/layouts/index.js index c0a7c7103b..541d8e409e 100644 --- a/client/src/views/admin/layouts/index.js +++ b/client/src/views/admin/layouts/index.js @@ -219,7 +219,13 @@ define('views/admin/layouts/index', 'view', function (Dep) { }, navigate: function (scope, type) { - this.getRouter().navigate('#Admin/layouts/scope=' + scope + '&type=' + type, {trigger: false}); + var url = '#Admin/layouts/scope=' + scope + '&type=' + type; + + if (this.em) { + url += '&em=true'; + } + + this.getRouter().navigate(url, {trigger: false}); }, renderDefaultPage: function () { From 161859606a43f1c862d981baf5fea7567f80ce7a Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sat, 21 Nov 2020 14:20:14 +0200 Subject: [PATCH 2/4] ceanup --- application/Espo/ORM/QueryParams/Builder.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/application/Espo/ORM/QueryParams/Builder.php b/application/Espo/ORM/QueryParams/Builder.php index 373228376f..0fa3678923 100644 --- a/application/Espo/ORM/QueryParams/Builder.php +++ b/application/Espo/ORM/QueryParams/Builder.php @@ -37,13 +37,7 @@ interface Builder { /** * Build a query instance. - * @todo Uncomment when 7.4 is a min supported PHP version. Need the support of contravariant method parameters. + * @todo Uncomment when 7.4 is a min supported PHP version. */ //public function build() : Query; - - /** - * Clone an existing query for a further modification and building. - * @todo Uncomment when 7.4 is a min supported PHP version. Need the support of contravariant method parameters. - */ - //public function clone(Query $query) : self; } From 962d3a049cfd19a24e0f9a9c373a0e578ca252ae Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 26 Nov 2020 09:44:22 +0200 Subject: [PATCH 3/4] disable edit access to user email address --- .../Resources/metadata/entityAcl/User.json | 3 +++ client/src/views/user/record/detail.js | 27 +++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/application/Espo/Resources/metadata/entityAcl/User.json b/application/Espo/Resources/metadata/entityAcl/User.json index 9516590965..55b119d1a8 100644 --- a/application/Espo/Resources/metadata/entityAcl/User.json +++ b/application/Espo/Resources/metadata/entityAcl/User.json @@ -29,6 +29,9 @@ "isActive": { "nonAdminReadOnly": true }, + "emailAddress": { + "nonAdminReadOnly": true + }, "teams": { "nonAdminReadOnly": true }, diff --git a/client/src/views/user/record/detail.js b/client/src/views/user/record/detail.js index bde0db5175..14f391208b 100644 --- a/client/src/views/user/record/detail.js +++ b/client/src/views/user/record/detail.js @@ -126,7 +126,9 @@ define('views/user/record/detail', 'views/record/detail', function (Dep) { }, setupNonAdminFieldsAccess: function () { - if (this.getUser().isAdmin()) return; + if (this.getUser().isAdmin()) { + return; + } var nonAdminReadOnlyFieldList = [ 'userName', @@ -138,9 +140,30 @@ define('views/user/record/detail', 'views/record/detail', function (Dep) { 'portalRoles', 'contact', 'accounts', - 'type' + 'type', + 'emailAddress', ]; + nonAdminReadOnlyFieldList = nonAdminReadOnlyFieldList.filter( + function (item) { + if (!this.model.hasField(item)) { + return true; + } + + var aclDefs = this.getMetadata().get(['entityAcl', 'User', 'fields', item]); + + if (!aclDefs) { + return true; + } + + if (aclDefs.nonAdminReadOnly) { + return true; + } + + return false; + }.bind(this), + ); + nonAdminReadOnlyFieldList.forEach(function (field) { this.setFieldReadOnly(field, true); }, this); From 1071f8a04550d9378a32bf9ee9cb2999efb00987 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 26 Nov 2020 12:09:45 +0200 Subject: [PATCH 4/4] v --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index edf09ec766..1e6420ea9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "6.0.6", + "version": "6.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 800b9e15ce..11f3f5848e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "espocrm", - "version": "6.0.6", + "version": "6.0.7", "description": "", "main": "index.php", "repository": {