Browse Source

Merge remote-tracking branch 'origin/master'

4.3
Jean-Roch Maitre 11 years ago
parent
commit
e01a497219
8 changed files with 211 additions and 69 deletions
  1. +13
    -1
      i18n/en-US.json
  2. +2
    -1
      i18n/fr-FR.json
  3. +21
    -3
      submodules/groups/groups.css
  4. +103
    -24
      submodules/groups/groups.js
  5. +5
    -20
      submodules/strategy/strategy.css
  6. +18
    -18
      submodules/strategy/strategy.js
  7. +33
    -0
      views/groups-feature-prepend.html
  8. +16
    -2
      views/strategy-menuLine.html

+ 13
- 1
i18n/en-US.json View File

@ -116,6 +116,15 @@
"3": "Purchase, Port and Assign numbers. Once complete, it will automatically be assigned to the specific User Group.",
"4": "Turn on/off and seamlessly manage any of the User Features specific to the User Group."
}
},
"__comment": "UI-1206: Adding a feature to add a Caller ID prepend on groups",
"__version": "3.22",
"prepend": {
"title": "Caller ID Prepend",
"headline": "Caller ID Prepend",
"cidNameLabel": "Caller ID Name prefix",
"cidNumberLabel": "Caller ID Number prefix"
}
},
@ -734,7 +743,10 @@
"fileUploadButton": "Choose File",
"__comment": "UI-1185: Adding a help message to the greetings",
"__version": "3.20_s4",
"greetingsHelp": "You need to click the \"Update\" button in order to save your changes for the greeting message."
"greetingsHelp": "You need to click the \"Update\" button in order to save your changes for the greeting message.",
"__comment": "UI-1657: Add default action translation",
"__version": "v3.22",
"defaultAction": "Default action"
},
"open": "Open",
"closed": "Closed",


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

@ -690,7 +690,8 @@
"pressKey": "Appuyer",
"for": "pour",
"fileUploadButton": "Choisir fichier",
"greetingsHelp": "Vous devez cliquer sur le bouton \"Mettre à jour\" pour sauvegarder les changements apportés au message d'accueil."
"greetingsHelp": "Vous devez cliquer sur le bouton \"Mettre à jour\" pour sauvegarder les changements apportés au message d'accueil.",
"defaultAction": "Action par défaut"
},
"open": "Ouvert",
"closed": "Fermé",


+ 21
- 3
submodules/groups/groups.css View File

@ -424,9 +424,8 @@
display: inline-block;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 25%;
width: 33.33%;
height: 150px;
border: 1px solid #FFF;
text-align: center;
@ -547,7 +546,26 @@
}
/* Next Action Feature */
/* Allow Call Forward Feature */
.feature-popup-container[data-feature="forward"] .help-box {
margin: 5px 20px 20px
}
/* CID Prepend Feature */
.feature-popup-container[data-feature="prepend"] form {
margin-bottom: 0;
}
.feature-popup-container[data-feature="prepend"] form > div {
position: relative;
margin-bottom: 10px;
}
.feature-popup-container[data-feature="prepend"] form span {
display: inline-block;
width: 160px;
vertical-align: middle;
text-align: right;
}
.feature-popup-container[data-feature="prepend"] form input {
margin-bottom: 0;
width: 100px;
}

+ 103
- 24
submodules/groups/groups.js View File

