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
var record = {"accountName":$scope.accountName,"industryType":$scope.industryType,"clientAddress":$scope.clientAddress,"deliveryManagers":$scope.accountManagers()};
addOrUpdateAccount(record,$scope.templateTitle,"N");
$timeout(function(){updateGrid($scope.templateTitle, record)},200);
$timeout(function(){updateGrid(action, record)},300);
}
}else if(action == "Update"){
if(accountName == undefined || accountName == ""){
......@@ -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 isFormUpated = myFactory.updateFormDataCheck($scope.myForm,dataRequired);
if(isFormUpated == true){
addOrUpdateAccount(record, $scope.templateTitle, "U");
$timeout(function () { updateGrid($scope.templateTitle, record) }, 200);
addOrUpdateAccount(record, action, "U");
$timeout(function () { updateGrid(action, record) }, 300);
}
else{
$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.parentData = {
"employeeId": "",
......@@ -11,6 +11,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
var today = new Date();
var priorDt = new Date(today.getTime() - (6 * 24 * 60 * 60 * 1000));
$scope.maxDate = today;
$scope.maxFromDate = priorDt;
$scope.toDate = today;
$scope.fromDate = priorDt;
......@@ -19,60 +20,59 @@ 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>';
$scope.gridOptions = {
paginationPageSizes : [10, 20, 30, 40, 50, 100],
paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10,
pageNumber: 1,
pageSize:10,
enableFiltering: true,
rowHeight:22,
enableFiltering:true,
columnDefs : [
{field : 'employeeId',displayName: 'Employee Id', enableColumnMenu: false, enableSorting: false,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},
{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}
],
enableGridMenu: true,
enableSelectAll: true,
exporterMenuExcel:false,
exporterMenuCsv:false,
exporterCsvFilename: '.csv',
exporterExcelFilename:'Employee Efforts Details',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "Employee Efforts Details", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) {
return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
},
exporterPdfCustomFormatter: function ( docDefinition ) {
docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
return docDefinition;
},
exporterPdfOrientation: 'portrait',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 800,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
},
gridMenuCustomItems: [{
title: 'Export all data as EXCEL',
action: function ($event) {
exportUiGridService.exportToExcel('sheet 1', $scope.gridApi, 'all', 'all');
},
order: 110
},
{
title: 'Export visible data as EXCEL',
action: function ($event) {
exportUiGridService.exportToExcel('sheet 1', $scope.gridApi, 'visible', 'visible');
},
order: 111
}
]
enableGridMenu: true,
enableSelectAll: true,
exporterMenuExcel:false,
exporterMenuCsv:false,
exporterCsvFilename: 'EmployeeEfforts.csv',
exporterExcelFilename:'EmployeeEfforts',
exporterPdfDefaultStyle: {fontSize: 9},
exporterPdfTableStyle: {margin: [30, 30, 30, 30]},
exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'},
exporterPdfHeader: { text: "Shift Details", style: 'headerStyle' },
exporterPdfFooter: function ( currentPage, pageCount ) {
return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' };
},
exporterPdfCustomFormatter: function ( docDefinition ) {
docDefinition.styles.headerStyle = { fontSize: 22, bold: true };
docDefinition.styles.footerStyle = { fontSize: 10, bold: true };
return docDefinition;
},
exporterPdfOrientation: 'portrait',
exporterPdfPageSize: 'LETTER',
exporterPdfMaxGridWidth: 500,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
onRegisterApi: function(gridApi){
$scope.gridApi = gridApi;
},
gridMenuCustomItems: [{
title: 'Export all data as EXCEL',
action: function ($event) {
exportUiGridService.exportToExcel('sheet 1', $scope.gridApi, 'all', 'all');
},
order: 110
},
{
title: 'Export visible data as EXCEL',
action: function ($event) {
exportUiGridService.exportToExcel('sheet 1', $scope.gridApi, 'visible', 'visible');
},
order: 111
}
]
};
$scope.gridOptions.data = $scope.records;
......@@ -95,7 +95,27 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
$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){
var day = date.getDate();
var month = date.getMonth() + 1;
......@@ -103,6 +123,16 @@ myApp.controller("assignEmployeeEffortrsController",function($scope, myFactory,
return year + '-' + (month < 10 ? "0" + month : month) + '-'
+ (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
//{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: '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;
......
......@@ -20,7 +20,7 @@ body {
padding: 0;
}
.scroll-content {
height: 95%;
height: 100%;
max-height: 500px;
overflow: auto;
}
......@@ -329,7 +329,7 @@ i.fa.fa-refresh:hover {
#footer .navbar-inverse, #footer .navbar-inverse {
background: #eeeef6;
border-top: 2px solid #00b4e5;
position: fixed;
position: relative;
}
#footer .navbar-inverse .copyrights {
/* background: #fff;
......@@ -644,4 +644,7 @@ cursor: pointer;
}
.my-profile{
height: calc(100vh - 102px) !important;
}
.manage-attendance-report {
height: calc(85vh - 183px) !important;
}
\ No newline at end of file
......@@ -17,7 +17,7 @@
</div>
<div class="row">
<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>
</div>
......
......@@ -63,7 +63,7 @@
<div class="row col-lg-12" style="height: 15px;"></div>
</div>
<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
data available</div>
</div>
......
......@@ -19,7 +19,7 @@
<div class="row">
<div class="col-lg-12">
<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
data available</div>
</div>
......
......@@ -16,11 +16,17 @@
<div class="form-group">
<div class="form-inline">
<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"
md-min-date="minDate" md-max-date="maxDate"
onkeydown="return false"
ng-change="validateDates(toDate, 'ToDate')"></md-datepicker></label>
></md-datepicker></label>
</div>
<div class="col-lg-2 col-md-2">
<label class="" for="submitBtn"><md-button
......@@ -33,7 +39,7 @@
</div>
<div class="form-group">
<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">
<div class="watermark" ng-show="!gridOptions.data.length">No
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