2019-03-08 08:41:53 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-18 11:55:22 +00:00
|
|
|
import Section from 'salix/components/section';
|
2019-03-08 08:41:53 +00:00
|
|
|
|
2020-03-18 11:55:22 +00:00
|
|
|
class Controller extends Section {
|
2019-03-29 09:51:02 +00:00
|
|
|
onSubmit() {
|
|
|
|
const sip = this.worker.sip;
|
|
|
|
const params = {
|
2023-08-23 05:34:01 +00:00
|
|
|
userFk: this.worker.id,
|
2019-06-17 09:14:45 +00:00
|
|
|
extension: sip.extension
|
2019-03-29 09:51:02 +00:00
|
|
|
};
|
2019-10-24 10:44:36 +00:00
|
|
|
this.$.watcher.check();
|
2019-10-24 22:53:53 +00:00
|
|
|
this.$http.patch('Sips', params).then(() => {
|
2019-10-24 10:44:36 +00:00
|
|
|
this.$.watcher.updateOriginalData();
|
|
|
|
this.vnApp.showSuccess(this.$t('Data saved! User must access web'));
|
2019-03-29 09:51:02 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnWorkerPbx', {
|
2019-03-08 08:41:53 +00:00
|
|
|
template: require('./index.html'),
|
2019-03-29 09:51:02 +00:00
|
|
|
controller: Controller,
|
2019-03-08 08:41:53 +00:00
|
|
|
bindings: {
|
|
|
|
worker: '<'
|
|
|
|
}
|
|
|
|
});
|