Commit c64cc99d authored by Soumya Gouri's avatar Soumya Gouri

Changing resource status from proposed to engaged

parent fc48b286
...@@ -609,7 +609,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -609,7 +609,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
'<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.saveRow(row.entity,\'Update\')"></i>' '<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.saveRow(row.entity,\'Update\')"></i>'
+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>' +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>'
+'<i ng-show="grid.appScope.showMoveToBenchIcon(row.entity) && !row.entity.editrow" id="moveResource" class="fa fa-arrow-circle-right fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Release" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.moveToBench(row.entity)"></i>'+ +'<i ng-show="grid.appScope.showMoveToBenchIcon(row.entity) && !row.entity.editrow" id="moveResource" class="fa fa-arrow-circle-right fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Release" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.moveToBench(row.entity)"></i>'+
'<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="deleteResource" class="fa fa-trash fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.deleteProposedResource(row.entity)"></i></p>'; '<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="deleteResource" class="fa fa-arrow-circle-left fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Engage" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.changeAllocationStatusToEngaged(row.entity)"></i>'+
'&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'Proposed\' && !row.entity.editrow" id="moveToProject" class="fa fa-trash fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.deleteProposedResource(row.entity)"></i></p>';
//'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>'; //'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
var getCellActiveTemplate = '<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>'; var getCellActiveTemplate = '<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>';
...@@ -788,6 +789,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -788,6 +789,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
$scope.moveToBench = function (row) { $scope.moveToBench = function (row) {
let role; let role;
if(row.resourceRole == 'Individual Contributor'){ if(row.resourceRole == 'Individual Contributor'){
...@@ -824,6 +826,40 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -824,6 +826,40 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}); });
} }
$scope.changeAllocationStatusToEngaged = function (row) {
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate,"status":"Engaged"};
console.log(record);
var urlRequest = "";
var loginEmpId = myFactory.getEmpId();
//urlRequest = appConfig.appUri+ "resources/moveToOpenPool?loginEmpId="+loginEmpId;
var req = {
method : 'PUT',
url : urlRequest,
headers : {
"Content-type" : "application/json"
},
data : record
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
if(response.data.message == "Resource's status has been changed Successfully"){
$timeout(function () {
getProjectDetails($scope.projectId, $scope.status);
}, 500);
}
$mdDialog.show($mdDialog.alert({
skipHide: true,
textContent: response.data.message ,
ok: 'ok'
})).then(function () {
$scope.myForm.$setPristine();
})
}, function myError(response){
$scope.result = "Error";
});
}
$scope.deleteProposedResource = function (row) { $scope.deleteProposedResource = function (row) {
$scope.id = row.id; $scope.id = row.id;
......
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