salix/modules/worker/front/pbx/index.js

34 lines
869 B
JavaScript
Raw Normal View History

2019-03-08 08:41:53 +00:00
import ngModule from '../module';
class Controller {
2019-06-17 09:14:45 +00:00
constructor($scope, $http, vnApp, $translate) {
this.$scope = $scope;
this.$http = $http;
2019-06-17 09:14:45 +00:00
this.vnApp = vnApp;
this._ = $translate;
}
onSubmit() {
const sip = this.worker.sip;
const params = {
userFk: this.worker.userFk,
2019-06-17 09:14:45 +00:00
extension: sip.extension
};
this.$scope.watcher.check();
this.$http.patch('/api/Sips', params).then(() => {
this.$scope.watcher.updateOriginalData();
2019-06-17 09:14:45 +00:00
this.vnApp.showSuccess(this._.instant('Data saved! User must access web'));
});
}
}
2019-06-17 09:14:45 +00:00
Controller.$inject = ['$scope', '$http', 'vnApp', '$translate'];
2019-03-08 08:41:53 +00:00
ngModule.component('vnWorkerPbx', {
template: require('./index.html'),
controller: Controller,
2019-03-08 08:41:53 +00:00
bindings: {
worker: '<'
}
});