Commit 118e5bf3 authored by rammula-nisum-com's avatar rammula-nisum-com Committed by rbonthala-nisum-com

issues in new team mate, new role and shift added to form (#98)

parent a5d233b1
...@@ -294,7 +294,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -294,7 +294,8 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
function AddProjectTeamController($scope, $mdDialog, dataToPass, gridOptionsData,employees) { function AddProjectTeamController($scope, $mdDialog, dataToPass, gridOptionsData,employees) {
$scope.searchTerm = ""; $scope.searchTerm = "";
$scope.roles = [{"roleName":"Employee"},{"roleName":"Lead"}];
$scope.updateSearch =function(e){ $scope.updateSearch =function(e){
e.stopPropagation(); e.stopPropagation();
} }
...@@ -629,6 +630,14 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -629,6 +630,14 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
return "Please select a employee"; return "Please select a employee";
} }
}; };
$scope.getSelectedRole = function(){
if($scope.role != undefined){
return $scope.role.roleName;
}
else {
return "Please select the role";
}
};
$scope.getProjectSelected = function(){ $scope.getProjectSelected = function(){
if ($scope.projectModel !== undefined) { if ($scope.projectModel !== undefined) {
$scope.project=$scope.projectModel; $scope.project=$scope.projectModel;
...@@ -664,6 +673,9 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -664,6 +673,9 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
}else if(employeeModel != undefined && projectModel != undefined }else if(employeeModel != undefined && projectModel != undefined
&& getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){ && getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){
$scope.alertMsg = "Employee is already assigned to the selected project"; $scope.alertMsg = "Employee is already assigned to the selected project";
}else if($scope.shift == undefined){
$scope.alertMsg = "Please select a shift timing";
document.getElementById('shift').focus();
}else if($scope.empBillableStatus == undefined){ }else if($scope.empBillableStatus == undefined){
$scope.alertMsg = "Please select a billable status"; $scope.alertMsg = "Please select a billable status";
document.getElementById('empBillableStatus').focus(); document.getElementById('empBillableStatus').focus();
...@@ -682,7 +694,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog, ...@@ -682,7 +694,7 @@ myApp.controller("projectTeamController",function($scope, myFactory, $mdDialog,
else { else {
$scope.alertMsg = ""; $scope.alertMsg = "";
var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": employeeModel.role, "designation":employeeModel.designation,"shift": employeeModel.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate,"newBillingStartDate":$scope.newBillingStartDate,"accountId":$scope.projectModel.accountId,"domainId":$scope.projectModel.domainId}; var record = {"employeeId":employeeModel.employeeId, "employeeName":employeeModel.employeeName, "emailId": employeeModel.emailId, "role": $scope.role.roleName, "designation":employeeModel.designation,"shift": $scope.shift,"projectId":projectModel.projectId,"projectName":projectModel.projectName,"account":$scope.projectModel.account,"managerId":myFactory.getEmpId(),"managerName":myFactory.getEmpName(),"mobileNumber":employeeModel.mobileNumber,"active":true,"billableStatus":$scope.empBillableStatus,"startDate":$scope.startDate,"endDate":$scope.endDate,"newBillingStartDate":$scope.newBillingStartDate,"accountId":$scope.projectModel.accountId,"domainId":$scope.projectModel.domainId};
addOrUpdateRole(record, $scope.templateTitle); addOrUpdateRole(record, $scope.templateTitle);
$timeout(function(){updateGrid($scope.templateTitle, record)},500); $timeout(function(){updateGrid($scope.templateTitle, record)},500);
} }
......
...@@ -215,4 +215,7 @@ md-select { ...@@ -215,4 +215,7 @@ md-select {
} }
.form-control{ .form-control{
text-transform:capitalize; text-transform:capitalize;
}
.md-datepicker-input-container{
width: 160px;
} }
\ No newline at end of file
...@@ -53,8 +53,23 @@ ...@@ -53,8 +53,23 @@
<output>Previous Project Start Date : {{ project.startDate | date : "dd-MM-yyyy"}}</output> <output>Previous Project Start Date : {{ project.startDate | date : "dd-MM-yyyy"}}</output>
<output>Previous Project End Date : {{project.endDate | date : "dd-MM-yyyy"}}</output> <output>Previous Project End Date : {{project.endDate | date : "dd-MM-yyyy"}}</output>
</div> </div>
<md-select ng-model="role"
md-selected-text="getSelectedRole()"
id="shift"> <md-optgroup
label="role"> <md-option
ng-value="role"
ng-repeat="role in roles">{{role.roleName}}</md-option>
</md-optgroup> </md-select>
<md-select ng-model="shift"
md-selected-text="getSelectedShift()"
id="shift"> <md-optgroup
label="shift"> <md-option
ng-value="shift"
ng-repeat="shift in shifts">{{shift}}</md-option>
</md-optgroup> </md-select>
<md-select ng-model="empBillableStatus" <md-select ng-model="empBillableStatus"
md-selected-text="getSelectedBillableStatus()" md-selected-text="getSelectedBillableStatus()"
id="empBillableStatus"> <md-optgroup id="empBillableStatus"> <md-optgroup
...@@ -62,25 +77,38 @@ ...@@ -62,25 +77,38 @@
ng-value="billableStatus" ng-value="billableStatus"
ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option> ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option>
</md-optgroup> </md-select> </md-optgroup> </md-select>
<table>
<tr ng-show="empBillableStatus">
<td>Current Billability Start Date </td>
<td>
<md-datepicker ng-model="newBillingStartDate" md-placeholder="Please select the date" id ="newBillingStartDate"
md-min-date="minDate" md-max-date="maxDate"
ng-change="currentBillabilityDateChange()"
onkeydown="return false">
</md-datepicker>
</td>
</tr>
<tr>
<td>Start Date</td>
<td>
<md-datepicker ng-model="startDate" md-placeholder="Please select the date" id ="startDate"
md-min-date="minDate" md-max-date="maxDate"
ng-disabled="newBillingStartDate"
onkeydown="return false">
</md-datepicker>
</td>
</tr>
<tr>
<td>End Date &nbsp</td>
<td>
<md-datepicker ng-model="endDate" md-placeholder="Please select the date" id="endDate"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false">
</md-datepicker>
</td>
</tr>
</table>
<div ng-show="empBillableStatus">
<output>Current Billability Start Date : <md-datepicker ng-model="newBillingStartDate" md-placeholder="Please Select Date" id ="newBillingStartDate"
md-min-date="minDate" md-max-date="maxDate"
ng-change="currentBillabilityDateChange()"
onkeydown="return false"
></md-datepicker></br></output>
</div>
<md-datepicker ng-model="startDate" md-placeholder="Assignment Start Date" id ="startDate"
md-min-date="minDate" md-max-date="maxDate"
ng-disabled="newBillingStartDate"
onkeydown="return false"
></md-datepicker></br>
<md-datepicker ng-model="endDate" md-placeholder="Assignment End Date" id="endDate"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
></md-datepicker>
<div role="alert"> <div role="alert">
<span class="error" style="color: red;">{{alertMsg}}</span> <span class="error" style="color: red;">{{alertMsg}}</span>
......
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