@ -146,6 +146,11 @@ define(function(require){
icon: 'fa fa-mail-forward',
iconColor: 'monster-orange',
title: self.i18n.active().groups.forward.title
},
prepend: {
icon: 'fa fa-file-text-o',
iconColor: 'monster-pink',
title: self.i18n.active().groups.prepend.title
}
},
hasFeatures: false
@ -226,9 +231,9 @@ define(function(require){
emptySearch = template.find('.groups-rows .empty-search-row');
_.each(rows, function(row) {
var row = $(row);
var $row = $(row);
row.data('search').toLowerCase().indexOf(searchString) < 0 ? row.hide() : row.show();
$row.data('search').toLowerCase().indexOf(searchString) < 0 ? $row.hide() : $row.show();
});
if(rows.size() > 0) {
@ -471,17 +476,22 @@ define(function(require){
template.find('.feature[data-feature="forward"]').on('click', function() {
self.groupsRenderForward(data);
});
template.find('.feature[data-feature="prepend"]').on('click', function() {
self.groupsRenderPrepend(data);
});
},
groupsRenderCallRecording: function(data) {
var self = this,
recordCallNode = monster.util.findCallflowNode(data.callflow, 'record_call'),
templateData = $.extend(true, {
group: data.group
},
(data.group.extra.mapFeatures.call_recording.active ? {
url: data.callflow.flow.data.url,
format: data.callflow.flow.data.format,
timeLimit: data.callflow.flow.data.time_limit
(data.group.extra.mapFeatures.call_recording.active && recordCallNode ? {
url: recordCallNode.data.url,
format: recordCallNode.data.format,
timeLimit: recordCallNode.data.time_limit
} : {})
),
featureTemplate = $(monster.template(self, 'groups-feature-call_recording', templateData)),
@ -519,21 +529,23 @@ define(function(require){
if(data.group.smartpbx.call_recording.enabled || enabled) {
data.group.smartpbx.call_recording.enabled = enabled;
var newCallflow = $.extend(true, {}, data.callflow);
var newCallflow = $.extend(true, {}, data.callflow),
currentNode = monster.util.findCallflowNode(newCallflow, 'record_call') || monster.util.findCallflowNode(newCallflow, 'callflow');
if(enabled) {
if(newCallflow.flow.module === 'record_call') {
newCallflow.flow.data = $.extend(true, { action: "start" }, formData);
if(currentNode.module === 'record_call') {
currentNode.data = $.extend(true, { action: "start" }, formData);
} else {
newCallflow.flow = {
children: {
"_": $.extend(true, {}, data.callflow.flow)
},
module: "record_call",
data: $.extend(true, { action: "start" }, formData)
}
currentNode.children = {
"_": $.extend(true, {}, currentNode)
};
currentNode.module = "record_call";
currentNode.data = $.extend(true, { action: "start" }, formData);
}
} else {
newCallflow.flow = $.extend(true, {}, data.callflow.flow.children["_"]);
} else if(currentNode.module === 'record_call') {
currentNode.module = currentNode.children["_"].module;
currentNode.data = currentNode.children["_"].data;
currentNode.children = currentNode.children["_"].children;
}
self.groupsUpdateCallflow(newCallflow, function(updatedCallflow) {
self.groupsUpdate(data.group, function(updatedGroup) {
@ -755,14 +767,11 @@ define(function(require){
if(data.group.smartpbx.next_action.enabled || enabled) {
data.group.smartpbx.next_action.enabled = enabled;
var newCallflow = $.extend(true, {}, data.callflow),
newFlow = newCallflow.flow;
callflowNode = monster.util.findCallflowNode(newCallflow, 'callflow');
if(newFlow.module === 'record_call') {
newFlow = newFlow.children['_'];
}
newFlow.children = {};
callflowNode.children = {};
if(enabled) {
newFlow.children['_'] = {
callflowNode.children['_'] = {
children: {},
module: selectedOption.data('module'),
data: { id: selectedOption.val() }
@ -831,6 +840,76 @@ define(function(require){
});
},
groupsRenderPrepend: function(data) {
var self = this,
prependNode = monster.util.findCallflowNode(data.callflow, 'prepend_cid'),
templateData = $.extend(true, {
group: data.group
},
(data.group.extra.mapFeatures.call_recording.active && prependNode ? {
caller_id_name_prefix: prependNode.data.caller_id_name_prefix,
caller_id_number_prefix: prependNode.data.caller_id_number_prefix
} : {})
),
featureTemplate = $(monster.template(self, 'groups-feature-prepend', templateData)),
switchFeature = featureTemplate.find('.switch-state'),
popup;
featureTemplate.find('.cancel-link').on('click', function() {
popup.dialog('close').remove();
});
switchFeature.on('change', function() {
$(this).prop('checked') ? featureTemplate.find('.content').slideDown() : featureTemplate.find('.content').slideUp();
});
featureTemplate.find('.save').on('click', function() {
var enabled = switchFeature.prop('checked'),
prependData = $.extend(true, { action: 'prepend' }, monster.ui.getFormData('prepend_form'));
if(!('smartpbx' in data.group)) { data.group.smartpbx = {}; }
if(!('prepend' in data.group.smartpbx)) {
data.group.smartpbx.prepend = {
enabled: false
};
}
if(data.group.smartpbx.prepend.enabled || enabled) {
data.group.smartpbx.prepend.enabled = enabled;
var newCallflow = $.extend(true, {}, data.callflow);
if(enabled) {
if(newCallflow.flow.module !== 'prepend_cid') {
newCallflow.flow = {
children: {
"_": $.extend(true, {}, data.callflow.flow)
},
module: 'prepend_cid',
data: prependData
}
}
} else {
if(prependNode) {
newCallflow.flow = $.extend(true, {}, prependNode.children["_"]);
}
}
self.groupsUpdateCallflow(newCallflow, function(updatedCallflow) {
self.groupsUpdate(data.group, function(updatedGroup) {
popup.dialog('close').remove();
self.groupsRender({ groupId: data.group.id });
});
});
} else {
popup.dialog('close').remove();
self.groupsRender({ groupId: data.group.id });
}
});
popup = monster.ui.dialog(featureTemplate, {
title: data.group.extra.mapFeatures.prepend.title,
position: ['center', 20]
});
},
groupsBindName: function(template, data) {
var self = this,
nameForm = template.find('#form-name');


+ 5
- 20
submodules/strategy/strategy.css View File

@ -520,7 +520,7 @@
}
#strategy_menu_popup {
width: 700px;
width: 760px;
padding: 20px;
}
#strategy_menu_popup > div:not(:last-of-type) {
@ -528,10 +528,13 @@
}
#strategy_menu_popup .menu-block > div {
float: left;
width: 340px;
}
#strategy_menu_popup .menu-block .left {
width: 400px;
}
#strategy_menu_popup .menu-block .right {
margin-left: 20px;
width: 340px;
}
#strategy_menu_popup .menu-block .title {
color: #22a5ff;
@ -549,18 +552,6 @@
display: inline-block;
vertical-align: middle;
}
#strategy_menu_popup .menu-block .menu-line .number-input {
width: 18px;
text-align: center;
}
#strategy_menu_popup .menu-block .menu-line .number-text {
width: 32px;
text-align: center;
color: #22a5ff;
font-size: 18px;
font-weight: bold;
cursor: pointer;
}
#strategy_menu_popup .menu-block .menu-line .target-input .add-on {
width: 20px;
}
@ -579,12 +570,6 @@
color: #ff1212 !important;
text-shadow: 1px 1px 1px #999;
}
#strategy_menu_popup .menu-block .menu-line.editing .number-text {
display: none;
}
#strategy_menu_popup .menu-block .menu-line:not(.editing) .number-input {
display: none;
}
#strategy_menu_popup .menu-block .add-menu-line {
margin-top: 10px;


+ 18
- 18
submodules/strategy/strategy.js View File

@ -1605,24 +1605,24 @@ define(function(require){
}
});
container.on('click', '.number-text', function(e) {
var $this = $(this);
$this.parents('.menu-line').addClass('editing');
$this.siblings('.number-input').focus();
});
container.on('blur', '.number-input', function(e) {
var $this = $(this);
$this.parents('.menu-line').removeClass('editing');
$this.siblings('.number-text').text($this.val() || "?");
});
container.on('keyup', '.number-input', function(e) {
var $this = $(this);
if(!/^[0-9#*]*$/.test($this.val())) {
$this.val($this.val().replace(/[^0-9#*]/g, ""));
}
});
// container.on('click', '.number-text', function(e) {
// var $this = $(this);
// $this.parents('.menu-line').addClass('editing');
// $this.siblings('.number-input').focus();
// });
// container.on('blur', '.number-input', function(e) {
// var $this = $(this);
// $this.parents('.menu-line').removeClass('editing');
// $this.siblings('.number-text').text($this.val() || "?");
// });
// container.on('keyup', '.number-input', function(e) {
// var $this = $(this);
// if(!/^[0-9#*]*$/.test($this.val())) {
// $this.val($this.val().replace(/[^0-9#*]/g, ""));
// }
// });
container.on('change', '.target-select', function(e) {
var $this = $(this),


+ 33
- 0
views/groups-feature-prepend.html View File

@ -0,0 +1,33 @@
<div class="feature-popup-container" data-feature="prepend">
<div class="feature-popup-title">
<div class="feature-fa-wrapper">
<i class="{{group.extra.mapFeatures.prepend.icon}}"></i>
</div>
{{ i18n.groups.prepend.headline }}
<div class="switch">
{{#monsterSwitch}}
<input class="switch-state" type="checkbox" data-on="{{i18n.enabled}}" data-off="{{i18n.disabled}}"{{#if group.extra.mapFeatures.prepend.active}} checked="checked"{{/if}}></input>
{{/monsterSwitch}}
</div>
</div>
<div class="content{{#unless group.extra.mapFeatures.prepend.active}} disabled{{/unless}}">
<form id="prepend_form">
<div>
<span>{{ i18n.groups.prepend.cidNameLabel }}</span>
<input required name="caller_id_name_prefix" type="text" value="{{caller_id_name_prefix}}">
</div>
<div>
<span>{{ i18n.groups.prepend.cidNumberLabel }}</span>
<input required name="caller_id_number_prefix" type="text" value="{{caller_id_number_prefix}}">
</div>
</form>
</div>
<div class="actions clearfix">
<div class="pull-right">
<a class="cancel-link monster-link blue" href="javascript:void(0);">{{ i18n.cancel }}</a>
<button type="button" class="monster-button monster-button-success save">{{ i18n.saveChanges }}</button>
</div>
</div>
</div>

+ 16
- 2
views/strategy-menuLine.html View File

@ -1,7 +1,21 @@
<div class="menu-line {{#unless number}}editing{{/unless}}">
<div class="text">{{i18n.strategy.popup.pressKey}}</div>
<div class="number-text">{{number}}</div>
<input class="number-input" type="text" maxlength="2" value="{{number}}">
<select class="number-input span1">
{{#select number}}
<option value="default">Default action</option>
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="*">*</option>
{{/select}}
</select>
<div class="text">{{i18n.strategy.popup.for}}</div>
<div class="input-prepend target-input">
<span class="add-on"><i class="target-icon"></i></span>


Loading…
Cancel
Save