Commit 2506cf52 authored by Prayas Jain's avatar Prayas Jain

Updated_Css_and_EmployeeEfforts

parent 6c60c5b1
...@@ -322,7 +322,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -322,7 +322,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
var record = {"accountName":$scope.accountName,"industryType":$scope.industryType,"clientAddress":$scope.clientAddress,"deliveryManagers":$scope.accountManagers()}; var record = {"accountName":$scope.accountName,"industryType":$scope.industryType,"clientAddress":$scope.clientAddress,"deliveryManagers":$scope.accountManagers()};
addOrUpdateAccount(record,$scope.templateTitle,"N"); addOrUpdateAccount(record,$scope.templateTitle,"N");
$timeout(function(){updateGrid($scope.templateTitle, record)},200); $timeout(function(){updateGrid(action, record)},300);
} }
}else if(action == "Update"){ }else if(action == "Update"){
if(accountName == undefined || accountName == ""){ if(accountName == undefined || accountName == ""){
...@@ -347,8 +347,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo ...@@ -347,8 +347,8 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
var dataRequired = {"accountName":dataToPass.accountName,"industryType":dataToPass.industryType,"clientAddress":dataToPass.clientAddress,"deliveryManagers":getDeliveryManagersFromService()}; var dataRequired = {"accountName":dataToPass.accountName,"industryType":dataToPass.industryType,"clientAddress":dataToPass.clientAddress,"deliveryManagers":getDeliveryManagersFromService()};
var isFormUpated = myFactory.updateFormDataCheck($scope.myForm,dataRequired); var isFormUpated = myFactory.updateFormDataCheck($scope.myForm,dataRequired);
if(isFormUpated == true){ if(isFormUpated == true){
addOrUpdateAccount(record, $scope.templateTitle, "U"); addOrUpdateAccount(record, action, "U");
$timeout(function () { updateGrid($scope.templateTitle, record) }, 200); $timeout(function () { updateGrid(action, record) }, 300);
} }
else{ else{
$mdDialog.show($mdDialog.alert({ $mdDialog.show($mdDialog.alert({
......
myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, $mdDialog, $http, appConfig, $timeout, $element, $window){ myApp.controller("assignEmployeeEffortrsController",function($scope,exportUiGridService, myFactory, $mdDialog, $http, appConfig, $timeout, $element, $window){
$scope.records = []; $scope.records = [];
$scope.parentData = { $scope.parentData = {
"employeeId": "", "employeeId": "",
...@@ -11,6 +11,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, ...@@ -11,6 +11,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
var today = new Date(); var today = new Date();
var priorDt = new Date(today.getTime() - (6 * 24 * 60 * 60 * 1000)); var priorDt = new Date(today.getTime() - (6 * 24 * 60 * 60 * 1000));
$scope.maxDate = today; $scope.maxDate = today;
$scope.maxFromDate = priorDt;
$scope.toDate = today; $scope.toDate = today;
$scope.fromDate = priorDt; $scope.fromDate = priorDt;
...@@ -19,30 +20,29 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, ...@@ -19,30 +20,29 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
// +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'InActive\'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i><i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>'; // +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.status == \'InActive\'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i><i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>';
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize : 10,
pageNumber: 1, pageNumber: 1,
pageSize:10, pageSize:10,
enableFiltering: true, enableFiltering:true,
rowHeight:22,
columnDefs : [ columnDefs : [
{field : 'employeeId',displayName: 'Employee Id', enableColumnMenu: false, enableSorting: false,enableFiltering: true}, {field : 'employeeId',displayName: 'Employee Id', enableColumnMenu: false, enableSorting: false,enableFiltering: true},
{field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true}, {field : 'employeeName',displayName: 'Employee Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'totalHoursSpentInWeek', displayName: 'Total Hours(HH:MM)', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width :230}, {name : 'totalHoursSpentInWeek', displayName: 'Total Hours(HH:MM)', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width :230},
{field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true}, {field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'account', displayName: 'Account', enableColumnMenu: false, enableSorting: false, enableFiltering:false}, {name : 'accountName', displayName: 'Account', enableColumnMenu: false, enableSorting: false, enableFiltering:false},
{name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:false} {name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:false}
], ],
enableGridMenu: true, enableGridMenu: true,
enableSelectAll: true, enableSelectAll: true,
exporterMenuExcel:false, exporterMenuExcel:false,
exporterMenuCsv:false, exporterMenuCsv:false,
exporterCsvFilename: '.csv', exporterCsvFilename: 'EmployeeEfforts.csv',
exporterExcelFilename:'Employee Efforts Details', exporterExcelFilename:'EmployeeEfforts',
exporterPdfDefaultStyle: {fontSize: 9}, exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "Employee Efforts Details", style: 'headerStyle' }, exporterPdfHeader: { text: "Shift Details", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) { exporterPdfFooter: function ( currentPage, pageCount ) {
return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
}, },
...@@ -53,7 +53,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, ...@@ -53,7 +53,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
}, },
exporterPdfOrientation: 'portrait', exporterPdfOrientation: 'portrait',
exporterPdfPageSize: 'LETTER', exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 800, exporterPdfMaxGridWidth: 500,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){ onRegisterApi: function(gridApi){
$scope.gridApi = gridApi; $scope.gridApi = gridApi;
...@@ -95,7 +95,27 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, ...@@ -95,7 +95,27 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
} }
$scope.validateDates = function(dateValue, from) {
if(from == "FromDate"){
var toDat = $scope.toDate;
var difference = daysBetween(dateValue, toDat);
if(difference < 0 ){
showAlert('From Date should not be greater than To Date');
$scope.fromDate = priorDt;
$scope.toDate = new Date(fromDate.getTime() + (6 * 24 * 60 * 60 * 1000));
}else{
$scope.fromDate = dateValue;
$scope.toDate = new Date($scope.fromDate.getTime() + (6 * 24 * 60 * 60 * 1000));
}
}
};
function showAlert(message) {
$mdDialog.show($mdDialog.alert().parent(
angular.element(document.querySelector('#popupContainer')))
.clickOutsideToClose(true).textContent(message).ariaLabel(
'Alert Dialog').ok('Ok'));
}
function getFormattedDate(date){ function getFormattedDate(date){
var day = date.getDate(); var day = date.getDate();
var month = date.getMonth() + 1; var month = date.getMonth() + 1;
...@@ -103,6 +123,16 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory, ...@@ -103,6 +123,16 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
return year + '-' + (month < 10 ? "0" + month : month) + '-' return year + '-' + (month < 10 ? "0" + month : month) + '-'
+ (day < 10 ? "0" + day : day); + (day < 10 ? "0" + day : day);
} }
function treatAsUTC(date) {
var result = new Date(date);
result.setMinutes(result.getMinutes() - result.getTimezoneOffset());
return result;
}
function daysBetween(fromDate, toDate) {
var millisecondsPerDay = 24 * 60 * 60 * 1000;
return Math.round((treatAsUTC(toDate) - treatAsUTC(fromDate)) / millisecondsPerDay);
}
}); });
...@@ -53,7 +53,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -53,7 +53,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
//{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false}, //{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false},
{ field: 'deliveryLeadIds', displayName: 'Delivery Lead / Lead ', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: true, enableFiltering: false }, { field: 'deliveryLeadIds', displayName: 'Delivery Lead / Lead ', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: true, enableFiltering: false },
{ field: 'status', displayName: 'Status ', enableColumnMenu: false, enableSorting: true, enableFiltering: false }, { field: 'status', displayName: 'Status ', enableColumnMenu: false, enableSorting: true, enableFiltering: false },
{ name: 'Actions', displayName: 'Actions', cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering: false, width: 130 } { name: 'Actions', displayName: 'Actions', cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering: false, width:100 }
] ]
}; };
$scope.gridOptions.data = $scope.records; $scope.gridOptions.data = $scope.records;
......
...@@ -20,7 +20,7 @@ body { ...@@ -20,7 +20,7 @@ body {
padding: 0; padding: 0;
} }
.scroll-content { .scroll-content {
height: 95%; height: 100%;
max-height: 500px; max-height: 500px;
overflow: auto; overflow: auto;
} }
...@@ -329,7 +329,7 @@ i.fa.fa-refresh:hover { ...@@ -329,7 +329,7 @@ i.fa.fa-refresh:hover {
#footer .navbar-inverse, #footer .navbar-inverse { #footer .navbar-inverse, #footer .navbar-inverse {
background: #eeeef6; background: #eeeef6;
border-top: 2px solid #00b4e5; border-top: 2px solid #00b4e5;
position: fixed; position: relative;
} }
#footer .navbar-inverse .copyrights { #footer .navbar-inverse .copyrights {
/* background: #fff; /* background: #fff;
...@@ -645,3 +645,6 @@ cursor: pointer; ...@@ -645,3 +645,6 @@ cursor: pointer;
.my-profile{ .my-profile{
height: calc(100vh - 102px) !important; height: calc(100vh - 102px) !important;
} }
.manage-attendance-report {
height: calc(85vh - 183px) !important;
}
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination class="manage-accounts myGrid grid-full-view"> <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination class=" myGrid grid-full-view">
<div class="watermark" ng-show="!gridOptions.data.length">No data available</div> <div class="watermark" ng-show="!gridOptions.data.length">No data available</div>
</div> </div>
</div> </div>
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<div class="row col-lg-12" style="height: 15px;"></div> <div class="row col-lg-12" style="height: 15px;"></div>
</div> </div>
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="myGrid grid-half-view"> class="myGrid manage-attendance-report grid-half-view">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination
class="myGrid manage-accounts grid-full-view"> class="myGrid grid-full-view">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
</div> </div>
......
...@@ -16,11 +16,17 @@ ...@@ -16,11 +16,17 @@
<div class="form-group"> <div class="form-group">
<div class="form-inline"> <div class="form-inline">
<div class="col-lg-4 col-md-4"> <div class="col-lg-4 col-md-4">
<label class="" for="toDate">To Date: <md-datepicker <label class="" for="toDate">From Date: <md-datepicker
ng-model="fromDate" md-placeholder="Enter date"
md-max-date="maxFromDate"
onkeydown="return false"
ng-change="validateDates(fromDate, 'FromDate')"></md-datepicker></label>
</div>
<div class="col-lg-4 col-md-4">
<label class="" for="toDate">To Date: <md-datepicker disabled
ng-model="toDate" md-placeholder="Enter date" ng-model="toDate" md-placeholder="Enter date"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false" onkeydown="return false"
ng-change="validateDates(toDate, 'ToDate')"></md-datepicker></label> ></md-datepicker></label>
</div> </div>
<div class="col-lg-2 col-md-2"> <div class="col-lg-2 col-md-2">
<label class="" for="submitBtn"><md-button <label class="" for="submitBtn"><md-button
...@@ -33,7 +39,7 @@ ...@@ -33,7 +39,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="form-inline col-lg-12"> <div class="form-inline col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="mygrid grid-full-view"> class="mygrid grid-full-view">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
data available</div> data available</div>
......
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