TT#17651 CSC CallFWD new sourcesets feature

- sourceset tabs and related vm data values generated dynamically from
  /api/cfsourcesets/ response
- updating sourcest name is now peristent

Change-Id: I579d9aff76b55cd0386c06f79672775b56333508
changes/27/14427/16
Carlo 8 years ago
parent 27ffa230a2
commit 02e7b70eb6

@ -16,7 +16,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
cfSourcesetStoreLoaded: 'cfSourcesetStoreLoaded', cfSourcesetStoreLoaded: 'cfSourcesetStoreLoaded',
cfStoreBeforeSync: 'cfStoreBeforeSync', cfStoreBeforeSync: 'cfStoreBeforeSync',
cfSourcesetBeforeSync: 'cfSourcesetBeforeSync', cfSourcesetBeforeSync: 'cfSourcesetBeforeSync',
cfTimesetBeforeSync: 'cfTimesetBeforeSync' cfTimesetBeforeSync: 'cfTimesetBeforeSync',
} }
} }
}, },
@ -25,7 +25,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var dropRec = data.records[0]; var dropRec = data.records[0];
var store = overModel.store; var store = overModel.store;
var recIndex = store.indexOf(dropRec); var recIndex = store.indexOf(dropRec);
var adjacentRec = dropPosition === 'before' ? store.getAt(recIndex+1) : store.getAt(recIndex-1); var adjacentRec = dropPosition === 'before' ? store.getAt(recIndex + 1) : store.getAt(recIndex - 1);
var destinationsetId = adjacentRec.get('destinationset_id') === dropRec.get('destinationset_id') ? dropRec.get('destinationset_id') : adjacentRec.get('destinationset_id'); var destinationsetId = adjacentRec.get('destinationset_id') === dropRec.get('destinationset_id') ? dropRec.get('destinationset_id') : adjacentRec.get('destinationset_id');
var destinationsetName = adjacentRec.get('destinationset_name') === dropRec.get('destinationset_name') ? dropRec.get('destinationset_name') : adjacentRec.get('destinationset_name'); var destinationsetName = adjacentRec.get('destinationset_name') === dropRec.get('destinationset_name') ? dropRec.get('destinationset_name') : adjacentRec.get('destinationset_name');
var afterTermination = adjacentRec.get('after_termination') === dropRec.get('after_termination') ? dropRec.get('after_termination') : adjacentRec.get('after_termination'); var afterTermination = adjacentRec.get('after_termination') === dropRec.get('after_termination') ? dropRec.get('after_termination') : adjacentRec.get('after_termination');
@ -50,13 +50,13 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
timesets = data.getData()._embedded['ngcp:cftimesets']; timesets = data.getData()._embedded['ngcp:cftimesets'];
} }
store.removeAll(); store.removeAll();
Ext.each(timesets, function (timeset) { Ext.each(timesets, function(timeset) {
var timesetName = timeset.name; var timesetName = timeset.name;
var timesetId = timeset.id; var timesetId = timeset.id;
me.setVmToTrue(timesetName); me.setVmToTrue(timesetName);
if (/(After|Company)\s(Hours)/.test(timesetName)) { if (/(After|Company)\s(Hours)/.test(timesetName)) {
var times = me.getModelValuesFromTimesData(timeset.times[0]); var times = me.getModelValuesFromTimesData(timeset.times[0]);
Ext.each(times.days, function (weekday) { Ext.each(times.days, function(weekday) {
var cfModel = Ext.create('NgcpCsc.model.CallForwardDestination', { var cfModel = Ext.create('NgcpCsc.model.CallForwardDestination', {
id: Ext.id(), id: Ext.id(),
timeset_name: timesetName, timeset_name: timesetName,
@ -75,7 +75,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}; };
}, },
setVmToTrue: function (name) { setVmToTrue: function(name) {
var vm = this.getViewModel(); var vm = this.getViewModel();
switch (name) { switch (name) {
case 'After Hours': case 'After Hours':
@ -84,45 +84,38 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
case 'Company Hours': case 'Company Hours':
vm.set('company_hours_exists_in_api', true); vm.set('company_hours_exists_in_api', true);
break; break;
case 'List A':
vm.set('list_a_exists_in_api', true);
break;
case 'List B':
vm.set('list_b_exists_in_api', true);
break;
}; };
}, },
cfSourcesetStoreLoaded: function(store, data) { cfSourcesetStoreLoaded: function(store, data) {
var me = this; var me = this;
var arrayOfModels = []; var arrayOfModels = [];
if (data.getData()._embedded == undefined) { if (data.getData()._embedded) {
return;
} else {
var sourcesets = data.getData()._embedded['ngcp:cfsourcesets']; var sourcesets = data.getData()._embedded['ngcp:cfsourcesets'];
store.removeAll(); store.removeAll();
Ext.each(sourcesets, function (sourceset) { store._sourcesets = sourcesets;
Ext.each(sourcesets, function(sourceset) {
var sourcesetName = sourceset.name; var sourcesetName = sourceset.name;
var sourcesetId = sourceset.id; var sourcesetId = sourceset.id;
me.setVmToTrue(sourcesetName); me.setVmToTrue(sourcesetName);
Ext.each(sourceset.sources, function (sourceEntry) { Ext.each(sourceset.sources, function(sourceEntry) {
var cfModel = Ext.create('NgcpCsc.model.CallForwardDestination', { arrayOfModels.push(Ext.create('NgcpCsc.model.CallForwardDestination', {
id: Ext.id(), id: Ext.id(),
sourceset_name: sourcesetName, sourceset_name: sourcesetName,
sourceset_id: sourcesetId, sourceset_id: sourcesetId,
source: sourceEntry.source source: sourceEntry.source
}); }))
arrayOfModels.push(cfModel);
}); });
}); });
if (arrayOfModels.length > 0) {
me.populateSourcesetStores(arrayOfModels);
};
} }
me.createSourcesetTabs(sourcesets);
Ext.defer(function(){
me.populateSourcesetStores(arrayOfModels);
},100)
}, },
getTimesetFromRoute: function (route) { getTimesetFromRoute: function(route) {
switch (route) { switch (route) {
case ('#callforward/always'): case ('#callforward/always'):
return null; return null;
@ -136,22 +129,22 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}; };
}, },
sortDestinationsetByPriority: function (destinations) { sortDestinationsetByPriority: function(destinations) {
var sorted = destinations.sort(function(a, b) { var sorted = destinations.sort(function(a, b) {
return parseFloat(a.priority) - parseFloat(b.priority); return parseFloat(a.priority) - parseFloat(b.priority);
}); });
return sorted; return sorted;
}, },
addCftOwnPhone: function (destinations) { addCftOwnPhone: function(destinations) {
if (destinations.length > 0) { if (destinations.length > 0) {
destinations.unshift({ destinations.unshift({
"announcement_id": null, "announcement_id": null,
"destination": "own phone", "destination": "own phone",
"priority": 1, "priority": 1,
"timeout": 15 "timeout": 15
}) })
} }
}, },
cfStoreLoaded: function(store, data) { cfStoreLoaded: function(store, data) {
@ -174,10 +167,11 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var destinationsets = decodedResponse._embedded['ngcp:cfdestinationsets']; var destinationsets = decodedResponse._embedded['ngcp:cfdestinationsets'];
destinationsets[0].destinations = me.sortDestinationsetByPriority(destinationsets[0].destinations); destinationsets[0].destinations = me.sortDestinationsetByPriority(destinationsets[0].destinations);
me.getView()._preventReLoad = true; // assumes there is no need to reload the store me.getView()._preventReLoad = true; // assumes there is no need to reload the store
Ext.each(cfTypeArrayOfObjects, function (cfTypeObjects, index) { Ext.each(cfTypeArrayOfObjects, function(cfTypeObjects, index) {
var cfType = cfTypes[index]; var cfType = cfTypes[index];
cfType !== 'cft' && me.addCftOwnPhone(destinationsets[0].destinations); // if 'cft' we invoke addCftOwnPhone() cfType !== 'cft' && me.addCftOwnPhone(destinationsets[0].destinations); // if 'cft' we invoke addCftOwnPhone()
Ext.each(cfTypeObjects, function(cfTypeObject) { Ext.each(cfTypeObjects, function(cfTypeObject) {
var destinationsetName = cfTypeObject.destinationset; var destinationsetName = cfTypeObject.destinationset;
var sourcesetName = cfTypeObject.sourceset; var sourcesetName = cfTypeObject.sourceset;
var timesetName = cfTypeObject.timeset; var timesetName = cfTypeObject.timeset;
@ -227,7 +221,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}, },
destinationIdExistsInArray: function (arr, id) { destinationIdExistsInArray: function(arr, id) {
return arr.some(function(arrObj) { return arr.some(function(arrObj) {
return id == arrObj.id; return id == arrObj.id;
}); });
@ -244,31 +238,38 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
if (data.destination !== 'own phone') { if (data.destination !== 'own phone') {
switch (recordsToSend.length === 0 || !me.destinationIdExistsInArray(recordsToSend, data.destinationset_id)) { switch (recordsToSend.length === 0 || !me.destinationIdExistsInArray(recordsToSend, data.destinationset_id)) {
case true: case true:
recordsToSend.push({id: data.destinationset_id, records: [{ recordsToSend.push({
"announcement_id": null, id: data.destinationset_id,
"destination": data.destination, records: [{
"priority": data.priority, "announcement_id": null,
"timeout": data.timeout }]}); "destination": data.destination,
"priority": data.priority,
"timeout": data.timeout
}]
});
break; break;
case false: case false:
recordsToSend.forEach(function (obj, index) { recordsToSend.forEach(function(obj, index) {
if (obj.id == data.destinationset_id) { if (obj.id == data.destinationset_id) {
recordsToSend[index].records.push({ recordsToSend[index].records.push({
"announcement_id": null, "announcement_id": null,
"destination": data.destination, "destination": data.destination,
"priority": data.priority, "priority": data.priority,
"timeout": data.timeout }); "timeout": data.timeout
});
}; };
}); });
break; break;
}; };
}; };
}); });
Ext.each(recordsToSend, function (obj) { Ext.each(recordsToSend, function(obj) {
Ext.Ajax.request({ Ext.Ajax.request({
url: '/api/cfdestinationsets/' + obj.id, url: '/api/cfdestinationsets/' + obj.id,
method: 'PATCH', method: 'PATCH',
headers: { 'Content-Type': 'application/json-patch+json' }, headers: {
'Content-Type': 'application/json-patch+json'
},
jsonData: [{ jsonData: [{
"op": "add", "op": "add",
"path": "/destinations", "path": "/destinations",
@ -285,22 +286,26 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return false; return false;
}, },
cfSourcesetBeforeSync: function (store, options) { cfSourcesetBeforeSync: function(store, options) {
// Using Ajax request here as we are using different url // Using Ajax request here as we are using different url
// params for PATCH compared to GET // params for PATCH compared to GET
delete options['destroy']; delete options['destroy'];
delete options['create']; delete options['create'];
delete options['update']; delete options['update'];
var sourcesetId = store.last().get('sourceset_id'); var sourcesetId = store._sourcesetListId;
var recordsToSend = []; var recordsToSend = [];
Ext.each(store.getRange(), function (record) { Ext.each(store.getRange(), function(record) {
var data = record.getData(); var data = record.getData();
recordsToSend.push({ "source": data.source }); recordsToSend.push({
"source": data.source
});
}); });
Ext.Ajax.request({ Ext.Ajax.request({
url: '/api/cfsourcesets/' + sourcesetId, url: '/api/cfsourcesets/' + sourcesetId,
method: 'PATCH', method: 'PATCH',
headers: { 'Content-Type': 'application/json-patch+json' }, headers: {
'Content-Type': 'application/json-patch+json'
},
jsonData: [{ jsonData: [{
"op": "add", "op": "add",
"path": "/sources", "path": "/sources",
@ -316,14 +321,14 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return false; return false;
}, },
cfTimesetBeforeSync: function (store, options) { cfTimesetBeforeSync: function(store, options) {
delete options['destroy']; delete options['destroy'];
delete options['create']; delete options['create'];
delete options['update']; delete options['update'];
return false; return false;
}, },
getDestinationFromSipId: function (destination) { getDestinationFromSipId: function(destination) {
var splitDestination = destination === 'own phone' ? [null, null, 'own phone', null, null] : destination.split(/(:|@)/); var splitDestination = destination === 'own phone' ? [null, null, 'own phone', null, null] : destination.split(/(:|@)/);
switch (splitDestination[4]) { switch (splitDestination[4]) {
case 'voicebox.local': case 'voicebox.local':
@ -348,7 +353,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}; };
}, },
getGridCategoryFromType: function (type) { getGridCategoryFromType: function(type) {
switch (type) { switch (type) {
case 'cft': case 'cft':
case 'cfu': case 'cfu':
@ -363,7 +368,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}; };
}, },
getTypeFromTypeName: function (type) { getTypeFromTypeName: function(type) {
switch (type) { switch (type) {
case 'Online': case 'Online':
return 'cfu'; return 'cfu';
@ -377,41 +382,23 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}; };
}, },
getSourceNameFromSourceSet: function (sourceset) { getSourceNameFromSourceSet: function(sourceset) {
switch (sourceset) { switch (sourceset) {
case 'List A':
return 'listA-';
break;
case 'List B':
return 'listB-';
break;
case null: case null:
return 'everybody-'; return 'everybody-';
break; break;
}; default:
}, return sourceset.replace(/ /g, '') + '-';
}
getSourceSetFromSourceName: function (sourceset) {
switch (sourceset) {
case 'listA':
return 'List A';
break;
case 'listB':
return 'List B';
break;
case null:
return null;
break;
};
}, },
getTimeNameFromTimeSet: function (timeset) { getTimeNameFromTimeSet: function(timeset) {
switch (timeset) { switch (timeset) {
case 'After Hours': case 'After Hours':
return 'afterHours-'; return 'afterhours-';
break; break;
case 'Company Hours': case 'Company Hours':
return 'companyHours-'; return 'companyhours-';
break; break;
case null: case null:
return 'always-'; return 'always-';
@ -419,12 +406,12 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
} }
}, },
getTimeSetFromTimeSource: function (timeset) { getTimeSetFromTimeSource: function(timeset) {
switch (timeset) { switch (timeset) {
case 'afterHours': case 'afterhours':
return 'After Hours'; return 'After Hours';
break; break;
case 'companyHours': case 'companyhours':
return 'Company Hours'; return 'Company Hours';
break; break;
case null: case null:
@ -439,15 +426,15 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return 'always'; return 'always';
break; break;
case '#callforward/afterhours': case '#callforward/afterhours':
return 'afterHours'; return 'afterhours';
break; break;
case '#callforward/companyhours': case '#callforward/companyhours':
return 'companyHours'; return 'companyhours';
break; break;
}; };
}, },
getModelValuesFromTimesData: function (timesData) { getModelValuesFromTimesData: function(timesData) {
var times = {}; var times = {};
var timesFromAndTo = timesData.hour !== null ? timesData.hour.split('-') : [null, null]; var timesFromAndTo = timesData.hour !== null ? timesData.hour.split('-') : [null, null];
var daysFromAndTo = timesData.wday !== null ? timesData.wday.split('-') : [null, null]; var daysFromAndTo = timesData.wday !== null ? timesData.wday.split('-') : [null, null];
@ -461,7 +448,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
times.timeFrom = timeFrom; times.timeFrom = timeFrom;
times.timeTo = timeTo; times.timeTo = timeTo;
if (!!timesData.wday) { if (!!timesData.wday) {
var weekdaysArray = weekdayLiterals.slice(dayFrom-1, dayTo); var weekdaysArray = weekdayLiterals.slice(dayFrom - 1, dayTo);
times.days = weekdaysArray; times.days = weekdaysArray;
} else { } else {
times.days = null; times.days = null;
@ -469,27 +456,27 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return times; return times;
}, },
populateTimesetStores: function (models) { populateTimesetStores: function(models) {
var vm = this.getViewModel(); var vm = this.getViewModel();
var currentRoute = window.location.hash; var currentRoute = window.location.hash;
var moduleName = this.getModuleFromRoute(currentRoute); var moduleName = this.getModuleFromRoute(currentRoute);
var store = Ext.getStore(moduleName + '-Timeset'); var store = Ext.getStore(moduleName + '-Timeset');
if (store.getCount() === 0 ) { if (store.getCount() === 0) {
Ext.each(models, function (model) { Ext.each(models, function(model) {
if (moduleName == 'afterHours' && model.get('timeset_name') == 'After Hours') { if (moduleName == 'afterours' && model.get('timeset_name') == 'After Hours') {
store.add(model); store.add(model);
} else if (moduleName == 'companyHours' && model.get('timeset_name') == 'Company Hours') { } else if (moduleName == 'companyours' && model.get('timeset_name') == 'Company Hours') {
store.add(model); store.add(model);
}; };
}); });
store.commitChanges(); store.commitChanges();
if (store.getCount() > 0 ) { if (store.getCount() > 0) {
vm.set(moduleName + '_hideMessage', true); vm.set(moduleName + '_hideMessage', true);
}; };
}; };
}, },
setLabelTerminationType: function (store) { setLabelTerminationType: function(store) {
var terminationPositionRecord = store.findRecord('destination_displayed', /(Voicemail|Fax2Mail|Conference|Custom-hours|Office-hours|Auto-attendant|Callthrough|Callingcard)/); var terminationPositionRecord = store.findRecord('destination_displayed', /(Voicemail|Fax2Mail|Conference|Custom-hours|Office-hours|Auto-attendant|Callthrough|Callingcard)/);
var storeCount = store.getCount(); var storeCount = store.getCount();
// Sets after_termination value for all records after first non-number // Sets after_termination value for all records after first non-number
@ -497,16 +484,16 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var terminationPositionIndex = store.indexOf(terminationPositionRecord); var terminationPositionIndex = store.indexOf(terminationPositionRecord);
var terminationTrueIndexRange = []; var terminationTrueIndexRange = [];
var terminationFalseIndexRange = []; var terminationFalseIndexRange = [];
for (i = terminationPositionIndex+1; i < storeCount; i++) { for (i = terminationPositionIndex + 1; i < storeCount; i++) {
terminationTrueIndexRange.push(i); terminationTrueIndexRange.push(i);
}; };
for (i = terminationPositionIndex; i >= 0; i--) { for (i = terminationPositionIndex; i >= 0; i--) {
terminationFalseIndexRange.push(i); terminationFalseIndexRange.push(i);
}; };
terminationTrueIndexRange.map(function (index) { terminationTrueIndexRange.map(function(index) {
store.getAt(index).set('after_termination', true); store.getAt(index).set('after_termination', true);
}); });
terminationFalseIndexRange.map(function (index) { terminationFalseIndexRange.map(function(index) {
store.getAt(index).set('after_termination', false); store.getAt(index).set('after_termination', false);
}); });
}; };
@ -538,44 +525,136 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
} }
}); });
}, },
populateDestinationStores: function(models) {
populateDestinationStores: function (models) {
var me = this; var me = this;
var store; var store;
var stores = []; var stores = [];
Ext.each(models, function (model) { Ext.each(models, function(model) {
var sourcename = me.getSourceNameFromSourceSet(model.get('sourceset')); var sourcename = me.getSourceNameFromSourceSet(model.get('sourceset'));
var timename = me.getTimeNameFromTimeSet(model.get('timeset')); var timename = me.getTimeNameFromTimeSet(model.get('timeset'));
var type = me.getGridCategoryFromType(model.get('type')); var type = me.getGridCategoryFromType(model.get('type'));
var storeName = sourcename + timename + type; var storeName = sourcename + timename + type;
store = Ext.getStore(storeName); store = Ext.getStore(storeName);
if (store) { if (store) {
store.add(model); store.add(model);
stores.push(store); stores.push(store);
} }
}); });
if (store) { if (store) {
Ext.each(stores, function (store) { Ext.each(stores, function(store) {
store.commitChanges(); store.commitChanges();
me.setLabelTerminationType(store); me.setLabelTerminationType(store);
}); });
} }
}, },
createSourcesetTabs: function(sourcesets) {
var me = this;
var vm = this.getViewModel();
var subscriberId = localStorage.getItem('subscriber_id');
var cfTabPanels = Ext.ComponentQuery.query('[name=cfTab]');
var currentRoute = window.location.hash;
var moduleName = this.getModuleFromRoute(currentRoute);
if (sourcesets && sourcesets.length > 0) {
Ext.each(cfTabPanels, function(tabP) {
if (tabP._tabId == moduleName) {
Ext.each(sourcesets, function(sourceset, index) {
var sourcesetName = sourceset.isModel ? sourceset.get('sourceset_name') : sourceset.name;
var sourcesetId = sourceset.isModel ? sourceset.get('sourceset_id') : sourceset.id;
var strippedSourcesetName = sourcesetName.replace(/ /g, '');
tabP._firstPrefixes.push(strippedSourcesetName + '-');
vm.set('sourceset-' + sourcesetId + '-title', sourcesetName);
vm.set('sourceset-' + sourcesetId + 'from-title', Ngcp.csc.locales.callforward.from[localStorage.getItem('languageSelected')] + sourcesetName);
vm.set('sourceset-' + sourcesetId + '-titleField-value', '');
Ext.defer(function() {
if (Ext.ComponentQuery.query("[name=" + tabP._tabId + '-tab-' + strippedSourcesetName + "]").length < 1) {
var newTab = Ext.create('Ext.panel.Panel', {
bind: {
title: '{sourceset-' + sourcesetId + 'from-title}'
},
name: tabP._tabId + '-tab-' + strippedSourcesetName,
id: (tabP._tabId + '-tab-' + strippedSourcesetName).toString(),
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_isEverybody: false,
_sourcesetStoreId: strippedSourcesetName,
_sourcesetListName: sourcesetName,
_sourcesetListId: sourcesetId,
_firstprefix: tabP._firstPrefixes[index + 1],
_secondprefix: tabP._secondprefix
})
]
});
tabP.add(newTab);
}
}, 100);
});
return;
}
});
} else {
var models = [];
Ext.Ajax.request({
url: '/api/cfsourcesets/',
method: 'POST',
jsonData: {
name: 'List A',
mode: 'whitelist',
subscriber_id: subscriberId
},
success: function(response, opts) {
var sourcesetId = response.getResponseHeader('Location').split('/')[3];
models.push(Ext.create('NgcpCsc.model.CallForwardDestination', {
id: Ext.id(),
sourceset_name: 'List A',
sourceset_id: sourcesetId
}));
Ext.Ajax.request({
url: '/api/cfsourcesets/',
method: 'POST',
jsonData: {
name: 'List B',
mode: 'whitelist',
subscriber_id: subscriberId
},
success: function(response, opts) {
var sourcesetId = response.getResponseHeader('Location').split('/')[3];
models.push(Ext.create('NgcpCsc.model.CallForwardDestination', {
id: Ext.id(),
sourceset_name: 'List B',
sourceset_id: sourcesetId
}));
me.createSourcesetTabs(models);
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
}
},
populateSourcesetStores: function (models) { populateSourcesetStores: function(models) {
var storeListAAlways = Ext.getStore('CallForwardListA'); var stores = {};
var storeListBAlways = Ext.getStore('CallForwardListB'); Ext.each(models, function(model) {
storeListAAlways.removeAll(); var tabId = model.get('sourceset_name');
storeListBAlways.removeAll(); var strippedSourcesetName = tabId.replace(/ /g, '');
Ext.each(models, function (model) { if(!stores[strippedSourcesetName]){
if (model.get('sourceset_name') == 'List A') { stores[strippedSourcesetName] = [];
storeListAAlways.add(model); }
} else if (model.get('sourceset_name') == 'List B') { stores[strippedSourcesetName].push(model);
storeListBAlways.add(model); });
}; Ext.Object.each(stores, function(storeNameSuffix, models){
var store = Ext.getStore('CallForwardList_' + storeNameSuffix);
store.removeAll();
store.add(models);
store.commitChanges();
}); });
storeListAAlways.commitChanges();
storeListBAlways.commitChanges();
}, },
editingPhoneDone: function(editor, context) { editingPhoneDone: function(editor, context) {
@ -587,11 +666,10 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
store.sync(); store.sync();
}, },
beforePhoneEdit: function (editor, context) { beforePhoneEdit: function(editor, context) {
var record = context.record; var record = context.record;
var grid = context.grid; var grid = context.grid;
record.set("edit", true); record.set("edit", true);
grid.getView().refresh();
}, },
collapsePanel: function(el) { collapsePanel: function(el) {
@ -639,33 +717,59 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}, },
saveNewTitle: function(button) { saveNewTitle: function(button) {
var me = this;
var vm = this.getViewModel(); var vm = this.getViewModel();
var buttonId = button.id; var buttonId = button.name;
var hiddenKey = 'hide_' + buttonId.split('-')[2]; var keys = buttonId.split('-');
vm.set(hiddenKey, !vm.get(hiddenKey)); Ext.Ajax.request({
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.save_success[localStorage.getItem('languageSelected')]); url: '/api/cfsourcesets/' + button._sourcesetListId,
method: 'PATCH',
headers: {
'Content-Type': 'application/json-patch+json'
},
jsonData: [{
"op": "replace",
"path": "/name",
"value": vm.get('sourceset-' + keys[0] + "-titleField-value")
}],
success: function(response, opts) {
me.updateTabsTitles(keys[0]);
me.fireEvent('showmessage', true, Ngcp.csc.locales.common.save_success[localStorage.getItem('languageSelected')]);
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
}, },
cancelNewTitle: function(button) { updateTabsTitles: function(sourcesetId, sourcesetTitleValue) {
var vm = this.getViewModel(); var vm = this.getViewModel();
var buttonId = button.id; var me = this;
var hiddenKey = 'hide_' + buttonId.split('-')[2]; var cfTabPanels = Ext.ComponentQuery.query('[name=cfTab]');
vm.set(hiddenKey, !vm.get(hiddenKey)); var currentRoute = window.location.hash;
var moduleName = this.getModuleFromRoute(currentRoute);
var newTitle = vm.get('sourceset-' + sourcesetId + "-titleField-value");
Ext.each(cfTabPanels, function(tabP) { // every CF submdule has its own vm
if (tabP._tabId !== moduleName) {
me.updateVMTitle(tabP.up('callforward').getViewModel(), sourcesetId, newTitle);
} else {
me.updateVMTitle(vm, sourcesetId, newTitle);
}
});
},
updateVMTitle: function(vm, sourcesetId, sourcestTitleValue) {
vm.set('sourceset-' + sourcesetId + "-title", sourcestTitleValue);
vm.set('sourceset-' + sourcesetId + "from-title", Ngcp.csc.locales.callforward.from[localStorage.getItem('languageSelected')] + sourcestTitleValue);
vm.set('sourceset-' + sourcesetId + "-titleField-value", "")
}, },
onEditClicked: function(el) { cancelNewTitle: function(button) {
var vm = this.getViewModel(); var vm = this.getViewModel();
var classList = el.target.classList; var buttonId = button.name;
switch (true) { var keys = buttonId.split('-');
case (classList.contains('edit-listA')): vm.set('sourceset-' + keys[0] + "-titleField-value", "");
vm.set('list_b', true);
vm.set('list_a', !vm.get('list_a'));
break;
case (classList.contains('edit-listB')):
vm.set('list_a', true);
vm.set('list_b', !vm.get('list_b'));
break;
};
}, },
checkIndexOf: function(string, target) { checkIndexOf: function(string, target) {
@ -677,95 +781,18 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var store = grid.getStore(); var store = grid.getStore();
var plugin = grid.getPlugin('celleditingSource'); var plugin = grid.getPlugin('celleditingSource');
var newRowIndex = store.getCount() + 1; var newRowIndex = store.getCount() + 1;
var record = store.last();
var sourcesetName = grid.id.split('-')[0] == 'listA' ? 'List A' : 'List B';
var listAId = null;
var listBId = null;
var listExistsInApi = false;
Ext.Ajax.request({
url: '/api/cfsourcesets/?subscriber_id=' + localStorage.getItem('subscriber_id'),
success: function(response, opts) {
var decodedResponse = Ext.decode(response.responseText);
if (decodedResponse._embedded) {
var sourcesets = decodedResponse._embedded['ngcp:cfsourcesets'];
Ext.each(sourcesets, function (destinationset, index) {
if (destinationset.name == 'List A') {
listAId = destinationset.id;
} else if (destinationset.name == 'List B') {
listBId = destinationset.id;
}
if (sourcesetName == 'List A' && listAId !== null) {
listExistsInApi = true;
} else if (sourcesetName == 'List B' && listBId !== null) {
listExistsInApi = true;
}
});
};
switch (!store.last()) {
case false:
if (record == null || (record.data.source !== ' ' && record.data.source !== '')) {
var cfSourcesetModel = Ext.create('NgcpCsc.model.CallForwardSourceset', {
id: Ext.id(),
source: " ",
sourceset_name: record.get('sourceset_name'),
sourceset_id: record.get('sourceset_id'),
edit: true
});
store.add(cfSourcesetModel);
};
break;
case true: // if store empty we need to create new sourceset
switch (listExistsInApi) {
case true:
var cfSourcesetModel = Ext.create('NgcpCsc.model.CallForwardSourceset', {
id: Ext.id(),
source: " ",
sourceset_name: sourcesetName,
sourceset_id: listAId || listBId,
edit: true
});
store.add(cfSourcesetModel);
break;
case false:
var subscriberId = localStorage.getItem('subscriber_id');
Ext.Ajax.request({
url: '/api/cfsourcesets/',
method: 'POST',
jsonData: {
name: sourcesetName,
subscriber_id: subscriberId
},
success: function(response, opts) {
var sourcesetId = response.getResponseHeader('Location').split('/')[3];
var cfSourcesetModel = Ext.create('NgcpCsc.model.CallForwardSourceset', {
id: Ext.id(),
source: " ",
sourceset_name: sourcesetName,
sourceset_id: sourcesetId,
edit: true
});
store.add(cfSourcesetModel);
},
failure: function(response, opts) {
console.log('server-side failure with status code ' + response.status);
}
});
break;
}
break;
}
},
failure: function(response, opts) { var cfSourcesetModel = Ext.create('NgcpCsc.model.CallForwardSourceset', {
console.log('server-side failure with status code ' + response.status); id: Ext.id(),
}, source: " ",
sourceset_name: vm.get('sourceset-' + grid.up('cfMainForm')._sourcesetListId + "-title"),
callback: function () { sourceset_id: grid.up('cfMainForm')._sourcesetListId,
plugin.startEditByPosition({ edit: true
row: newRowIndex, });
column: 0 store.add(cfSourcesetModel);
}); plugin.startEditByPosition({
} row: newRowIndex,
column: 0
}); });
}, },
@ -774,16 +801,8 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var buttonPrefixOne = buttonIdSplit[0]; var buttonPrefixOne = buttonIdSplit[0];
var buttonPrefixTwo = buttonIdSplit[1]; var buttonPrefixTwo = buttonIdSplit[1];
var buttonSuffix = buttonIdSplit[2]; var buttonSuffix = buttonIdSplit[2];
switch (buttonSuffix) { var grid = Ext.getCmp(buttonPrefixOne + '-' + buttonPrefixTwo + '-cf-sourceset-list-grid');
case 'addListAButton': this.writeNewSourceToStore(grid);
var grid = Ext.getCmp(buttonPrefixOne + '-' + buttonPrefixTwo + '-cf-sourceset-list-a-grid');
this.writeNewSourceToStore(grid);
break;
case 'addListBButton':
var grid = Ext.getCmp(buttonPrefixOne + '-' + buttonPrefixTwo + '-cf-sourceset-list-b-grid');
this.writeNewSourceToStore(grid);
break;
};
}, },
removeEntry: function(grid, rowIndex, colIndex) { removeEntry: function(grid, rowIndex, colIndex) {
@ -798,7 +817,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
confirmCFRemoval: function(record) { confirmCFRemoval: function(record) {
var me = this; var me = this;
var store = record.store; var store = record.store;
if(store){ if (store) {
store.remove(record); store.remove(record);
store.sync(); store.sync();
me.setLabelTerminationType(store); me.setLabelTerminationType(store);
@ -810,26 +829,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
var prefix = currentSourceset + '-' + view + '-'; var prefix = currentSourceset + '-' + view + '-';
return [prefix + 'CallForwardOnline', prefix + 'CallForwardBusy', prefix + 'CallForwardOffline']; return [prefix + 'CallForwardOnline', prefix + 'CallForwardBusy', prefix + 'CallForwardOffline'];
}, },
onTabClicked: function(cmp) {
var me = this;
var vm = me.getViewModel();
var currentRoute = window.location.hash.replace('hours', 'Hours');
var currentTimeset = currentRoute.split('/')[1];
var currentSourceset = cmp.id.split('-')[2];
var storesArray = this.getStoresArrayFromRoute(currentRoute, currentSourceset);
if (currentSourceset === 'everybody') {
vm.set('list_b', true);
vm.set('list_a', true);
} else if (currentSourceset === 'listA') {
vm.set('list_b', true);
vm.set('list_a', false);
} else if (currentSourceset === 'listB') {
vm.set('list_a', true);
vm.set('list_b', false);
};
},
renderDay: function(value, meta, record) { renderDay: function(value, meta, record) {
if (record.get('closed') === true) { if (record.get('closed') === true) {
return Ext.String.format('<div class="cf-deactivate-day">{0}</div>', value); return Ext.String.format('<div class="cf-deactivate-day">{0}</div>', value);
@ -975,7 +974,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}, },
createNewStandardSet: function (url, name, subscriberId) { createNewStandardSet: function(url, name, subscriberId) {
var vm = this.getViewModel(); var vm = this.getViewModel();
Ext.Ajax.request({ Ext.Ajax.request({
url: url, url: url,
@ -986,49 +985,50 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}, },
success: function(response, opts) { success: function(response, opts) {
switch (name) { switch (name) {
case 'List A':
vm.set('list_a_exists_in_api', true);
break;
case 'List B':
vm.set('list_b_exists_in_api', true);
break;
case 'After Hours': case 'After Hours':
vm.set('after_hours_exists_in_api', true); vm.set('after_hours_exists_in_api', true);
break; break;
case 'Company Hours': case 'Company Hours':
vm.set('company_hours_exists_in_api', true); vm.set('company_hours_exists_in_api', true);
break; break;
} }
} }
}); });
}, },
createNewMapping: function (subscriberId, newType, newDestinationsetName, newSourceset, newTimeset) { createNewMapping: function(subscriberId, newType, newDestinationsetName, newSourceset, newTimeset) {
Ext.Ajax.request({ Ext.Ajax.request({
url: '/api/cfmappings/' + subscriberId, url: '/api/cfmappings/' + subscriberId,
method: 'PATCH', method: 'PATCH',
headers: { 'Content-Type': 'application/json-patch+json' }, headers: {
'Content-Type': 'application/json-patch+json'
},
jsonData: [{ jsonData: [{
"op": "add", "op": "add",
"path": "/" + newType, "path": "/" + newType,
"value": [{ "destinationset": newDestinationsetName, "sourceset": newSourceset, "timeset": newTimeset }] "value": [{
"destinationset": newDestinationsetName,
"sourceset": newSourceset,
"timeset": newTimeset
}]
}] }]
}); });
}, },
writeNewDestinationToStore: function (store, destination, timeout) { writeNewDestinationToStore: function(store, destination, timeout) {
var me = this; var me = this;
var vm = this.getViewModel(); var vm = this.getViewModel();
var simpleDestination = destination; var simpleDestination = destination;
var priority = 1; var priority = 1;
var storeCount = store.getCount(); var storeCount = store.getCount();
var activeTab = this.getView().down('tabpanel').getActiveTab().down('cfMainForm');
// Removes timeout if destination is not a number // Removes timeout if destination is not a number
var ringFor = !Ext.isNumber(parseInt(destination)) ? '' : timeout; var ringFor = !Ext.isNumber(parseInt(destination)) ? '' : timeout;
var storeIdSplit = store.storeId.split('-'); var storeIdSplit = store.storeId.split('-');
var newSourcesetName = storeIdSplit[0] == 'everybody' ? null : storeIdSplit[0]; var newSourcesetName = storeIdSplit[0] == 'everybody' ? null : storeIdSplit[0];
var newTimesetName = storeIdSplit[1] == 'always' ? null : storeIdSplit[1]; var newTimesetName = storeIdSplit[1] == 'always' ? null : storeIdSplit[1];
var newTypeName = storeIdSplit[2].slice(11); var newTypeName = storeIdSplit[2].slice(11);
var newSourceset = this.getSourceSetFromSourceName(newSourcesetName); var newSourceset = activeTab ? vm.get('sourceset-' + activeTab._sourcesetListId + "-title") : null;
var newTimeset = this.getTimeSetFromTimeSource(newTimesetName); var newTimeset = this.getTimeSetFromTimeSource(newTimesetName);
var newType = this.getTypeFromTypeName(newTypeName); var newType = this.getTypeFromTypeName(newTypeName);
var newDestination = destination === 'Voicemail' ? 'voicebox' : destination.toLowerCase(); var newDestination = destination === 'Voicemail' ? 'voicebox' : destination.toLowerCase();
@ -1037,7 +1037,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
// checked with Andreas // checked with Andreas
var newTimeout = !timeout ? '10' : timeout; var newTimeout = !timeout ? '10' : timeout;
if (!store.last()) { // if store empty we need to create new destset if (!store.last()) { // if store empty we need to create new destset
var newDestinationsetName = 'csc_defined_' + newType; var newDestinationsetName = 'csc_defined_' + newType + '_' + Date.now();
var subscriberId = localStorage.getItem('subscriber_id'); var subscriberId = localStorage.getItem('subscriber_id');
Ext.Ajax.request({ Ext.Ajax.request({
url: '/api/cfdestinationsets/', url: '/api/cfdestinationsets/',
@ -1062,9 +1062,15 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
store.add(cfModel); store.add(cfModel);
me.setLabelTerminationType(store); me.setLabelTerminationType(store);
store.sync(); store.sync();
// TODO @Robert: do we need to create new timeset/sourceset here?
// it seems to me that they have to exist already, if user is able
// to create a new destination
// Creates new sourceset/timeset if variable is not set to null // Creates new sourceset/timeset if variable is not set to null
newSourceset && me.createNewStandardSet('/api/cfsourcesets/', newSourceset, subscriberId); //newSourceset && me.createNewStandardSet('/api/cfsourcesets/', newSourceset, subscriberId);
newTimeset && me.createNewStandardSet('/api/cftimesets/', newTimeset, subscriberId); //newTimeset && me.createNewStandardSet('/api/cftimesets/', newTimeset, subscriberId);
me.createNewMapping(subscriberId, newType, newDestinationsetName, newSourceset, newTimeset); me.createNewMapping(subscriberId, newType, newDestinationsetName, newSourceset, newTimeset);
}, },
failure: function(response, opts) { failure: function(response, opts) {

@ -1,6 +1,8 @@
Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', { Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
extend: 'Ext.form.Panel', extend: 'Ext.form.Panel',
xtype: 'cfMainForm',
defaults: { defaults: {
width: '100%' width: '100%'
}, },
@ -15,460 +17,415 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
ui: 'cf-mainform', ui: 'cf-mainform',
initComponent: function() { _isEverybody: true,
var storeListA = Ext.getStore('CallForwardListA') || Ext.create('NgcpCsc.store.CallForwardSourceset', { _sourcesetStoreId: null,
storeId: 'CallForwardListA'
});
var storeListB = Ext.getStore('CallForwardListB') || Ext.create('NgcpCsc.store.CallForwardSourceset', {
storeId: 'CallForwardListB'
});
if(!storeListA.isLoaded()){ _sourcesetListName: null,
storeListA.load();
_sourcesetListId: null,
initComponent: function() {
if (this._sourcesetStoreId) {
var sourceSetList = Ext.getStore('CallForwardList_' + this._sourcesetStoreId) || Ext.create('NgcpCsc.store.CallForwardSourceset', {
storeId: 'CallForwardList_' + this._sourcesetStoreId,
_sourcesetListName: this._sourcesetListName,
_sourcesetListId: this._sourcesetListId
});
var callForwardList = Ext.create('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
id: this._firstprefix + this._secondprefix + 'cf-sourceset-list-grid',
store: sourceSetList
});
} else {
if(Ext.getStore('firstSLStore')){
Ext.getStore('firstSLStore').load(); // forces the tabs to be rendered
}else{
Ext.create('NgcpCsc.store.CallForwardSourceset', {
storeId: 'firstSLStore',
autoLoad: true
});
}
} }
var callForwardListAGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
id: this._firstprefix + this._secondprefix + 'cf-sourceset-list-a-grid',
store: storeListA
});
var callForwardListBGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
id: this._firstprefix + this._secondprefix + 'cf-sourceset-list-b-grid',
store: storeListB
});
var busyGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', { var busyGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
id: this._firstprefix + this._secondprefix + 'CallForwardBusy', id: this._firstprefix + this._secondprefix + 'CallForwardBusy',
store: Ext.create('NgcpCsc.store.CallForwardDestinations', { store: Ext.create('NgcpCsc.store.CallForwardDestinations', {
storeId: this._firstprefix + this._secondprefix + 'CallForwardBusy' storeId: this._firstprefix + this._secondprefix + 'CallForwardBusy',
_sourcesetListName: this._sourcesetListName
}) })
}); });
var onlineGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', { var onlineGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
id: this._firstprefix + this._secondprefix + 'CallForwardOnline', id: this._firstprefix + this._secondprefix + 'CallForwardOnline',
store: Ext.create('NgcpCsc.store.CallForwardDestinations', { store: Ext.create('NgcpCsc.store.CallForwardDestinations', {
storeId: this._firstprefix + this._secondprefix + 'CallForwardOnline' storeId: this._firstprefix + this._secondprefix + 'CallForwardOnline',
_sourcesetListName: this._sourcesetListName
}) })
}); });
var offlineGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', { var offlineGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainGrid', {
id: this._firstprefix + this._secondprefix + 'CallForwardOffline', id: this._firstprefix + this._secondprefix + 'CallForwardOffline',
store: Ext.create('NgcpCsc.store.CallForwardDestinations', { store: Ext.create('NgcpCsc.store.CallForwardDestinations', {
storeId: this._firstprefix + this._secondprefix + 'CallForwardOffline' storeId: this._firstprefix + this._secondprefix + 'CallForwardOffline',
_sourcesetListName: this._sourcesetListName
}) })
}); });
this.items = [{ this.items = [{
xtype: 'panel', xtype: 'panel',
hidden: this._isEverybody,
bind: { bind: {
title: '{source_lista_title}', title: '{sourceset-' + this._sourcesetListId + '-title}'
hidden: '{list_a}'
}, },
collapsible: true, collapsible: true,
collapsed: true, collapsed: true,
items: [{ items: [{
xtype: 'form', xtype: 'form',
layout: 'hbox', layout: 'hbox',
margin: '10 0 0 0', margin: '10 0 0 0',
bind: { // TODO Robert reintroduce toggle button for sourceset Title
hidden: '{hide_lista_titleField}' items: [{
xtype: 'textfield',
userCls: 'cf-sourceset-textfield',
fieldLabel: Ngcp.csc.locales.callforward.sourceset_title[localStorage.getItem('languageSelected')],
flex: 1,
bind: {
value: '{sourceset-' +this._sourcesetListId + '-titleField-value}'
}
}, {
xtype: 'button',
html: Ngcp.csc.locales.common.cancel_caps[localStorage.getItem('languageSelected')],
name: this._sourcesetListId + '-' + this._secondprefix + 'titleField-cancelButton',
margin: '0 0 0 10',
handler: 'cancelNewTitle'
}, {
xtype: 'button',
html: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
name: this._sourcesetListId + '-' + this._secondprefix + 'titleField-saveButton',
_sourcesetListId: this._sourcesetListId,
margin: '0 0 0 10',
handler: 'saveNewTitle'
}]
}, },
items: [{ callForwardList || {}, {
xtype: 'textfield',
userCls: 'cf-sourceset-textfield',
fieldLabel: Ngcp.csc.locales.callforward.sourceset_title[localStorage.getItem('languageSelected')],
flex: 1,
bind: '{source_lista_title}'
}, {
xtype: 'button',
html: Ngcp.csc.locales.common.cancel_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'lista_titleField-cancelButton',
margin: '0 0 0 10',
handler: 'cancelNewTitle'
}, {
xtype: 'button',
html: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'lista_titleField-saveButton',
margin: '0 0 0 10',
handler: 'saveNewTitle'
}]
},
callForwardListAGrid,
{
xtype: 'panel', xtype: 'panel',
layout: 'hbox', layout: 'hbox',
margin: '15 0 0 0', margin: '15 0 0 0',
items: [ items: [{
{
xtype: 'button', xtype: 'button',
text: Ngcp.csc.locales.callforward.add_new_source[localStorage.getItem('languageSelected')], text: Ngcp.csc.locales.callforward.add_new_source[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'addListAButton', id: this._firstprefix + this._secondprefix + 'addButton',
margin: '0 0 0 620',
width: 135, width: 135,
margin: '0 0 0 620',
listeners: { listeners: {
click: 'addEmptySourcesetRow' click: 'addEmptySourcesetRow'
} }
}] }]
}] }
]
}, {
xtype: 'container',
userCls: 'cf-text cf-subheader',
html: Ngcp.csc.locales.callforward.when_phone_online[localStorage.getItem('languageSelected')]
}, {
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [
onlineGrid
]
}, { }, {
xtype: 'panel', xtype: 'panel',
margin: '10 7 0 155',
bind: { bind: {
title: '{source_listb_title}', hidden: '{online_add_new_then_hidden}'
hidden: '{list_b}'
}, },
collapsible: true, id: this._firstprefix + this._secondprefix + 'onlineThenRingFields',
collapsed: true, layout: 'hbox',
items: [{ items: [{
xtype: 'form', xtype: 'combo',
layout: 'hbox', displayField: 'name',
margin: '10 0 0 0', valueField: 'name',
store: 'Forwards',
id: this._firstprefix + this._secondprefix + 'onlineThenDest',
bind: '{online_then_dest}',
allowBlank: false,
editable: false,
flex: 3,
margin: '0 10 0 0',
listeners: {
change: 'selectRing'
}
}, {
xtype: 'textfield',
flex: 3,
id: this._firstprefix + this._secondprefix + 'onlineThenNumber',
emptyText: Ngcp.csc.locales.callforward.enter_number[localStorage.getItem('languageSelected')],
bind: { bind: {
hidden: '{hide_listb_titleField}' hidden: '{online_then_timeout_hidden}',
value: '{online_then_number}'
}, },
items: [{ listeners: {
xtype: 'textfield', specialkey: 'onEnterPressed'
userCls: 'cf-sourceset-textfield', }
fieldLabel: Ngcp.csc.locales.callforward.sourceset_title[localStorage.getItem('languageSelected')],
flex: 1,
bind: '{source_listb_title}'
}, {
xtype: 'button',
html: Ngcp.csc.locales.common.cancel_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'listb_titleField-cancelButton',
margin: '0 0 0 10',
handler: 'cancelNewTitle'
}, {
xtype: 'button',
html: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'listb_titleField-saveButton',
margin: '0 0 0 10',
handler: 'saveNewTitle'
}]
},
callForwardListBGrid,
{
xtype: 'panel',
layout: 'hbox',
margin: '15 0 0 0',
bind: {
hidden: '{list_b}'
},
items: [
{
xtype: 'button',
text: Ngcp.csc.locales.callforward.add_new_source[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'addListBButton',
width: 135,
margin: '0 0 0 620',
listeners: {
click: 'addEmptySourcesetRow'
}
}]
}]
}, {
xtype: 'container',
userCls: 'cf-text cf-subheader',
html: Ngcp.csc.locales.callforward.when_phone_online[localStorage.getItem('languageSelected')]
}, {
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [
onlineGrid
]
}, { }, {
xtype: 'panel', xtype: 'numberfield',
margin: '10 7 0 155', step: 10,
minValue: 0,
maxValue: 300,
labelWidth: 80,
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'onlineThenTimeout',
bind: { bind: {
hidden: '{online_add_new_then_hidden}' value: '{online_then_timeout}',
hidden: '{online_then_timeout_hidden}'
}, },
id: this._firstprefix + this._secondprefix + 'onlineThenRingFields', allowBlank: false,
layout: 'hbox', editable: true,
items: [{ flex: 4,
xtype: 'combo', margin: '0 0 0 10'
displayField: 'name',
valueField: 'name',
store: 'Forwards',
id: this._firstprefix + this._secondprefix + 'onlineThenDest',
bind: '{online_then_dest}',
allowBlank: false,
editable: false,
flex: 3,
margin: '0 10 0 0',
listeners: {
change: 'selectRing'
}
}, {
xtype: 'textfield',
flex: 3,
id: this._firstprefix + this._secondprefix + 'onlineThenNumber',
emptyText: Ngcp.csc.locales.callforward.enter_number[localStorage.getItem('languageSelected')],
bind: {
hidden: '{online_then_timeout_hidden}',
value: '{online_then_number}'
},
listeners: {
specialkey: 'onEnterPressed'
}
}, {
xtype: 'numberfield',
step: 10,
minValue:0,
maxValue: 300,
labelWidth: 80,
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'onlineThenTimeout',
bind: {
value: '{online_then_timeout}',
hidden: '{online_then_timeout_hidden}'
},
allowBlank: false,
editable: true,
flex: 4,
margin: '0 0 0 10'
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 10',
flex: 1,
bind: {
hidden: '{online_then_timeout_hidden}'
}
}, {
xtype: 'button',
text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'onlineSaveButton',
width: 100,
listeners: {
click: 'addNewDestination'
}
}]
}, { }, {
html: Ngcp.csc.locales.callforward.add_new_destination[localStorage.getItem('languageSelected')], xtype: 'container',
xtype: 'button', html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'onlineButton', padding: '7 0 0 10',
width: 165, flex: 1,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: { bind: {
hidden: '{online_add_button_hidden}' hidden: '{online_then_timeout_hidden}'
} }
}, { }, {
html: Ngcp.csc.locales.callforward.cancel_destination[localStorage.getItem('languageSelected')],
xtype: 'button', xtype: 'button',
id: this._firstprefix + this._secondprefix + 'onlineButtonCancel', text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
width: 165, id: this._firstprefix + this._secondprefix + 'onlineSaveButton',
margin: '15 0 0 155', width: 100,
listeners: { listeners: {
click: 'toggleNewDestinationForm' click: 'addNewDestination'
}, }
bind: { }]
hidden: '{online_cancel_button_hidden}' }, {
html: Ngcp.csc.locales.callforward.add_new_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'onlineButton',
width: 165,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: {
hidden: '{online_add_button_hidden}'
}
}, {
html: Ngcp.csc.locales.callforward.cancel_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'onlineButtonCancel',
width: 165,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: {
hidden: '{online_cancel_button_hidden}'
}
}, {
xtype: 'container',
userCls: 'cf-text cf-subheader',
html: Ngcp.csc.locales.callforward.when_phone_busy[localStorage.getItem('languageSelected')]
}, {
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [
busyGrid
]
}, {
xtype: 'panel',
margin: '10 7 0 155',
bind: {
hidden: '{busy_add_new_then_hidden}'
},
id: this._firstprefix + this._secondprefix + 'busyThenRingFields',
layout: 'hbox',
items: [{
xtype: 'combo',
displayField: 'name',
valueField: 'name',
store: 'Forwards',
id: this._firstprefix + this._secondprefix + 'busyThenDest',
bind: '{busy_then_dest}',
allowBlank: false,
editable: false,
flex: 3,
margin: '0 10 0 0',
listeners: {
change: 'selectRing'
} }
}, { }, {
xtype: 'container', xtype: 'textfield',
userCls: 'cf-text cf-subheader', flex: 3,
html: Ngcp.csc.locales.callforward.when_phone_busy[localStorage.getItem('languageSelected')] id: this._firstprefix + this._secondprefix + 'busyThenNumber',
}, { emptyText: Ngcp.csc.locales.callforward.enter_number[localStorage.getItem('languageSelected')],
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [
busyGrid
]
}, {
xtype: 'panel',
margin: '10 7 0 155',
bind: { bind: {
hidden: '{busy_add_new_then_hidden}' hidden: '{busy_then_timeout_hidden}',
value: '{busy_then_number}'
}, },
id: this._firstprefix + this._secondprefix + 'busyThenRingFields',
layout: 'hbox',
items: [{
xtype: 'combo',
displayField: 'name',
valueField: 'name',
store: 'Forwards',
id: this._firstprefix + this._secondprefix + 'busyThenDest',
bind: '{busy_then_dest}',
allowBlank: false,
editable: false,
flex: 3,
margin: '0 10 0 0',
listeners: {
change: 'selectRing'
}
}, {
xtype: 'textfield',
flex: 3,
id: this._firstprefix + this._secondprefix + 'busyThenNumber',
emptyText: Ngcp.csc.locales.callforward.enter_number[localStorage.getItem('languageSelected')],
bind: {
hidden: '{busy_then_timeout_hidden}',
value: '{busy_then_number}'
},
listeners: {
specialkey: 'onEnterPressed'
}
}, {
xtype: 'numberfield',
step: 10,
minValue:0,
maxValue: 300,
labelWidth: 80,
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'busyThenTimeout',
bind: {
value: '{busy_then_timeout}',
hidden: '{busy_then_timeout_hidden}'
},
allowBlank: false,
editable: true,
flex: 4,
margin: '0 0 0 10'
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 10',
flex: 1,
bind: {
hidden: '{busy_then_timeout_hidden}'
}
}, {
xtype: 'button',
text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'busySaveButton',
width: 100,
listeners: {
click: 'addNewDestination'
}
}]
}, {
html: Ngcp.csc.locales.callforward.add_new_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'busyButton',
width: 165,
margin: '15 0 0 155',
listeners: { listeners: {
click: 'toggleNewDestinationForm' specialkey: 'onEnterPressed'
}
}, {
xtype: 'numberfield',
step: 10,
minValue: 0,
maxValue: 300,
labelWidth: 80,
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'busyThenTimeout',
bind: {
value: '{busy_then_timeout}',
hidden: '{busy_then_timeout_hidden}'
}, },
allowBlank: false,
editable: true,
flex: 4,
margin: '0 0 0 10'
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 10',
flex: 1,
bind: { bind: {
hidden: '{busy_add_button_hidden}' hidden: '{busy_then_timeout_hidden}'
} }
}, { }, {
html: Ngcp.csc.locales.callforward.cancel_destination[localStorage.getItem('languageSelected')],
xtype: 'button', xtype: 'button',
id: this._firstprefix + this._secondprefix + 'busyButtonCancel', text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
width: 165, id: this._firstprefix + this._secondprefix + 'busySaveButton',
margin: '15 0 0 155', width: 100,
listeners: { listeners: {
click: 'toggleNewDestinationForm' click: 'addNewDestination'
}, }
bind: { }]
hidden: '{busy_cancel_button_hidden}' }, {
html: Ngcp.csc.locales.callforward.add_new_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'busyButton',
width: 165,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: {
hidden: '{busy_add_button_hidden}'
}
}, {
html: Ngcp.csc.locales.callforward.cancel_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'busyButtonCancel',
width: 165,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: {
hidden: '{busy_cancel_button_hidden}'
}
}, {
xtype: 'container',
userCls: 'cf-text cf-subheader',
html: Ngcp.csc.locales.callforward.when_phone_offline[localStorage.getItem('languageSelected')]
}, {
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [
offlineGrid
]
}, {
xtype: 'panel',
margin: '10 7 0 155',
bind: {
hidden: '{offline_add_new_then_hidden}'
},
id: this._firstprefix + this._secondprefix + 'offlineThenRingFields',
layout: 'hbox',
items: [{
xtype: 'combo',
displayField: 'name',
valueField: 'name',
store: 'Forwards',
id: this._firstprefix + this._secondprefix + 'offlineThenDest',
bind: '{offline_then_dest}',
allowBlank: false,
editable: false,
flex: 3,
margin: '0 10 0 0',
listeners: {
change: 'selectRing'
} }
}, { }, {
xtype: 'container', xtype: 'textfield',
userCls: 'cf-text cf-subheader', flex: 3,
html: Ngcp.csc.locales.callforward.when_phone_offline[localStorage.getItem('languageSelected')] id: this._firstprefix + this._secondprefix + 'offlineThenNumber',
}, { emptyText: Ngcp.csc.locales.callforward.enter_number[localStorage.getItem('languageSelected')],
xtype: 'container',
layout: 'hbox',
margin: '10 0 0 50',
items: [
offlineGrid
]
}, {
xtype: 'panel',
margin: '10 7 0 155',
bind: { bind: {
hidden: '{offline_add_new_then_hidden}' hidden: '{offline_then_timeout_hidden}',
value: '{offline_then_number}'
}, },
id: this._firstprefix + this._secondprefix + 'offlineThenRingFields',
layout: 'hbox',
items: [{
xtype: 'combo',
displayField: 'name',
valueField: 'name',
store: 'Forwards',
id: this._firstprefix + this._secondprefix + 'offlineThenDest',
bind: '{offline_then_dest}',
allowBlank: false,
editable: false,
flex: 3,
margin: '0 10 0 0',
listeners: {
change: 'selectRing'
}
}, {
xtype: 'textfield',
flex: 3,
id: this._firstprefix + this._secondprefix + 'offlineThenNumber',
emptyText: Ngcp.csc.locales.callforward.enter_number[localStorage.getItem('languageSelected')],
bind: {
hidden: '{offline_then_timeout_hidden}',
value: '{offline_then_number}'
},
listeners: {
specialkey: 'onEnterPressed'
}
}, {
xtype: 'numberfield',
step: 10,
minValue:0,
maxValue: 300,
labelWidth: 80,
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'offlineThenTimeout',
bind: {
value: '{offline_then_timeout}',
hidden: '{offline_then_timeout_hidden}'
},
allowBlank: false,
editable: true,
flex: 4,
margin: '0 0 0 10'
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 10',
flex: 1,
bind: {
hidden: '{offline_then_timeout_hidden}'
}
}, {
xtype: 'button',
text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'offlineSaveButton',
width: 100,
listeners: {
click: 'addNewDestination'
}
}]
}, {
html: Ngcp.csc.locales.callforward.add_new_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'offlineButton',
width: 165,
margin: '15 0 0 155',
listeners: { listeners: {
click: 'toggleNewDestinationForm' specialkey: 'onEnterPressed'
}
}, {
xtype: 'numberfield',
step: 10,
minValue: 0,
maxValue: 300,
labelWidth: 80,
fieldLabel: Ngcp.csc.locales.callforward.and_ring_for[localStorage.getItem('languageSelected')],
id: this._firstprefix + this._secondprefix + 'offlineThenTimeout',
bind: {
value: '{offline_then_timeout}',
hidden: '{offline_then_timeout_hidden}'
}, },
allowBlank: false,
editable: true,
flex: 4,
margin: '0 0 0 10'
}, {
xtype: 'container',
html: Ngcp.csc.locales.callforward.secs[localStorage.getItem('languageSelected')],
padding: '7 0 0 10',
flex: 1,
bind: { bind: {
hidden: '{offline_add_button_hidden}' hidden: '{offline_then_timeout_hidden}'
} }
}, { }, {
html: Ngcp.csc.locales.callforward.cancel_destination[localStorage.getItem('languageSelected')],
xtype: 'button', xtype: 'button',
id: this._firstprefix + this._secondprefix + 'offlineButtonCancel', text: Ngcp.csc.locales.common.save_caps[localStorage.getItem('languageSelected')],
width: 165, id: this._firstprefix + this._secondprefix + 'offlineSaveButton',
margin: '15 0 0 155', width: 100,
listeners: { listeners: {
click: 'toggleNewDestinationForm' click: 'addNewDestination'
},
bind: {
hidden: '{offline_cancel_button_hidden}'
} }
}]
}, {
html: Ngcp.csc.locales.callforward.add_new_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'offlineButton',
width: 165,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: {
hidden: '{offline_add_button_hidden}'
}
}, {
html: Ngcp.csc.locales.callforward.cancel_destination[localStorage.getItem('languageSelected')],
xtype: 'button',
id: this._firstprefix + this._secondprefix + 'offlineButtonCancel',
width: 165,
margin: '15 0 0 155',
listeners: {
click: 'toggleNewDestinationForm'
},
bind: {
hidden: '{offline_cancel_button_hidden}'
}
}]; }];
this.callParent(); this.callParent();

@ -6,8 +6,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardModel', {
data: { data: {
after_hours: true, after_hours: true,
company_hours: true, company_hours: true,
list_a: true,
list_b: true,
online_first_timeout_hidden: false, online_first_timeout_hidden: false,
busy_first_timeout_hidden: true, busy_first_timeout_hidden: true,
offline_first_timeout_hidden: true, offline_first_timeout_hidden: true,
@ -34,12 +32,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardModel', {
offline_then_dest: 'Number', offline_then_dest: 'Number',
offline_then_number: '', offline_then_number: '',
offline_then_timeout: '10', offline_then_timeout: '10',
source_lista_title: 'List A',
source_listb_title: 'List B',
hide_lista_titleField: true,
hide_listb_titleField: true,
list_a_exists_in_api: false,
list_b_exists_in_api: false,
after_hours_exists_in_api: false, after_hours_exists_in_api: false,
company_hours_exists_in_api: false company_hours_exists_in_api: false
}, },

@ -3,13 +3,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTab', {
xtype: 'cftab', xtype: 'cftab',
listeners: { name: 'cfTab',
click: {
fn: 'onEditClicked',
element: 'el',
delegate: '.cf-edit'
}
},
defaults: { defaults: {
bodyPadding: 10, bodyPadding: 10,
@ -20,8 +14,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTab', {
_secondprefix: null, _secondprefix: null,
_firstPrefixes: [],
initComponent: function () { initComponent: function () {
this.items = [{ this.items = [{
@ -29,43 +21,13 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTab', {
id: this._tabId + '-tab-everybody', id: this._tabId + '-tab-everybody',
items: [ items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', { Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_isEverybody: true,
_firstprefix: this._firstPrefixes[0], _firstprefix: this._firstPrefixes[0],
_secondprefix: this._secondprefix _secondprefix: this._secondprefix
}) })
], ]
listeners: { }];
activate: 'onTabClicked'
}
}, {
bind: {
title: Ngcp.csc.locales.callforward.from[localStorage.getItem('languageSelected')] + '{source_lista_title}'
},
id: this._tabId + '-tab-listA',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: this._firstPrefixes[1],
_secondprefix: this._secondprefix
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: Ngcp.csc.locales.callforward.from[localStorage.getItem('languageSelected')] + '{source_listb_title}'
},
id: this._tabId + '-tab-listB',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: this._firstPrefixes[2],
_secondprefix: this._secondprefix
})
],
listeners: {
activate: 'onTabClicked'
}
}]
this.callParent(); this.callParent();
} }

@ -23,7 +23,7 @@ Ext.define('NgcpCsc.view.pages.callforward.afterhours.Afterhours', {
hidden: '{!after_hours_exists_in_api}' hidden: '{!after_hours_exists_in_api}'
}, },
store: Ext.create('NgcpCsc.store.CallForwardTimeset', { store: Ext.create('NgcpCsc.store.CallForwardTimeset', {
storeId: 'afterHours-Timeset' storeId: 'afterhours-Timeset'
}) })
}); });
@ -81,8 +81,8 @@ Ext.define('NgcpCsc.view.pages.callforward.afterhours.Afterhours', {
}, { }, {
xtype: 'cftab', xtype: 'cftab',
_tabId: 'afterhours', _tabId: 'afterhours',
_firstPrefixes: ['everybody-', 'listA-', 'listB-'], _firstPrefixes: ['everybody-'],
_secondprefix: 'afterHours-', _secondprefix: 'afterhours-',
bind: { bind: {
hidden: '{!after_hours_exists_in_api}' hidden: '{!after_hours_exists_in_api}'
} }

@ -29,7 +29,7 @@ Ext.define('NgcpCsc.view.pages.callforward.always.Always', {
}, { }, {
xtype: 'cftab', xtype: 'cftab',
_tabId: 'always', _tabId: 'always',
_firstPrefixes: ['everybody-', 'listA-', 'listB-'], _firstPrefixes: ['everybody-'],
_secondprefix: 'always-' _secondprefix: 'always-'
}] }]
}]; }];

@ -11,9 +11,6 @@ Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
_type: 'companyHours', _type: 'companyHours',
autoLoad: true, autoLoad: true,
listeners: { listeners: {
beforeload: function(store) {
store._preventReLoad = false;
},
load: function(store, recs) { load: function(store, recs) {
this.fireEvent('cfStoreLoaded', this, recs[0]); this.fireEvent('cfStoreLoaded', this, recs[0]);
} }
@ -26,7 +23,7 @@ Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
hidden: '{!company_hours_exists_in_api}' hidden: '{!company_hours_exists_in_api}'
}, },
store: Ext.create('NgcpCsc.store.CallForwardTimeset', { store: Ext.create('NgcpCsc.store.CallForwardTimeset', {
storeId: 'companyHours-Timeset' storeId: 'companyhours-Timeset'
}) })
}); });
@ -85,8 +82,8 @@ Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
}, { }, {
xtype: 'cftab', xtype: 'cftab',
_tabId: 'companyhours', _tabId: 'companyhours',
_firstPrefixes: ['everybody-', 'listA-', 'listB-'], _firstPrefixes: ['everybody-'],
_secondprefix: 'companyHours-', _secondprefix: 'companyhours-',
bind: { bind: {
hidden: '{!company_hours_exists_in_api}' hidden: '{!company_hours_exists_in_api}'
} }

Loading…
Cancel
Save