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; } 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/admin/layouts/index.js b/client/src/views/admin/layouts/index.js index 076713644e..ea86c2797b 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 () { 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); 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": {