Browse Source

Merge branch 'master' of github.com:2600hz/monster-ui-voip

4.3
Jean-Roch Maitre 9 years ago
parent
commit
e735a7bb20
7 changed files with 225 additions and 28 deletions
  1. +18
    -3
      i18n/en-US.json
  2. +2
    -0
      submodules/callLogs/callLogs.css
  3. +1
    -0
      submodules/callLogs/callLogs.js
  4. +167
    -25
      submodules/strategy/strategy.js
  5. +1
    -0
      views/callLogs-layout.html
  6. +6
    -0
      views/strategy-faxingnum.html
  7. +30
    -0
      views/strategy-popupEditFaxbox.html

+ 18
- 3
i18n/en-US.json View File

@ -908,7 +908,8 @@
"__version": "3.22",
"faxing": {
"nameExtension": "'s Main Faxbox",
"headerExtension": " Fax Printer"
"headerExtension": " Fax Printer",
"editFaxbox": "Edit Faxbox"
},
"__comment": "UI-1774: Adding custom greetings to conference",
"__version": "3.22",
@ -922,7 +923,20 @@
"__comment": "UI-2499: Handle case where greeting has been deleted",
"__version": "4.0",
"greetingMissing": "The greeting that was configured on this Virtual Receptionist is missing. Please setup a new greeting."
"greetingMissing": "The greeting that was configured on this Virtual Receptionist is missing. Please setup a new greeting.",
"__comment": "",
"__version": "3.22",
"popupEditFaxbox": {
"titles": {
"create": "Create Main Faxbox",
"edit": "Edit Main Faxbox"
},
"text": "Main Faxbox",
"labels": {
"inbound": "Inbound Notification Email"
}
}
},
"callLogs": {
@ -967,7 +981,8 @@
"actions": {
"report": "Report Call",
"details": "Technical Details"
}
},
"downloadTooltip": "In \"Custom\" Mode, you'll need to click on \"Filter\" before clicking on download."
},
"myOffice": {


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

@ -32,6 +32,7 @@
#call_logs_container .fixed-ranges-date {
margin-top: 10px;
margin-right: 30px;
}
#call_logs_container .fixed-ranges-date .highlight-date {
@ -42,6 +43,7 @@
#call_logs_container .custom-range {
display: none;
margin-right: 30px;
}
#call_logs_container .custom-range.active {


+ 1
- 0
submodules/callLogs/callLogs.js View File

