diff --git a/application/Espo/Resources/i18n/en_US/Settings.json b/application/Espo/Resources/i18n/en_US/Settings.json index 4acff9e5a8..7672ef8dce 100644 --- a/application/Espo/Resources/i18n/en_US/Settings.json +++ b/application/Espo/Resources/i18n/en_US/Settings.json @@ -65,7 +65,8 @@ "dashboardLayout": "Dashboard Layout (default)", "siteUrl": "Site URL", "addressPreview": "Address Preview", - "addressFormat": "Address Format" + "addressFormat": "Address Format", + "notificationSoundsDisabled": "Disable Notification Sounds" }, "options": { "weekStart": { diff --git a/application/Espo/Resources/layouts/Settings/notifications.json b/application/Espo/Resources/layouts/Settings/notifications.json index 9e89c2df88..d48ebe4b10 100644 --- a/application/Espo/Resources/layouts/Settings/notifications.json +++ b/application/Espo/Resources/layouts/Settings/notifications.json @@ -2,7 +2,8 @@ { "label": "In-app Notifications", "rows": [ - [{"name": "assignmentNotificationsEntityList"}] + [{"name": "assignmentNotificationsEntityList"}], + [{"name": "notificationSoundsDisabled"}] ] }, { diff --git a/application/Espo/Resources/metadata/entityDefs/Settings.json b/application/Espo/Resources/metadata/entityDefs/Settings.json index 703b325d1a..50b4bced46 100644 --- a/application/Espo/Resources/metadata/entityDefs/Settings.json +++ b/application/Espo/Resources/metadata/entityDefs/Settings.json @@ -304,6 +304,9 @@ "notStorable": true, "readOnly": true, "view": "views/settings/fields/address-preview" + }, + "notificationSoundsDisabled": { + "type": "bool" } } } diff --git a/client/modules/crm/src/views/meeting/popup-notification.js b/client/modules/crm/src/views/meeting/popup-notification.js index d4f81007d4..6ff6f4d64b 100644 --- a/client/modules/crm/src/views/meeting/popup-notification.js +++ b/client/modules/crm/src/views/meeting/popup-notification.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -Espo.define('Crm:Views.Meeting.PopupNotification', 'Views.PopupNotification', function (Dep) { +Espo.define('crm:crm:views/meeting/popup-notification', 'views/popup-notification', function (Dep) { return Dep.extend({ @@ -34,7 +34,7 @@ Espo.define('Crm:Views.Meeting.PopupNotification', 'Views.PopupNotification', fu style: 'primary', - template: 'crm:meeting.popup-notification', + template: 'crm:meeting/popup-notification', closeButton: true, diff --git a/client/src/views/popup-notification.js b/client/src/views/popup-notification.js index 8b9399ee11..e38ac0a2ce 100644 --- a/client/src/views/popup-notification.js +++ b/client/src/views/popup-notification.js @@ -44,6 +44,8 @@ Espo.define('views/popup-notification', 'view', function (Dep) { var id = this.options.id; var containerSelector = this.containerSelector = '#' + id; + this.notificationSoundsDisabled = this.getConfig().get('notificationSoundsDisabled'); + this.on('render', function () { $(containerSelector).remove(); @@ -85,6 +87,8 @@ Espo.define('views/popup-notification', 'view', function (Dep) { }, playSound: function () { + if (this.notificationSoundsDisabled) return; + var html = '' + '