Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.19' into 3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
JRMaitre committed Feb 3, 2015
2 parents f0ec7af + a8dd2ff commit 590051e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
11 changes: 8 additions & 3 deletions submodules/groups/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ define(function(require){
groupsRenderRingback: function(data) {
var self = this,
silenceMediaId = 'silence_stream://300000',
ringGroupNode = data.callflow.flow;
ringGroupNode = data.baseCallflow.flow;

while(ringGroupNode.module !== 'ring_group' && '_' in ringGroupNode.children) {
ringGroupNode = ringGroupNode.children['_'];
Expand Down Expand Up @@ -668,7 +668,7 @@ define(function(require){
};
}

self.groupsUpdateCallflow(data.callflow, function() {
self.groupsUpdateCallflow(data.baseCallflow, function() {
self.groupsUpdate(data.group, function(updatedGroup) {
popup.dialog('close').remove();
self.groupsRender({ groupId: data.group.id });
Expand All @@ -680,7 +680,7 @@ define(function(require){
data.group.smartpbx.ringback.enabled = false;
}

self.groupsUpdateCallflow(data.callflow, function() {
self.groupsUpdateCallflow(data.baseCallflow, function() {
self.groupsUpdate(data.group, function(updatedGroup) {
popup.dialog('close').remove();
self.groupsRender({ groupId: data.group.id });
Expand Down Expand Up @@ -1175,6 +1175,11 @@ define(function(require){
callback(null, data);
});
},
baseCallflow: function(callback) {
self.groupsGetBaseRingGroup(groupId, function(data) {
callback(null, data);
});
},
voicemails: function(callback) {
self.groupsListVMBoxes(function(data) {
callback(null, data);
Expand Down
18 changes: 13 additions & 5 deletions submodules/strategy/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ define(function(require){
type: "default"
},
callflow: callflowName,
callEntities: self.strategyGetCallEntitiesDropdownData(strategyData.callEntities),
callEntities: self.strategyGetCallEntitiesDropdownData(strategyData.callEntities, true),
voicemails: strategyData.voicemails,
tabMessage: self.i18n.active().strategy.calls.callTabsMessages[callflowName]
};
Expand Down Expand Up @@ -1596,11 +1596,18 @@ define(function(require){
});
},

strategyGetCallEntitiesDropdownData: function(callEntities) {
strategyGetCallEntitiesDropdownData: function(callEntities, useBasicUser) {
var self = this,
useBasicUser = (useBasicUser === true) || false,
entities = $.extend(true, {}, callEntities),
results = [];

_.each(callEntities, function(value, key) {
if(!useBasicUser) {
entities.user = entities.userCallflows;
}
delete entities.userCallflows;

_.each(entities, function(value, key) {
var group = {
groupName: self.i18n.active().strategy.callEntities[key],
groupType: key,
Expand Down Expand Up @@ -2106,7 +2113,8 @@ define(function(require){
function(err, results) {
var callEntities = {
device: results.devices,
user: [],
user: $.extend(true, [], results.users),
userCallflows: [],
ring_group: []
};

Expand All @@ -2122,7 +2130,7 @@ define(function(require){
} else {
user.module = 'user';
}
callEntities.user.push(user);
callEntities.userCallflows.push(user);
});

_.each(results.groups, function(group) {
Expand Down

0 comments on commit 590051e

Please sign in to comment.