TT#12778 Csc split up CF module, and impl changes

Split Ngcp-csc call forward module into three submodules based on
timesource (always/after hours/company hours).

Plus implement the following changes:
* not bold text
* new placement/implementation of timeset grid
* add cursor pointer to sourceset/timeset grid
* autofocus on bottom list A/B row when add new
* remove bulletpoints
* change to tabpanel for sourcesets
* implement clickable icons in tabs
* adjust layout of "first ring" and "then ring" fields and labels
* implement 'big-820'/'small-100' layout to be consistent with other views
* implement onEnterPressed ability
* change structure of views (mainform/tabpanel, etc) and affected controllers to use new ids
* ability to change List A/List B name
* refactor controller where needed
* implement validity check for controllers for saving "then ring" destinations to store
* correct styling after restructuring views

Change-Id: Ied00dd73f2044c0af2fb82a0be17c66c3c597663
changes/38/12138/17
Robert Axelsen 8 years ago
parent 32e28adf37
commit bef4aed9e5

@ -27,10 +27,30 @@ Ext.define('NgcpCsc.store.NavigationTree', {
}, {
text: 'Call Forward',
iconCls: Ngcp.csc.icons.doubleangleright,
viewType: 'callforward',
routeId: 'callforward',
acl: ['administrator'],
leaf: true
children: [{
text: 'Always',
iconCls: Ngcp.csc.icons.star,
viewType: 'always',
routeId: 'callforward/always',
acl: ['administrator'],
leaf: true
}, {
text: 'After Hours',
iconCls: Ngcp.csc.icons.timescircle,
viewType: 'afterhours',
routeId: 'callforward/afterhours',
acl: ['administrator'],
leaf: true
}, {
text: 'Company Hours',
iconCls: Ngcp.csc.icons.building,
viewType: 'companyhours',
routeId: 'callforward/companyhours',
acl: ['administrator'],
leaf: true
}]
}, {
text: 'Call Blocking',
iconCls: Ngcp.csc.icons.block,

@ -14,6 +14,9 @@ Ext.define('Ngcp.csc.icons', {
block2x: "x-fa fa-ban fa-2x",
book: "x-fa fa-book",
book2x: "x-fa fa-book fa-2x",
building: "x-fa fa-building",
calendar: "x-fa fa-calendar",
calendar2x: "x-fa fa-calendar fa-2x",
chevronleft: "x-fa fa-chevron-left",
chevronight: "x-fa fa-chevron-right",
circle: "x-fa fa-circle",
@ -56,6 +59,10 @@ Ext.define('Ngcp.csc.icons', {
phonesquare: "x-fa fa-phone-square",
send: "x-fa fa-send",
send2x: "x-fa fa-send fa-2x",
square: "x-fa fa-square-o",
square_checked: "x-fa fa-check-square-o",
star: "x-fa fa-star",
timescircle: "x-fa fa-times-circle",
toggle: {
off: 'x-fa fa-toggle-off',
off2x: 'x-fa fa-toggle-off fa-2x',

@ -733,7 +733,7 @@ Ext.define('Ngcp.csc.locales', {
fr: 'Move',
sp: 'Move'
},
closed: {
full_day: {
en: 'Closed',
it: 'Closed',
de: 'Closed',
@ -810,6 +810,27 @@ Ext.define('Ngcp.csc.locales', {
fr: 'For calling parties ...',
sp: 'For calling parties ...'
},
for_calls_during_always: {
en: 'For calls during always ...',
it: 'For calls during always ...',
de: 'For calls during always ...',
fr: 'For calls during always ...',
sp: 'For calls during always ...'
},
for_calls_during_after_hours: {
en: 'For calls during after hours ...',
it: 'For calls during after hours ...',
de: 'For calls during after hours ...',
fr: 'For calls during after hours ...',
sp: 'For calls during after hours ...'
},
for_calls_during_company_hours: {
en: 'For calls during company hours ...',
it: 'For calls during company hours ...',
de: 'For calls during company hours ...',
fr: 'For calls during company hours ...',
sp: 'For calls during company hours ...'
},
and_ring_for: {
en: 'and ring for',
it: 'and ring for',
@ -823,6 +844,20 @@ Ext.define('Ngcp.csc.locales', {
de: 'secs',
fr: 'secs',
sp: 'secs'
},
sourceset_title: {
en: 'Sourceset title',
it: 'Sourceset title',
de: 'Sourceset title',
fr: 'Sourceset title',
sp: 'Sourceset title'
},
change_title: {
en: 'CHANGE TITLE',
it: 'CHANGE TITLE',
de: 'CHANGE TITLE',
fr: 'CHANGE TITLE',
sp: 'CHANGE TITLE'
}
},
filters: {

@ -3,20 +3,15 @@
@include extjs-panel-ui ( $ui: 'cf-widget', );
@include extjs-panel-ui ( $ui: 'cf-mainform', );
@include extjs-panel-ui ( $ui: 'cf-grid', );
@mixin icon($icon) {
@include fa-icon;
@extend .fa;
@extend .fa-#{$icon}:before;
};
// TODO: Use rem mixin suggested by mdanek:
// http://paste.mgm.sipwise.com/show/2210/
// cf-mainform text and headline
.x-panel-cf-mainform {
#onlineThenTimeout-labelEl,
#busyThenTimeout-labelEl,
#offline-then-timeout-labelEl {
#offlineThenTimeout-labelEl,
#onlineFirstTimeout-labelEl,
#busyFirstTimeout-labelEl,
#offlineFirstTimeout-labelEl {
padding-left: 15px;
}
#busyFirstDest-labelTextEl,
@ -24,7 +19,6 @@
#onlineFirstDest-labelTextEl,
.cf-thentext,
.cf-text {
font-weight: 600;
margin-bottom: 7px;
}
.cf-thentext {
@ -44,60 +38,6 @@
}
}
// cf-mainform segmented buttons
.x-panel-cf-mainform {
.x-segmented-button {
white-space: nowrap;
.x-btn-button-default-small {
display: inline-block;
}
.x-btn-icon-el-default-small {
float: right;
}
.x-btn-inner-default-small {
float: left;
}
}
.x-segmented-button-item-horizontal {
display: inline-block;
width: 32%;
height: 35px;
margin: 0 5px;
}
x-segmented-button-item-horizontal {
.x-segmented-button-first {
margin-left: 10px;
}
.x-segmented-button-last {
margin: 0 0 0 5px;
}
}
}
// cf-mainform time -and sourceset "embed"
.x-panel-cf-mainform {
.cf-embed-row {
.x-autocontainer-innerCt {
display: block;
}
#alwaysButtonBelow,
#everybodyButtonBelow {
padding: 0 9px 0 0;
}
#afterHoursButtonBelow,
#listAButtonBelow {
padding: 0 1px 0 8px;
}
#companyHoursButtonBelow,
#listBButtonBelow {
padding: 0 2px 0 8px;
}
.cf-deactivate-day {
color: #B4B8B3;
}
}
}
// cf-mainform grid panel
.x-panel-cf-mainform {
.x-grid-empty {
@ -107,14 +47,10 @@
.x-grid-row {
background: white;
}
div.x-grid-empty::before {
@include icon(circle);
font-size: 0.7em;
margin: 0 4px;
}
.x-panel-cf-grid .x-grid-cell-inner {
padding-top: 7px;
margin: 0;
cursor: pointer;
}
.x-panel-cf-grid .cf-tpl-fa,
.cf-tpl-fa {
@ -130,3 +66,21 @@
padding: 20px 10px;
}
}
// cf-mainform timeset panel
.x-panel-cf-mainform {
.cf-calls-during {
margin: 7px 15px 0 0;
}
.cf-calendar-button,
.cf-calendar-button .x-btn-icon-el-default-small {
margin-right: 5px;
}
.cf-calendar-button,
.cf-calendar-button .x-btn-icon-el-default-small,
.cf-calls-curing-section .x-btn.x-btn-pressed.x-btn-default-small {
background: white;
color: $base-color;
border: none;
}
}

@ -5,20 +5,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForward', {
controller: 'callforward',
viewModel: 'callforward',
layout: 'responsivecolumn',
initComponent: function () {
this.items = [{
userCls: 'big-70 small-100',
xtype: 'core-container',
items: [{
xtype: 'callforwardmainform'
}]
}];
this.callParent();
}
viewModel: 'callforward'
});

@ -3,17 +3,40 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
alias: 'controller.callforward',
selectFirstRing: function(component, record) {
var vm = this.getViewModel();
function showHideTimeoutField(timeoutField) {
record === 'Own phone' ? vm.set(timeoutField, false) : vm.set(timeoutField, true);
onEnterPressed: function (field, el) {
var me = this;
if (el.getKey() == el.ENTER) {
me.addNewDestination(field);
};
if (component.getId() === 'onlineFirstDest') {
showHideTimeoutField('online_first_timeout_hidden');
} else if (component.getId() === 'busyFirstDest') {
showHideTimeoutField('busy_first_timeout_hidden');
} else if (component.getId() === 'offlineFirstDest') {
showHideTimeoutField('offline_first_timeout_hidden');
},
toggleChangeTitle: function (button) {
var vm = this.getViewModel();
var buttonId = button.id;
var hiddenKey = 'hide_' + buttonId.split('-')[2];
vm.set(hiddenKey, !vm.get(hiddenKey));
},
saveNewTitle: function (button) {
var vm = this.getViewModel();
var buttonId = button.id;
var hiddenKey = 'hide_' + buttonId.split('-')[2];
vm.set(hiddenKey, !vm.get(hiddenKey));
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.save_success[localStorage.getItem('languageSelected')]);
},
onEditClicked: function (el) {
var vm = this.getViewModel();
var classList = el.target.classList;
switch (true) {
case (classList.contains('edit-listA')):
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;
};
},
@ -21,22 +44,32 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
return target.indexOf(string) > -1;
},
addEmptyRowToStore: function (store) {
saveEmptyRowToStore: function (grid) {
var store = grid.getStore();
var plugin = grid.getPlugin('celleditingTime');
var targetStore = Ext.getStore(store);
var newRowIndex = store.getCount() + 1;
var record = targetStore.getAt(targetStore.getCount() - 1);
if (record == null || record.data.phone !== '') {
targetStore.add({ "phone": "", "active": false, "ring_for": "" });
};
plugin.startEditByPosition({ row: newRowIndex, column: 0 });
},
addEmptyRow: function (button) {
var targetId = button.id;
if (this.checkIndexOf('addListAButton', targetId)) {
var grid = Ext.getCmp('cf-sourceset-list-a-grid');
this.addEmptyRowToStore(grid.getStore());
} else if (this.checkIndexOf('addListBButton', targetId)) {
var grid = Ext.getCmp('cf-sourceset-list-b-grid');
this.addEmptyRowToStore(grid.getStore());
var buttonIdSplit = button.id.split('-');
var buttonPrefixOne = buttonIdSplit[0];
var buttonPrefixTwo = buttonIdSplit[1];
var buttonSuffix = buttonIdSplit[2];
switch (buttonSuffix) {
case 'addListAButton':
var grid = Ext.getCmp(buttonPrefixOne + '-' + buttonPrefixTwo + '-cf-sourceset-list-a-grid');
this.saveEmptyRowToStore(grid);
break;
case 'addListBButton':
var grid = Ext.getCmp(buttonPrefixOne + '-' + buttonPrefixTwo + '-cf-sourceset-list-b-grid');
this.saveEmptyRowToStore(grid);
break;
};
},
@ -47,75 +80,36 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.remove_success[localStorage.getItem('languageSelected')]);
},
changeWidget: function (target, vm) {
var me = this;
vm.set('after_hours', true);
vm.set('company_hours', true);
vm.set('list_a', true);
vm.set('list_b', true);
switch (target) {
case 'afterHoursButton-btnIconEl':
if (vm.get('active_widget') == 'After hours') {
vm.set('after_hours', true);
} else {
vm.set('active_widget', Ngcp.csc.locales.callforward.after_hours[localStorage.getItem('languageSelected')]);
vm.set('after_hours', false);
};
break;
case 'companyHoursButton-btnIconEl':
if (vm.get('active_widget') == 'Company hours') {
vm.set('company_hours', true);
} else {
vm.set('active_widget', Ngcp.csc.locales.callforward.company_hours[localStorage.getItem('languageSelected')]);
vm.set('company_hours', false);
};
break;
case 'listAButton-btnIconEl':
if (vm.get('active_widget') == 'List A') {
vm.set('list_a', true);
} else {
vm.set('active_widget', Ngcp.csc.locales.callforward.list_a[localStorage.getItem('languageSelected')]);
vm.set('list_a', false);
};
break;
case 'listBButton-btnIconEl':
if (vm.get('active_widget') == 'List B') {
vm.set('list_a', true);
} else {
vm.set('active_widget', Ngcp.csc.locales.callforward.list_b[localStorage.getItem('languageSelected')]);
vm.set('list_b', false);
};
break;
};
},
getSelectedSet: function (type) {
return type == 'timeButtons' ? 'selected_timeset' : 'selected_sourceset';
getStoresArrayFromRoute: function (currentRoute, currentSourceset) {
var view = currentRoute.split('/')[1];
var prefix = currentSourceset + '-' + view + '-';
return [prefix + 'CallForwardOnline', prefix + 'CallForwardBusy', prefix + 'CallForwardOffline'];
},
clickSegmentedButton: function (button, event) {
var me = this,
vm = me.getViewModel(),
targetId = event.getTarget().id,
buttonValue = button.value,
buttonType = button.findParentByType('segmentedbutton').itemId,
storesArray = ['CallForwardOnline', 'CallForwardBusy', 'CallForwardOffline'],
loadingBar = me.lookupReference('loadingBar');
me.changeWidget(targetId, vm);
vm.set(me.getSelectedSet(buttonType), buttonValue);
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);
var loadingBar = me.lookupReference('loadingBar');
loadingBar.showBusy();
vm.set('list_a', true);
vm.set('list_b', true);
Ext.Ajax.request({
url: '/resources/data/callForwardCombinations.json',
success: function(response, opts) {
var obj = Ext.decode(response.responseText),
combinationStore = obj.data[0],
selectedTimeset = vm.get('selected_timeset'),
selectedSourceset = vm.get('selected_sourceset');
var obj = Ext.decode(response.responseText);
var combinationStore = obj.data[0];
storesArray.map(function (storeName) {
var store = Ext.getStore(storeName);
store.removeAll();
var strippedStoreName = storeName.split('-')[2];
// Workaround since tabpanel being in initComponent causes this function to run before we have a route set.
// This short-circuits into evaluating the right hand side only if we have a store that is not undefined
!!store && store.removeAll();
for (node in combinationStore) {
if (me.checkIndexOf(storeName, node) && me.checkIndexOf(selectedTimeset, node) && me.checkIndexOf(selectedSourceset, node)) {
if (me.checkIndexOf(strippedStoreName, node) && me.checkIndexOf(currentTimeset, node) && me.checkIndexOf(currentSourceset, node)) {
var records = combinationStore[node];
store.add(records);
};
@ -126,7 +120,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
});
},
failure: function(response, opts) {
console.log('failed to load store, with code ' + response.status);
}
});
},
@ -139,31 +132,16 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
}
},
toggleClosedState: function(grid, rowIndex, colIndex, item, event, record, row) {
toggleClosedState: function(grid, rowIndex, colIndex, item, event, record) {
record.set('closed', !record.get('closed'));
this.renderDay(record.get('closed'), null, record);
},
toggleClosedClass: function (val, meta, rec) {
return rec.get('closed') === true ? "x-fa fa-check-square-o" : "x-fa fa-square-o";
},
resetTimesetWidget: function (el) {
var buttonId = el.id;
if (buttonId == 'resetAfter') {
var grid = Ext.getCmp('cf-timeset-after-grid');
var store = grid.getStore();
store.rejectChanges();
grid.reconfigure(store);
} else {
var grid = Ext.getCmp('cf-timeset-company-grid');
var store = grid.getStore();
store.rejectChanges();
grid.reconfigure(store);
};
return rec.get('closed') === true ? Ngcp.csc.icons.square_checked : Ngcp.csc.icons.square;
},
removeSourcelistRecord: function(grid, rowIndex, colIndex) {
removeSourcelistRecord: function(grid, rowIndex) {
var store = grid.getStore();
var rec = grid.getStore().getAt(rowIndex);
store.remove(rec);
@ -172,84 +150,135 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardController', {
renderPhoneColumn: function(value, metaData, record) {
if (record.get('ring_for') === '' && !Ext.isNumber(parseInt(value))) {
return Ext.String.format('<i class="fa fa-circle cf-tpl-fa" aria-hidden="true"></i>{0}', value);
return Ext.String.format('{0}', value);
} else if (Ext.isNumber(parseInt(value))) {
return Ext.String.format('<i class="fa fa-circle cf-tpl-fa" aria-hidden="true"></i>+{0} and ring for {1} secs', value, record.get('ring_for'));
return Ext.String.format('+{0} and ring for {1} secs', value, record.get('ring_for'));
} else {
return Ext.String.format('<i class="fa fa-circle cf-tpl-fa" aria-hidden="true"></i>{0} and ring for {1} secs', value, record.get('ring_for'));
return Ext.String.format('{0} and ring for {1} secs', value, record.get('ring_for'));
};
},
selectThenRing: function (component, record) {
var vm = this.getViewModel();
function showHideTimeoutField(timeoutField) {
record === 'Number' ? vm.set(timeoutField, false) : vm.set(timeoutField, true);
};
if (component.getId() === 'onlineThenDest') {
showHideTimeoutField('online_then_timeout_hidden');
} else if (component.getId() === 'busyThenDest') {
showHideTimeoutField('busy_then_timeout_hidden');
} else if (component.getId() === 'offlineThenDest') {
showHideTimeoutField('offline_then_timeout_hidden');
showHideTimeoutField: function (vm, record, timeoutField) {
switch (record) {
case 'Number':
case 'Own phone':
vm.set(timeoutField, false);
break;
case 'Voicemail':
case 'Fax2Mail':
case 'None':
vm.set(timeoutField, true);
break;
};
},
showNewDestinationForm: function (button) {
selectRing: function (component, record) {
var vm = this.getViewModel();
var cmpIdSplit = component.getId().split('-');
var timeoutFieldCategory = cmpIdSplit[2].replace(/FirstDest|ThenDest/, '');
var firstOrThen = cmpIdSplit[2].replace(/online|offline|busy/, '').toLowerCase().replace('dest', '');
this.showHideTimeoutField(vm, record, timeoutFieldCategory + '_' + firstOrThen + '_timeout_hidden');
},
toggleNewDestinationForm: function (button) {
var me = this;
var vm = this.getViewModel();
var targetId = button.id;
if (this.checkIndexOf('onlineButton', targetId)) {
vm.set('online_add_new_then_hidden', !vm.get('online_add_new_then_hidden'));
} else if (this.checkIndexOf('busyButton', targetId)) {
vm.set('busy_add_new_then_hidden', !vm.get('busy_add_new_then_hidden'));
} else if (this.checkIndexOf('offlineButton', targetId)) {
vm.set('offline_add_new_then_hidden', !vm.get('offline_add_new_then_hidden'));
switch (true) {
case (me.checkIndexOf('online', targetId)):
vm.set('online_add_new_then_hidden', !vm.get('online_add_new_then_hidden'));
break;
case (me.checkIndexOf('busy', targetId)):
vm.set('busy_add_new_then_hidden', !vm.get('busy_add_new_then_hidden'));
break;
case (me.checkIndexOf('offline', targetId)):
vm.set('offline_add_new_then_hidden', !vm.get('offline_add_new_then_hidden'));
break;
};
},
saveDestinationToStore: function (store) {
var me = this;
var vm = me.getViewModel();
var targetStore = Ext.getStore(store);
var newPhone, newTimeout;
switch (store) {
hideThenFieldsByStoreName: function (vm, storeNameStripped) {
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.save_success[localStorage.getItem('languageSelected')]);
switch (storeNameStripped) {
case 'CallForwardOnline':
var newDest = vm.get('online_then_dest');
var newNumber = vm.get('online_then_number');
var newTimeout = newDest === 'Number' ? vm.get('online_then_timeout') : '';
var newPhone = newDest === 'Number' ? newNumber : newDest;
targetStore.add({ "phone": newPhone, "ring_for": newTimeout });
vm.set('online_add_new_then_hidden', true);
break;
case 'CallForwardBusy':
var newDest = vm.get('busy_then_dest');
var newNumber = vm.get('busy_then_number');
var newTimeout = newDest === 'Number' ? vm.get('busy_then_timeout') : '';
var newPhone = newDest === 'Number' ? newNumber : newDest;
targetStore.add({ "phone": newPhone, "ring_for": newTimeout });
vm.set('busy_add_new_then_hidden', true);
break;
case 'CallForwardOffline':
var newDest = vm.get('offline_then_dest');
var newNumber = vm.get('offline_then_number');
var newTimeout = newDest === 'Number' ? vm.get('offline_then_timeout') : '';
var newPhone = newDest === 'Number' ? newNumber : newDest;
targetStore.add({ "phone": newPhone, "ring_for": newTimeout });
vm.set('offline_add_new_then_hidden', true);
break;
};
this.fireEvent('showmessage', true, Ngcp.csc.locales.common.save_success[localStorage.getItem('languageSelected')]);
},
addNewDestination: function (button) {
var targetId = button.id;
if (this.checkIndexOf('onlineSaveButton', targetId)) {
this.saveDestinationToStore('CallForwardOnline');
} else if (this.checkIndexOf('busySaveButton', targetId)) {
this.saveDestinationToStore('CallForwardBusy');
} else if (this.checkIndexOf('offlineSaveButton', targetId)) {
this.saveDestinationToStore('CallForwardOffline');
validateDestinationForm: function (storeName) {
var me = this;
var vm = me.getViewModel();
var targetStore = Ext.getStore(storeName);
var storeNameStripped = storeName.split('-')[2];
var storeNameCategory = storeNameStripped.replace('CallForward', '').toLowerCase();
var newNumber = vm.get(storeNameCategory + '_then_number');
var newDest = vm.get(storeNameCategory + '_then_dest');
var newPhone, newTimeout;
switch (Ext.isEmpty(newNumber) || newDest === 'Voicemail' || newDest === 'Fax2Mail') {
case true:
switch (Ext.isEmpty(newNumber) && newDest === 'Number') {
case true:
me.fireEvent('showmessage', false, 'Number is required. Please retry.');
break;
case false:
targetStore.add({ "phone": newDest, "ring_for": "" });
me.hideThenFieldsByStoreName(vm, storeNameStripped);
break;
};
vm.set(storeNameCategory + '_then_number', '');
break;
case false:
switch (Ext.isNumber(parseInt(newNumber))) {
case false:
me.fireEvent('showmessage', false, 'Only numbers allowed. Please retry.');
vm.set(storeNameCategory + '_then_number', '');
break;
case true:
var newTimeout = newDest === 'Number' ? vm.get(storeNameCategory + '_then_timeout') : '';
var newPhone = newDest === 'Number' ? newNumber : newDest;
targetStore.add({ "phone": newPhone, "ring_for": newTimeout });
vm.set(storeNameCategory + '_then_number', '');
me.hideThenFieldsByStoreName(vm, storeNameStripped);
break;
};
break;
};
},
addNewDestination: function (element) {
var me = this;
var targetId = element.id;
var splitTargetId = targetId.split('-');
var selectedSourceset = splitTargetId[0];
var selectedTimeset = splitTargetId[1];
switch (true) {
case (me.checkIndexOf('online', targetId)):
me.validateDestinationForm(selectedSourceset + '-' + selectedTimeset + '-CallForwardOnline');
break;
case (me.checkIndexOf('busy', targetId)):
me.validateDestinationForm(selectedSourceset + '-' + selectedTimeset + '-CallForwardBusy');
break;
case (me.checkIndexOf('offline', targetId)):
me.validateDestinationForm(selectedSourceset + '-' + selectedTimeset + '-CallForwardOffline');
break;
};
},
toggleAfterTimesetGrid: function () {
var vm = this.getViewModel();
vm.set('after_hours', !vm.get('after_hours'));
},
toggleCompanyTimesetGrid: function () {
var vm = this.getViewModel();
vm.set('company_hours', !vm.get('company_hours'));
}
});

File diff suppressed because it is too large Load Diff

@ -16,8 +16,6 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardModel', {
online_add_new_then_hidden: true,
busy_add_new_then_hidden: true,
offline_add_new_then_hidden: true,
active_widget: '',
row_elements_disabled: false,
selected_timeset: 'always',
selected_sourceset: 'everybody',
online_then_dest: 'Number',
@ -28,7 +26,11 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardModel', {
busy_then_timeout: '10',
offline_then_dest: '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
}
});

@ -1,19 +1,20 @@
Ext.define('NgcpCsc.view.pages.callforward.CallForwardSourcesetGrid', {
extend: 'Ext.grid.Panel',
xtype: 'callforwardsourcesetgrid',
viewConfig: {
markDirty: false
},
plugins: {
pluginId: 'celleditingTime',
ptype: 'cellediting',
clicksToEdit: 1
},
hideHeaders: true,
width: 500,
initComponent: function() {
this.columns = {
defaults: {

@ -43,7 +43,7 @@ Ext.define('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
}
}
}, {
text: Ngcp.csc.locales.callforward.closed[localStorage.getItem('languageSelected')],
text: Ngcp.csc.locales.callforward.full_day[localStorage.getItem('languageSelected')],
dataIndex: 'closed',
xtype: 'actioncolumn',
align: 'center',

@ -0,0 +1,71 @@
Ext.define('NgcpCsc.view.pages.callforward.afterhours.Afterhours', {
extend: 'NgcpCsc.view.pages.callforward.CallForward',
xtype: 'afterhours',
ui: 'cf-mainform',
initComponent: function () {
var callForwardAfterGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
id: 'cf-timeset-after-grid',
store: Ext.create('NgcpCsc.store.CallForwardTimeset', {
proxy: {
type: 'ajax',
url: '/resources/data/callForwardAfter.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
})
});
this.items = [{
userCls: Ext.os.is.Desktop ? 'big-820' : 'small-100',
xtype: 'core-container',
items: [{
layout: 'responsivecolumn',
xtype: 'container',
items: [{
xtype: 'panel',
userCls: 'big-33 small-100 cf-calls-curing-section',
items: [{
layout: 'hbox',
items: [{
xtype: 'container',
userCls: 'cf-calls-during',
html: Ngcp.csc.locales.callforward.for_calls_during_after_hours[localStorage.getItem('languageSelected')],
margin: '10 0 0 0'
}, {
xtype: 'button',
userCls: 'cf-calendar-button',
iconCls: Ngcp.csc.icons.calendar2x,
handler: 'toggleAfterTimesetGrid'
}]
}]
}, {
xtype: 'panel',
userCls: 'big-66 small-100',
bind: {
hidden: '{after_hours}'
},
items: [
callForwardAfterGrid
]
}]
}, {
xtype: 'container',
userCls: 'cf-text',
html: Ngcp.csc.locales.callforward.for_calling_parties[localStorage.getItem('languageSelected')],
margin: '10 0 10 0'
}, {
xtype: 'statusbar',
reference: 'loadingBar'
}, {
xtype: 'afterhourstabs'
}]
}];
this.callParent();
}
});

@ -0,0 +1,71 @@
Ext.define('NgcpCsc.view.pages.callforward.afterhours.AfterHoursTabs', {
extend: 'Ext.tab.Panel',
xtype: 'afterhourstabs',
listeners: {
click: {
fn: 'onEditClicked',
element: 'el',
delegate: '.cf-edit'
}
},
defaults: {
bodyPadding: 10,
scrollable: true
},
initComponent: function () {
this.items = [{
title: Ngcp.csc.locales.callforward.source_one[localStorage.getItem('languageSelected')],
id: 'afterhours-tab-everybody',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'everybody-',
_secondprefix: 'afterHours-'
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: '{source_lista_title}'
},
id: 'afterhours-tab-listA',
iconCls: Ngcp.csc.icons.pencil + ' cf-edit edit-listA',
iconAlign: 'right',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'listA-',
_secondprefix: 'afterHours-'
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: '{source_listb_title}'
},
id: 'afterhours-tab-listB',
iconCls: Ngcp.csc.icons.pencil + ' cf-edit edit-listB',
iconAlign: 'right',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'listB-',
_secondprefix: 'afterHours-'
})
],
listeners: {
activate: 'onTabClicked'
}
}]
this.callParent();
}
});

@ -0,0 +1,44 @@
Ext.define('NgcpCsc.view.pages.callforward.always.Always', {
extend: 'NgcpCsc.view.pages.callforward.CallForward',
xtype: 'always',
ui: 'cf-mainform',
initComponent: function () {
this.items = [{
userCls: Ext.os.is.Desktop ? 'big-820' : 'small-100',
xtype: 'core-container',
items: [{
layout: 'responsivecolumn',
xtype: 'container',
items: [{
xtype: 'panel',
userCls: 'big-33 small-100 cf-calls-curing-section',
items: [{
layout: 'hbox',
items: [{
xtype: 'container',
userCls: 'cf-calls-during',
html: Ngcp.csc.locales.callforward.for_calls_during_always[localStorage.getItem('languageSelected')],
margin: '10 0 0 0'
}]
}]
}]
}, {
xtype: 'container',
userCls: 'cf-text',
html: Ngcp.csc.locales.callforward.for_calling_parties[localStorage.getItem('languageSelected')],
margin: '10 0 10 0'
}, {
xtype: 'statusbar',
reference: 'loadingBar'
}, {
xtype: 'alwaystabs'
}]
}];
this.callParent();
}
});

@ -0,0 +1,70 @@
Ext.define('NgcpCsc.view.pages.callforward.always.AlwaysTabs', {
extend: 'Ext.tab.Panel',
xtype: 'alwaystabs',
listeners: {
click: {
fn: 'onEditClicked',
element: 'el',
delegate: '.cf-edit'
}
},
defaults: {
bodyPadding: 10,
scrollable: true
},
initComponent: function () {
this.items = [{
title: Ngcp.csc.locales.callforward.source_one[localStorage.getItem('languageSelected')],
id: 'always-tab-everybody',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'everybody-',
_secondprefix: 'always-'
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: '{source_lista_title}'
},
id: 'always-tab-listA',
iconCls: Ngcp.csc.icons.pencil + ' cf-edit edit-listA',
iconAlign: 'right',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'listA-',
_secondprefix: 'always-'
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: '{source_listb_title}'
},
id: 'always-tab-listB',
iconCls: Ngcp.csc.icons.pencil + ' cf-edit edit-listB',
iconAlign: 'right',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'listB-',
_secondprefix: 'always-'
})
],
listeners: {
activate: 'onTabClicked'
}
}]
this.callParent();
}
});

@ -0,0 +1,72 @@
Ext.define('NgcpCsc.view.pages.callforward.companyhours.Companyhours', {
extend: 'NgcpCsc.view.pages.callforward.CallForward',
xtype: 'companyhours',
ui: 'cf-mainform',
initComponent: function () {
var callForwardCompanyGrid = Ext.create('NgcpCsc.view.pages.callforward.CallForwardTimesetGrid', {
id: 'cf-timeset-company-grid',
store: Ext.create('NgcpCsc.store.CallForwardTimeset', {
proxy: {
type: 'ajax',
url: '/resources/data/callForwardCompany.json',
reader: {
type: 'json',
rootProperty: 'data'
}
}
})
});
this.items = [{
userCls: Ext.os.is.Desktop ? 'big-820' : 'small-100',
xtype: 'core-container',
items: [{
layout: 'responsivecolumn',
xtype: 'container',
items: [{
xtype: 'panel',
userCls: 'big-33 small-100 cf-calls-curing-section',
items: [{
layout: 'hbox',
items: [{
xtype: 'container',
userCls: 'cf-calls-during',
html: Ngcp.csc.locales.callforward.for_calls_during_company_hours[localStorage.getItem('languageSelected')],
margin: '10 0 0 0'
}, {
xtype: 'button',
userCls: 'cf-calendar-button',
iconCls: Ngcp.csc.icons.calendar2x,
handler: 'toggleCompanyTimesetGrid'
}]
}]
}, {
xtype: 'panel',
userCls: 'big-66 small-100',
bind: {
hidden: '{company_hours}'
},
items: [
callForwardCompanyGrid
]
}]
},
{
xtype: 'container',
userCls: 'cf-text',
html: Ngcp.csc.locales.callforward.for_calling_parties[localStorage.getItem('languageSelected')],
margin: '10 0 10 0'
}, {
xtype: 'statusbar',
reference: 'loadingBar'
}, {
xtype: 'companyhourstabs'
}]
}];
this.callParent();
}
});

@ -0,0 +1,70 @@
Ext.define('NgcpCsc.view.pages.callforward.companyhours.CompanyHoursTabs', {
extend: 'Ext.tab.Panel',
xtype: 'companyhourstabs',
listeners: {
click: {
fn: 'onEditClicked',
element: 'el',
delegate: '.cf-edit'
}
},
defaults: {
bodyPadding: 10,
scrollable: true
},
initComponent: function () {
this.items = [{
title: Ngcp.csc.locales.callforward.source_one[localStorage.getItem('languageSelected')],
id: 'companyhours-tab-everybody',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'everybody-',
_secondprefix: 'companyHours-'
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: '{source_lista_title}'
},
id: 'companyhours-tab-listA',
iconCls: Ngcp.csc.icons.pencil + ' cf-edit edit-listA',
iconAlign: 'right',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'listA-',
_secondprefix: 'companyHours-'
})
],
listeners: {
activate: 'onTabClicked'
}
}, {
bind: {
title: '{source_listb_title}'
},
id: 'companyhours-tab-listB',
iconCls: Ngcp.csc.icons.pencil + ' cf-edit edit-listB',
iconAlign: 'right',
items: [
Ext.create('NgcpCsc.view.pages.callforward.CallForwardMainForm', {
_firstprefix: 'listB-',
_secondprefix: 'companyHours-'
})
],
listeners: {
activate: 'onTabClicked'
}
}]
this.callParent();
}
});

@ -33,7 +33,7 @@ Ext.define('NgcpCsc.view.pages.pbxconfig.PbxConfigController', {
var storeName = this.getStoreFromRoute(currentRoute);
var recId = field.id.split("-")[3];
var iconDivId = 'edit' + storeName.slice(0, -1) + '-' + recId;
var iconDiv = document.getElementById(iconDivId)
var iconDiv = document.getElementById(iconDivId);
me.saveCard(iconDiv);
};
},

@ -62,6 +62,8 @@ $angle-down: "\f107";
$bell: "\f0f3";
$block: "\f05e";
$book: "\f02d";
$building: "\f1ad";
$calendar: '\f073';
$chevron-left: "\f053";
$chevron-right: "\f054";
$circle: "\f111";
@ -94,6 +96,10 @@ $play: "\f04b";
$phone: "\f095";
$phonesquare: "\f098";
$send: "\f1d8";
$square: "\f096";
$square_checked: "\f046";
$star: "\f005";
$times-circle: "\f057";
$toggle-off:"\f204";
$toggle-on:"\f205";
$trash: "\f1f8";

Loading…
Cancel
Save