Commit cddfe08e authored by Rajeshekar's avatar Rajeshekar

Update Team mate from projects screen

parent 09997c7a
......@@ -9,7 +9,23 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
"action": "",
"managerIds":[],
"accountId":"",
"domainId":""
"domainId":"",
"employeeId": "",
"employeeName": "",
"emailId":"",
"role": "",
"shift": "",
"projectId":"",
"projectName":"",
"managerId":"",
"managerName":"",
"experience":"",
"designation":"",
"billableStatus":"",
"mobileNumber":"",
"startDate":"",
"endDate":"",
"newBillingStartDate":"",
};
$scope.managers = [];
......@@ -424,6 +440,8 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
'projectId': dataToPass.projectId
};
var employeeModel = $scope.employeeModel;
var getCellTemplate1 = '<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')"></i>'+
'&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>';
$scope.gridOptions = {
......@@ -439,6 +457,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
{ field: 'designation', displayName: 'Designation ', enableColumnMenu: false, enableSorting: false },
{ field: 'active', displayName: 'Status ', enableColumnMenu: false, enableSorting: false, cellTemplate: getCellActiveTemplate },
{ field: 'billableStatus', displayName: 'Billability ', enableColumnMenu: false, enableSorting: false },
{name : 'Actions', displayName: 'Actions',cellTemplate: getCellTemplate1, enableColumnMenu: false, enableSorting: false, width:100,enableFiltering: false}
]
};
$scope.isDisabled = true;
......@@ -451,14 +470,96 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
showAlert("Something went wrong while fetching data!!!");
$scope.gridOptions.data = [];
});
$scope.parentData = {
"projectId": "",
"projectName": "",
"account": "",
"status": "",
"action": "",
"managerIds":[],
"accountId":"",
"domainId":"",
"employeeId": "",
"employeeName": "",
"emailId":"",
"role": "",
"shift": "",
"projectId":"",
"projectName":"",
"managerId":"",
"managerName":"",
"experience":"",
"designation":"",
"billableStatus":"",
"mobileNumber":"",
"startDate":"",
"endDate":"",
"newBillingStartDate":"",
};
$scope.getRowData = function(row, action){
console.log('row selected',row);
$scope.parentData.employeeId = row.entity.employeeId;
$scope.parentData.employeeName = row.entity.employeeName;
$scope.parentData.emailId = row.entity.emailId;
$scope.parentData.role = row.entity.role;
$scope.parentData.shift = row.entity.shift;
$scope.parentData.projectId = row.entity.projectId;
$scope.parentData.projectName = row.entity.projectName;
//$scope.parentData.managerId = row.entity.managerId;
//$scope.parentData.managerName = row.entity.managerName;
$scope.parentData.experience = row.entity.experience;
$scope.parentData.designation = row.entity.designation;
$scope.parentData.billableStatus = row.entity.billableStatus;
$scope.parentData.mobileNumber = row.entity.mobileNumber;
$scope.parentData.startDate = row.entity.startDate;
$scope.parentData.endDate = row.entity.endDate;
$scope.parentData.newBillingStartDate = row.entity.newBillingStartDate;
if(action == "Update"){
$scope.updateTeamMate(action, $scope.parentData);
}
else if(action == "Delete"){
$scope.deleteRole(row,$scope.parentData.id);
}else if(action=="ViewTeamDetail"){
$scope.viewTeamDetail(action, $scope.parentData);
}else if(action=="ViewBillability"){
$scope.ViewBillability(action, $scope.parentData);
}
document.addEventListener("DOMSubtreeModified", function(e) {
if(document.getElementsByClassName("md-tab")[1] && (document.getElementsByClassName("md-tab")[1].style.visibility === "")){
document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ;
}
}, false);
} else if (dataToPass.action == "UnAssigned") {
}
$scope.updateTeamMate = function(action, userData){
$('#home').addClass('md-scroll-mask');
userData.action = action;
$mdDialog.show({
controller: AddProjectTeamController,
templateUrl: 'templates/UpdateTeamMate.html',
parent: angular.element(document.body),
clickOutsideToClose:false,
locals:{dataToPass: userData, gridOptionsData: $scope.gridOptions.data, employees: $scope.employees},
})
.then(function(result) {
if(result == "Add") showAlert('New Teammate assigned successfully');
else if(result == "Update") {
$scope.refreshPage();
showAlert('Teammate updated successfully');
}
else if(result == "Cancelled") console.log(result);
else showAlert('Teammate assigning/updation failed!!!');
});
};
}else if (dataToPass.action == "UnAssigned") {
$scope.gridOptions = {
paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize: 10,
......@@ -481,6 +582,9 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
$scope.gridOptions.data = [];
});
} else if (dataToPass.action == "allocated") {
var getCellTemplate = '<p class="col-lg-12"><i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,\'Update\')"></i>'+
'&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>';
$scope.gridOptions = {
paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize: 10,
......@@ -495,6 +599,7 @@ myApp.controller("projectController", function ($scope, myFactory, exportUiGridS
{ field: 'experience', displayName: 'Exp', enableColumnMenu: true, enableSorting: true, width: 50 },
{ field: 'designation', displayName: 'Designation ', enableColumnMenu: false, enableSorting: false },
{ field: 'billableStatus', displayName: 'Billability ', enableColumnMenu: false, enableSorting: false },
],
enableGridMenu: true,
enableSelectAll: true,
......
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