From 1e3c9dedfd4bd3806484bd7715886d10b27b7258 Mon Sep 17 00:00:00 2001 From: Saren Currie Date: Tue, 13 Oct 2015 10:51:16 +1300 Subject: [PATCH 01/38] Fixed typo: someones leave -> someone leaves --- i18n/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 5c22f986..f2393289 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -1117,7 +1117,7 @@ "recipients": { "menuTitle": "Recipients", "sectionTitle": "Recipients", - "header": "This panel lets you manage who will be notified when someones leave a message on this voicemail box. Click on \"Add New Recipient\" to add an e-mail address to the list", + "header": "This panel lets you manage who will be notified when someone leaves a message on this voicemail box. Click on \"Add New Recipient\" to add an e-mail address to the list", "create": "Add New Recipient" }, "__comment": "UI-975: Adding the prepend feature to numbers", From 18358bf5ab4889cd5cf520cacdb3a1b70b6ff175 Mon Sep 17 00:00:00 2001 From: Saren Currie Date: Tue, 13 Oct 2015 10:52:32 +1300 Subject: [PATCH 02/38] on -> in --- i18n/en-US.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index f2393289..50742570 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -1117,7 +1117,7 @@ "recipients": { "menuTitle": "Recipients", "sectionTitle": "Recipients", - "header": "This panel lets you manage who will be notified when someone leaves a message on this voicemail box. Click on \"Add New Recipient\" to add an e-mail address to the list", + "header": "This panel lets you manage who will be notified when someone leaves a message in this voicemail box. Click on \"Add New Recipient\" to add an e-mail address to the list", "create": "Add New Recipient" }, "__comment": "UI-975: Adding the prepend feature to numbers", From b60a705cb774effc6cd00ea4f40ce65985ee1ced Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Tue, 27 Oct 2015 15:23:31 -0700 Subject: [PATCH 03/38] UI-1851: Update walkthrough dashboard text --- i18n/en-US.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 50742570..1b06d19b 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -971,23 +971,23 @@ "__comment": "UI-1220: Adding a Main VMBox automatically when they first load the SmartPBX if they don't have one", "__version": "3.19", "mainVMBoxName": "Main Voicemail Box", - - "__comment": "UI-1604: Walkthrough dashboard", - "__version": "3.21", - "walkthrough": { - "steps": { - "1": "Review your entire office setup including your users, devices, numbers, main number and conference number", - "2": "Create and manage most of your services in the Users tab. Create new users, purchase port, and assign numbers, add an autoprovision devices, and manage User Features.", - "3": "Once you have created enough users, create user groups. This is extremely useful if you have users that work in the same department, such as a sales team.", - "4": "Create a main number for your business. Manage call handling with Virtual Receptionist, and route calls depending on Office Hours and Holidays" - } - }, "__comment": "UI-1210: Display the Main Faxbox number on the dashboard", "__version": "3.22", "faxingNumberLabel": "Faxbox Number", "__comment": "UI-1197: Display company directory on the dashboard", "__version": "3.22", - "directoryLabel": "Company Directory Users:" + "directoryLabel": "Company Directory Users:", + + "__comment": "UI-1851: Update walkthrough dashboard text", + "__version": "3.23", + "walkthrough": { + "steps": { + "1": "Welcome to SmartPBX, the easiest way to set up your office phone system! This is the main dashboard. From here you can see your users, devices, numbers all in one place!", + "2": "Setting up Users is a breeze in SmartPBX. Create and manage most of your services in the Users tab. Create new users, purchase port, and assign numbers, add an autoprovision devices, and manage User Features.", + "3": "Once you have created enough users, create user groups. This is extremely useful if you have users that work in the same department, such as a sales team.", + "4": "Main Number services are highly important for your business! Manage call handling with Virtual Receptionist, and route calls depending on Office Hours and Holidays." + } + } }, "__comment": "UI-299, v3.19_s2: Added the Feature Codes tab to SmartPBX.", From 7a2247ed6122c4de253b93d253eb5ef272a58e59 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Mon, 2 Nov 2015 11:32:04 -0800 Subject: [PATCH 04/38] UI-1855: On the dashboard, hide e911 related actions when the feature is disabled on the account --- submodules/myOffice/myOffice.js | 104 ++++++++++++++++++------------ views/myOffice-callerIdPopup.html | 2 + 2 files changed, 65 insertions(+), 41 deletions(-) diff --git a/submodules/myOffice/myOffice.js b/submodules/myOffice/myOffice.js index 114e6596..d8205250 100644 --- a/submodules/myOffice/myOffice.js +++ b/submodules/myOffice/myOffice.js @@ -523,11 +523,12 @@ define(function(require){ if(channelsArray.indexOf(val.bridge_id) < 0) { channelsArray.push(val.bridge_id); } - }) + }); if( data.mainNumbers && data.mainNumbers.length > 0 + && monster.util.isNumberFeatureEnabled('e911') && ( !('caller_id' in data.account) || !('emergency' in data.account.caller_id) @@ -539,7 +540,7 @@ define(function(require){ data.topMessage = { class: 'btn-danger', message: self.i18n.active().myOffice.missingE911Message - } + }; } data.totalChannels = channelsArray.length; @@ -754,35 +755,40 @@ define(function(require){ var self = this, parent = args.parent, myOfficeData = args.myOfficeData, + isE911Enabled = monster.util.isNumberFeatureEnabled('e911'), templateData = { + isE911Enabled: isE911Enabled, mainNumbers: myOfficeData.mainNumbers, selectedMainNumber: 'caller_id' in myOfficeData.account && 'external' in myOfficeData.account.caller_id ? myOfficeData.account.caller_id.external.number || 'none' : 'none' }, popupTemplate = $(monster.template(self, 'myOffice-callerIdPopup', templateData)), - e911Form = popupTemplate.find('.emergency-form > form'), popup = monster.ui.dialog(popupTemplate, { title: self.i18n.active().myOffice.callerId.title, position: ['center', 20] }); - monster.ui.validate(e911Form, { - messages: { - 'postal_code': { - required: '*' - }, - 'street_address': { - required: '*' - }, - 'locality': { - required: '*' - }, - 'region': { - required: '*' + if (isE911Enabled) { + var e911Form = popupTemplate.find('.emergency-form > form'); + + monster.ui.validate(e911Form, { + messages: { + 'postal_code': { + required: '*' + }, + 'street_address': { + required: '*' + }, + 'locality': { + required: '*' + }, + 'region': { + required: '*' + } } - } - }); + }); - monster.ui.valid(e911Form); + monster.ui.valid(e911Form); + } self.myOfficeCallerIdPopupBindEvents({ parent: parent, @@ -814,18 +820,20 @@ define(function(require){ callerIdNameInput.val(""); } - if("dash_e911" in numberData) { - emergencyZipcodeInput.val(numberData.dash_e911.postal_code); - emergencyAddress1Input.val(numberData.dash_e911.street_address); - emergencyAddress2Input.val(numberData.dash_e911.extended_address); - emergencyCityInput.val(numberData.dash_e911.locality); - emergencyStateInput.val(numberData.dash_e911.region); - } else { - emergencyZipcodeInput.val(""); - emergencyAddress1Input.val(""); - emergencyAddress2Input.val(""); - emergencyCityInput.val(""); - emergencyStateInput.val(""); + if (monster.util.isNumberFeatureEnabled('e911')) { + if("dash_e911" in numberData) { + emergencyZipcodeInput.val(numberData.dash_e911.postal_code); + emergencyAddress1Input.val(numberData.dash_e911.street_address); + emergencyAddress2Input.val(numberData.dash_e911.extended_address); + emergencyCityInput.val(numberData.dash_e911.locality); + emergencyStateInput.val(numberData.dash_e911.region); + } else { + emergencyZipcodeInput.val(""); + emergencyAddress1Input.val(""); + emergencyAddress2Input.val(""); + emergencyCityInput.val(""); + emergencyStateInput.val(""); + } } }); } @@ -860,7 +868,6 @@ define(function(require){ popupTemplate.find('.save').on('click', function() { var callerIdNumber = callerIdNumberSelect.val(), - e911Form = popupTemplate.find('.emergency-form > form'), updateAccount = function() { self.myOfficeUpdateAccount(account, function(updatedAccount) { popup.dialog('close').remove(); @@ -868,9 +875,8 @@ define(function(require){ parent: parent }); }); - }; - if(callerIdNumber) { - if(monster.ui.valid(e911Form)) { + }, + setCallerId = function () { var callerIdName = callerIdNameInput.val(); account.caller_id = $.extend(true, {}, account.caller_id, { @@ -889,16 +895,32 @@ define(function(require){ delete numberData.cnam; } - $.extend(true, numberData, { - dash_e911: monster.ui.getFormData(e911Form[0]) - }); - self.myOfficeUpdateNumber(numberData, function(data) { updateAccount(); }); }); - } else { - monster.ui.alert(self.i18n.active().myOffice.callerId.mandatoryE911Alert); + }, + e911Form; + + if (monster.util.isNumberFeatureEnabled('e911')) { + e911Form = popupTemplate.find('.emergency-form > form'); + } + + if(callerIdNumber) { + if (monster.util.isNumberFeatureEnabled('e911')) { + if (monster.ui.valid(e911Form)) { + $.extend(true, numberData, { + dash_e911: monster.ui.getFormData(e911Form[0]) + }); + + setCallerId(); + } + else { + monster.ui.alert(self.i18n.active().myOffice.callerId.mandatoryE911Alert); + } + } + else { + setCallerId(); } } else { delete account.caller_id.external; diff --git a/views/myOffice-callerIdPopup.html b/views/myOffice-callerIdPopup.html index 86673a40..c05d647c 100644 --- a/views/myOffice-callerIdPopup.html +++ b/views/myOffice-callerIdPopup.html @@ -33,6 +33,7 @@ {{/monsterText}} + {{#if isE911Enabled}}
{{ i18n.myOffice.callerId.emergencyLabel }}
@@ -67,6 +68,7 @@

{{ i18n.myOffice.callerId.emergencyHelp2 }}

{{/monsterText}}
+ {{/if}}
From 4ddb82b33429c1e8e05d9ca3c3e0553f82dcd281 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Mon, 2 Nov 2015 13:26:04 -0800 Subject: [PATCH 05/38] UI-1855: On Users management, hide e911 feature when disabled on the account --- submodules/users/users.js | 52 ++++++++++++++++++++------------- views/users-numbers.html | 4 ++- views/users-numbersItemRow.html | 4 ++- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/submodules/users/users.js b/submodules/users/users.js index 19fcc5a4..e1e52a00 100644 --- a/submodules/users/users.js +++ b/submodules/users/users.js @@ -1053,7 +1053,10 @@ define(function(require){ template .find('.list-assigned-items') - .append($(monster.template(self, 'users-numbersItemRow', { number: val }))); + .append($(monster.template(self, 'users-numbersItemRow', { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), + number: val + }))); extraSpareNumbers = _.without(extraSpareNumbers, val.phoneNumber); }); @@ -1080,7 +1083,10 @@ define(function(require){ number.viewFeatures = $.extend(true, {}, features); number.phoneNumber = number.id; - var rowTemplate = monster.template(self, 'users-numbersItemRow', { number: number }); + var rowTemplate = monster.template(self, 'users-numbersItemRow', { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), + number: number + }); monster.ui.tooltips(rowTemplate); @@ -1164,28 +1170,30 @@ define(function(require){ } }); - template.on('click', '.e911-number', function() { - var e911Cell = $(this).parents('.item-row').first(), - phoneNumber = e911Cell.data('id'); + if (monster.util.isNumberFeatureEnabled('e911')) { + template.on('click', '.e911-number', function() { + var e911Cell = $(this).parents('.item-row').first(), + phoneNumber = e911Cell.data('id'); - if(phoneNumber) { - var args = { - phoneNumber: phoneNumber, - callbacks: { - success: function(data) { - if(!($.isEmptyObject(data.data.dash_e911))) { - e911Cell.find('.features i.feature-dash_e911').addClass('active'); - } - else { - e911Cell.find('.features i.feature-dash_e911').removeClass('active'); + if(phoneNumber) { + var args = { + phoneNumber: phoneNumber, + callbacks: { + success: function(data) { + if(!($.isEmptyObject(data.data.dash_e911))) { + e911Cell.find('.features i.feature-dash_e911').addClass('active'); + } + else { + e911Cell.find('.features i.feature-dash_e911').removeClass('active'); + } } } - } - }; + }; - monster.pub('common.e911.renderPopup', args); - } - }); + monster.pub('common.e911.renderPopup', args); + } + }); + } template.on('click', '.prepend-number', function() { var prependCell = $(this).parents('.item-row').first(), @@ -2608,7 +2616,9 @@ define(function(require){ self.usersGetNumbersData(userId, function(results) { self.usersFormatNumbersData(userId, results, function(results) { - template = $(monster.template(self, 'users-numbers', results)); + template = $(monster.template(self, 'users-numbers', $.extend(true, {}, results, { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911') + }))); callback && callback(template, results); }); diff --git a/views/users-numbers.html b/views/users-numbers.html index 4fd69bf3..0e02f272 100644 --- a/views/users-numbers.html +++ b/views/users-numbers.html @@ -15,7 +15,9 @@ diff --git a/views/users-numbersItemRow.html b/views/users-numbersItemRow.html index be3c9b42..de882b14 100644 --- a/views/users-numbersItemRow.html +++ b/views/users-numbersItemRow.html @@ -8,7 +8,9 @@ From 8fb3e7b1b937d9f779e6b329c96b7e88bb5f09ba Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Mon, 2 Nov 2015 13:26:47 -0800 Subject: [PATCH 06/38] UI-1855: On Groups management, hide e911 feature when disabled on the account --- submodules/groups/groups.js | 52 +++++++++++++++++++------------- views/groups-numbers.html | 4 ++- views/groups-numbersItemRow.html | 4 ++- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/submodules/groups/groups.js b/submodules/groups/groups.js index f9049f31..68c1a4b5 100644 --- a/submodules/groups/groups.js +++ b/submodules/groups/groups.js @@ -426,7 +426,9 @@ define(function(require){ self.groupsGetNumbersData(groupId, function(data) { self.groupsFormatNumbersData(data, function(data) { - template = $(monster.template(self, 'groups-numbers', data)); + template = $(monster.template(self, 'groups-numbers', $.extend(true, {}, data, { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911') + }))); self.groupsBindNumbers(template, data); @@ -1038,28 +1040,30 @@ define(function(require){ } }); - template.on('click', '.e911-number', function() { - var e911Cell = $(this).parents('.item-row').first(), - phoneNumber = e911Cell.data('id'); + if (monster.util.isNumberFeatureEnabled('e911')) { + template.on('click', '.e911-number', function() { + var e911Cell = $(this).parents('.item-row').first(), + phoneNumber = e911Cell.data('id'); - if(phoneNumber) { - var args = { - phoneNumber: phoneNumber, - callbacks: { - success: function(data) { - if(!($.isEmptyObject(data.data.dash_e911))) { - e911Cell.find('.features i.feature-dash_e911').addClass('active'); - } - else { - e911Cell.find('.features i.feature-dash_e911').removeClass('active'); + if(phoneNumber) { + var args = { + phoneNumber: phoneNumber, + callbacks: { + success: function(data) { + if(!($.isEmptyObject(data.data.dash_e911))) { + e911Cell.find('.features i.feature-dash_e911').addClass('active'); + } + else { + e911Cell.find('.features i.feature-dash_e911').removeClass('active'); + } } } - } - }; + }; - monster.pub('common.e911.renderPopup', args); - } - }); + monster.pub('common.e911.renderPopup', args); + } + }); + } template.on('click', '.callerId-number', function() { var cnamCell = $(this).parents('.item-row').first(), @@ -1130,7 +1134,10 @@ define(function(require){ template .find('.list-assigned-items') - .append($(monster.template(self, 'groups-numbersItemRow', { number: val }))); + .append($(monster.template(self, 'groups-numbersItemRow', { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), + number: val + }))); extraSpareNumbers = _.without(extraSpareNumbers, val.phoneNumber); }); @@ -1159,7 +1166,10 @@ define(function(require){ number.viewFeatures = $.extend(true, {}, features); number.phoneNumber = number.id; - var rowTemplate = monster.template(self, 'groups-numbersItemRow', { number: number }); + var rowTemplate = monster.template(self, 'groups-numbersItemRow', { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), + number: number + }); monster.ui.tooltips(rowTemplate); diff --git a/views/groups-numbers.html b/views/groups-numbers.html index f482fe56..1a2ab642 100644 --- a/views/groups-numbers.html +++ b/views/groups-numbers.html @@ -15,7 +15,9 @@ diff --git a/views/groups-numbersItemRow.html b/views/groups-numbersItemRow.html index be3c9b42..de882b14 100644 --- a/views/groups-numbersItemRow.html +++ b/views/groups-numbersItemRow.html @@ -8,7 +8,9 @@ From 5804a02a1df060ce32d548cfc5e28fd5dc84eecf Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Mon, 2 Nov 2015 13:27:20 -0800 Subject: [PATCH 07/38] UI-1855: On Devices management, hide e911 related actions when the feature is disabled on the account --- submodules/devices/devices.js | 4 ++- views/devices-ata.html | 36 +++++++++++++++------------ views/devices-fax.html | 36 +++++++++++++++------------ views/devices-mobile.html | 36 +++++++++++++++------------ views/devices-sip_device.html | 46 +++++++++++++++++++---------------- views/devices-softphone.html | 46 +++++++++++++++++++---------------- 6 files changed, 113 insertions(+), 91 deletions(-) diff --git a/submodules/devices/devices.js b/submodules/devices/devices.js index 4ade4b77..df31f5b1 100644 --- a/submodules/devices/devices.js +++ b/submodules/devices/devices.js @@ -269,7 +269,9 @@ define(function(require){ mode = data.id ? 'edit' : 'add', type = data.device_type, popupTitle = mode === 'edit' ? monster.template(self, '!' + self.i18n.active().devices[type].editTitle, { name: data.name }) : self.i18n.active().devices[type].addTitle, - templateDevice = $(monster.template(self, 'devices-'+type, data)), + templateDevice = $(monster.template(self, 'devices-'+type, $.extend(true, {}, data, { + isE911Enabled: monster.util.isNumberFeatureEnabled('e911') + }))), deviceForm = templateDevice.find('#form_device'); if (data.hasOwnProperty('provision') && data.provision.hasOwnProperty('feature_keys')) { diff --git a/views/devices-ata.html b/views/devices-ata.html index 0b49a58d..4b8fab60 100644 --- a/views/devices-ata.html +++ b/views/devices-ata.html @@ -23,7 +23,9 @@ @@ -113,22 +115,24 @@
-
-
- {{ i18n.devices.popupSettings.callerId.sectionTitle }} -
- - {{#if extra.hasE911Numbers}} -
- -
+ {{#if isE911Enabled}} +
+
+ {{ i18n.devices.popupSettings.callerId.sectionTitle }}
- {{else}} - {{#monsterText 'error'}} - {{ i18n.devices.popupSettings.callerId.noE911Numbers }} - {{/monsterText}} - {{/if}} -
+ + {{#if extra.hasE911Numbers}} +
+ +
+
+ {{else}} + {{#monsterText 'error'}} + {{ i18n.devices.popupSettings.callerId.noE911Numbers }} + {{/monsterText}} + {{/if}} +
+ {{/if}}
diff --git a/views/devices-fax.html b/views/devices-fax.html index 677b0892..6639ed48 100644 --- a/views/devices-fax.html +++ b/views/devices-fax.html @@ -23,7 +23,9 @@ @@ -133,22 +135,24 @@
-
-
- {{ i18n.devices.popupSettings.callerId.sectionTitle }} -
- - {{#if extra.hasE911Numbers}} -
- -
+ {{#if isE911Enabled}} +
+
+ {{ i18n.devices.popupSettings.callerId.sectionTitle }}
- {{else}} - {{#monsterText 'error'}} - {{ i18n.devices.popupSettings.callerId.noE911Numbers }} - {{/monsterText}} - {{/if}} -
+ + {{#if extra.hasE911Numbers}} +
+ +
+
+ {{else}} + {{#monsterText 'error'}} + {{ i18n.devices.popupSettings.callerId.noE911Numbers }} + {{/monsterText}} + {{/if}} +
+ {{/if}}
diff --git a/views/devices-mobile.html b/views/devices-mobile.html index 9073202f..8715c621 100644 --- a/views/devices-mobile.html +++ b/views/devices-mobile.html @@ -24,7 +24,9 @@
  • {{ i18n.devices.popupSettings.audio.menuTitle }}
  • {{ i18n.devices.popupSettings.video.menuTitle }}
  • {{ i18n.devices.popupSettings.restrictions.menuTitle }}
  • -
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • + {{#if isE911Enabled}} +
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • + {{/if}}
  • {{ i18n.devices.popupSettings.miscellaneous.menuTitle }}
  • @@ -135,22 +137,24 @@ -
    -
    - {{ i18n.devices.popupSettings.callerId.sectionTitle }} -
    - - {{#if extra.hasE911Numbers}} -
    - -
    + {{#if isE911Enabled}} +
    +
    + {{ i18n.devices.popupSettings.callerId.sectionTitle }}
    - {{else}} - {{#monsterText 'error'}} - {{ i18n.devices.popupSettings.callerId.noE911Numbers }} - {{/monsterText}} - {{/if}} -
    + + {{#if extra.hasE911Numbers}} +
    + +
    +
    + {{else}} + {{#monsterText 'error'}} + {{ i18n.devices.popupSettings.callerId.noE911Numbers }} + {{/monsterText}} + {{/if}} +
    + {{/if}}
    diff --git a/views/devices-sip_device.html b/views/devices-sip_device.html index 3e338afa..9c6529b9 100644 --- a/views/devices-sip_device.html +++ b/views/devices-sip_device.html @@ -32,7 +32,9 @@
  • {{ i18n.devices.popupSettings.audio.menuTitle }}
  • {{ i18n.devices.popupSettings.video.menuTitle }}
  • {{ i18n.devices.popupSettings.restrictions.menuTitle }}
  • -
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • + {{#if isE911Enabled}} +
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • + {{/if}}
  • {{ i18n.devices.popupSettings.miscellaneous.menuTitle }}
  • {{#if provision.feature_keys}}
  • {{ i18n.devices.popupSettings.featureKeys.menuTitle }}
  • @@ -172,28 +174,30 @@
    -
    -
    - {{ i18n.devices.popupSettings.callerId.sectionTitle }} -
    - - {{#if extra.hasE911Numbers}} -
    - -
    + {{#if isE911Enabled}} +
    +
    + {{ i18n.devices.popupSettings.callerId.sectionTitle }}
    -
    - -
    -

    + + {{#if extra.hasE911Numbers}} +
    + +
    -
    - {{else}} - {{#monsterText 'error'}} - {{ i18n.devices.popupSettings.callerId.noE911Numbers }} - {{/monsterText}} - {{/if}} -
    +
    + +
    +

    +
    +
    + {{else}} + {{#monsterText 'error'}} + {{ i18n.devices.popupSettings.callerId.noE911Numbers }} + {{/monsterText}} + {{/if}} +
    + {{/if}}
    diff --git a/views/devices-softphone.html b/views/devices-softphone.html index 9d51936d..09c7564e 100644 --- a/views/devices-softphone.html +++ b/views/devices-softphone.html @@ -24,7 +24,9 @@
  • {{ i18n.devices.popupSettings.audio.menuTitle }}
  • {{ i18n.devices.popupSettings.video.menuTitle }}
  • {{ i18n.devices.popupSettings.restrictions.menuTitle }}
  • -
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • + {{#if isE911Enabled}} +
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • + {{/if}}
  • {{ i18n.devices.popupSettings.miscellaneous.menuTitle }}
  • @@ -129,28 +131,30 @@
    -
    -
    - {{ i18n.devices.popupSettings.callerId.sectionTitle }} -
    - - {{#if extra.hasE911Numbers}} -
    - -
    + {{#if isE911Enabled}} +
    +
    + {{ i18n.devices.popupSettings.callerId.sectionTitle }}
    -
    - -
    -

    + + {{#if extra.hasE911Numbers}} +
    + +
    -
    - {{else}} - {{#monsterText 'error'}} - {{ i18n.devices.popupSettings.callerId.noE911Numbers }} - {{/monsterText}} - {{/if}} -
    +
    + +
    +

    +
    +
    + {{else}} + {{#monsterText 'error'}} + {{ i18n.devices.popupSettings.callerId.noE911Numbers }} + {{/monsterText}} + {{/if}} +
    + {{/if}}
    From 3cf3b280f980c1a6f09a09bcc6862d8d05e97df5 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Mon, 2 Nov 2015 15:35:25 -0800 Subject: [PATCH 08/38] UI-1855: On Main Number management, hide e911 feature when disabled on the account --- submodules/strategy/strategy.js | 42 ++++++++++++++++++--------------- views/strategy-numbers.html | 4 +++- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/submodules/strategy/strategy.js b/submodules/strategy/strategy.js index 98944b2a..4445654d 100644 --- a/submodules/strategy/strategy.js +++ b/submodules/strategy/strategy.js @@ -399,6 +399,7 @@ define(function(require){ return ret; } }), + isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), spareLinkEnabled: (_.countBy(accountNumbers, function(number) {return number.used_by ? 'assigned' : 'spare';})['spare'] > 0) }, template = $(monster.template(self, 'strategy-'+templateName, templateData)); @@ -750,9 +751,10 @@ define(function(require){ var $this = $(this), numberToRemove = $this.data('number'), e911Feature = $this.data('e911'), + isE911Enabled = monster.util.isNumberFeatureEnabled('e911'), indexToRemove = strategyData.callflows["MainCallflow"].numbers.indexOf(numberToRemove.toString()); - if(e911Feature === 'active' && container.find('.number-element .remove-number[data-e911="active"]').length === 1) { + if(e911Feature === 'active' && container.find('.number-element .remove-number[data-e911="active"]').length === 1 && isE911Enabled) { monster.ui.alert('error', self.i18n.active().strategy.alertMessages.lastE911Error); } else if(indexToRemove >= 0) { self.strategyGetNumber(numberToRemove, function(dataNumber) { @@ -871,28 +873,30 @@ define(function(require){ } }); - container.on('click', '.number-element .e911-number', function() { - var e911Cell = $(this).parents('.number-element').first(), - phoneNumber = e911Cell.find('.remove-number').data('number'); + if (monster.util.isNumberFeatureEnabled('e911')) { + container.on('click', '.number-element .e911-number', function() { + var e911Cell = $(this).parents('.number-element').first(), + phoneNumber = e911Cell.find('.remove-number').data('number'); - if(phoneNumber) { - var args = { - phoneNumber: phoneNumber, - callbacks: { - success: function(data) { - if(!($.isEmptyObject(data.data.dash_e911))) { - e911Cell.find('.features i.feature-dash_e911').addClass('active'); - } - else { - e911Cell.find('.features i.feature-dash_e911').removeClass('active'); + if(phoneNumber) { + var args = { + phoneNumber: phoneNumber, + callbacks: { + success: function(data) { + if(!($.isEmptyObject(data.data.dash_e911))) { + e911Cell.find('.features i.feature-dash_e911').addClass('active'); + } + else { + e911Cell.find('.features i.feature-dash_e911').removeClass('active'); + } } } - } - }; + }; - monster.pub('common.e911.renderPopup', args); - } - }); + monster.pub('common.e911.renderPopup', args); + } + }); + } container.on('click', '.number-element .prepend-number', function() { var prependCell = $(this).parents('.number-element').first(), diff --git a/views/strategy-numbers.html b/views/strategy-numbers.html index d3d909f3..3e4c0dff 100644 --- a/views/strategy-numbers.html +++ b/views/strategy-numbers.html @@ -15,7 +15,9 @@ From 46f93c2942b65c60dc5c358fb24b0f5690b95d3d Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Tue, 3 Nov 2015 09:05:54 -0800 Subject: [PATCH 09/38] UI-1855: Fix tooltip bug when buying numbers --- submodules/groups/groups.js | 11 ++++++----- submodules/users/users.js | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/submodules/groups/groups.js b/submodules/groups/groups.js index 68c1a4b5..634ccd46 100644 --- a/submodules/groups/groups.js +++ b/submodules/groups/groups.js @@ -1148,7 +1148,7 @@ define(function(require){ template.find('.spare-link').addClass('disabled'); } } - } + }; monster.pub('common.numbers.dialogSpare', args); }); @@ -1160,16 +1160,15 @@ define(function(require){ searchType: $(this).data('type'), callbacks: { success: function(numbers) { - monster.pub('common.numbers.getListFeatures', function(features) { _.each(numbers, function(number, k) { number.viewFeatures = $.extend(true, {}, features); number.phoneNumber = number.id; - var rowTemplate = monster.template(self, 'groups-numbersItemRow', { + var rowTemplate = $(monster.template(self, 'groups-numbersItemRow', { isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), number: number - }); + })); monster.ui.tooltips(rowTemplate); @@ -1464,7 +1463,9 @@ define(function(require){ number.localityEnabled = 'locality' in number ? true : false; _.each(number.features, function(feature) { - number.viewFeatures[feature].active = 'active'; + if(feature in number.viewFeatures) { + number.viewFeatures[feature].active = 'active'; + } }); if(number.used_by === '') { diff --git a/submodules/users/users.js b/submodules/users/users.js index e1e52a00..dad98a68 100644 --- a/submodules/users/users.js +++ b/submodules/users/users.js @@ -1074,6 +1074,7 @@ define(function(require){ template.on('click', '.actions .buy-link', function(e) { e.preventDefault(); + monster.pub('common.buyNumbers', { searchType: $(this).data('type'), callbacks: { @@ -1083,10 +1084,10 @@ define(function(require){ number.viewFeatures = $.extend(true, {}, features); number.phoneNumber = number.id; - var rowTemplate = monster.template(self, 'users-numbersItemRow', { + var rowTemplate = $(monster.template(self, 'users-numbersItemRow', { isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), number: number - }); + })); monster.ui.tooltips(rowTemplate); From e073912ae07708632a992ed7f3729aa3eeb4d6d6 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Tue, 10 Nov 2015 14:37:32 -0800 Subject: [PATCH 10/38] OOB: Add a specific CSS class to target device edition popup --- submodules/devices/devices.css | 72 +++++++++++++++++----------------- submodules/devices/devices.js | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/submodules/devices/devices.css b/submodules/devices/devices.css index 5703af91..fce1e714 100644 --- a/submodules/devices/devices.css +++ b/submodules/devices/devices.css @@ -223,28 +223,28 @@ overflow: visible; } -.edit-device { +.voip-edit-device-popup .edit-device { width: 700px; } -.edit-device .actions { +.voip-edit-device-popup .edit-device .actions { border-top: 1px solid #CCCCCC; height: 30px; line-height: 30px; padding: 15px; } -.edit-device .actions button { +.voip-edit-device-popup .edit-device .actions button { margin-left: 10px; } -.edit-device .title-bar { +.voip-edit-device-popup .edit-device .title-bar { border-bottom: 1px solid #ccc; margin-bottom: 20px; padding: 15px 0; } -.edit-device .title-bar .device-title > div { +.voip-edit-device-popup .edit-device .title-bar .device-title > div { display: inline-block; float: left; font-size: 18px; @@ -253,27 +253,27 @@ margin-left: 40px; } -.edit-device .title-bar .device-title .device-icon { +.voip-edit-device-popup .edit-device .title-bar .device-title .device-icon { height: 75px; line-height: 75px; } -.edit-device .title-bar .device-title .device-icon > i { +.voip-edit-device-popup .edit-device .title-bar .device-title .device-icon > i { font-size: 48px; vertical-align: middle; } -.edit-device .title-bar .device-title .device-image { +.voip-edit-device-popup .edit-device .title-bar .device-title .device-image { border-radius: 2px; border: 1px solid #CCC; } -.edit-device .title-bar .nav-pills { +.voip-edit-device-popup .edit-device .title-bar .nav-pills { margin-top: 24px; margin-right: 15px; } -.edit-device .content .tabs-section .title { +.voip-edit-device-popup .edit-device .content .tabs-section .title { color: #22a5ff; font-size: 24px; margin-bottom: 30px; @@ -281,57 +281,57 @@ text-shadow: 1px 0 1px #CCCCCC; } -.edit-device .content .tabs-section .helper { +.voip-edit-device-popup .edit-device .content .tabs-section .helper { position: relative; margin: 0 40px 15px 40px; } -.edit-device .content .tabs-section .helper i { +.voip-edit-device-popup .edit-device .content .tabs-section .helper i { position: absolute; top: 0; left: -25px; } -.edit-device .content .tabs-section .number-address { +.voip-edit-device-popup .edit-device .content .tabs-section .number-address { display: none; } -.edit-device .help-box.red-box { - margin: 10px 25px +.voip-edit-device-popup .edit-device .help-box.red-box { + margin: 10px 25px; } -.edit-device .content #form_device .displayed-realm { +.voip-edit-device-popup .edit-device .content #form_device .displayed-realm { line-height: 30px; font-weight: bold; } -.edit-device .restrictions-container { +.voip-edit-device-popup .edit-device .restrictions-container { position: relative; } -.edit-device .restriction-matcher-div { +.voip-edit-device-popup .edit-device .restriction-matcher-div { margin-right: 40px; float: right; } -.edit-device .restriction-matcher-input { +.voip-edit-device-popup .edit-device .restriction-matcher-input { width: 120px; margin-right: 10px; margin-left: 5px; } -.edit-device .restriction-matcher-sign { +.voip-edit-device-popup .edit-device .restriction-matcher-sign { margin-left: 20px; width: 25px; vertical-align: middle; display: none; } -.edit-device .restriction-list { +.voip-edit-device-popup .edit-device .restriction-list { display: inline-block; } -.edit-device .restriction-message { +.voip-edit-device-popup .edit-device .restriction-message { width: 275px; margin: 0 0 0 30px !important; padding: 10px; @@ -339,71 +339,71 @@ display: none; } -.edit-device .disabled-restrictions-info { +.voip-edit-device-popup .edit-device .disabled-restrictions-info { width: 270px; position: absolute; bottom: 0px; right: 40px; } -.edit-device .restriction-list .restriction-line.disabled .control-label, -.edit-device .restriction-list .restriction-line.disabled .control-label > i { +.voip-edit-device-popup .edit-device .restriction-list .restriction-line.disabled .control-label, +.voip-edit-device-popup .edit-device .restriction-list .restriction-line.disabled .control-label > i { cursor: default; color: #aaa; } -.edit-device .feature-key-value { +.voip-edit-device-popup .edit-device .feature-key-value { display: none; margin-left: 20px; } -.edit-device .feature-key-value.active { +.voip-edit-device-popup .edit-device .feature-key-value.active { display: inline-block; } -.edit-device .feature-key-value label { +.voip-edit-device-popup .edit-device .feature-key-value label { display: inline-block; margin-right: 10px; } /* Codecs selector */ -.edit-device .content .codec-selector .box-selector { +.voip-edit-device-popup .edit-device .content .codec-selector .box-selector { float: left; width: 300px; } -.edit-device .content .codec-selector .box-selector:first-child { +.voip-edit-device-popup .edit-device .content .codec-selector .box-selector:first-child { margin-left: 30px; margin-right: 40px; } -.edit-device .content .codec-selector .box-selector ul { +.voip-edit-device-popup .edit-device .content .codec-selector .box-selector ul { height: 328px; overflow: auto; } -.edit-device .content #video_codec_selector .box-selector ul { +.voip-edit-device-popup .edit-device .content #video_codec_selector .box-selector ul { min-height: 123px; } /* RTP Special CSS */ -.edit-device .content .rtp-line > * { +.voip-edit-device-popup .edit-device .content .rtp-line > * { float: left; font-size: 14px; margin-right: 10px; } -.edit-device .form-horizontal .control-label.checkbox { +.voip-edit-device-popup .edit-device .form-horizontal .control-label.checkbox { width: inherit; margin-left: 35px; padding-top: 3px; } /* Restart Button */ -.edit-device #restart_device { +.voip-edit-device-popup .edit-device #restart_device { margin-left: 10px; } /* Special checkbox case */ -.edit-device .form-horizontal .control-label.checkbox-basic { +.voip-edit-device-popup .edit-device .form-horizontal .control-label.checkbox-basic { margin-left: 160px; } \ No newline at end of file diff --git a/submodules/devices/devices.js b/submodules/devices/devices.js index df31f5b1..281877be 100644 --- a/submodules/devices/devices.js +++ b/submodules/devices/devices.js @@ -507,7 +507,7 @@ define(function(require){ var popup = monster.ui.dialog(templateDevice, { position: ['center', 20], title: popupTitle, - dialogClass: 'overflow-visible' + dialogClass: 'voip-edit-device-popup overflow-visible' }); }, From 38f54593f97762d4ebb9404af7be033fcf624b3a Mon Sep 17 00:00:00 2001 From: Jean-Roch Maitre Date: Thu, 12 Nov 2015 14:20:23 -0800 Subject: [PATCH 11/38] UI-1886: Adding media option to Virtual Receptionnist and Call options --- i18n/en-US.json | 5 ++- submodules/strategy/strategy.js | 60 ++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 1b06d19b..d173cdbc 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -797,7 +797,10 @@ "directory": "Directory", "__comment": "UI-1742: Can now select a callflow created in Advanced Callflows in Main Number", "__version": "3.22", - "advancedCallflows": "Advanced Callflows" + "advancedCallflows": "Advanced Callflows", + "__comment": "UI-1886: Can now select a media in virtual receptionist", + "__version": "3.23", + "media": "Media" }, "confirmMessages": { "deleteHoliday": "This holiday will be permanently deleted. Continue?", diff --git a/submodules/strategy/strategy.js b/submodules/strategy/strategy.js index 4445654d..60fc5c5a 100644 --- a/submodules/strategy/strategy.js +++ b/submodules/strategy/strategy.js @@ -367,7 +367,6 @@ define(function(require){ }); }); - self.strategyNumbersBindEvents(strategyNumbersContainer, strategyData); self.strategyConfNumBindEvents(strategyConfNumContainer, strategyData); self.strategyFaxingNumBindEvents(strategyFaxingNumContainer, strategyData); @@ -627,7 +626,6 @@ define(function(require){ tabMessage: self.i18n.active().strategy.calls.callTabsMessages[callflowName] }; - if (strategyData.callflows[callflowName].flow.hasOwnProperty("is_main_number_cf")) { tabData.callOption.callEntityId = strategyData.callflows[callflowName].flow.data.id; tabData.callOption.type = "advanced-callflow"; @@ -1624,6 +1622,7 @@ define(function(require){ case 'user': case 'device': case 'callflow': + case 'media': flowElement.data.id = selectedEntity.val(); break; case 'ring_group': @@ -2127,19 +2126,15 @@ define(function(require){ } switch(entityType) { - case 'directory': - case 'user': - case 'device': - case 'voicemail': - case 'callflow': - menuElements[number].data.id = entityId; - break; case 'ring_group': menuElements[number].data.endpoints = [{ endpoint_type: "group", id: entityId }]; break; + default: + menuElements[number].data.id = entityId; + break; } }); @@ -2173,16 +2168,16 @@ define(function(require){ _.each(entities, function(value, key) { var group = { - groupName: self.i18n.active().strategy.callEntities[key], - groupType: key, - entities: $.map(value, function(entity) { - return { - id: entity.id, - name: entity.name || (entity.first_name + ' ' + entity.last_name), - module: entity.module || key - }; - }) - }; + groupName: self.i18n.active().strategy.callEntities[key], + groupType: key, + entities: $.map(value, function(entity) { + return { + id: entity.id, + name: entity.name || (entity.first_name + ' ' + entity.last_name), + module: entity.module || key + }; + }) + }; switch(group.groupType) { case 'directory': @@ -2197,6 +2192,9 @@ define(function(require){ case 'ring_group': group.groupIcon = 'fa fa-users'; break; + case 'media': + group.groupIcon = 'fa fa-music'; + break; case 'voicemail': group.groupIcon = 'icon-telicon-voicemail'; break; @@ -2668,6 +2666,11 @@ define(function(require){ } }); }, + media: function (callback) { + self.strategyListMedia(function (media) { + callback(null, media); + }); + }, userCallflows: function(_callback) { self.callApi({ resource: 'callflow.list', @@ -2753,6 +2756,7 @@ define(function(require){ var callEntities = { device: results.devices, user: $.extend(true, [], results.users), + media: results.media, userCallflows: [], ring_group: [], userGroups: $.map(results.userGroups, function(val) { @@ -2764,6 +2768,10 @@ define(function(require){ advancedCallflows: results.advancedCallflows }; + _.each(callEntities.media, function(media) { + media.module = 'media'; + }); + _.each(callEntities.device, function(device) { device.module = 'device'; }); @@ -2953,6 +2961,20 @@ define(function(require){ }); }, + strategyListMedia: function(callback) { + var self = this; + + self.callApi({ + resource: 'media.list', + data: { + accountId: self.accountId + }, + success: function(data, status) { + callback && callback(data.data); + } + }); + }, + _strategyOnCurrentAccountUpdated: function(accountData) { var self = this; $('#strategy_custom_hours_timezone').text(timezone.formatTimezone(accountData.timezone)); From e85fc60dd603a4ffec09e2ae8607fd131ac77e88 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Thu, 12 Nov 2015 15:26:04 -0800 Subject: [PATCH 12/38] UI-1856: On the dashboard, hide cnam related actions when the feature is disabled on the account --- i18n/en-US.json | 8 ++++-- i18n/fr-FR.json | 4 ++- submodules/myOffice/myOffice.css | 2 ++ submodules/myOffice/myOffice.js | 43 +++++++++++++++++++++----------- views/myOffice-layout.html | 22 ++++++++-------- 5 files changed, 52 insertions(+), 27 deletions(-) diff --git a/i18n/en-US.json b/i18n/en-US.json index 1b06d19b..336dc97b 100644 --- a/i18n/en-US.json +++ b/i18n/en-US.json @@ -947,7 +947,6 @@ "mandatoryE911Alert": "You must specify e911 information for your company caller ID number." }, "missingMainNumberForCallerId": "You need to add a main number to your office before configuring the Caller-ID!", - "missingE911Message": "Please setup your Company Caller ID and e911 on a Main Number.", "missingMainNumberMessage": "Please add a Main Number to your account.", "totalUsers": "Total Users", "totalDevices": "Total Devices", @@ -987,7 +986,12 @@ "3": "Once you have created enough users, create user groups. This is extremely useful if you have users that work in the same department, such as a sales team.", "4": "Main Number services are highly important for your business! Manage call handling with Virtual Receptionist, and route calls depending on Office Hours and Holidays." } - } + }, + "__comment": "UI-1856: On the dashboard, hide cnam related actions when the feature is disabled on the account", + "__version": "3.23", + "missingCnamE911Message": "Please setup your Company Caller ID and e911 on a Main Number.", + "missingCnamMessage": "Please setup your Company Caller ID on a Main Number.", + "missingE911Message": "Please setup your e911 on a Main Number." }, "__comment": "UI-299, v3.19_s2: Added the Feature Codes tab to SmartPBX.", diff --git a/i18n/fr-FR.json b/i18n/fr-FR.json index c807abea..310316e9 100644 --- a/i18n/fr-FR.json +++ b/i18n/fr-FR.json @@ -859,7 +859,9 @@ "mandatoryE911Alert": "Vous devez spécifier les infos E911 pour le Caller-ID de ce numéro d'entreprise." }, "missingMainNumberForCallerId": "Veuillez ajouter un Numéro principal à votre compte avant de configurer le Caller-ID de votre compte!", - "missingE911Message": "Veuillez configurer le Caller-ID et l'E911 sur un de vos numéros principaux.", + "missingCnamE911Message": "Veuillez configurer le Caller-ID et l'E911 sur un de vos numéros principaux.", + "missingCnamMessage": "Veuillez configurer le Caller-ID sur un de vos numéros principaux.", + "missingE911Message": "Veuillez configurer l'E911 sur un de vos numéros principaux.", "missingMainNumberMessage": "Veuillez ajouter un Numéro principal à votre compte.", "totalUsers": "Utilisateurs", "totalDevices": "Téléphones", diff --git a/submodules/myOffice/myOffice.css b/submodules/myOffice/myOffice.css index 577436d3..58b2a0b8 100644 --- a/submodules/myOffice/myOffice.css +++ b/submodules/myOffice/myOffice.css @@ -14,6 +14,7 @@ -webkit-box-sizing: border-box; } #myoffice_container .dashboard-header .header-title { + float: left; width: 55%; padding: 10px 20px; line-height: 40px; @@ -23,6 +24,7 @@ white-space: nowrap; } #myoffice_container .dashboard-header .header-link { + float: right; width: 15%; border-left: solid 1px #dcdcdc; color: #fff; diff --git a/submodules/myOffice/myOffice.js b/submodules/myOffice/myOffice.js index d8205250..90f9b181 100644 --- a/submodules/myOffice/myOffice.js +++ b/submodules/myOffice/myOffice.js @@ -33,6 +33,7 @@ define(function(require){ self.myOfficeLoadData(function(myOfficeData) { var dataTemplate = { + isCnamEnabled: monster.util.isNumberFeatureEnabled('cnam'), account: myOfficeData.account, totalUsers: myOfficeData.users.length, totalDevices: myOfficeData.devices.length, @@ -528,7 +529,6 @@ define(function(require){ if( data.mainNumbers && data.mainNumbers.length > 0 - && monster.util.isNumberFeatureEnabled('e911') && ( !('caller_id' in data.account) || !('emergency' in data.account.caller_id) @@ -537,10 +537,24 @@ define(function(require){ || data.numbers[data.account.caller_id.emergency.number].features.indexOf('dash_e911') < 0 ) ) { - data.topMessage = { - class: 'btn-danger', - message: self.i18n.active().myOffice.missingE911Message - }; + if (monster.util.isNumberFeatureEnabled('cnam') && monster.util.isNumberFeatureEnabled('e911')) { + data.topMessage = { + class: 'btn-danger', + message: self.i18n.active().myOffice.missingCnamE911Message + }; + } + else if (monster.util.isNumberFeatureEnabled('cnam')) { + data.topMessage = { + class: 'btn-danger', + message: self.i18n.active().myOffice.missingCnamMessage + }; + } + else if (monster.util.isNumberFeatureEnabled('e911')) { + data.topMessage = { + class: 'btn-danger', + message: self.i18n.active().myOffice.missingE911Message + }; + } } data.totalChannels = channelsArray.length; @@ -595,13 +609,15 @@ define(function(require){ }); }); - template.find('.header-link.caller-id:not(.disabled)').on('click', function(e) { - e.preventDefault(); - self.myOfficeRenderCallerIdPopup({ - parent: parent, - myOfficeData: myOfficeData + if (monster.util.isNumberFeatureEnabled('cnam')) { + template.find('.header-link.caller-id:not(.disabled)').on('click', function(e) { + e.preventDefault(); + self.myOfficeRenderCallerIdPopup({ + parent: parent, + myOfficeData: myOfficeData + }); }); - }); + } template.find('.header-link.caller-id.disabled').on('click', function(e) { monster.ui.alert(self.i18n.active().myOffice.missingMainNumberForCallerId); @@ -755,9 +771,8 @@ define(function(require){ var self = this, parent = args.parent, myOfficeData = args.myOfficeData, - isE911Enabled = monster.util.isNumberFeatureEnabled('e911'), templateData = { - isE911Enabled: isE911Enabled, + isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), mainNumbers: myOfficeData.mainNumbers, selectedMainNumber: 'caller_id' in myOfficeData.account && 'external' in myOfficeData.account.caller_id ? myOfficeData.account.caller_id.external.number || 'none' : 'none' }, @@ -767,7 +782,7 @@ define(function(require){ position: ['center', 20] }); - if (isE911Enabled) { + if (monster.util.isNumberFeatureEnabled('e911')) { var e911Form = popupTemplate.find('.emergency-form > form'); monster.ui.validate(e911Form, { diff --git a/views/myOffice-layout.html b/views/myOffice-layout.html index ce297e5d..ced9c660 100644 --- a/views/myOffice-layout.html +++ b/views/myOffice-layout.html @@ -1,22 +1,24 @@
    From 89ab9103a27b91adcc1c03e7c932758cc5cb9e06 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Thu, 12 Nov 2015 15:27:47 -0800 Subject: [PATCH 13/38] UI-1856: On Device Creation, hide cnam related actions when the feature is disabled on the account --- submodules/devices/devices.js | 2 +- views/devices-ata.html | 4 ++-- views/devices-fax.html | 4 ++-- views/devices-mobile.html | 4 ++-- views/devices-sip_device.html | 4 ++-- views/devices-softphone.html | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/submodules/devices/devices.js b/submodules/devices/devices.js index 281877be..34bc4f60 100644 --- a/submodules/devices/devices.js +++ b/submodules/devices/devices.js @@ -270,7 +270,7 @@ define(function(require){ type = data.device_type, popupTitle = mode === 'edit' ? monster.template(self, '!' + self.i18n.active().devices[type].editTitle, { name: data.name }) : self.i18n.active().devices[type].addTitle, templateDevice = $(monster.template(self, 'devices-'+type, $.extend(true, {}, data, { - isE911Enabled: monster.util.isNumberFeatureEnabled('e911') + showEmergencyCnam: monster.util.isNumberFeatureEnabled('cnam') && monster.util.isNumberFeatureEnabled('e911') }))), deviceForm = templateDevice.find('#form_device'); diff --git a/views/devices-ata.html b/views/devices-ata.html index 4b8fab60..57e68c53 100644 --- a/views/devices-ata.html +++ b/views/devices-ata.html @@ -23,7 +23,7 @@ @@ -115,7 +115,7 @@
    - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
    {{ i18n.devices.popupSettings.callerId.sectionTitle }} diff --git a/views/devices-fax.html b/views/devices-fax.html index 6639ed48..bfbc15bb 100644 --- a/views/devices-fax.html +++ b/views/devices-fax.html @@ -23,7 +23,7 @@ @@ -135,7 +135,7 @@
    - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
    {{ i18n.devices.popupSettings.callerId.sectionTitle }} diff --git a/views/devices-mobile.html b/views/devices-mobile.html index 8715c621..deb78c52 100644 --- a/views/devices-mobile.html +++ b/views/devices-mobile.html @@ -24,7 +24,7 @@
  • {{ i18n.devices.popupSettings.audio.menuTitle }}
  • {{ i18n.devices.popupSettings.video.menuTitle }}
  • {{ i18n.devices.popupSettings.restrictions.menuTitle }}
  • - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • {{/if}}
  • {{ i18n.devices.popupSettings.miscellaneous.menuTitle }}
  • @@ -137,7 +137,7 @@
    - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
    {{ i18n.devices.popupSettings.callerId.sectionTitle }} diff --git a/views/devices-sip_device.html b/views/devices-sip_device.html index 9c6529b9..f39d78ea 100644 --- a/views/devices-sip_device.html +++ b/views/devices-sip_device.html @@ -32,7 +32,7 @@
  • {{ i18n.devices.popupSettings.audio.menuTitle }}
  • {{ i18n.devices.popupSettings.video.menuTitle }}
  • {{ i18n.devices.popupSettings.restrictions.menuTitle }}
  • - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • {{/if}}
  • {{ i18n.devices.popupSettings.miscellaneous.menuTitle }}
  • @@ -174,7 +174,7 @@
    - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
    {{ i18n.devices.popupSettings.callerId.sectionTitle }} diff --git a/views/devices-softphone.html b/views/devices-softphone.html index 09c7564e..705dbec0 100644 --- a/views/devices-softphone.html +++ b/views/devices-softphone.html @@ -24,7 +24,7 @@
  • {{ i18n.devices.popupSettings.audio.menuTitle }}
  • {{ i18n.devices.popupSettings.video.menuTitle }}
  • {{ i18n.devices.popupSettings.restrictions.menuTitle }}
  • - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
  • {{ i18n.devices.popupSettings.callerId.menuTitle }}
  • {{/if}}
  • {{ i18n.devices.popupSettings.miscellaneous.menuTitle }}
  • @@ -131,7 +131,7 @@
    - {{#if isE911Enabled}} + {{#if showEmergencyCnam}}
    {{ i18n.devices.popupSettings.callerId.sectionTitle }} From 1ec9c54cb1124cefa24ba097c4464bb19d50a787 Mon Sep 17 00:00:00 2001 From: Joris Tirado Date: Thu, 12 Nov 2015 15:30:58 -0800 Subject: [PATCH 14/38] UI-1856: On the Group tab, hide cnam related actions when the feature is disabled on the account --- submodules/groups/groups.js | 49 ++++++++++++++++++-------------- views/groups-numbers.html | 4 ++- views/groups-numbersItemRow.html | 4 ++- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/submodules/groups/groups.js b/submodules/groups/groups.js index 634ccd46..7aac97aa 100644 --- a/submodules/groups/groups.js +++ b/submodules/groups/groups.js @@ -427,6 +427,7 @@ define(function(require){ self.groupsGetNumbersData(groupId, function(data) { self.groupsFormatNumbersData(data, function(data) { template = $(monster.template(self, 'groups-numbers', $.extend(true, {}, data, { + isCnamEnabled: monster.util.isNumberFeatureEnabled('cnam'), isE911Enabled: monster.util.isNumberFeatureEnabled('e911') }))); @@ -1065,33 +1066,35 @@ define(function(require){ }); } - template.on('click', '.callerId-number', function() { - var cnamCell = $(this).parents('.item-row').first(), - phoneNumber = cnamCell.data('id'); + if (monster.util.isNumberFeatureEnabled('cnam')) { + template.on('click', '.callerId-number', function() { + var cnamCell = $(this).parents('.item-row').first(), + phoneNumber = cnamCell.data('id'); - if(phoneNumber) { - var args = { - phoneNumber: phoneNumber, - callbacks: { - success: function(data) { - if('cnam' in data.data && data.data.cnam.display_name) { - cnamCell.find('.features i.feature-outbound_cnam').addClass('active'); - } else { - cnamCell.find('.features i.feature-outbound_cnam').removeClass('active'); - } + if(phoneNumber) { + var args = { + phoneNumber: phoneNumber, + callbacks: { + success: function(data) { + if('cnam' in data.data && data.data.cnam.display_name) { + cnamCell.find('.features i.feature-outbound_cnam').addClass('active'); + } else { + cnamCell.find('.features i.feature-outbound_cnam').removeClass('active'); + } - if('cnam' in data.data && data.data.cnam.inbound_lookup) { - cnamCell.find('.features i.feature-inbound_cnam').addClass('active'); - } else { - cnamCell.find('.features i.feature-inbound_cnam').removeClass('active'); + if('cnam' in data.data && data.data.cnam.inbound_lookup) { + cnamCell.find('.features i.feature-inbound_cnam').addClass('active'); + } else { + cnamCell.find('.features i.feature-inbound_cnam').removeClass('active'); + } } } - } - }; + }; - monster.pub('common.callerId.renderPopup', args); - } - }); + monster.pub('common.callerId.renderPopup', args); + } + }); + } template.on('click', '.prepend-number', function() { var prependCell = $(this).parents('.item-row').first(), @@ -1135,6 +1138,7 @@ define(function(require){ template .find('.list-assigned-items') .append($(monster.template(self, 'groups-numbersItemRow', { + isCnamEnabled: monster.util.isNumberFeatureEnabled('cnam'), isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), number: val }))); @@ -1166,6 +1170,7 @@ define(function(require){ number.phoneNumber = number.id; var rowTemplate = $(monster.template(self, 'groups-numbersItemRow', { + isCnamEnabled: monster.util.isNumberFeatureEnabled('cnam'), isE911Enabled: monster.util.isNumberFeatureEnabled('e911'), number: number })); diff --git a/views/groups-numbers.html b/views/groups-numbers.html index 1a2ab642..e655b4fd 100644 --- a/views/groups-numbers.html +++ b/views/groups-numbers.html @@ -14,7 +14,9 @@
    - {{#if id}} - {{ i18n.devices.deleteDevice }} - {{/if}} -
    {{ i18n.cancel }}