Browse Source

UI-2500: Add new popup to create/edit main faxbox

4.3
Joris Tirado 9 years ago
parent
commit
7ffcc435e7
4 changed files with 146 additions and 27 deletions
  1. +16
    -2
      i18n/en-US.json
  2. +99
    -24
      submodules/strategy/strategy.js
  3. +1
    -1
      views/strategy-faxingnum.html
  4. +30
    -0
      views/strategy-popupEditFaxbox.html

+ 16
- 2
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": {


+ 99
- 24
submodules/strategy/strategy.js View File

@ -1113,18 +1113,53 @@ define(function(require){
updateCallflow();
}
else {
var email = window.prompt('Email address for the main faxbox');
var template = $(monster.template(self, 'strategy-popupEditFaxbox')),
popup = monster.ui.dialog(template, {
title: 'Create Main Faxbox',
position: ['center', 20],
hideClose: true
});
self.strategyBuildFaxbox({
data: {
email: email,
number: mainFaxing.numbers[0]
},
success: function(data) {
mainFaxing.flow.data.id = data.id;
updateCallflow();
}
});
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();
}
});
}
});
}
}
},
@ -1164,8 +1199,6 @@ define(function(require){
container.on('click', '.action-links .edit-email', function(e) {
event.preventDefault();
var email = window.prompt('Email address for the main faxbox');
monster.waterfall([
function(callback) {
self.strategyGetFaxbox({
@ -1173,7 +1206,55 @@ define(function(require){
faxboxId: strategyData.callflows.MainFaxing.flow.data.id
},
success: function(faxbox) {
callback(null, faxbox);
var template = $(monster.template(self, 'strategy-popupEditFaxbox', {
email: faxbox.notifications.inbound.email.send_to
})),
popup = monster.ui.dialog(template, {
title: 'Edit Main Faxbox',
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
}
}
}
}));
}
});
}
});
},
@ -1181,15 +1262,7 @@ define(function(require){
self.strategyUpdateFaxbox({
data: {
faxboxId: faxboxData.id,
data: $.extend(true, {}, faxboxData, {
notifications: {
inbound: {
email: {
send_to: email
}
}
}
})
data: faxboxData
},
success: function(updatedFaxbox) {
callback(null, updatedFaxbox);
@ -1198,7 +1271,9 @@ define(function(require){
}
],
function(err, results) {
toastr.success('Main Fabox Email Successfully Changed');
if (!err) {
toastr.success('Main Fabox Email Successfully Changed');
}
}
);
});


+ 1
- 1
views/strategy-faxingnum.html View File

@ -18,7 +18,7 @@
{{#unless actionLinksEnabled}}
<a href="#" class="edit-email monster-link">
<i class="icon-telicon-setting-cog"></i>
Edit Fax Recipient
{{i18n.strategy.faxing.editFaxbox}}
</a>
{{/unless}}
{{#if actionLinksEnabled}}


+ 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