@ -42,6 +42,7 @@ define(function(require){
dataTemplate.cdrs = cdrs;
template = $(monster.template(self, 'callLogs-layout', dataTemplate));
monster.ui.tooltips(template);
if(cdrs && cdrs.length) {
var cdrsTemplate = $(monster.template(self, 'callLogs-cdrsList', {cdrs: cdrs, showReport: monster.config.whitelabel.callReportEmail ? true : false}));


+ 167
- 25
submodules/strategy/strategy.js View File

@ -185,7 +185,7 @@ define(function(require){
self.strategyListDirectories(function (directories) {
callback(null, directories);
});
}
},
},
function(err, results) {
var hasMainNumber = (results.callflows["MainCallflow"].numbers.length > 1),
@ -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,15 +1113,53 @@ define(function(require){
updateCallflow();
}
else {
self.strategyBuildFaxbox({
data: {
number: mainFaxing.numbers[0]
},
success: function(data) {
mainFaxing.flow.data.id = data.id;
updateCallflow();
}
});
var template = $(monster.template(self, 'strategy-popupEditFaxbox')),
popup = monster.ui.dialog(template, {
title: self.i18n.active().strategy.popupEditFaxbox.titles.create,
position: ['center', 20],
hideClose: true
});
template
.find('.cancel-link')
.on('click', function(event) {
event.preventDefault();
popup.dialog('close').remove();
});
template
.find('.save')
.on('click', function(event) {
event.preventDefault();
var $form = template.find('#faxbox_form'),
email = monster.ui.getFormData('faxbox_form').email;
monster.ui.validate($form, {
rules: {
email: {
required: true,
email: true
}
}
});
if (monster.ui.valid($form)) {
popup.dialog('close').remove();
self.strategyBuildFaxbox({
data: {
email: email,
number: mainFaxing.numbers[0]
},
success: function(data) {
mainFaxing.flow.data.id = data.id;
updateCallflow();
}
});
}
});
}
}
},
@ -1158,6 +1196,88 @@ define(function(require){
monster.pub('common.numbers.dialogSpare', args);
});
container.on('click', '.action-links .edit-email', function(e) {
event.preventDefault();
monster.waterfall([
function(callback) {
self.strategyGetFaxbox({
data: {
faxboxId: strategyData.callflows.MainFaxing.flow.data.id
},
success: function(faxbox) {
var template = $(monster.template(self, 'strategy-popupEditFaxbox', {
email: faxbox.notifications.inbound.email.send_to
})),
popup = monster.ui.dialog(template, {
title: self.i18n.active().strategy.popupEditFaxbox.titles.edit,
position: ['center', 20]
});
template
.find('.cancel-link')
.on('click', function(event) {
event.preventDefault();
popup.dialog('close').remove();
callback(true, null);
});
template
.find('.save')
.on('click', function(event) {
event.preventDefault();
var $form = template.find('#faxbox_form'),
email = monster.ui.getFormData('faxbox_form').email;
monster.ui.validate($form, {
rules: {
email: {
required: true,
email: true
}
}
});
if (monster.ui.valid($form)) {
popup.dialog('close').remove();
callback(null, _.extend(faxbox, {
notifications: {
inbound: {
email: {
send_to: email
}
}
}
}));
}
});
}
});
},
function(faxboxData, callback) {
self.strategyUpdateFaxbox({
data: {
faxboxId: faxboxData.id,
data: faxboxData
},
success: function(updatedFaxbox) {
callback(null, updatedFaxbox);
}
});
}
],
function(err, results) {
if (!err) {
toastr.success('Main Fabox Email Successfully Changed');
}
}
);
});
container.on('click', '.action-links .buy-link', function(e) {
e.preventDefault();
monster.pub('common.buyNumbers', {
@ -2519,14 +2639,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 +2655,12 @@ define(function(require){
notifications: {
inbound: {
email: {
send_to: email
}
},
outbound: {
email: {
send_to: email
send_to: args.data.email
}
}
}
};
if(!email) {
delete args.data.notifications;
}
self.strategyCreateFaxbox(args);
}
});
@ -3388,6 +3496,23 @@ define(function(require){
});
},
strategyGetFaxbox: function(args) {
var self = this;
self.callApi({
resource: 'faxbox.get',
data: $.extend(true, {
accountId: self.accountId
}, args.data),
success: function(data, status) {
args.hasOwnProperty('success') && args.success(data.data);
},
error: function(data, status) {
args.hasOwnProperty('error') && args.error();
}
});
},
strategyCreateFaxbox: function(args) {
var self = this;
@ -3406,6 +3531,23 @@ define(function(require){
});
},
strategyUpdateFaxbox: function(args) {
var self = this;
self.callApi({
resource: 'faxbox.update',
data: $.extend(true, {
accountId: self.accountId
}, args.data),
success: function(data, status) {
args.hasOwnProperty('success') && args.success(data.data);
},
error: function(data, status) {
args.hasOwnProperty('error') && args.error();
}
});
},
strategyDeleteFaxbox: function(args) {
var self = this;


+ 1
- 0
views/callLogs-layout.html View File

@ -38,6 +38,7 @@
{{/if}}
<a href="#" role="button" class="monster-link download-csv"><i class="fa fa-download monster-green"></i>{{i18n.download}}</a>
<i class="help-popover fa fa-question" data-toggle="tooltip" data-placement="top" data-original-title="{{ i18n.callLogs.downloadTooltip }}"></i>
</div>
</div>


+ 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>
{{i18n.strategy.faxing.editFaxbox}}
</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">


+ 30
- 0
views/strategy-popupEditFaxbox.html View File

@ -0,0 +1,30 @@
<div class="monster-feature-popup-container" data-feature="faxing">
<div class="feature-popup-title">
<div class="feature-fa-wrapper">
<i class="icon-telicon-fax"></i>
</div>
{{i18n.strategy.popupEditFaxbox.text}}
</div>
<div class="content">
<form class="form-horizontal" id="faxbox_form">
<div class="contorl-group">
<label for="email" class="control-label">
{{i18n.strategy.popupEditFaxbox.labels.inbound}}
</label>
<div class="controls">
<input type="text" id="email" name="email" value="{{email}}">
</div>
</div>
</form>
</div>
<div class="actions clearfix">
<div class="pull-right">
{{#if email}}
<a class="cancel-link monster-link blue" href="javascript:void(0);">{{ i18n.cancel }}</a>
{{/if}}
<button type="button" class="monster-button monster-button-success save">{{ i18n.saveChanges }}</button>
</div>
</div>
</div>

Loading…
Cancel
Save