Commit 194ddb67 authored by vsunke-nisum-com's avatar vsunke-nisum-com Committed by rbonthala-nisum-com

MT-89 Changes in newroletemplate assignroels.js (#69)

parent 736d9e53
...@@ -201,15 +201,17 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -201,15 +201,17 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.gender = ""; $scope.gender = "";
$scope.empRole; $scope.empRole;
$scope.empEmail = ""; $scope.empEmail = "";
$scope.empLocation = "";
$scope.functionalGroup = ""; $scope.functionalGroup;
$scope.empStatus = ""; $scope.empStatus;
$scope.employmentType = ""; $scope.employmentType;
$scope.designation = ""; $scope.designation;
$scope.empLocation;
$scope.dateOfJoining;
$scope.domain = ""; $scope.domain = "";
$scope.isDisabled = false; $scope.isDisabled = false;
$scope.hasPassort = ""; $scope.hasPassort;
$scope.hasB1 = ""; $scope.hasB1;
}else if(dataToPass.action == "Update") { }else if(dataToPass.action == "Update") {
$scope.empId = dataToPass.employeeId; $scope.empId = dataToPass.employeeId;
$scope.empName = dataToPass.employeeName; $scope.empName = dataToPass.employeeName;
...@@ -314,7 +316,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -314,7 +316,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.alertMsg = "Please enter a valid nisum email id"; $scope.alertMsg = "Please enter a valid nisum email id";
document.getElementById('empEmail').focus(); document.getElementById('empEmail').focus();
}else{ }else{
$scope.alertMsg = ""; $scope.alertMsg = "Email ID is mandatory";
} }
} }
...@@ -334,14 +336,22 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -334,14 +336,22 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var gender = $scope.gender; var gender = $scope.gender;
var empRole = $scope.empRole; var empRole = $scope.empRole;
var empEmail = $scope.empEmail; var empEmail = $scope.empEmail;
var designation = $scope.designation;
var empLocation = $scope.empLocation;
var employmentType = $scope.employmentType;
var functionalGroup = $scope.functionalGroup;
var hasPassort = $scope.hasPassort;
var hasB1 = $scope.hasB1;
var empStatus = $scope.empStatus;
var dateOfJoining = $scope.dateOfJoining;
if(searchId == ""){ if(searchId == ""){
$scope.alertMsg = "Employee ID is mandatory"; $scope.alertMsg = "Employee Id is mandatory";
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else if(searchId != "" && !checkRoleEmpIdRange(searchId)){ }else if(searchId != "" && !checkRoleEmpIdRange(searchId)){
$scope.alertMsg = 'Employee ID should be in between '+appConfig.empStartId+' - '+appConfig.empEndId; $scope.alertMsg = 'Employee Id should be in between '+appConfig.empStartId+' - '+appConfig.empEndId;
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else if(searchId != "" && checkRoleExistence(searchId) && $scope.templateTitle == "Add"){ }else if(searchId != "" && checkRoleExistence(searchId) && $scope.templateTitle == "Add"){
$scope.alertMsg = 'Employee ID is already assigned a role'; $scope.alertMsg = 'Employee Id is already assigned a role';
document.getElementById('empId').focus(); document.getElementById('empId').focus();
}else if(empName == ""){ }else if(empName == ""){
$scope.alertMsg = "Employee Name is mandatory"; $scope.alertMsg = "Employee Name is mandatory";
...@@ -352,9 +362,33 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $ ...@@ -352,9 +362,33 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}else if(empEmail == "") { }else if(empEmail == "") {
$scope.alertMsg = "Email ID is mandatory"; $scope.alertMsg = "Email ID is mandatory";
document.getElementById('empEmail').focus(); document.getElementById('empEmail').focus();
}else if(dateOfJoining == undefined){
$scope.alertMsg = "Please select a Date Of Joining";
document.getElementById('dateOfJoining').focus();
}else if(empStatus == undefined){
$scope.alertMsg = "Please select a employee status";
document.getElementById('empStatus').focus();
}else if(empRole == undefined){ }else if(empRole == undefined){
$scope.alertMsg = "Please select a role"; $scope.alertMsg = "Please select a role";
document.getElementById('empRole').focus(); document.getElementById('empRole').focus();
}else if(designation == undefined){
$scope.alertMsg = "Please select a designation";
document.getElementById('designation').focus();
}else if(empLocation == undefined){
$scope.alertMsg = "Please select a location";
document.getElementById('empLocation').focus();
}else if(employmentType == undefined){
$scope.alertMsg = "Please select a Employment Type";
document.getElementById('employmentType').focus();
}else if(functionalGroup == undefined){
$scope.alertMsg = "Please select a Functional Org";
document.getElementById('functionalGroup').focus();
}else if(hasPassort == undefined){
$scope.alertMsg = "Please select a Passport";
document.getElementById('hasPassort').focus();
}else if(hasB1 == undefined){
$scope.alertMsg = "Please select a Visa";
document.getElementById('hasB1').focus();
}else{ }else{
$scope.alertMsg = ""; $scope.alertMsg = "";
console.log($scope.empName,"VENU"); console.log($scope.empName,"VENU");
......
...@@ -208,3 +208,5 @@ md-dialog{ ...@@ -208,3 +208,5 @@ md-dialog{
.ui-grid-canvas .ui-grid-cell-contents { .ui-grid-canvas .ui-grid-cell-contents {
white-space: normal; white-space: normal;
} }
.mandatory:after {content: " *"; color: red; font-size: 15px;}
\ No newline at end of file
...@@ -20,20 +20,20 @@ ...@@ -20,20 +20,20 @@
<div class="form-group"> <div class="form-group">
<table> <table>
<tr> <tr>
<td colspan="4"><b>Emp ID:</b></td> <td colspan="4"><b>Emp ID:</b><span class="mandatory"></span></td>
<td colspan="8"><input type="text" class="form-control" <td colspan="8"><input type="text" class="form-control"
id="empId" name="empId" ng-model="empId" id="empId" name="empId" ng-model="empId"
placeholder="Employee ID" ng-blur="validateEmpId()" placeholder="Employee ID" ng-blur="validateEmpId()"
ng-disabled="isDisabled" /></td> ng-disabled="isDisabled" /></td>
<tr> <tr>
<tr> <tr>
<td colspan="4"><b>Employee Name:</b></td> <td colspan="4"><b>Employee Name:</b><span class="mandatory"></span></td>
<td colspan="8"><input type="text" class="form-control" <td colspan="8"><input type="text" class="form-control"
id="empName" name="empName" ng-model="empName" id="empName" name="empName" ng-model="empName"
placeholder="Employee Name" /></td> placeholder="Employee Name" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="-10"><b>Gender:</b></td> <td colspan="-10"><b>Gender:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="gender" <td colspan="8"><md-select ng-model="gender"
md-selected-text="getSelectedGender()" id="gender"> md-selected-text="getSelectedGender()" id="gender">
<md-option ng-model="gender" value="Male">Male </md-option> <md-option <md-option ng-model="gender" value="Male">Male </md-option> <md-option
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Email:</b></td> <td colspan="4"><b>Email:</b><span class="mandatory"></span></td>
<td colspan="8"><input type="text" class="form-control" <td colspan="8"><input type="text" class="form-control"
id="empEmail" name="empEmail" ng-model="empEmail" id="empEmail" name="empEmail" ng-model="empEmail"
placeholder="Email ID" ng-blur="validateEmailId()" placeholder="Email ID" ng-blur="validateEmailId()"
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Date of Joining:</b></td> <td colspan="4"><b>Date of Joining:</b><span class="mandatory"></span></td>
<td colspan="8"><md-datepicker ng-model="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"
md-max-date="maxDate" onkeydown="return false"></md-datepicker> md-max-date="maxDate" onkeydown="return false"></md-datepicker>
</td> </td>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Employment Status:</b></td> <td colspan="4"><b>Employment Status:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="empStatus" <td colspan="8"><md-select ng-model="empStatus"
md-selected-text="getSelectedEmpStatus()" id="empStatus"> md-selected-text="getSelectedEmpStatus()" id="empStatus">
<md-optgroup label="Employment Status"> <md-option <md-optgroup label="Employment Status"> <md-option
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Designation:</b></td> <td colspan="4"><b>Designation:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="designation" <td colspan="8"><md-select ng-model="designation"
md-selected-text="getDesignationText()" id="designation"> md-selected-text="getDesignationText()" id="designation">
<md-optgroup label="designations"> <md-option <md-optgroup label="designations"> <md-option
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Work Location:</b></td> <td colspan="4"><b>Work Location:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="empLocation" <td colspan="8"><md-select ng-model="empLocation"
md-selected-text="getSelectedLocation()" id="empLocation"> md-selected-text="getSelectedLocation()" id="empLocation">
<md-optgroup label="locations"> <md-option <md-optgroup label="locations"> <md-option
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="4"><b>Employment Type:</b></td> <td colspan="4"><b>Employment Type:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="employmentType" <td colspan="8"><md-select ng-model="employmentType"
md-selected-text="getSelectedEmploymentType()" md-selected-text="getSelectedEmploymentType()"
id="employmentType"> <md-optgroup id="employmentType"> <md-optgroup
...@@ -137,17 +137,17 @@ ...@@ -137,17 +137,17 @@
<h4>Other Info</h4> <h4>Other Info</h4>
<div class="form-group"> <div class="form-group">
<table> <table>
<tr> <!-- <tr>
<td colspan="4"><b>Domain:</b></td> <td colspan="4"><b>Domain:</b></td>
<td colspan="8"><md-select ng-model="domain" <td colspan="8"><md-select ng-model="domain"
md-selected-text="getSelectedDomain()" id="domain"> md-selected-text="getSelectedDomain()" id="domain">
<md-optgroup label="Domain"> <md-option <md-optgroup label="Domain"> <md-option
ng-value="domain" ng-repeat="domain in domains">{{domain}}</md-option> ng-value="domain" ng-repeat="domain in domains">{{domain}}</md-option>
</md-optgroup> </md-select></td> </md-optgroup> </md-select></td>
</tr> </tr> -->
<tr> <tr>
<td colspan="4"><b>Functional Group:</b></td> <td colspan="4"><b>Functional Group:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="functionalGroup" <td colspan="8"><md-select ng-model="functionalGroup"
md-selected-text="getSelectedFunctionalGroup()" md-selected-text="getSelectedFunctionalGroup()"
id="functionalGroup"> <md-optgroup id="functionalGroup"> <md-optgroup
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="1"><b>HasPassport:</b></td> <td colspan="1"><b>HasPassport:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="hasPassort" <td colspan="8"><md-select ng-model="hasPassort"
id="hasPassort"> <md-option ng-model="hasPassort" id="hasPassort"> <md-option ng-model="hasPassort"
value="Yes">Yes </md-option> <md-option ng-model="hasPassort" value="Yes">Yes </md-option> <md-option ng-model="hasPassort"
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="1"><b>Has B1 Visa:</b></td> <td colspan="1"><b>Has B1 Visa:</b><span class="mandatory"></span></td>
<td colspan="8"><md-select ng-model="hasB1" id="hasB1"> <td colspan="8"><md-select ng-model="hasB1" id="hasB1">
<md-option ng-model="hasB1" value="Yes">Yes </md-option> <md-option <md-option ng-model="hasB1" value="Yes">Yes </md-option> <md-option
ng-model="hasB1" value="No">No</md-option> </md-select></td> ng-model="hasB1" value="No">No</md-option> </md-select></td>
......
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