Browse Source

UI-1856: On the dashboard, hide cnam related actions when the feature is disabled on the account

4.3
Joris Tirado 10 years ago
parent
commit
e85fc60dd6
5 changed files with 52 additions and 27 deletions
  1. +6
    -2
      i18n/en-US.json
  2. +3
    -1
      i18n/fr-FR.json
  3. +2
    -0
      submodules/myOffice/myOffice.css
  4. +29
    -14
      submodules/myOffice/myOffice.js
  5. +12
    -10
      views/myOffice-layout.html

+ 6
- 2
i18n/en-US.json View File

@ -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.",


+ 3
- 1
i18n/fr-FR.json View File

@ -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",


+ 2
- 0
submodules/myOffice/myOffice.css View File

@ -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;


+ 29
- 14
submodules/myOffice/myOffice.js View File

@ -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, {


+ 12
- 10
views/myOffice-layout.html View File

@ -1,22 +1,24 @@
<div id="myoffice_container">
<div class="dashboard-header">
<div class="header-title">{{account.name}}</div>
<a href="#" class="header-link caller-id{{#compare mainNumbers.length "===" 0}} disabled{{/compare}}">
<div class="header-link-icon"><i class="monster-white fa-lg fa fa-user"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.callerID}}</div>
</a>
<a href="#" class="header-link music-on-hold">
<div class="header-link-icon"><i class="monster-white fa-lg fa fa-music"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.musicOnHold}}</div>
<a href="#" class="header-link strategy-hours link-box" data-category="strategy" data-subcategory="strategy-hours">
<div class="header-link-icon"><i class="fa fa-clock-o fa-lg monster-white"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.hours}}</div>
</a>
<!-- <a href="#" class="header-link call-recording">
<div class="header-link-icon"><i class="monster-white fa-lg fa fa-microphone"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.callRecording}}</div>
</a> -->
<a href="#" class="header-link strategy-hours link-box" data-category="strategy" data-subcategory="strategy-hours">
<div class="header-link-icon"><i class="fa fa-clock-o fa-lg monster-white"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.hours}}</div>
<a href="#" class="header-link music-on-hold">
<div class="header-link-icon"><i class="monster-white fa-lg fa fa-music"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.musicOnHold}}</div>
</a>
{{#if isCnamEnabled}}
<a href="#" class="header-link caller-id{{#compare mainNumbers.length "===" 0}} disabled{{/compare}}">
<div class="header-link-icon"><i class="monster-white fa-lg fa fa-user"></i></div>
<div class="header-link-title">{{i18n.myOffice.topBarLinks.callerID}}</div>
</a>
{{/if}}
</div>
<div class="dashboard-content">


Loading…
Cancel
Save