diff --git a/application/Espo/Services/User.php b/application/Espo/Services/User.php index baab0fc2da..bd28df9ace 100644 --- a/application/Espo/Services/User.php +++ b/application/Espo/Services/User.php @@ -224,7 +224,9 @@ class User extends Record if (!is_null($newPassword) && !empty($data['sendAccessInfo'])) { if ($user->isActive()) { - $this->sendPassword($user, $newPassword); + try { + $this->sendPassword($user, $newPassword); + } catch (\Exception $e) {} } } diff --git a/client/src/ui.js b/client/src/ui.js index 901d4824c5..1aea7d0748 100644 --- a/client/src/ui.js +++ b/client/src/ui.js @@ -40,11 +40,11 @@ Espo.define('ui', [], function () { this.height = false; this.buttons = []; this.removeOnClose = true; - this.graggable = false; + this.draggable = false; this.container = 'body' this.onRemove = function () {}; - var params = ['className', 'backdrop', 'keyboard', 'closeButton', 'header', 'body', 'width', 'height', 'fitHeight', 'buttons', 'removeOnClose', 'graggable', 'container', 'onRemove']; + var params = ['className', 'backdrop', 'keyboard', 'closeButton', 'header', 'body', 'width', 'height', 'fitHeight', 'buttons', 'removeOnClose', 'draggable', 'container', 'onRemove']; params.forEach(function (param) { if (param in options) { this[param] = options[param]; @@ -99,7 +99,7 @@ Espo.define('ui', [], function () { } }.bind(this)); - if (this.graggable) { + if (this.draggable) { this.$el.find('header').css('cursor', 'pointer'); this.$el.draggable({ handle: 'header', diff --git a/client/src/views/modal.js b/client/src/views/modal.js index 1b24aec151..5f6c451016 100644 --- a/client/src/views/modal.js +++ b/client/src/views/modal.js @@ -53,6 +53,8 @@ Espo.define('views/modal', 'view', function (Dep) { escapeDisabled: false, + isDraggable: false, + events: { 'click .action': function (e) { var $target = $(e.currentTarget); @@ -135,6 +137,7 @@ Espo.define('views/modal', 'view', function (Dep) { width: this.width, keyboard: !this.escapeDisabled, fitHeight: this.fitHeight, + draggable: this.isDraggable, onRemove: function () { this.onDialogClose(); }.bind(this) diff --git a/client/src/views/user/detail.js b/client/src/views/user/detail.js index 6153d8f274..20926b8362 100644 --- a/client/src/views/user/detail.js +++ b/client/src/views/user/detail.js @@ -40,27 +40,28 @@ Espo.define('views/user/detail', 'views/detail', function (Dep) { action: "preferences" }); + if (!this.model.get('isPortalUser')) { + if ((this.getAcl().check('EmailAccountScope') && this.model.id == this.getUser().id) || this.getUser().isAdmin()) { + this.menu.buttons.push({ + name: 'emailAccounts', + label: "Email Accounts", + style: 'default', + action: "emailAccounts" + }); + } - if ((this.getAcl().check('EmailAccountScope') && this.model.id == this.getUser().id) || this.getUser().isAdmin()) { - this.menu.buttons.push({ - name: 'emailAccounts', - label: "Email Accounts", - style: 'default', - action: "emailAccounts" - }); - } - - if (this.model.id == this.getUser().id && this.getAcl().checkScope('ExternalAccount')) { - this.menu.buttons.push({ - name: 'externalAccounts', - label: 'External Accounts', - style: 'default', - action: "externalAccounts" - }); + if (this.model.id == this.getUser().id && this.getAcl().checkScope('ExternalAccount')) { + this.menu.buttons.push({ + name: 'externalAccounts', + label: 'External Accounts', + style: 'default', + action: "externalAccounts" + }); + } } } - if (this.getAcl().checkScope('Calendar')) { + if (this.getAcl().checkScope('Calendar') && !this.model.get('isPortalUser')) { var showActivities = this.getAcl().checkUserPermission(this.model); if (!showActivities) { if (this.getAcl().get('userPermission') === 'team') { diff --git a/client/src/views/user/record/detail.js b/client/src/views/user/record/detail.js index ab418e1d70..8e4712a580 100644 --- a/client/src/views/user/record/detail.js +++ b/client/src/views/user/record/detail.js @@ -57,6 +57,11 @@ Espo.define('views/user/record/detail', 'views/record/detail', function (Dep) { } } + if (this.model.get('isPortalUser')) { + this.hidePanel('activities'); + this.hidePanel('history'); + } + if (this.model.id == this.getUser().id) { this.listenTo(this.model, 'after:save', function () { this.getUser().set(this.model.toJSON());