diff --git a/modules/worker/front/phones/index.js b/modules/worker/front/phones/index.js index b4eb8df71..3810832d9 100644 --- a/modules/worker/front/phones/index.js +++ b/modules/worker/front/phones/index.js @@ -1,9 +1,8 @@ import ngModule from '../module'; class Controller { - constructor($scope, $stateParams) { + constructor($scope) { this.$scope = $scope; - this.$stateParams = $stateParams; } get worker() { @@ -12,12 +11,15 @@ class Controller { set worker(value) { this._worker = value; - if (value) { - this.$scope.$applyAsync(()=> { - this.$scope.model.link = {userFk: value.userFk}; - this.$scope.model.refresh(); - }); - } + if (value) + this.setLink(value); + } + + setLink(value) { + this.$scope.$applyAsync(()=> { + this.$scope.model.link = {userFk: value.userFk}; + this.$scope.model.refresh(); + }); } onSubmit() { @@ -34,7 +36,7 @@ class Controller { } } -Controller.$inject = ['$scope', '$stateParams']; +Controller.$inject = ['$scope']; ngModule.component('vnWorkerPhones', { template: require('./index.html'), diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json index c92ccc94d..e2fa9c165 100644 --- a/modules/worker/front/routes.json +++ b/modules/worker/front/routes.json @@ -8,7 +8,7 @@ {"state": "worker.card.pbx", "icon": "icon-pbx"}, {"state": "worker.card.calendar", "icon": "icon-calendar"}, {"state": "worker.card.timeControl", "icon": "access_time"}, - {"state": "worker.card.phones", "icon": "icon-pbx"} + {"state": "worker.card.phones", "icon": "contact_phone"} ], "routes": [ {