Browse Source

UI-2500: Add prompt to create faxbox with custom notification email

4.3
Joris Tirado 9 years ago
parent
commit
3d1f4385a6
2 changed files with 21 additions and 11 deletions
  1. +15
    -11
      submodules/strategy/strategy.js
  2. +6
    -0
      views/strategy-faxingnum.html

+ 15
- 11
submodules/strategy/strategy.js View File

@ -1104,8 +1104,8 @@ define(function(require){
self.strategyRefreshTemplate(parentContainer, strategyData);
});
};
if(mainFaxing.numbers.length <= 1
&& mainFaxing.numbers[0] === "undefinedfaxing") {
if(mainFaxing.numbers.length <= 1 && mainFaxing.numbers[0] === "undefinedfaxing") {
mainFaxing.numbers = [];
}
mainFaxing.numbers = mainFaxing.numbers.concat(numbers);
@ -1113,8 +1113,11 @@ define(function(require){
updateCallflow();
}
else {
var email = window.prompt('Email address for the main faxbox');
self.strategyBuildFaxbox({
data: {
email: email,
number: mainFaxing.numbers[0]
},
success: function(data) {
@ -1158,6 +1161,14 @@ define(function(require){
monster.pub('common.numbers.dialogSpare', args);
});
container.on('click', '.action-links .edit-email', function(e) {
event.preventDefault();
var email = window.prompt('Email address for the main faxbox');
console.log(email);
});
container.on('click', '.action-links .buy-link', function(e) {
e.preventDefault();
monster.pub('common.buyNumbers', {
@ -2519,14 +2530,11 @@ define(function(require){
return results;
},
strategyBuildFaxbox: function(args) {
var self = this;
self.strategyGetAccount({
success: function(account) {
var email = account.contact && account.contact.technical && account.contact.technical.hasOwnProperty('email') ? account.contact.technical.email : undefined;
args.data = {
name: account.name + self.i18n.active().strategy.faxing.nameExtension,
caller_name: account.name,
@ -2538,21 +2546,17 @@ define(function(require){
notifications: {
inbound: {
email: {
send_to: email
send_to: args.data.email
}
},
outbound: {
email: {
send_to: email
send_to: args.data.email
}
}
}
};
if(!email) {
delete args.data.notifications;
}
self.strategyCreateFaxbox(args);
}
});


+ 6
- 0
views/strategy-faxingnum.html View File

@ -15,6 +15,12 @@
<div class="number-actions">
<a href="#" class="monster-link blue cancel-link pull-right">{{ i18n.close }}</a>
<div class="action-links nav-bar clearfix">
{{#unless actionLinksEnabled}}
<a href="#" class="edit-email monster-link">
<i class="icon-telicon-setting-cog"></i>
Edit Fax Recipient
</a>
{{/unless}}
{{#if actionLinksEnabled}}
<a href="#" class="spare-link monster-link pull-left{{#unless spareLinkEnabled}} disabled{{/unless}}"><i class="fa fa-file-text-o monster-orange fa-lg"></i>{{ i18n.strategy.numberLinks.spare }}</a>
<ul class="nav pull-left">


Loading…
Cancel
Save