issue #244 fixed

parent c38782c5
......@@ -41,7 +41,7 @@ function SignInCtrl($scope,
email: '',
logoUrl: ''
},
office_idx: -1
id_off: -1
};
};
......@@ -92,7 +92,12 @@ function SignInCtrl($scope,
return;
}
if ($scope.formdata.role == 'therapist_nooffice' && $scope.formdata.office.country == '00') {
if (($scope.formdata.role == 'therapist_office' || $scope.formdata.role == 'tutor_office') && $scope.formdata.id_off == -1) {
ngToast.danger({ content: $translate.instant('select_office') });
return;
}
if ($scope.formdata.role == 'therapist_nooffice' && $scope.formdata.office.country == '00') {
ngToast.danger({ content: $translate.instant('country_office_requested') });
return;
}
......@@ -112,10 +117,8 @@ function SignInCtrl($scope,
$scope.showdialog = true;
if ($scope.formdata.office_idx != -1) {
$scope.formdata.id_off = $scope.offices[$scope.formdata.office_idx].id;
delete $scope.formdata.office_idx;
}
if ($scope.formdata.id_off == -1)
delete $scope.formdata.id_off;
if ($scope.formdata.role === 'tutor_nooffice') {
$scope.formdata.office.name = 'no_office';
......
......@@ -223,9 +223,9 @@
<div class="form-group" id="office_selection">
<legend translate>office_center</legend>
<select class="form-control" ng-model="formdata.office_idx" ng-required="formdata.role == 'therapist_office' || formdata.role == 'tutor_office'">
<select class="form-control" ng-model="formdata.id_off" ng-required="formdata.role == 'therapist_office' || formdata.role == 'tutor_office'">
<option selected disabled hidden value="-1">{{ 'select_office' | translate }}</option>
<option ng-repeat="office in offices | orderBy: 'name' track by $index" ng-value="$index"> {{ office.name }} </option>
<option ng-repeat="office in offices | orderBy: 'name' track by office.id" ng-value="office.id"> {{ office.name }} </option>
</select>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment