Commit c387c185 authored by mduppanapudi-nisum-com's avatar mduppanapudi-nisum-com Committed by rbonthala-nisum-com

bug fixes in manage employee and manage project (#127)

parent 33d41f29
...@@ -151,8 +151,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -151,8 +151,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
locals:{dataToPass: userData, gridOptionsData: $scope.gridOptions.data}, locals:{dataToPass: userData, gridOptionsData: $scope.gridOptions.data},
}) })
.then(function(result) { .then(function(result) {
if(result == "Add") showAlert('Role assigned successfully'); if(result == "Add") showAlert('Employee assigned successfully');
else if(result == "Update") showAlert('Role updated successfully'); else if(result == "Update") {
$scope.getUserRoles();
showAlert('Employee updated successfully');
}
else if(result == "Cancelled") console.log(result); else if(result == "Cancelled") console.log(result);
else showAlert('Role assigning/updation failed!!!'); else showAlert('Role assigning/updation failed!!!');
}); });
...@@ -358,6 +361,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -358,6 +361,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var hasB1 = $scope.hasB1; var hasB1 = $scope.hasB1;
var empStatus = $scope.empStatus; var empStatus = $scope.empStatus;
var dateOfJoining = $scope.dateOfJoining; var dateOfJoining = $scope.dateOfJoining;
var dateOfBirth = $scope.dateOfBirth;
if(searchId == ""){ if(searchId == ""){
$scope.alertMsg = "Employee Id is mandatory"; $scope.alertMsg = "Employee Id is mandatory";
document.getElementById('empId').focus(); document.getElementById('empId').focus();
...@@ -379,12 +383,15 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -379,12 +383,15 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}else if(dateOfJoining == undefined){ }else if(dateOfJoining == undefined){
$scope.alertMsg = "Please select a Date Of Joining"; $scope.alertMsg = "Please select a Date Of Joining";
document.getElementById('dateOfJoining').focus(); document.getElementById('dateOfJoining').focus();
}else if(dateOfBirth != undefined && !(today.getFullYear() - dateOfBirth.getFullYear() > 20 )){
$scope.alertMsg = "Please check your date of birth";
document.getElementById('dateOfBirth').focus();
}else if(empStatus == undefined){ }else if(empStatus == undefined){
$scope.alertMsg = "Please select a employee status"; $scope.alertMsg = "Please select a employee status";
document.getElementById('empStatus').focus(); document.getElementById('empStatus').focus();
}else if(empRole == undefined){ }else if(functionalGroup == undefined){
$scope.alertMsg = "Please select a role"; $scope.alertMsg = "Please select a Functional Org";
document.getElementById('empRole').focus(); document.getElementById('functionalGroup').focus();
}else if(designation == undefined){ }else if(designation == undefined){
$scope.alertMsg = "Please select a designation"; $scope.alertMsg = "Please select a designation";
document.getElementById('designation').focus(); document.getElementById('designation').focus();
...@@ -394,9 +401,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -394,9 +401,9 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}else if(employmentType == undefined){ }else if(employmentType == undefined){
$scope.alertMsg = "Please select a Employment Type"; $scope.alertMsg = "Please select a Employment Type";
document.getElementById('employmentType').focus(); document.getElementById('employmentType').focus();
}else if(functionalGroup == undefined){ }else if(empRole == undefined){
$scope.alertMsg = "Please select a Functional Org"; $scope.alertMsg = "Please select a role";
document.getElementById('functionalGroup').focus(); document.getElementById('empRole').focus();
}else if(hasPassort == undefined){ }else if(hasPassort == undefined){
$scope.alertMsg = "Please select a Passport"; $scope.alertMsg = "Please select a Passport";
document.getElementById('hasPassort').focus(); document.getElementById('hasPassort').focus();
......
...@@ -1062,6 +1062,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS ...@@ -1062,6 +1062,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
} }
else if (!(($scope.newBillingStartDate >= $scope.startDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){ else if (!(($scope.newBillingStartDate >= $scope.startDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date"; $scope.alertMsg = $scope.empBillableStatus + " start date should be in between start date and end date";
}else if($scope.endDate > dataToPass.projectEndDate){
$scope.alertMsg = "End date should not exceed project end date";
} }
else { else {
$scope.alertMsg = ""; $scope.alertMsg = "";
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<tr> <tr>
<td colspan="4"><b>Date of Joining:</b><span class="mandatory"></span></td> <td colspan="4"><b>Date of Joining:</b><span class="mandatory"></span></td>
<td colspan="8"><md-datepicker ng-model="dateOfJoining" id="dateOfJoining" <td colspan="8"><md-datepicker ng-model="dateOfJoining" id="dateOfJoining"
md-placeholder="Date of Joining" md-min-date="minDate" md-placeholder="Date of Joining" md-min-date="minDate" id="dateOfBirth"
md-max-date="maxDate" onkeydown="return false"></md-datepicker> md-max-date="maxDate" onkeydown="return false"></md-datepicker>
</td> </td>
</tr> </tr>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</md-optgroup> </md-select></td> </md-optgroup> </md-select></td>
</tr> </tr>
<tr ng-show="empStatus == 'In Active'"> <tr ng-show="empStatus == 'In Active'">
<td colspan="4"><b>Employment Status:</b><span class="mandatory"></span></td> <td colspan="4"><b>Employee Exit Date:</b><span class="mandatory"></span></td>
<td colspan="8"><md-datepicker ng-model="exitDate" <td colspan="8"><md-datepicker ng-model="exitDate"
md-placeholder="Exit Date" md-min-date="minDate" md-placeholder="Exit Date" md-min-date="minDate"
md-max-date="maxDate" onkeydown="return false"></md-datepicker> md-max-date="maxDate" onkeydown="return false"></md-datepicker>
......
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 to comment