merge master-newdesign

MOE_DEV_NEW_TEMPORARY_DESIGN
Mohamed Mekawy 6 years ago
commit cceb434cf4

1876
Mohem/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -101,12 +101,13 @@
"cordova.plugins.diagnostic": "^5.0.1", "cordova.plugins.diagnostic": "^5.0.1",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"date-fns": "^1.30.1", "date-fns": "^1.30.1",
"ionic2-calendar": "^0.5.8",
"mx.ferreyra.callnumber": "0.0.2", "mx.ferreyra.callnumber": "0.0.2",
"ng-circle-progress": "^1.5.1", "ng-circle-progress": "^1.5.1",
"ng2-file-upload": "^1.3.0", "ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2", "ng2-pdf-viewer": "^5.3.2",
"ngx-gauge": "^1.0.0-beta.10", "ngx-gauge": "^1.0.0-beta.10",
"npm": "^6.13.1", "npm": "^6.13.7",
"phonegap-plugin-barcodescanner": "^8.1.0", "phonegap-plugin-barcodescanner": "^8.1.0",
"phonegap-plugin-multidex": "^1.0.0", "phonegap-plugin-multidex": "^1.0.0",
"primeicons": "^1.0.0", "primeicons": "^1.0.0",
@ -139,11 +140,11 @@
"karma-coverage-istanbul-reporter": "~2.0.1", "karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2", "karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2", "karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.13.0", "node-sass": "^4.13.1",
"protractor": "~5.4.0", "protractor": "^5.4.3",
"ts-node": "~8.0.0", "ts-node": "~8.0.0",
"tslint": "~5.12.0", "tslint": "~5.12.0",
"typescript": "~3.1.6" "typescript": "3.1.6"
}, },
"description": "An Ionic project", "description": "An Ionic project",
"cordova": { "cordova": {
@ -201,4 +202,4 @@
"android" "android"
] ]
} }
} }

@ -1,20 +1,21 @@
<!-- <ion-header > <ion-header >
<ion-toolbar class="header-toolbar-new"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light">{{ts.trPK('absenceList','absenceList')}}</ion-title> <ion-title color="light">{{ts.trPK('absenceList','absenceList')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons></nav-buttons> <nav-buttons></nav-buttons>
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <!-- <ion-buttons slot="end">
<button class="headerBtn" (click)="AccrualBalances()"> <button class="headerBtn" (click)="AccrualBalances()">
<img class="headerImg" src="../assets/imgs/accubalance.png"> <img class="headerImg" src="../assets/imgs/accubalance.png">
</button> </button>
</ion-buttons> </ion-buttons> -->
</ion-toolbar> </ion-toolbar>
</ion-header> --> </ion-header>
<ion-content class="colorBG">
<ion-content >
<!-- colorBG -->
<div class="contentEit" style="background: #f3f1f1;">
<div class="header-div"> <div class="header-div">
<!-- <ion-buttons slot="end"> <!-- <ion-buttons slot="end">
@ -22,10 +23,12 @@
<img class="headerImg" src="../assets/imgs/accubalance.png"> <img class="headerImg" src="../assets/imgs/accubalance.png">
</button> </button>
</ion-buttons> --> </ion-buttons> -->
<ion-buttons slot="start">
<!-- <ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button> <ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons> </ion-buttons>
<p class="Title">{{ts.trPK('absenceList','absenceList')}}</p> <p class="Title">{{ts.trPK('absenceList','absenceList')}}</p> -->
</div> </div>
@ -39,7 +42,7 @@
<div style="color: black;"> <div style="color: black;">
<div class="result-graph"> <div class="result-graph">
<div> <div >
<!-- <ion-item> --> <!-- <ion-item> -->
<!-- <ion-label class="datelabel">{{request.P_EFFECTIVE_DATE}}</ion-label> --> <!-- <ion-label class="datelabel">{{request.P_EFFECTIVE_DATE}}</ion-label> -->
<ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY" placeholder="DD MMMM YYYY" <ion-datetime [(ngModel)]="Sdate" class="datetime" displayFormat="DD MMMM YYYY" placeholder="DD MMMM YYYY"
@ -51,9 +54,11 @@
margin-top: -10px; margin-right: -9px;"></div> margin-top: -10px; margin-right: -9px;"></div>
<div class="result-text-container"> <div class="result-text-container">
<!-- <h2>10</h2> --> <h2>{{totalnumber}}</h2>
<h2>{{accrualNet + accrualUsed + accrualYearly}}</h2>
<!-- <h2>{{accrualNet + accrualUsed + accrualYearly}}</h2> -->
<span>{{ts.trPK('absenceList','totalNumber')}}</span> <span>{{ts.trPK('absenceList','totalNumber')}}</span>
@ -139,7 +144,7 @@
<!-- /////////////////////////////////////////////////////////up --> <!-- /////////////////////////////////////////////////////////up -->
<ion-content padding> <!-- <ion-content padding> -->
<div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" > <div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" >
<ion-row> <ion-row>
@ -245,7 +250,7 @@
<ion-icon class="addClass" name="add" (click)="createAbsence()"></ion-icon> <ion-icon class="addClass" name="add" (click)="createAbsence()"></ion-icon>
</div>
</ion-content> </ion-content>
<!-- <ion-footer> <!-- <ion-footer>
<div class="centerDiv"> <div class="centerDiv">

@ -144,9 +144,9 @@
border-radius: 20px !important; border-radius: 20px !important;
padding-top: 28px; padding-top: 28px;
padding-bottom: 14px; padding-bottom: 14px;
margin-left: 9px; margin-left: 13px;
margin-right: 13px; margin-right: 13px;
margin-top: -94px; margin-top: -136px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -159,7 +159,7 @@
margin: 0; margin: 0;
position: absolute; position: absolute;
left: 31%; left: 31%;
top: 26%; top: 23%;
display: block; display: block;
text-align: center; text-align: center;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
@ -204,4 +204,15 @@ margin-top: -13px;
font-size: 17px; font-size: 17px;
font-family: WorkSans-Bold; font-family: WorkSans-Bold;
margin-top: -4px; margin-top: -4px;
}
.contentEit:before {
position: absolute;
content: "";
// background: #22c6b3;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
} }

@ -97,7 +97,8 @@ export class HomeComponent implements OnInit {
this.accrualNet = this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT; this.accrualNet = this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.leaveAccrualBalance.ACCRUAL_USED_ENTITLEMENT; this.accrualUsed = this.leaveAccrualBalance.ACCRUAL_USED_ENTITLEMENT;
this.accrualYearly = this.leaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT; this.accrualYearly = this.leaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT;
this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly;
this.totalnumber= this.totalnumber.toFixed(3);
this.request = this.common.sharedService.getSharedData('leaveAccrualBalanceDate', false); this.request = this.common.sharedService.getSharedData('leaveAccrualBalanceDate', false);
console.log("this.request" + this.request.P_EFFECTIVE_DATE); console.log("this.request" + this.request.P_EFFECTIVE_DATE);
this.effectiveDate = this.request.P_EFFECTIVE_DATE; this.effectiveDate = this.request.P_EFFECTIVE_DATE;
@ -254,7 +255,8 @@ createAbsence() {
this.accrualNet = this.balance[0].ACCRUAL_NET_ENTITLEMENT; this.accrualNet = this.balance[0].ACCRUAL_NET_ENTITLEMENT;
this.accrualUsed = this.balance[0].ACCRUAL_USED_ENTITLEMENT; this.accrualUsed = this.balance[0].ACCRUAL_USED_ENTITLEMENT;
this.accrualYearly = this.balance[0].ACCRUAL_YEARLY_ENTITLEMENT; this.accrualYearly = this.balance[0].ACCRUAL_YEARLY_ENTITLEMENT;
this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly;
this.totalnumber= this.totalnumber.toFixed(3);
this.data = { this.data = {
// labels: ['earingTotal', 'deductionTotal'], // labels: ['earingTotal', 'deductionTotal'],
datasets: [ datasets: [

@ -1,13 +1,13 @@
import { Injectable } from "@angular/core"; import { Injectable } from '@angular/core';
import { Observable } from "rxjs"; import { Observable } from 'rxjs';
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
@Injectable({ @Injectable({
providedIn: "root" providedIn: 'root'
}) })
export class AccrualService { export class AccrualService {
public static GET_ACCRUAL_BALANCE = public static GET_ACCRUAL_BALANCE =
"Services/ERP.svc/REST/GET_ACCRUAL_BALANCES"; 'Services/ERP.svc/REST/GET_ACCRUAL_BALANCES';
constructor( constructor(
public con: ConnectorService, public con: ConnectorService,
public authService: AuthenticationService public authService: AuthenticationService

@ -29,6 +29,10 @@ export class AppComponent implements OnInit, AfterViewInit {
companyDesc: string = "Powered By Cloud Solutions"; companyDesc: string = "Powered By Cloud Solutions";
public direction = "ltr"; public direction = "ltr";
User_Job_name: string; User_Job_name: string;
requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; //this.deviceToken
};
user: boolean;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
private cs: CommonService, private cs: CommonService,
@ -71,6 +75,7 @@ export class AppComponent implements OnInit, AfterViewInit {
} }
private startReceivingPushService() { private startReceivingPushService() {
console.log("platform.ready")
this.pushService.startReceiving(); this.pushService.startReceiving();
} }
subscribeEvents() { subscribeEvents() {
@ -159,6 +164,7 @@ export class AppComponent implements OnInit, AfterViewInit {
closeMenu(){ closeMenu(){
this.menu.toggle(); this.menu.toggle();
} }
} }

@ -15,6 +15,9 @@ import { FilePath } from '@ionic-native/file-path/ngx';
import { File } from '@ionic-native/file/ngx'; import { File } from '@ionic-native/file/ngx';
import { Base64 } from '@ionic-native/base64/ngx'; import { Base64 } from '@ionic-native/base64/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; import { FirebaseX } from '@ionic-native/firebase-x/ngx';
import { NgCalendarModule } from 'ionic2-calendar';
@NgModule({ @NgModule({
declarations: [AppComponent], declarations: [AppComponent],
entryComponents: [], entryComponents: [],
@ -25,7 +28,8 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx';
hardwareBackButton: true, hardwareBackButton: true,
}), }),
AppRoutingModule, AppRoutingModule,
HmgCommonModule HmgCommonModule,
NgCalendarModule
], ],
providers: [ providers: [
StatusBar, StatusBar,

@ -4,6 +4,9 @@ import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbore
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import {AttendScanService} from '../../hmg-common/services/attend-services/attend-scan.service'; import {AttendScanService} from '../../hmg-common/services/attend-services/attend-scan.service';
import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response'; import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response';
import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service';
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
templateUrl: './home.component.html', templateUrl: './home.component.html',
@ -22,11 +25,14 @@ export class HomeComponent implements OnInit {
public isCheckedIn = undefined; public isCheckedIn = undefined;
public displayTime: any; public displayTime: any;
public percent: any; public percent: any;
public spentHours: any;
public userData = this.sharedData.getSharedData(AuthenticatedUser.SHARED_DATA, false);
constructor( constructor(
public cs: CommonService, public cs: CommonService,
public db: DashboredService, public db: DashboredService,
public ts: TranslatorService, public ts: TranslatorService,
public attendScanService: AttendScanService public attendScanService: AttendScanService,
public sharedData: SharedDataService
) { } ) { }
ngOnInit() { ngOnInit() {
@ -91,12 +97,18 @@ export class HomeComponent implements OnInit {
convertAndAssignTime(data) { convertAndAssignTime(data) {
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':')); this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
this.initTimer(); this.isCheckedIn = this.spentHours === 0 ? false : true;
} if (this.isCheckedIn) {
this.initTimer();
}
}
showAttendanceTracking() { showAttendanceTracking() {
this.db.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
};
this.db.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
const key = 'GetAttendanceTrackingList'; const key = 'GetAttendanceTrackingList';
this.convertAndAssignTime(result[key]); this.convertAndAssignTime(result[key]);

@ -7,6 +7,8 @@ import { IonicModule } from '@ionic/angular';
import { AttendancePage } from './attendance.page'; import { AttendancePage } from './attendance.page';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
import {MonthlyAttendanceComponent} from './monthly-attendance/monthly-attendance.component';
import { HmgCommonModule } from '../hmg-common/hmg-common.module';
const routes: Routes = [ const routes: Routes = [
{ {
@ -16,6 +18,10 @@ const routes: Routes = [
{ {
path: 'home', path: 'home',
component: HomeComponent component: HomeComponent
},
{
path: 'monthlyAttendance',
component: MonthlyAttendanceComponent
} }
] ]
} }
@ -26,8 +32,9 @@ const routes: Routes = [
CommonModule, CommonModule,
FormsModule, FormsModule,
IonicModule, IonicModule,
HmgCommonModule,
RouterModule.forChild(routes) RouterModule.forChild(routes)
], ],
declarations: [AttendancePage, HomeComponent] declarations: [AttendancePage, HomeComponent, MonthlyAttendanceComponent]
}) })
export class AttendancePageModule {} export class AttendancePageModule {}

@ -0,0 +1,113 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons>
<ion-title color="light">{{ts.trPK('attendance','attendance')}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="colorBG">
<div class="header-div">
<div class="header-div">
<p style="position: absolute; left: 40%; bottom: 65%;">{{currentMonth}}</p>
<ion-slides>
<ion-slide>
<ion-grid class="headerGrid">
<div style="color: black;">
<!-- <ngx-gauge
[type]="gaugeType"
[value]="gaugeValue"
[label]="gaugeLabel">
</ngx-gauge> -->
<div class="result-graph">
<div class="request-heading">
<span>Open Request Analysis</span>
</div>
<div class="result-text-container">
<h2>287</h2>
<span>TOTAL <br> OPEN REQUEST</span>
</div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<div style="position: relative;
left: 79%;
bottom: 35px;
color: black;
background-color: #22c6b3;
width: 20%; height: 6px;">
</div>
<div style="position: relative;
left: 79%;
bottom: 20px;
color: black;
background-color: #094875;
width: 20%; height: 6px;">
</div>
</div>
</ion-grid>
</ion-slide>
</ion-slides>
</div>
</div>
<div style="margin-top: 45%;">
<ion-grid>
<ion-row>
<ion-col>
<ion-grid class="labelGrid">
<ion-row>
<ion-col>
<label style="font-size: 13px;">SCHEDULE</label>
</ion-col>
<ion-col>
<h2 style="margin-left: 45%; font-size: 25px;">23</h2>
</ion-col>
</ion-row>
</ion-grid>
</ion-col>
<ion-col>
<ion-grid class="labelGrid">
<ion-row>
<ion-col>
<label style="font-size: 12px;">OFF DAYS</label>
</ion-col>
<ion-col>
<h2 style="margin-left: 45%; font-size: 25px;">08</h2>
</ion-col>
</ion-row>
</ion-grid>
</ion-col>
<ion-col>
<ion-grid class="labelGrid">
<label style="font-size: 13px;">NON ANALYZED</label>
<h2 style="margin-left: 45%; font-size: 25px;">01</h2>
</ion-grid>
</ion-col>
<ion-col>
<ion-grid class="labelGrid">
<label style="font-size: 13px;">SHORTAGE HOURS</label>
<h2 style="margin-left: 45%; font-size: 25px;">03</h2>
</ion-grid>
</ion-col>
</ion-row>
</ion-grid>
</div>
<div >
<ion-grid class="bodyGrid">
<app-circle-calendar></app-circle-calendar>
</ion-grid>
</div>
</ion-content>

@ -0,0 +1,242 @@
.colorBG {
--background: #f0efef;
}
.header-div {
background: #22c6b3;
color: var(--light);
text-transform: capitalize;
display: block;
position: relative;
height: 210px;
margin-bottom: 60px;
}
.chart-modal .modal-Wrapper {
--background: rgb(116, 108, 108) !important;
--border-color:white!important ;
width: 85%!important ;
height: 40px !important ;
}
.navbar{
font-size: 10px !important;
--background: #22C6B3 !important;
color: aliceblue !important;
// margin-top: 10px !important;
}
.menu{
// margin-left:330px !important;
margin-top: 0px !important;
font-size: 35px !important;
background: #22C6B3;
color: aliceblue;
margin-left: 0px !important;
}
.person{
margin-left:100px !important;
margin-top: 0px !important;
font-size: 23px !important;
background: #22C6B3 !important;
color: aliceblue !important;
}
.grid{
margin-bottom: 550px !important;
margin-top: 20px !important;
margin-left: 15px !important;
margin-right: 15px !important;
background-color:white !important;
border-radius: 20px !important;
height: 250px !important;
}
.headerGrid{
margin-bottom: 550px !important;
margin-top: 80px !important;
margin-left: 15px !important;
margin-right: 15px !important;
background-color:white !important;
border-radius: 20px !important;
height: 250px !important;
}
.bodyGrid{
margin-bottom: 550px !important;
margin-top: 20px !important;
margin-left: 15px !important;
margin-right: 15px !important;
background-color:white !important;
border-radius: 20px !important;
height: 270px !important;
}
.labelGrid{
margin-top: -30px !important;
background-color:white !important;
border-radius: 20px !important;
height: 100px !important;
}
.ionSliders{
margin: 0px !important;
padding: 0px !important;
}
.ionSlide{
margin-top: 5px !important;
margin-left: 190px !important;
color: black !important;
}
.dateLable{
margin-left: 90px !important;
color: black !important;
font-size: small !important;
margin-top: 15px !important;
}
// h1{
// font-size: 15px !important;
// text-align: center !important;
// }
.arrowDropright{
margin-left:100px !important;
font-size: 20px !important;
color: rgb(168, 165, 165) !important;
margin-top: 15px !important;
}
.arrowDropleft{
font-size: 20px !important;
margin-left: 10px !important;
margin-top: 15px !important;
color: rgb(116, 108, 108) !important;
}
.ionLable{
font-size: 10px !important;
}
.number{
font-size: 18px !important;
font-weight: bolder !important;
color: black !important;
}
.header-div{
background:var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: #22C6B3;
// background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%);
color:var(--light);
text-transform: capitalize;
display: block;
position: relative;
height: 210px;
margin-bottom:60px;
// border-radius: 0px 0px 70px 70px;
}
.request-heading {
span {
text-align: center;
display: block;
padding-top: 8px;
font-family: workSans-Regular;
}
}
.result-graph {
position: relative;
background: white;
margin-right: 20px;
margin-left: 20px;
margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
}
.result-text-container {
padding: 0;
margin: 0;
position: absolute;
left: 50%;
top: 50%;
display: block;
text-align: center;
transform: translate(-50%, -50%);
h2 {
font-size: 38px;
font-family: WorkSans-Bold;
margin: 0 auto;
line-height: 36px;
}
span {
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
font-family: workSans-Regular;
}
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MonthlyAttendanceComponent } from './monthly-attendance.component';
describe('MonthlyAttendanceComponent', () => {
let component: MonthlyAttendanceComponent;
let fixture: ComponentFixture<MonthlyAttendanceComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MonthlyAttendanceComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(MonthlyAttendanceComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,101 @@
import { Component, OnInit } from '@angular/core';
import { CommonService } from '../../hmg-common/services/common/common.service';
import { TranslatorService } from '../../hmg-common/services/translator/translator.service';
import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service';
import { GetSubordinatesAttdStatusRequest } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { GetSubordinatesAttdStatusResponse } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse';
@Component({
selector: 'app-monthly-attendance',
templateUrl: './monthly-attendance.component.html',
styleUrls: ['./monthly-attendance.component.scss'],
})
export class MonthlyAttendanceComponent implements OnInit {
constructor(
private cs: CommonService,
public ts: TranslatorService,
public sharedData: SharedDataService,
public DS: DashboredService) { }
gaugeType = 'full';
gaugeValue = 28.3;
gaugeLabel = 'Days';
// gaugeAppendText = "km/hr";
currentMonth: any;
todayYear: any;
todayMonth: any;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
public data = {
datasets: [
{
data: [120, 50],
backgroundColor: [
'#22c6b3',
'#094875',
],
borderWidth: 2
}]
};
ngOnInit() { }
ionViewWillEnter() {
this.currentMonth = this.sharedData.getSharedData("currentMonth");
console.log(this.currentMonth);
let day = this.currentMonth.split(" ");
this.todayMonth =day[0];
this.todayYear = day[1];
this.todayYear = parseInt(this.todayYear);
console.log("MONTH: " +this.todayMonth);
console.log("YEAR: " +this.todayYear);
this.getSubordinatesAttStatus()
}
getSubordinatesAttStatus() {
let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
// request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; //test
// request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/";//test
console.log(this.currentMonth);
request.SearchMonth = this.todayMonth;
request.SearchYear = 2019//this.todayYear;
this.DS.getSubordinatesAttStatus(request, () => { console.log("Error "); }).subscribe((result: GetSubordinatesAttdStatusResponse) => {
if (this.cs.validResponse(result)) {
console.log("response");
console.log(result);
}
});
}
x(){
console.log("ENAD CHANge")
}
}

@ -1,5 +1,5 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button> <ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons> </ion-buttons>

@ -78,6 +78,7 @@ export class CheckUserComponent implements OnInit {
console.log(result); console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.P_USER_NAME; this.loginData.P_USER_NAME = this.P_USER_NAME;
// this.loginData.EMPLOYEE_NAME=result.MemberLoginList[0].EMPLOYEE_NAME;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.sharedData.setSharedData(true,Password.IS_FORGET_PSW); this.sharedData.setSharedData(true,Password.IS_FORGET_PSW);
this.cs.stopLoading(); this.cs.stopLoading();

@ -1,5 +1,5 @@
<ion-header *ngIf="!accessFromOutSide"> <ion-header *ngIf="!accessFromOutSide">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons> <nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons>
</ion-buttons> </ion-buttons>
@ -28,7 +28,10 @@
<!-- <img [src]="logo" class="loginLogo" /> <!-- <img [src]="logo" class="loginLogo" />
<h1 class="heading1">{{welcome}} </h1> --> <h1 class="heading1">{{welcome}} </h1> -->
<!-- <p class="text1" style="margin-bottom: -8px;font-weight: bold;font-size: 22px;">{{ts.trPK('login','Verify-text')}} </p> --> <!-- <p class="text1" style="margin-bottom: -8px;font-weight: bold;font-size: 22px;">{{ts.trPK('login','Verify-text')}} </p> -->
<p class="text1" style="font-size: 28px;margin-bottom: 0px" >{{empname}}</p> <!--
<p class="text1" style="font-size: 28px;margin-bottom: 0px" >{{empname}}</p>
-->
</ion-col> </ion-col>
</ion-row> <div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div> </ion-row> <div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div>
<!-- <type-writer *ngIf="!onlySMSBox" [text]="'login, verify-fingerprint' | translate" class="description" <!-- <type-writer *ngIf="!onlySMSBox" [text]="'login, verify-fingerprint' | translate" class="description"

@ -29,6 +29,7 @@ import { PushService } from 'src/app/hmg-common/services/push/push.service';
import { Platform } from '@ionic/angular'; import { Platform } from '@ionic/angular';
import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response'; import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response';
import { LoginModel } from '../models/LoginModel'; import { LoginModel } from '../models/LoginModel';
import * as moment from "moment";
@ -70,6 +71,8 @@ export class ConfirmLoginComponent implements OnInit {
password:any; password:any;
loginType: any; loginType: any;
empname: string; empname: string;
lastLoginDate: string;
user_name: string;
constructor( constructor(
@ -120,6 +123,7 @@ export class ConfirmLoginComponent implements OnInit {
this.password = localStorage.getItem("password"); this.password = localStorage.getItem("password");
this.empname = localStorage.getItem("emp-name"); this.empname = localStorage.getItem("emp-name");
} }
@ -674,9 +678,9 @@ export class ConfirmLoginComponent implements OnInit {
console.log("authService.getLoginInfo"); console.log("authService.getLoginInfo");
if(result.Mohemm_GetPatientID_List.length > 0){ if(result.Mohemm_GetMobileLoginInfoList.length > 0){
if ( result.Mohemm_GetPatientID_List[0].LoginType == 2 || result.Mohemm_GetPatientID_List[0].LoginType == 3) { if ( result.Mohemm_GetMobileLoginInfoList[0].LoginType == 2 || result.Mohemm_GetMobileLoginInfoList[0].LoginType == 3) {
this.loginTokenID = result.LogInTokenID; this.loginTokenID = result.LogInTokenID;
//send silent sms //send silent sms
@ -742,6 +746,11 @@ export class ConfirmLoginComponent implements OnInit {
console.log("insert"); console.log("insert");
localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME); localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME);
console.log("empnmae: "+ localStorage.getItem("emp-name")); console.log("empnmae: "+ localStorage.getItem("emp-name"));
this.user_name=result.MemberInformationList[0].EMPLOYEE_NAME;
//get date and time of last login
let currDateTime = moment().format('MMM DD , YYYY HH:mm')
localStorage.setItem("login-at",currDateTime);
if (this.platform.is("cordova")) { if (this.platform.is("cordova")) {
this.insertMobileLogin(); this.insertMobileLogin();
@ -781,12 +790,13 @@ export class ConfirmLoginComponent implements OnInit {
request.DeviceType= this.cs.getDeviceType(); request.DeviceType= this.cs.getDeviceType();
request.DeviceToken=this.deviceToken; request.DeviceToken="5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
//request.TokenID= //request.TokenID=
request.LoginType=this.selectedOption; request.LoginType=this.selectedOption;
request.EmployeeName=this.user_name;
this.authService this.authService
@ -840,10 +850,13 @@ private checkUserAuthentication() {
console.log("this.loginData before "+ this.loginData); console.log("this.loginData before "+ this.loginData);
this.loginData = new LoginModel(); this.loginData = new LoginModel();
console.log("this.loginData after "+ this.loginData); console.log("this.loginData after "+ this.loginData);
// console.log("result.MemberLoginList.EMPLOYEE_NAME "+ result.MemberInformationList[0].EMPLOYEE_NAME);
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER; this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
this.loginData.P_USER_NAME = this.username; this.loginData.P_USER_NAME = this.username;
this.loginData.EmployeeName = this.user_name;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
//this.remeberMyInfo(); //this.remeberMyInfo();

@ -1,5 +1,5 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons> <nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons>
</ion-buttons> </ion-buttons>

@ -5,7 +5,7 @@
<img class="centerDiv" src="../assets/imgs/header.png" /> <img class="centerDiv" src="../assets/imgs/header.png" />
</ion-col> </ion-col>
</ion-row> --> </ion-row> -->
<ion-row *ngIf="loginDiv"> <ion-row *ngIf="!user">
<div class="content"> <div class="content">
@ -19,7 +19,7 @@
</div> </div>
</ion-row> </ion-row>
<ion-row *ngIf="welcomeBack "> <ion-row *ngIf="user ">
<ion-col [size]="4"> <ion-col [size]="4">
<img [src]="logo" class="logo" /> <img [src]="logo" class="logo" />
@ -30,12 +30,12 @@
<ion-row> <ion-row>
<ion-col *ngIf="loginDiv"> <ion-col *ngIf="!user">
<P class="pageTitle text-caps">{{ts.trPK('login','login')}}</P> <P class="pageTitle text-caps">{{ts.trPK('login','login')}}</P>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
<div *ngIf="loginDiv"> <div *ngIf="!user">
<ion-item class="item-input-login"> <ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/username.png" item-start /> <img class="item-icon" src="assets/imgs/username.png" item-start />
<ion-input class="login-input" required type="text" [(ngModel)]="username" placeholder="{{ts.trPK('login','username')}}"> <ion-input class="login-input" required type="text" [(ngModel)]="username" placeholder="{{ts.trPK('login','username')}}">
@ -73,7 +73,7 @@
<!-- div login--> <!-- div login-->
<!-- <div *ngIf="welcomeBack"> --> <!-- <div *ngIf="welcomeBack"> -->
<welcome-login (onLogin)="login()" (loginWithUser)="loginWithUser()" *ngIf="welcomeBack "> <welcome-login (onLogin)="login()" (loginWithUser)="loginWithUser()" *ngIf="user ">
</welcome-login> </welcome-login>
<!-- </div> --> <!-- </div> -->
@ -83,7 +83,7 @@
</ion-content> </ion-content>
<ion-footer *ngIf="loginDiv"> <ion-footer *ngIf="!user">
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="button-login" (click)="onLogin()">{{ts.trPK('login','login')}}</ion-button> <ion-button class="button-login" (click)="onLogin()">{{ts.trPK('login','login')}}</ion-button>
</div> </div>

@ -45,7 +45,10 @@ export class LoginComponent implements OnInit, OnDestroy {
public loginDiv:boolean =true; public loginDiv:boolean =true;
public welcomeBack:boolean =false; public welcomeBack:boolean =false;
public logo = "assets/icon/login/password.png"; public logo = "assets/icon/login/password.png";
deviceToken: any="";
user: boolean =false;
DeviceType: string;
requestGetLoginInfo:any;
constructor( constructor(
public cs: CommonService, public cs: CommonService,
@ -64,25 +67,61 @@ export class LoginComponent implements OnInit, OnDestroy {
) { } ) { }
ngOnInit() { ngOnInit() {
// this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
// console.log("get deviceToken login"+ this.deviceToken)
this.deviceToken= localStorage.getItem('devicyeToken');
console.log("let deviceToken" + this.deviceToken);
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {
console.log("no deviceToken" );
this.pushService.startReceiving();
setTimeout(() => {
this.deviceToken= localStorage.getItem('deviceToken');
console.log('login enabled second time: ' + this.deviceToken);
}, 1000);
}
setTimeout(() => {
this.getLastLoginInfo();
},5000);
//here will delete below part and depdding on user (response from getMobileInfo)
this.username = localStorage.getItem("user"); this.username = localStorage.getItem("user");
this.password = localStorage.getItem("password"); this.password = localStorage.getItem("password"); //****//
let remember = localStorage.getItem("remember"); let remember = localStorage.getItem("remember");//****//
this.empname= localStorage.getItem("emp-name"); this.empname= localStorage.getItem("emp-name");
this.logintype= localStorage.getItem("login-type"); this.logintype= localStorage.getItem("login-type");
if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false } if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false }
if(this.username || this.empname){
this.loginDiv=false; //here will be check on user if exite then s part and depdding on user (response from getMobileInfo)
this.welcomeBack=true;
if(this.user){
// this.loginDiv=false;
// this.welcomeBack=true;
}else{ }else{
this.loginDiv=true; // this.user=true;
this.welcomeBack=false; // this.welcomeBack=false;
} }
// alert("user>>" + this.username); // alert("user>>" + this.username);
// alert("pass>>>" + this.password); // alert("pass>>>" + this.password);
// alert("remember>>>" + this.remeberMe); // alert("remember>>>" + this.remeberMe);
/// call getLoginInfo
} }
ngOnDestroy(): void { ngOnDestroy(): void {
@ -125,20 +164,24 @@ export class LoginComponent implements OnInit, OnDestroy {
} }
public onLogin() { public onLogin() {
// console.log("onLogin"); console.log("onLogin");
// this.checkAppUpdated(); // this.checkAppUpdated();
// this.checkUserAuthentication(); // this.checkUserAuthentication();
let deviceToken = localStorage.getItem('deviceToken'); this.deviceToken = localStorage.getItem('deviceToken');
if (deviceToken) { console.log("let deviceToken" + this.deviceToken);
console.log('login enabled first time: ' + deviceToken);
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
this.checkAppUpdated(); this.checkAppUpdated();
} else { } else {
console.log("no deviceToken" );
this.pushService.startReceiving(); this.pushService.startReceiving();
setTimeout(() => { setTimeout(() => {
deviceToken = localStorage.getItem('deviceToken'); this.deviceToken = localStorage.getItem('deviceToken');
this.checkAppUpdated(); this.checkAppUpdated();
console.log('login enabled second time: ' + deviceToken); console.log('login enabled second time: ' + this.deviceToken);
}, 1000); }, 1000);
} }
} }
@ -194,9 +237,12 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log("success"); console.log("success");
this.cs.stopLoading(); this.cs.stopLoading();
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
// alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList.EMPLOYEE_NAME);
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER; this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
this.loginData.P_USER_NAME = this.username; this.loginData.P_USER_NAME = this.username;
// this.loginData.EMPLOYEE_NAME =result.MemberLoginList[0].EMPLOYEE_NAME;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo(); this.remeberMyInfo();
@ -279,6 +325,8 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log(result); console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.username; this.loginData.P_USER_NAME = this.username;
this.loginData.EmployeeName =result.MemberLoginList[0].EMPLOYEE_NAME;
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.sharedData.setSharedData(true, Password.IS_FORGET_PSW); this.sharedData.setSharedData(true, Password.IS_FORGET_PSW);
@ -292,8 +340,8 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log("login emit"); console.log("login emit");
console.log("login"); console.log("login");
// this.checkUserAuthentication(); // this.checkUserAuthentication();
this.loginDiv=true; //this.loginDiv=true;
this.welcomeBack=false; this.user=false;
} }
@ -302,4 +350,33 @@ export class LoginComponent implements OnInit, OnDestroy {
this.cs.openConfirmLoginPage(); this.cs.openConfirmLoginPage();
} }
///
getLastLoginInfo(){
this.requestGetLoginInfo= {
DeviceType:this.cs.getDeviceType(),
DeviceToken:this.deviceToken//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken
}
this.authService.getLoginInfo(this.requestGetLoginInfo,() => {}, this.ts.trPK('general', 'ok')).subscribe(res => {
if (this.cs.validResponse(res)) {
if(res.Mohemm_GetMobileLoginInfoList.length > 0){
this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0],
res.Mohemm_GetMobileLoginInfoList[0],
AuthenticationService.IMEI_USER_DATA
);
this.user = true;
}
else{
this.user=false
}
}
});
}
} }

@ -3,4 +3,7 @@ export class LoginModel {
activationCode: string; activationCode: string;
P_USER_NAME: string; P_USER_NAME: string;
MobileNumber: string; MobileNumber: string;
EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_NAME:string;
EmployeeName:string;
} }

@ -1,5 +1,5 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons> <nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons>
</ion-buttons> </ion-buttons>

@ -22,6 +22,7 @@ import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/mod
import { Password } from "../models/password"; import { Password } from "../models/password";
import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request'; import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request';
import * as moment from "moment";
@ -79,6 +80,7 @@ export class SmsPageComponent implements OnInit {
public smc_code: any = []; public smc_code: any = [];
code: any; code: any;
user_name: string;
constructor( constructor(
@ -346,6 +348,12 @@ export class SmsPageComponent implements OnInit {
console.log("insert"); console.log("insert");
localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME); localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME);
console.log("empnmae: "+ localStorage.getItem("emp-name")); console.log("empnmae: "+ localStorage.getItem("emp-name"));
// localStorage.setItem("login-at", new Date().toISOString());
this.user_name=result.MemberInformationList[0].EMPLOYEE_NAME;
//get date and time of last login
let currDateTime = moment().format('MMM DD , YYYY HH:mm')
localStorage.setItem("login-at",currDateTime);
if (this.platform.is("cordova")) { if (this.platform.is("cordova")) {
// localStorage.setItem("full-name", result.P_USER_NAME); // localStorage.setItem("full-name", result.P_USER_NAME);
@ -370,7 +378,7 @@ export class SmsPageComponent implements OnInit {
public insertMobileLogin(){ public insertMobileLogin(){
// alert("insertMobileLogin"); console.log("loginData" + this.loginData);
let request = new GetLoginInfoRequest(); let request = new GetLoginInfoRequest();
@ -388,10 +396,12 @@ export class SmsPageComponent implements OnInit {
request.DeviceType= this.common.getDeviceType(); request.DeviceType= this.common.getDeviceType();
request.DeviceToken=this.deviceToken; request.DeviceToken=this.deviceToken;//"5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36";//this.deviceToken;
request.LoginType=this.loginTypeData.loginType; request.LoginType=this.loginTypeData.loginType;
request.EmployeeName=this.user_name;
this.authService this.authService
.insertMobileLoginInfo( .insertMobileLoginInfo(

@ -1,15 +1,16 @@
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar-new"> <ion-toolbar class="header-toolbar-new">
<nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons> <nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons>
<ion-title>{{headerTitle}}</ion-title> <ion-title style="color: white;">{{headerTitle}}</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content class="colorBG"> <ion-content>
<div class="">
<div class="" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'"> <!-- class="colorBG" -->
<div class="content" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'">
<ion-grid class="headerGrid" style="padding-top: 30%;"> <ion-grid class="headerGrid">
<p class="title">{{ts.trPK('absenceList','tickets-balance')}}</p> <p class="title">{{ts.trPK('absenceList','tickets-balance')}}</p>
<div style="color: black;"> <div style="color: black;">
@ -224,6 +225,7 @@
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll> </ion-infinite-scroll>
</div>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
@ -233,4 +235,5 @@
<!-- <ion-button class="footer-button" color="customnavy" ion-button (click)="addEITRrq()"> <!-- <ion-button class="footer-button" color="customnavy" ion-button (click)="addEITRrq()">
{{'general, add' | translate}}</ion-button> --> {{'general, add' | translate}}</ion-button> -->
</div> </div>
</ion-footer> </ion-footer>

@ -85,6 +85,17 @@ h4 {
} }
//////////////////////////////// ////////////////////////////////
.content:before {
position: absolute;
content: "";
background: #22c6b3;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
.colorBG{ .colorBG{
--background: #f0efef; --background: #f0efef;
@ -99,7 +110,7 @@ h4 {
.title{ .title{
text-align: center; text-align: center;
color: black; color: black;
margin-top: -10px; margin-top: 5px;
font-size: 17px; font-size: 17px;
} }
.today-graph{ .today-graph{
@ -111,22 +122,37 @@ h4 {
} }
.headerGrid{ .headerGrid{
// background-color: white !important;
// border: 1px solid #cac8c8 !important;
// border-radius: 20px !important;
// padding-top: 28px;
// padding-bottom: 53px;
// margin-left: 9px;
// margin-right: 13px;
// margin-top: -94px;
// margin-bottom: 10px;
background-color: white !important; background-color: white !important;
border: 1px solid #cac8c8 !important; border: 1px solid #cac8c8 !important;
border-radius: 20px !important; /* padding-top: 28px; */
padding-top: 28px;
padding-bottom: 53px; padding-bottom: 53px;
margin-left: 9px; padding-top: -30px;
margin-left: 13px;
margin-right: 13px; margin-right: 13px;
margin-top: -94px; /* margin-top: -86px; */
margin-bottom: 10px; margin-bottom: 10px;
position: relative;
z-index: 1;
border-radius: 20px;
margin-top: 17px;
} }
.result-graph{ .result-graph{
font-size: 14px; font-size: 14px;
margin-left: -48px; margin-left: -48px;
margin-right: 3px; margin-right: 3px;
margin-bottom: -30px; margin-bottom: -30px;
} }
.green-label{ .green-label{

@ -44,7 +44,6 @@ export class EitListComponent implements OnInit {
accrualNetInfants: any; accrualNetInfants: any;
accrualUNetChild: any; accrualUNetChild: any;
accrualNetAdult: any; accrualNetAdult: any;
public options = { public options = {
cutoutPercentage: 80, cutoutPercentage: 80,
@ -83,6 +82,7 @@ export class EitListComponent implements OnInit {
this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT; this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT;
this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT; this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT;
this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT; this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT;
this.data = { this.data = {
// labels: ['earingTotal', 'deductionTotal'], // labels: ['earingTotal', 'deductionTotal'],
datasets: [ datasets: [

@ -12,7 +12,9 @@
<ion-content> <ion-content>
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;">
<!--From Home List-->
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" [hidden]="pageType=='myteam'" *ngIf="pageType=='home'">
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu.children; let i=index" <ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu.children; let i=index"
(click)="openPage(menuItem, i);"> (click)="openPage(menuItem, i);">
<ion-row style="width: 100%;"> <ion-row style="width: 100%;">
@ -46,4 +48,44 @@
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon> --> *ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon> -->
</ion-item> </ion-item>
</ion-list> </ion-list>
<!--From My Team List-->
<ion-list style="margin-top: 40px;border-top: 1px solid #c8c8c8;" [hidden]="pageType=='home'" *ngIf="pageType=='myteam'">
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu; let i=index"
(click)="openPage(menuItem, i);">
<ion-row style="width: 100%;">
<!-- Parent Pages -->
<ion-col size="12" class="">
<div [ngClass]="{'selectedDiv': selectedMenu == i,'notSelected': selectedMenu != i }">
<ion-label>
<b text-wrap>{{menuItem.PROMPT}}</b>
<ion-icon style="float: right;font-size: 25px;color: grey;" name="arrow-forward"></ion-icon>
</ion-label>
</div>
<!-- Child Pages -->
<ion-list [hidden]="selectedMenu != i" lines="full">
<ion-item lines="full" class="" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
(click)="openPage(subPage)">
<!-- <ion-row>
<ion-col size="10" class="menu-name"><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span> -->
<ion-label><span ion-text color="color2">&nbsp;{{subPage.PROMPT}} </span>
<ion-icon style="float: right;font-size: 25px;color: grey;" name="arrow-forward"></ion-icon>
</ion-label>
<!-- </ion-col>
</ion-row> -->
</ion-item>
</ion-list>
</ion-col>
</ion-row>
<!-- <ion-icon [name]="selectedMenu == i? 'ios-arrow-down' : 'ios-arrow-forward'"
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon> -->
</ion-item>
</ion-list>
</ion-content> </ion-content>

@ -17,10 +17,12 @@ export class HomeComponent implements OnInit {
// Selected Side Menu // Selected Side Menu
selectedMenu: any; selectedMenu: any;
direction: string; direction: string;
pageType :string;
constructor(private cs: CommonService, private ts: TranslatorService) { constructor(private cs: CommonService, private ts: TranslatorService) {
this.direction = TranslatorService.getCurrentLanguageName() this.direction = TranslatorService.getCurrentLanguageName()
this.menu = this.cs.sharedService.getSharedData('menuEntries', false); this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false);
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
const title: string = this.ts.trPK('eit', 'my-requests'); const title: string = this.ts.trPK('eit', 'my-requests');
this.headerTitle = this.menu.PROMPT ? this.menu.PROMPT : title; this.headerTitle = this.menu.PROMPT ? this.menu.PROMPT : title;
@ -58,6 +60,9 @@ export class HomeComponent implements OnInit {
if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){ if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){
this.cs.openPayslipPage(); this.cs.openPayslipPage();
} }
if (menuEntry.REQUEST_TYPE === 'TIME_CARD') {
this.cs.openTimeCardPage();
}
} }
} }

@ -101,7 +101,7 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component';
import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import {DashboredService} from './services/dashbored/dashbored.service'; import {DashboredService} from './services/dashbored/dashbored.service';
// import {NgxGaugeModule} from 'ngx-gauge'; import {NgxGaugeModule} from 'ngx-gauge';
import { StatsButtonComponent } from './ui/stats-button/stats-button.component'; import { StatsButtonComponent } from './ui/stats-button/stats-button.component';
import { ServicesButtonComponent } from './ui/services-button/services-button.component'; import { ServicesButtonComponent } from './ui/services-button/services-button.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component' import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
@ -110,9 +110,12 @@ import {FabButtonComponent} from './ui/fab-button/fab-button.component'
import { AttendScanService } from './services/attend-services/attend-scan.service'; import { AttendScanService } from './services/attend-services/attend-scan.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { NgCircleProgressModule } from 'ng-circle-progress'; import { NgCircleProgressModule } from 'ng-circle-progress';
import {ChartModule} from 'primeng/chart'; import { CardFilterComponent } from './ui/card-filter/card-filter.component';
import { CardFilterComponent} from './ui/card-filter/card-filter.component'; import { EmployeeInformationComponent } from './ui/employee-information/employee-information.component';
import { CircleCalendarComponent } from './ui/circle-calendar/circle-calendar.component';
import { NgCalendarModule } from 'ionic2-calendar';
import { DateInfoModalComponent } from './ui/circle-calendar/date-info-modal/date-info-modal.component';
import { ChartModule } from 'primeng/chart';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
@ -124,8 +127,9 @@ import { CardFilterComponent} from './ui/card-filter/card-filter.component';
ListboxModule, ListboxModule,
PdfViewerModule, PdfViewerModule,
NgCircleProgressModule.forRoot(), NgCircleProgressModule.forRoot(),
NgCalendarModule,
ChartModule, ChartModule,
// NgxGaugeModule NgxGaugeModule
], ],
declarations: [ declarations: [
FabButtonComponent, FabButtonComponent,
@ -187,7 +191,12 @@ import { CardFilterComponent} from './ui/card-filter/card-filter.component';
StatsButtonComponent, StatsButtonComponent,
ServicesButtonComponent, ServicesButtonComponent,
ConfirmLoginComponent, ConfirmLoginComponent,
CardFilterComponent CardFilterComponent,
EmployeeInformationComponent,
ConfirmLoginComponent,
CircleCalendarComponent,
DateInfoModalComponent
], ],
exports: [ exports: [
FabButtonComponent, FabButtonComponent,
@ -243,13 +252,20 @@ import { CardFilterComponent} from './ui/card-filter/card-filter.component';
FileUploderProfileComponent, FileUploderProfileComponent,
AccordinTabCustomComponent, AccordinTabCustomComponent,
AccordinCustomComponent, AccordinCustomComponent,
// NgxGaugeModule, NgxGaugeModule,
StatsButtonComponent, StatsButtonComponent,
ServicesButtonComponent, ServicesButtonComponent,
ConfirmLoginComponent, ConfirmLoginComponent,
NgCircleProgressModule, NgCircleProgressModule,
ChartModule, ChartModule,
CardFilterComponent CardFilterComponent,
EmployeeInformationComponent,
ConfirmLoginComponent,
CircleCalendarComponent,
DateInfoModalComponent,
NgCalendarModule,
ChartModule
], ],
providers: [ providers: [
AttendScanService, AttendScanService,
@ -293,7 +309,8 @@ import { CardFilterComponent} from './ui/card-filter/card-filter.component';
MenuService, MenuService,
OpenNativeSettings, OpenNativeSettings,
BarcodeScanner BarcodeScanner
] ],
entryComponents: [DateInfoModalComponent],
}) })
export class HmgCommonModule { } export class HmgCommonModule { }

@ -55,7 +55,7 @@ export class AuthenticationService {
public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode'; public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode';
public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType'; public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType';
public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo'; public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW';//Mohemm_GetMobileLoginInfo
public static insertMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo'; public static insertMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo';
/* register methods */ /* register methods */
@ -82,6 +82,7 @@ export class AuthenticationService {
public static LOGIN_DATA="logindata"; public static LOGIN_DATA="logindata";
public static DEVICE_TOKEN = "device_token"; public static DEVICE_TOKEN = "device_token";
public static LAST_LOGIN = 'last-login'; public static LAST_LOGIN = 'last-login';
public static IMEI_USER_DATA = "imei-user-data";
// private static user: AuthenticatedUser; // private static user: AuthenticatedUser;
@ -107,7 +108,6 @@ export class AuthenticationService {
request.P_USER_NAME = user.EMPLOYEE_NUMBER; request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER; request.UserName = user.EMPLOYEE_NUMBER;
request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS; request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS;
if (AuthenticationService.requireRelogin) { if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog(); this.sessionTimeOutDialog();
} }
@ -304,11 +304,11 @@ export class AuthenticationService {
} }
public getLoginInfo( public getLoginInfo(
request: GetLoginInfoRequest, request: any,
onError: any, onError: any,
errorLabel: string errorLabel: string
): Observable<GetLoginInfoResponse> { ): Observable<GetLoginInfoResponse> {
this.setPublicFields(request); //this.setPublicFields(request);
return this.con.post( return this.con.post(
AuthenticationService.getMobileLoginInfo, AuthenticationService.getMobileLoginInfo,
request, request,

@ -20,5 +20,7 @@ export class CheckUserAuthenticationResponse extends Response {
public IsPasswordExpired: boolean; public IsPasswordExpired: boolean;
//public P_SESSION_ID:string; //public P_SESSION_ID:string;
public MemberLoginList: MemberList ; public MemberLoginList: MemberList ;
public BasicMemberInformation: BasicInfo; public BasicMemberInformation: BasicInfo;
public EMPLOYEE_DISPLAY_NAME: string;
public EMPLOYEE_NAME:string;
} }

@ -14,6 +14,8 @@ export class GetLoginInfoRequest extends Request {
CompanyID:number; CompanyID:number;
DeviceType:string; DeviceType:string;
LoginType:number; LoginType:number;
EMPLOYEE_NAME:string;
EmployeeName:string;
// constructor(user: AuthenticatedUser) { // constructor(user: AuthenticatedUser) {
// super(); // super();
// this.NationalID = user.IdentificationNo; // this.NationalID = user.IdentificationNo;

@ -5,7 +5,8 @@ export class GetLoginInfoResponse extends Response {
SMSLoginRequired: boolean; SMSLoginRequired: boolean;
isSMSSent: boolean; isSMSSent: boolean;
LogInTokenID: string; LogInTokenID: string;
Mohemm_GetPatientID_List:any Mohemm_GetPatientID_List:any //old one
Mohemm_GetMobileLoginInfoList:any
isActiveCode: boolean; isActiveCode: boolean;
// PatientOutSA: boolean; // PatientOutSA: boolean;
} }

@ -6,4 +6,6 @@ export class MemberList {
public P_RETURN_MSG: string; public P_RETURN_MSG: string;
public P_RETURN_STATUS: string; public P_RETURN_STATUS: string;
public P_SESSION_ID: number; public P_SESSION_ID: number;
public EMPLOYEE_DISPLAY_NAME: string;
public EMPLOYEE_NAME:string;
} }

@ -1107,8 +1107,12 @@ public getMonthNameAr(value: number): string {
this.nav.navigateForward(['/eit/homepage']); this.nav.navigateForward(['/eit/homepage']);
} }
public openMyTeamPage() { public openMyTeamPage() {
console.log('someeeeeeee');
this.nav.navigateForward(['/my-team/home']); this.nav.navigateForward(['/my-team/home']);
} }
public openMyTeamDetailPage() {
this.nav.navigateForward(['/my-team/details']);
}
public openPage(link: string) { public openPage(link: string) {
this.nav.navigateForward([link]); this.nav.navigateForward([link]);
@ -1188,6 +1192,9 @@ public getMonthNameAr(value: number): string {
public openPayslipPage() { public openPayslipPage() {
this.nav.navigateForward(['/payslip/home']); this.nav.navigateForward(['/payslip/home']);
} }
public openTimeCardPage() {
this.nav.navigateForward(["/time-card/time-card-details"]);
}
public openEarningsPage() { public openEarningsPage() {
this.nav.navigateForward(['/payslip/Earnings']); this.nav.navigateForward(['/payslip/Earnings']);
} }
@ -1205,6 +1212,10 @@ public getMonthNameAr(value: number): string {
} }
public navigatePage(path) {
this.nav.navigateForward([path]);
}
public reload(url: string, from: string) { public reload(url: string, from: string) {
console.log('force reload called from:' + from); console.log('force reload called from:' + from);
// window.location.reload(); // window.location.reload();

@ -7,4 +7,9 @@ export class AttendanceTrackingList {
public P_SCHEDULED_HOURS: string; public P_SCHEDULED_HOURS: string;
public P_SHT_NAME: string; public P_SHT_NAME: string;
public P_SPENT_HOURS: string; public P_SPENT_HOURS: string;
public P_BREAK_HOURS: string;
public P_LATE_IN_HOURS: string;
public P_SWIPES_EXEMPTED_FLAG: string;
public P_SWIPE_IN: string;
public P_SWIPE_OUT: string;
} }

@ -66,8 +66,8 @@ export class DashboredService {
oerrorLable oerrorLable
); );
} }
public getAttendanceTracking(onError ?: any ,oerrorLable ?: any): Observable<AttendanceTrackingResponse>{ public getAttendanceTracking(selectedEmployee: any, onError ?: any , oerrorLable ?: any): Observable<AttendanceTrackingResponse>{
const request = new Request(); const request = selectedEmployee;
this.authService.authenticateRequest(request); this.authService.authenticateRequest(request);
return this.con.post( return this.con.post(
DashboredService.attendancetrackingUrl, DashboredService.attendancetrackingUrl,

@ -2,6 +2,9 @@ import { Request } from '../../../services/models/request'
export class GetSubordinatesAttdStatusRequest extends Request{ export class GetSubordinatesAttdStatusRequest extends Request{
//public static SHARED_DATA = ''; //public static SHARED_DATA = '';
public P_SCHEDULE_DATE_FROM :any; public P_SCHEDULE_DATE_FROM: any;
public P_SCHEDULE_DATE_TO :any; public P_SCHEDULE_DATE_TO: any;
public SearchMonth: string;
public SearchYear: number;
} }

@ -43,6 +43,7 @@ export class PushService {
) { } ) { }
public startReceiving() { public startReceiving() {
console.log("startReceiving");
// this.processStartReceiving(); // this.processStartReceiving();
this.processStartReceivingWithFirebase(); this.processStartReceivingWithFirebase();
} }
@ -161,10 +162,11 @@ export class PushService {
} }
private registerInBackend(data: any) { private registerInBackend(data: any) {
console.log('firebasex Token ID: ' + data); console.log('firebasex Token ID: ' + data);
if (data) { if (data) {
this.cs.sharedService.setSharedData(data, AuthenticationService.DEVICE_TOKEN); this.cs.sharedService.setSharedData(data, AuthenticationService.DEVICE_TOKEN);
localStorage.setItem('deviceToken', data); localStorage.setItem('deviceToken', data);
} }
if (this.authService.isAuthenticated()) { if (this.authService.isAuthenticated()) {
this.registerAuthenticatedUser(data); this.registerAuthenticatedUser(data);
@ -216,14 +218,22 @@ export class PushService {
private processStartReceivingWithFirebase() { private processStartReceivingWithFirebase() {
console.log("processStartReceivingWithFirebase");
this.firebasex.getToken().then(token => { this.firebasex.getToken().then(token => {
console.log(token); // alert("token: "+ token);
this.registerInBackend(token);
});
this.firebasex.onTokenRefresh().subscribe(token => {
console.log(token);
this.registerInBackend(token); this.registerInBackend(token);
}); }).catch(error => console.error('Error getting token', error));
// this.firebase.getToken()
// .then(token => console.log(`The token is ${token}`))
// .catch(error => console.error('Error getting token', error));
// this.firebasex.onTokenRefresh().subscribe(token => {
// alert("token: "+ token);
// this.registerInBackend(token);
// });
} }
public onPushReceived(payload: any) { public onPushReceived(payload: any) {
@ -240,4 +250,7 @@ export class PushService {
} }

@ -29,4 +29,5 @@
.text-span{ .text-span{
font-size: 14px; font-size: 14px;
color: #888; color: #888;
margin: -1px;
} }

@ -0,0 +1,14 @@
<calendar #slider [dateFormatter]="calendar.dateFormatter"
[monthviewEventDetailTemplate]="template"
[calendarMode]="calendar.mode"
[currentDate]="currentDateParent"
[lockSwipes]="true"
(onTimeSelected)="onDayClicked($event)">
</calendar>
<ng-template #template let-showEventDetail="showEventDetail" let-selectedDate="selectedDate" let-noEventsLabel="noEventsLabel">
</ng-template>

@ -0,0 +1,124 @@
// .modalCss .modal-Wrapper {
// width: 600px;
// height: 300px;
// }
.chart-modal .modal-Wrapper {
--background: rgb(116, 108, 108) !important;
--border-color:white!important ;
width: 85%!important ;
height: 40px !important ;
}
.navbar{
font-size: 10px !important;
--background: #22C6B3 !important;
color: aliceblue !important;
// margin-top: 10px !important;
}
.menu{
// margin-left:330px !important;
margin-top: 0px !important;
font-size: 35px !important;
background: #22C6B3;
color: aliceblue;
margin-left: 0px !important;
}
.person{
margin-left:100px !important;
margin-top: 0px !important;
font-size: 23px !important;
background: #22C6B3 !important;
color: aliceblue !important;
}
.grid{
margin-bottom: 550px !important;
margin-top: 20px !important;
margin-left: 15px !important;
margin-right: 15px !important;
background-color:white !important;
border-radius: 20px !important;
height: 250px !important;
}
.ionSliders{
margin: 0px !important;
padding: 0px !important;
}
.ionSlide{
margin-top: 5px !important;
margin-left: 190px !important;
color: black !important;
}
.dateLable{
margin-left: 90px !important;
color: black !important;
font-size: small !important;
margin-top: 15px !important;
}
// h1{
// font-size: 15px !important;
// text-align: center !important;
// }
.arrowDropright{
margin-left:100px !important;
font-size: 20px !important;
color: rgb(168, 165, 165) !important;
margin-top: 15px !important;
}
.arrowDropleft{
font-size: 20px !important;
margin-left: 10px !important;
margin-top: 15px !important;
color: rgb(116, 108, 108) !important;
}
.ionLable{
font-size: 10px !important;
}
.number{
font-size: 18px !important;
font-weight: bolder !important;
color: black !important;
}
.header-div{
background:var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: #22C6B3;
// background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%);
color:var(--light);
text-transform: capitalize;
display: block;
position: relative;
height: 210px;
margin-bottom:60px;
// border-radius: 0px 0px 70px 70px;
}
.advanced-search-modal {
--height: 12cm !important;
--width: 80% !important;
--border-radius: 0.4cm;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CircleCalendarComponent } from './circle-calendar.component';
describe('CircleCalendarComponent', () => {
let component: CircleCalendarComponent;
let fixture: ComponentFixture<CircleCalendarComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CircleCalendarComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CircleCalendarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,149 @@
import { Component, OnInit, Output, Input, ViewChild, ElementRef, EventEmitter } from '@angular/core';
import { TimeSlot } from './time.slot';
import { SharedDataService } from '../../services/shared-data-service/shared-data.service';
import { ModalController } from '@ionic/angular';
import { DateInfoModalComponent } from './date-info-modal/date-info-modal.component';
import { MenuResponse } from '../../services/menu/models/menu-response';
import * as moment from 'moment';
import { CommonService } from '../../services/common/common.service';
import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request';
import { TimeCardService } from 'src/app/time-card/service/time-card.service';
import { GetShiftDetailRequest } from 'src/app/time-card/service/models/get-shift-detail.request';
import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-request';
@Component({
selector: 'app-circle-calendar',
templateUrl: './circle-calendar.component.html',
styleUrls: ['./circle-calendar.component.scss']
})
export class CircleCalendarComponent implements OnInit {
@Input() eventsdateDayOff: any = [];
@Input() eventsdateAttend: any = [];
@Input() eventsdateAbsent: any = [];
@Input() normalDays: any = [];
@Input() dayHoursTypeDetailsList: any = [];
@Input() currentDateParent: string;
@Output() monthTitle = new EventEmitter();
@Output() currentYear = new EventEmitter();
public monthName: any;
public yearDate: any;
public selEmp: string;
public selMenu: MenuResponse = new MenuResponse();
public respID: number;
public menuType: any;
public dayAndHoursPageNumber = 1;
public selectedFilters: any = {};
public selectedShiftFilter: any;
public arrDaysAttendance: any = [];
public arrDaysAbsent: any = [];
public arrDaysOff: any = [];
public selectedShift: any;
public shiftDetailsData: any = [];
public swipeDetailsData: any = [];
public arrOfAllList: any = [];
eventsdata: any = [];
public calendar = {
mode: 'month'
};
public currentAvailableAppoDate: any;
public eventsInput: any = [];
public events: TimeSlot[] = [];
public selectedTime: string;
public selectedDate: string;
public weekDaysEn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
public weekDaysEnSort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
public lockSwipeToPrev: any = true;
public currentDate: any;
public selectedDateObject: any;
public currentDateToSwipe: any;
public activeMonth: any;
public isFirst = false;
public selectedIndexData: any;
arrFutrueDays: any;
eventsdateFutrue: any;
detailData: any;
constructor(
public sharedData: SharedDataService,
public mod: ModalController,
public common: CommonService,
public timeCardService: TimeCardService) { }
@ViewChild('slider') slides: ElementRef;
ngOnInit() {
this.reRenderCalendar();
console.log(this.currentDateParent);
}
// tslint:disable-next-line: use-life-cycle-interface
ngAfterViewInit() {
setTimeout(() => {
this.reRenderCalendar();
}, 1000);
}
reRenderCalendar() {
this.renderDate(this.eventsdateAbsent, 'absent');
this.renderDate(this.eventsdateAttend, 'present');
this.renderDate(this.eventsdateDayOff, 'dayoff');
this.renderDate(this.normalDays, 'scheduleDay');
}
public async dateModal(shiftDetails) {
const modal = await this.mod.create({
component: DateInfoModalComponent,
showBackdrop: true,
backdropDismiss: true,
componentProps: {
TODAYDATE: this.selectedIndexData,
SHIFTDETAILS: shiftDetails
}
});
modal.cssClass = 'calendar-modal';
await modal.present();
}
public renderDate(arrayDays, cssClass) {
const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)');
arrayDays.forEach(dateObj => {
const date = dateObj.startTime;
td.forEach(element => {
// tslint:disable-next-line: triple-equals
if (date.getDate() == element.textContent.trim()) {
element.classList.add(cssClass);
}
});
});
}
onDayClicked(event) {
if (this.isFirst) {
console.log(event.selectedTime.getDate());
const selectedIndex = event.selectedTime.getDate();
this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1];
if (this.selectedIndexData.present) {
const rtpID = this.selectedIndexData.RTP_ID;
this.getScheduleShiftDetails(rtpID);
}
} else {
this.isFirst = true;
}
}
getScheduleShiftDetails(RTP_ID) {
const GetShiftDetailRequestObject = new GetShiftDetailRequest();
GetShiftDetailRequestObject.P_RTP_ID = RTP_ID;
GetShiftDetailRequestObject.P_PAGE_NUM = 1;
GetShiftDetailRequestObject.P_PAGE_LIMIT = 10;
this.timeCardService.getShiftDetail(GetShiftDetailRequestObject).subscribe((result) => {
if (this.common.validResponse(result)) {
console.log(result);
this.shiftDetailsData = result.GetScheduleShiftsDetailsList;
this.dateModal(result);
}
});
}
}

@ -0,0 +1,104 @@
<!-- <ion-slides [options]="slideOptsOne" (ionSlideDidChange)="slideChanged($event)">
<ion-slide *ngFor="let shift of SHIFTDETAILS.GetScheduleShiftsDetailsList; let i=index"> -->
<!-- <div> -->
<ion-grid class="headerGrid">
<ion-row style="margin-left: -130px; margin-top: 27px;">
<ion-col size="10">
<div style="width: 100%;">
<div class="result-graph">
<div class="result-text-container">
<h2 class="percentage">{{percentage}}</h2>
<span>Completed <br><br><br><br></span>
</div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
</div>
</ion-col>
<ion-col size="2">
<div class="div" >
<ion-row >
<p class="p0">{{nameDay}}</p>
</ion-row>
<ion-row >
<p class="p1">{{day}}</p>
</ion-row>
<ion-row >
<p class="p2">{{nameMonth}}</p>
</ion-row>
<ion-row >
<p class="p3">{{year}}</p>
</ion-row>
<ion-row>
<p class="p5">{{ts.trPK('attendance','present')}}</p>
</ion-row>
</div>
</ion-col>
</ion-row>
</ion-grid>
<div>
<ion-grid class="grid">
<ion-row class="gridrow">
<ion-col class="liftcol">
<ion-row class="amountlabel"> <p>{{shiftTime}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','shift-time')}}</p>
</ion-row>
</ion-col>
<ion-col class="rightcol">
<ion-row class="amountlabel"><p >{{scheduled}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','regular')}}</p>
</ion-row>
</ion-col>
</ion-row>
<ion-row class="gridrow" >
<ion-col class="liftcol">
<ion-row class="amountlabel"><p >{{startDate}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','check-in')}}</p>
</ion-row>
</ion-col>
<ion-col class="rightcol">
<ion-row class="amountlabel"> <p >{{endDate}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','check-out')}} </p>
</ion-row>
</ion-col>
</ion-row >
<ion-row class="gridrow">
<ion-col class="liftcol">
<ion-row class="amountlabel"> <p >{{lateIn}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','late-in')}}</p>
</ion-row>
</ion-col>
<ion-col class="rightcol">
<ion-row class="amountlabel"> <p >{{excess}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','excess')}}</p>
</ion-row>
</ion-col>
</ion-row>
<ion-row class="gridrow">
<ion-col class="liftcol">
<ion-row class="amountlabel"> <p >{{shortage}}</p> </ion-row>
<ion-row class="rowlabel">
<p>{{ts.trPK('attendance-tracking','shortage')}}</p>
</ion-row>
</ion-col>
<ion-col class="rightcol">
<ion-row class="amountlabel"> <p >{{earlyOut}}</p> </ion-row>
<ion-row class="rowlabel">
<p >{{ts.trPK('attendance-tracking','early-out')}}</p>
</ion-row>
</ion-col>
</ion-row>
</ion-grid>
</div>
<!-- </div> -->
<!-- </ion-slide>
</ion-slides> -->

@ -0,0 +1,180 @@
.result-text-container {
// padding: 0;
// margin: 0;
// position: absolute;
// left: 50%;
// top: 50%;
// display: block;
// text-align: center;
// transform: translate(-50%, -50%);
//////////////////////////here
padding: 0;
margin: 0;
position: absolute;
left: 58%;
top: 67%;
display: block;
text-align: center;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
h2 {
font-size: 25px;
// font-family: WorkSans-Bold;
font-weight: bold;
margin: 0 auto;
line-height: 36px;
}
span {
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
font-family: workSans-Regular;
color: rgb(163, 163, 163) !important;
}
}
.today-graph{
display: block;
height: 127px;
width: 288px;
}
.amountlabel{
color: black !important;
font-weight: bold !important;
font-size: 13px !important;
// border-top: 1px solid rgb(163, 163, 163) !important;
margin-left: 0px !important;
margin-bottom: -29px !important;
}
.rowlabel{
color: rgb(163, 163, 163) !important;
font-size: 13px !important;
font-family: WorkSans-Bold;
}
.grid{
padding-bottom: -20px !important;
padding-top: -20px !important;
height: 360px !important;
}
.liftcol{
// padding-top: 1px !important;
// padding-bottom: 1px !important;
border-right: 1px solid rgb(163, 163, 163) !important;
}
.rightcol{
margin-left: 5px !important;
}
.gridrow{
border-top: 1px solid rgb(163, 163, 163) !important;
margin-left: 19px;
margin-right: 12px;
}
.div{
// border: 1px solid #a3a3a3 !important;
// text-align: center;
// width: 274%;
// border-radius: 8%;
// height: 40%;
// margin-right: -11px;
border: 1px solid #a3a3a3 !important;
border-radius: 9px;
width: 241%;
margin-right: -226px;
}
.p0{
margin-bottom: -13px !important;
color: black !important;
font-weight: bold !important;
font-size: 15px !important;
margin-top: 8px;
text-align: center;
display: block;
width: 100%;
}
.p1{
margin-bottom: -7px !important;
color: black !important;
font-family: WorkSans-Bold !important;
font-size: 33px;
margin-top: 10px;
text-align: center;
display: block;
width: 100%;
}
.p2{ font-weight: bold !important;
font-size: 17px !important;
margin-bottom: 43px !important;
margin-top: 0px !important;
color: black !important;
font-weight: bold !important;
margin-left: 33px;
}
.p3{ /* margin-bottom: -72px !important; */
color: black !important;
font-weight: bold !important;
font-size: 19px;
margin-top: -43px;
margin-left: 27px;
}
.p4{ margin-bottom: 56px !important;
margin-top: -26px !important;
color: black !important;
}
// .pdiv{background-color: gray;height: 26px;}
.p5{
font-size: 14px;
text-align: center;
background-color: #094875;
color: white;
margin-top: -13px;
margin-bottom: -3px;
height: 21px;
width: 110px;
padding-top: 7px;
/* font-family: WorkSans-Bold !important; */
padding-bottom: 21px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
}
// .less{ background-color: #22C6B3;
// background-color: #22C6B3;
// border: none;
// color: white;
// text-align: center;
// text-decoration: none;
// display: inline-block;
// font-size: 12px;
// border-radius: 30px;
// height: 26px;
// padding: 6px 24px;
// margin-left: 123px;
// /* margin-top: -19px; */
// margin-bottom: 17px;
// }

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { DateInfoModalComponent } from './date-info-modal.component';
describe('DateInfoModalComponent', () => {
let component: DateInfoModalComponent;
let fixture: ComponentFixture<DateInfoModalComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DateInfoModalComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(DateInfoModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,138 @@
import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { ModalController, NavParams, IonInfiniteScroll } from '@ionic/angular';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { IonSlides } from '@ionic/angular';
@Component({
selector: 'app-date-info-modal',
templateUrl: './date-info-modal.component.html',
styleUrls: ['./date-info-modal.component.scss'],
})
export class DateInfoModalComponent implements OnInit {
@ViewChild('slides') slides: IonSlides;
[x: string]: any;
gaugeType = 'full';
gaugeValue = 28.3;
gaugeLabel = 'Days';
@Input() TODAYDATE: any;
@Input() SHIFTDETAILS: any;
today: any;
month: any;
monthDate: any;
excess: any;
shortage: any;
lateIn: any;
scheduled: any;
earlyOut: any;
shiftTime: any;
startDate: any;
endDate: any;
shift: any;
percentage: any;
data: any;
scheduleDate: any;
tests: any;
year: any;
nameMonth: any;
nameDay: any;
public weekDaysEn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
public options = {
cutoutPercentage: 85,
tooltips: { enabled: false },
legend: { display: false }
};
public slideOptsOne = {
slidesPerView: 1,
spaceBetween: 0
};
constructor(
public modalController: ModalController,
public navParams: NavParams,
public ts: TranslatorService
) { }
ngOnInit() {
console.log(this.TODAYDATE);
this.excess = this.TODAYDATE.EXCESS_HRS;
this.lateIn = this.TODAYDATE.LATE_IN_HRS;
this.shortage = this.TODAYDATE.SHORTAGE_HRS;
this.scheduled = this.TODAYDATE.SCHEDULED_HRS;
this.earlyOut = this.TODAYDATE.EARLY_OUT_HRS ;
this.scheduleDate = this.TODAYDATE.SCHEDULE_DATE;
this.assignData(this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0]);
}
assignData(shiftDetails) {
this.shiftTime = shiftDetails.SHT_NAME;
this.startDate = shiftDetails.SHT_ACTUAL_START_TIME;
this.endDate = shiftDetails.SHT_ACTUAL_END_TIME;
this.percentage = shiftDetails.PERCENTAGE;
this.percChart = this.percentage.substring(0, this.percentage.indexOf('%'));
const test = this.scheduleDate;
const splitdate = test.split(' ');
const date = splitdate[0];
const test1 = date.split('/');
this.day = test1[1];
this.year = test1[2];
this.month = test1[0];
// tslint:disable-next-line: radix
this.nameMonth = this.getMonthName(parseInt(this.month));
this.nameDay = this.getHeaderDay(new Date(date));
const d = new Date(date);
this.data = {
labels: ['percentage'],
datasets: [
{
data: [this.percChart],
backgroundColor: [
'#094875'
],
borderWidth: 2
}]
};
}
slideChanged(ev) {
this.slides.getActiveIndex().then(index => {
const shiftDetails = this.SHIFTDETAILS[index];
this.assignData(shiftDetails);
});
}
public getMonthName(value: number): string {
switch (value) {
case 1:
return 'Jan';
case 2:
return 'Feb';
case 3:
return 'Mar';
case 4:
return 'Apr';
case 5:
return 'May';
case 6:
return 'Jun';
case 7:
return 'Jul';
case 8:
return 'Aug';
case 9:
return 'Sep';
case 10:
return 'Oct';
case 11:
return 'Nov';
case 12:
return 'Dec';
}
}
getHeaderDay(date: any) {
return this.weekDaysEn[date.getDay()];
}
}

@ -0,0 +1,21 @@
export class TimeSlot {
constructor(isoTime: string, startDate: string, end: string) {
this.isoTime = isoTime;
this.start = startDate;
this.end = end;
this.allDay = true;
this.draggable = false;
}
public eventTimeLabel() {
return new Date(this.end).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false });
}
// event time in iso format
isoTime: string;
// start of event day
start: string;
// event date time
end: string;
allDay: boolean;
draggable: boolean;
}

@ -0,0 +1,26 @@
<div class="team-member-container">
<ion-row>
<ion-col [size]="3">
<div class="user-image-container">
<div class="user-image">
<img [src]="employeeImage" alt="Team Member Image"/>
</div>
</div>
</ion-col>
<ion-col [size]="9" style="padding: 8px 5px 0px;margin-top: 14px;">
<div>
<span class="employee-name">
<h2 class="name">{{name}}</h2>
<span class="title">{{title}}</span>
</span>
<a class="image-container" href="tel:{{employeePhoneNumber}}">
<img src="../assets/imgs/green_call_icon.png" >
</a>
</div>
<!-- <div class="swipe-information">
<span class="check-in"><strong>Check-In:</strong> {{checkIn}}</span>
<span><strong>Check-Out:</strong> {{checkOut}}</span>
</div> -->
</ion-col>
</ion-row>
</div>

@ -0,0 +1,84 @@
.team-member-container{
background: white;
border-radius: 100px 20px 20px 100px;
margin-top: 15px;
font-family: WorkSans-Regular;
}
.user-image-container{
position: relative;
width: 70px;
height: 70px;
display: block;
margin: 0 auto;
// &:before{
// position: absolute;
// content: "";
// width: 20px;
// height: 20px;
// border-radius: 20px;
// border: 1px solid white;
// top: 0;
// right: 0;
// background-color: red;
// z-index: 9;
// }
// &.present:before{
// background-color: green !important;
// }
}
.user-image{
overflow: hidden;
position: relative;
display: block;
width: 100%;
height: 100%;
border-radius: 80px;
border: 1px solid #ccc;
margin: 0px auto 6px;
img {
width: 100%;
max-height: 100%;
}
}
.employee-name{
display: inline-block;
width: 80%;
.name{
font-size: 16px;
color: black;
margin: 0;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.title{
font-size: 13px;
color: #888;
width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
display: block;
}
}
.image-container{
width: 20%;
display: inline-block;
text-align: center;
vertical-align: top;
margin-top: 5px;
}
.swipe-information{
color: #888;
font-size: 12px;
border-top: 1px solid #ccc;
padding-top: 6px;
margin-top: 6px;
.check-in {
font-size: 12px;
margin-right: 15px;
}
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EmployeeInformationComponent } from './employee-information.component';
describe('EmployeeInformationComponent', () => {
let component: EmployeeInformationComponent;
let fixture: ComponentFixture<EmployeeInformationComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EmployeeInformationComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EmployeeInformationComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,21 @@
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-employee-information',
templateUrl: './employee-information.component.html',
styleUrls: ['./employee-information.component.scss'],
})
export class EmployeeInformationComponent implements OnInit {
public userImage: any = '../assets/imgs/profile.png';
@Input() name: string;
@Input() title: string;
@Input() employeeImage: string;
@Input() employeePhoneNumber: string;
constructor() { }
ngOnInit() {}
}

@ -3,10 +3,16 @@
<div class="circle"> <div class="circle">
<ion-fab class="fab-i "> <ion-fab class="fab-i ">
<ion-fab-button class="cbookApointmentBtn" (click)="onClick()" > <ion-fab-button [ngClass]="type === 'add' ? 'addnon' : 'cbookApointmentBtn' " (click)="onClick()" >
<!-- <img style="width: 39%; margin-top: -29%;" src="assets/icon/booking.png" /> --> <!-- <img style="width: 39%; margin-top: -29%;" src="assets/icon/booking.png" /> -->
<ion-icon class="iconFab" name="finger-print"></ion-icon> <div *ngIf="type != 'add' ">
<ion-icon class="iconFab" name="finger-print"></ion-icon>
<p class="fab-p">{{ 'attendance-tracking,title' | translate }} </p> <p class="fab-p">{{ 'attendance-tracking,title' | translate }} </p>
</div>
<div *ngIf="type === 'add' ">
<ion-icon style="margin-top:0px" class="iconFab" name="add"></ion-icon>
<!-- <ion-icon name="add-outline"></ion-icon> -->
</div>
</ion-fab-button> </ion-fab-button>
</ion-fab> </ion-fab>

@ -19,6 +19,22 @@ ion-fab-button{
--background: transparent; --background: transparent;
} }
.addnon{
--background: var(--darkblue)!important;
background-size: cover;
background-position: top right;
border-radius: 50%;
height: 80px;
width: 80px;
width: 80px;
height: 80px;
right: 8%;
position: fixed;
color: white;
bottom: 20%;
border-radius: 50%;
z-index: 999;
}
.fab-p{ .fab-p{
// position: absolute; // position: absolute;
@ -51,7 +67,7 @@ button-inner{
} }
.iconFab{ .iconFab{
margin-top: -37px; margin-top: -37px;
width: 100px; width: 100px;
height: 60px; height: 60px;
} }

@ -1,4 +1,4 @@
import { Component, OnInit, Output, EventEmitter } from '@angular/core'; import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
import { TranslatorService } from '../../services/translator/translator.service'; import { TranslatorService } from '../../services/translator/translator.service';
@Component({ @Component({
@ -7,13 +7,14 @@ import { TranslatorService } from '../../services/translator/translator.service'
styleUrls: ['./fab-button.component.scss'], styleUrls: ['./fab-button.component.scss'],
}) })
export class FabButtonComponent implements OnInit { export class FabButtonComponent implements OnInit {
@Input() type:string;
@Output() trigger = new EventEmitter(); @Output() trigger = new EventEmitter();
public direction: any; public direction: any;
constructor( constructor(
) { } ) { }
ngOnInit() { ngOnInit() {
console.log("type" + this.type);
this.direction = TranslatorService.getCurrentDirection(); this.direction = TranslatorService.getCurrentDirection();
} }

@ -1,6 +1,7 @@
<div feedback class="custom-button"> <div feedback class="custom-button">
<div class="iconBox"> <div class="iconBox">
<img [src]="icon" class="icon"> <img *ngIf="title != 'My Team' && title != 'Vacation Rule'" [src]="'data:image/png;base64,'+icon" class="icon">
<img *ngIf="title == 'My Team' || title == 'Vacation Rule'" [src]="icon" class="icon">
</div> </div>
<div class="titleBox"> <div class="titleBox">
<p class="pClass">{{title}}</p> <p class="pClass">{{title}}</p>

@ -1,33 +1,46 @@
<ion-content has-bouncing="false" forceOverscroll="false" class="ion-no-padding"> <ion-content has-bouncing="false" forceOverscroll="false" class="ion-no-padding">
<ion-grid padding> <ion-grid padding>
<ion-row> <!-- <ion-row>
<ion-col [size]="12"> <ion-col [size]="12">
<!-- <img [src]="logo" class="loginLogo" /> <img [src]="logo" class="loginLogo" />
<h1 class="heading1">{{welcome}} </h1> --> <h1 class="heading1">{{welcome}} </h1>
<p class="text1" style="margin-bottom: -8px;font-weight: bold;font-size: 28px;">{{'home,welcome-back' | translate}} </p> <p class="text1" style="margin-bottom: -8px;font-weight: bold;font-size: 28px;">{{'home,welcome-back' | translate}} </p>
<p class="text1" style="font-size: 28px;margin-top: 0px;" >{{empname}}</p> <p class="text1" style="font-size: 28px;margin-top: 0px;" >{{empname}}</p>
<p *ngIf="!empname" class="text1">{{welcome_txt}} </p> <p *ngIf="!empname" class="text1">{{welcome_txt}} </p>
<p class="text1">{{txt_account}} </p> <p class="text1">{{txt_account}} </p>
</ion-col> </ion-col>
</ion-row> </ion-row> -->
<ion-row class="row-border" *ngIf="empname && isLastLogin"> <ion-row>
<ion-col [size]="12">
<h1 class="heading1">{{welcome}} </h1>
<p *ngIf="!user" class="text1">{{welcome_txt}} </p>
<p class="text1">{{txt_account}} </p>
</ion-col>
</ion-row>
<ion-row class="row-border" *ngIf="user && isLastLogin">
<ion-col size="6" style="padding: 5px 10px; border-right:1px solid #bbbbbb"> <ion-col size="6" style="padding: 5px 10px; border-right:1px solid #bbbbbb">
<p class="last-login" style="font-weight: bold">{{'login,last-login' | translate}} </p> <p class="last-login" style="font-weight: bold">{{'login,last-login' | translate}} </p>
<!-- <p class="last-login small-font-size">{{user.EditedOn | date}} <p class="last-login small-font-size">{{user.EditedOn | date}}
{{lastLoginTime}}</p>--> {{lastLoginTime }}</p>
<!-- <p class="last-login "> {{lastLoginDate}}</p> -->
</ion-col> </ion-col>
<ion-col size="6" style="padding: 5px 10px;"> <ion-col size="6" style="padding: 5px 10px;">
<p class="last-login" style="font-weight: bold" [ngClass]="{'fadein':empname && isLastLogin }"> <p class="last-login" style="font-weight: bold" [ngClass]="{'fadein':user && isLastLogin }">
{{'login,last-login-with' | translate}} {{'login,last-login-with' | translate}}
</p> </p>
<p class="last-login">{{getLoginType(logintype)}}</p> <p class="last-login">{{getLoginType(logintype)}}</p>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row class="ion-no-padding description" *ngIf="empname && isLastLogin"> <ion-row class="ion-no-padding description" *ngIf="user && isLastLogin">
<ion-col style="margin-top:-5px" class="ion-no-padding " [size]=6> <ion-col style="margin-top:-5px" class="ion-no-padding " [size]=6>
<app-confirm-login [accessFromOutSide]="true" *ngIf="empname"></app-confirm-login> <app-confirm-login [accessFromOutSide]="true" *ngIf="user"></app-confirm-login>
</ion-col> </ion-col>
<ion-col [size]=6> <ion-col [size]=6>
<app-button (click)="loginwithuser()" [title]="button.title | translate " [icon]="button.icon" <app-button (click)="loginwithuser()" [title]="button.title | translate " [icon]="button.icon"
@ -44,7 +57,7 @@
</ion-content> </ion-content>
<ion-footer class="welcome-footer"> <ion-footer class="welcome-footer">
<ion-row class="ion-justify-content-center " *ngIf="empname"> <ion-row class="ion-justify-content-center " *ngIf="user">
<ion-col [size]="12"> <ion-col [size]="12">
<ion-button class="centerDiv button-login" expand="block" (click)="login()"> <ion-button class="centerDiv button-login" expand="block" (click)="login()">

@ -69,6 +69,8 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
password: string; password: string;
empname: string; empname: string;
logintype: any; logintype: any;
lastLoginDate: string;
user_name: string;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -80,12 +82,32 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
ngOnInit() { ngOnInit() {
// retrive user info ** // retrive user info **
this.user = this.cs.sharedService.getSharedData(
AuthenticationService.IMEI_USER_DATA,
false
);
this.userName = localStorage.getItem("user"); this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password"); this.password = localStorage.getItem("password");
let remember = localStorage.getItem("remember"); let remember = localStorage.getItem("remember");
this.empname= localStorage.getItem("emp-name"); this.empname= localStorage.getItem("emp-name");
this.logintype= localStorage.getItem("login-type"); this.logintype= localStorage.getItem("login-type");
this.lastLoginDate= localStorage.getItem("login-at");
// this.lastLoginDate= new Date(this.lastLoginDate).toISOString()
// let day = this.lastLoginDate.getDate();
// let month = this.lastLoginDate.getMonth() + 1;
// let year = this.lastLoginDate.getFullYear();
// let todayDate = month + '/' + day + '/' + year;
// this.lastLoginTime = moment(this.cs.evaluteDateAsObject(this.lastLoginDate)).format("HH:mm");
this.logintype = parseInt(this.logintype) this.logintype = parseInt(this.logintype)
console.log(" this.lastLoginTime" + this.lastLoginTime);
console.log(" this.lastLoginDate" + this.lastLoginDate);
this.welcome_txt = this.ts.trPK("home", "welcome-txt"); this.welcome_txt = this.ts.trPK("home", "welcome-txt");
@ -99,7 +121,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.setDescription(); this.setDescription();
//later to fix below code //later to fix below code
if (this.user) { if (this.user) {
// this.lastLoginTime = moment(this.cs.evaluteDateAsObject(this.user.EditedOn)).format("HH:mm"); this.lastLoginTime = moment(this.cs.evaluteDateAsObject(this.user.EditedOn)).format("HH:mm");
} }
} }
@ -107,7 +129,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
} }
private setWelcomeMessage() { private setWelcomeMessage1() {
console.log(this.userName + "this.userName"); console.log(this.userName + "this.userName");
if (this.userName) { if (this.userName) {
@ -117,12 +139,38 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.welcome += " " + this.empname || ''; this.welcome += " " + this.empname || '';
this.isLastLogin = true; this.isLastLogin = true;
console.log(this.isLastLogin + "this.isLastLogin"); console.log(this.isLastLogin + "this.isLastLogin");
} else { } else {
this.welcome = this.ts.trPK("home", "welcome-head"); this.welcome = this.ts.trPK("home", "welcome-head");
} }
} }
private setWelcomeMessage() {
console.log(" setWelcomeMessage ");
if (this.user) {
console.log(" this.user.EmployeeName: "+ this.user.EmployeeName);
if(this.user.EmployeeName != null && this.user.EmployeeName !=''){
this.user_name=this.user.EmployeeName;
}
else{
this.user_name="";
}
this.welcome = this.ts.trPK("home", "welcome-back");
this.welcome += " " + this.user_name || '';
this.isLastLogin = true;
} else {
this.welcome = this.ts.trPK("home", "welcome-head");
}
}
private setDescription() { private setDescription() {
this.txt_account = this.userName ? this.txt_account = this.userName ?
this.ts.trPK("home", "account-info") :""; this.ts.trPK("home", "account-info") :"";

@ -23,13 +23,26 @@
</ion-slides> </ion-slides>
</ion-row> </ion-row>
<!-- <ion-row *ngFor="let item of menuList; let i=index">
<ng-container *ngIf="item.MENU_TYPE === 'M'">
<ion-col [size]="12">
<ion-label>{{item.MENU_NAME}}</ion-label>
</ion-col>
<app-services-button
(click)="openMyTeamPage()"
[title]="item.MENU_NAME"
icon="assets/icon/new-design/leave_balance.png">
</app-services-button>
</ng-container>
</ion-row> -->
<ion-row *ngFor="let menuItem of menuEntries; let i=index"> <ion-row *ngFor="let menuItem of menuEntries; let i=index">
<ion-row class="attendance-module" *ngIf="i == 1"> <ion-row class="attendance-module" *ngIf="i == 1">
<ion-col [size]="8"> <ion-col [size]="8">
<h3>{{'home,monthly-attendance' | translate}}</h3> <h3>{{'home,monthly-attendance' | translate}}</h3>
<span>{{'home,monthly-time-sheet-view' | translate}}</span> <span>{{'home,monthly-time-sheet-view' | translate}}</span>
<ion-button> <ion-button (click)="openTimeCard()">
{{'home,view-detail' | translate}} {{'home,view-detail' | translate}}
</ion-button> </ion-button>
</ion-col> </ion-col>
@ -46,100 +59,28 @@
<app-services-button <app-services-button
(click)="openPage(subMenu)" (click)="openPage(subMenu)"
[title]="subMenu.PROMPT" [title]="subMenu.PROMPT"
icon="assets/icon/new-design/leave_balance.png"> [icon]="subMenu.ICON">
</app-services-button> </app-services-button>
</ion-slide> </ion-slide>
</ion-slides> <ion-slide *ngIf="i == 0">
</ion-row> <app-services-button
(click)="openMyTeamPage()"
<!-- <ion-row class="attendance-module"> title="My Team"
<ion-col [size]="8"> icon="assets/icon/new-design/leave_balance.png">
<h3>Monthly Attendance</h3> </app-services-button>
<span>View your Monthly Time Sheet</span> </ion-slide>
<ion-button> <ion-slide *ngIf="i == 2">
View Detail <app-services-button
</ion-button> (click)="Vacation_Rule()"
</ion-col> title="Vacation Rule"
<ion-col [size]="4"> icon="assets/icon/new-design/vacation_rules_icon.png">
<img src="assets/icon/new-design/attendance_button_icon.png"/> </app-services-button>
</ion-col> </ion-slide>
</ion-row> -->
<!-- <ion-row>
<ion-col [size]="12">
<ion-label>My Travelling</ion-label>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Ticket Request"
icon="assets/icon/new-design/ticket_request.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Borrowing Passport"
icon="assets/icon/new-design/borrowing_passport.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Vacations Rules"
icon="assets/icon/new-design/vacation_rules.png">
</app-services-button>
</ion-col>
</ion-row> -->
<!-- <ion-row>
<ion-col [size]="12">
<ion-label>Miscellaneous</ion-label>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Uniform Request"
icon="assets/icon/new-design/uniform_request.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="ID Badge Request"
icon="assets/icon/new-design/id_badge_request.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Separation/ Resignation"
icon="assets/icon/new-design/separation_resignation.png">
</app-services-button>
</ion-col>
</ion-row> -->
<!-- </ion-slides>
<ion-row> </ion-row>
<ion-col [size]="4">
<app-services-button
title="Recreational Activities"
icon="assets/icon/new-design/recreational_activities.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Employee Certificate"
icon="assets/icon/new-design/employee_certificate.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="IT Forms"
icon="assets/icon/new-design/it_forms.png">
</app-services-button>
</ion-col>
</ion-row> -->
</ion-grid> </ion-grid>
<div class="fixed-shift-timer" *ngIf="isCheckedIn" (click)="openattentracking()"> <div class="fixed-shift-timer" *ngIf="isCheckedIn" (click)="openattentracking()">
<span class="subTitle"> {{'home,time-left' | translate}} </span> <span class="subTitle"> {{'home,time-left' | translate}} </span>

@ -15,24 +15,27 @@ import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request'
import { Response } from 'src/app/hmg-common/services/models/response'; import { Response } from 'src/app/hmg-common/services/models/response';
import { AttendanceService } from './services/attendance.services'; import { AttendanceService } from './services/attendance.services';
import { LoginRequest } from '../hmg-common/services/authentication/models/login.request'; import { LoginRequest } from '../hmg-common/services/authentication/models/login.request';
import {FileUploaderComponent} from '../hmg-common/ui/file-uploader/file-uploader.component' import { FileUploaderComponent } from '../hmg-common/ui/file-uploader/file-uploader.component';
import { Camera} from '@ionic-native/Camera/ngx'; import { Camera } from '@ionic-native/Camera/ngx';
import { File } from '@ionic-native/file/ngx'; import { File } from '@ionic-native/file/ngx';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { SharedDataService } from '../hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from '../hmg-common/services/shared-data-service/shared-data.service';
import { DevicePermissionsService } from '../hmg-common/services/device-permissions/device-permissions.service'; import { DevicePermissionsService } from '../hmg-common/services/device-permissions/device-permissions.service';
import { DashboredService } from '../hmg-common/services/dashbored/dashbored.service'; import { DashboredService } from '../hmg-common/services/dashbored/dashbored.service';
import { OrganizationSalariesResponse } from '../hmg-common/services/dashbored/organization-salaries.response'; import { OrganizationSalariesResponse } from '../hmg-common/services/dashbored/organization-salaries.response';
import { OpenMissingSwipesResponse} from '../hmg-common/services/dashbored/open-missing-swipes.response'; import { OpenMissingSwipesResponse } from '../hmg-common/services/dashbored/open-missing-swipes.response';
import {PerformanceAppraisalResponse} from '../hmg-common/services/dashbored/performance-appraisal.response'; import { PerformanceAppraisalResponse } from '../hmg-common/services/dashbored/performance-appraisal.response';
import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/attendance-tracking.response'; import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/attendance-tracking.response';
import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse'; import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse';
import {GetSubordinatesAttdStatusRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; import { GetSubordinatesAttdStatusRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest';
import {GetSubordinatesLeavesRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest' import { GetSubordinatesLeavesRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest';
import {GetOpenNotificationsResponse} from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse' import { GetOpenNotificationsResponse } from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import {GetSubordinatesAttdStatusResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse' import { GetSubordinatesAttdStatusResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse';
import {GetSubordinatesLeavesResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse' import { GetSubordinatesLeavesResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse';
import { AccrualService } from '../accrual-balances/services/accrual.service'; import { AccrualService } from '../accrual-balances/services/accrual.service';
import { GetDayAndHoursDetailsRequest } from '../time-card/service/models/get-day-hours-type-details.request';
import * as moment from 'moment';
import { TimeCardService } from '../time-card/service/time-card.service';
import { WorklistMainService } from '../notification/service/work-list.main.service'; import { WorklistMainService } from '../notification/service/work-list.main.service';
@Component({ @Component({
@ -54,36 +57,39 @@ export class HomePage implements OnInit {
public fileUploder: FileUploaderComponent; public fileUploder: FileUploaderComponent;
location: boolean; location: boolean;
camera: boolean; camera: boolean;
ticketRequestObject : any;
leaveRequestObject : any;
missingSwipeRequestObject : any;
public statsButtons = [ public statsButtons = [
{ {
title: this.ts.trPK('home','worklist'), title: this.ts.trPK('home','worklist'),
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/work_list.png', icon: 'assets/icon/new-design/work_list.png',
link: '/notification/homepage' link: '1'
},
{
title: this.ts.trPK('home','pending-request'),
statsValue: 13,
icon: 'assets/icon/new-design/pending_request.png',
link: ''
}, },
// {
// title: 'Pending Request',
// statsValue: 13,
// icon: 'assets/icon/new-design/pending_request.png',
// link: ''
// },
{ {
title: this.ts.trPK('home','missing-swipes'), title: this.ts.trPK('home','missing-swipes'),
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/missing_swipe.png', icon: 'assets/icon/new-design/missing_swipe.png',
link: '' link: '2'
}, },
{ {
title: this.ts.trPK('home','leave-balance'), title: this.ts.trPK('home','leave-balance'),
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/leave_balance.png', icon: 'assets/icon/new-design/leave_balance.png',
link: '' link: '3'
}, },
{ {
title: this.ts.trPK('absenceList','tickets-balance'), title: this.ts.trPK('absenceList','tickets-balance'),
statsValue: 0, statsValue: 0,
icon: 'assets/icon/new-design/ticket_balance.png', icon: 'assets/icon/new-design/ticket_balance.png',
link: '' link: '4'
} }
]; ];
@ -107,8 +113,8 @@ export class HomePage implements OnInit {
// ]; // ];
public slideOptsOne = { public slideOptsOne = {
slidesPerView: 3.5, slidesPerView: 3.5,
spaceBetween: 10 spaceBetween: 10
}; };
public slideOptsTwo = { public slideOptsTwo = {
slidesPerView: 3.2, slidesPerView: 3.2,
@ -119,12 +125,17 @@ export class HomePage implements OnInit {
public hasFinished = false; public hasFinished = false;
public remainingTime: any; public remainingTime: any;
public scheduledTime: any; public scheduledTime: any;
public spentHours: any;
public isCheckedIn = undefined; public isCheckedIn = undefined;
public displayTime: any; public displayTime: any;
public menuEntries: any; public menuEntries: any;
public percent: any; public percent: any;
public selEmp: string;
public selMenu: MenuResponse = new MenuResponse();
public respID: number;
public menuType: any;
accrualBalancesList: any; accrualBalancesList: any;
public countAllNotification: number =0; public countAllNotification = 0;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -147,17 +158,21 @@ export class HomePage implements OnInit {
private permissions: DevicePermissionsService, private permissions: DevicePermissionsService,
public DS: DashboredService, public DS: DashboredService,
public accrualService: AccrualService, public accrualService: AccrualService,
public workListService: WorklistMainService, //////////////////////////////////////// TIME AND DATE////////////////////////////
public timeCardService: TimeCardService,
///////////////////// END/////////////////////////////////////////////////////////
public workListService: WorklistMainService
) { ) {
this.events.subscribe('img-change', displayImg => { this.events.subscribe('img-change', displayImg => {
this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg); this.userImage = this.sanitizer.bypassSecurityTrustUrl(
'data:Image/*;base64,' + displayImg
);
console.log('html saved img: ' + this.userImage); console.log('html saved img: ' + this.userImage);
}); });
} }
ngOnInit() { ngOnInit() {
// this.getUserDetails(); // this.getUserDetails();
// this.getCount(); // this.getCount();
// this.events.subscribe('getNotCount', badge => { // this.events.subscribe('getNotCount', badge => {
// this.notBadge = badge; // this.notBadge = badge;
@ -165,20 +180,20 @@ export class HomePage implements OnInit {
} }
ionViewWillEnter() { ionViewWillEnter() {
this.remainingTime = 0; this.remainingTime = 0;
this.displayTime = '00:00:00'; this.displayTime = '00:00:00';
this.runTimer = false; this.runTimer = false;
this.getUserDetails(); this.getUserDetails();
} }
initTimer() { initTimer() {
this.runTimer = false; this.runTimer = false;
this.hasStarted = false; this.hasStarted = false;
this.hasFinished = false; this.hasFinished = false;
this.percent = 100 - ((this.remainingTime / this.scheduledTime) * 100); this.percent = 100 - (this.remainingTime / this.scheduledTime) * 100;
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
this.startTimer(); this.startTimer();
} }
startTimer() { startTimer() {
this.runTimer = true; this.runTimer = true;
@ -188,11 +203,16 @@ export class HomePage implements OnInit {
timerTick() { timerTick() {
setTimeout(() => { setTimeout(() => {
if (!this.runTimer) { return; } if (!this.runTimer) {
return;
}
this.remainingTime--; this.remainingTime--;
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
if (this.remainingTime > 0) { if (this.remainingTime > 0) {
const newPercent: any = ((this.remainingTime / this.scheduledTime) * 100).toFixed(2); const newPercent: any = (
(this.remainingTime / this.scheduledTime) *
100
).toFixed(2);
this.percent = 100 - newPercent; this.percent = 100 - newPercent;
this.timerTick(); this.timerTick();
} else { } else {
@ -204,21 +224,20 @@ export class HomePage implements OnInit {
getSecondsAsDigitalClock(inputSeconds: number) { getSecondsAsDigitalClock(inputSeconds: number) {
const secNum = parseInt(inputSeconds.toString(), 10); // don't forget the second param const secNum = parseInt(inputSeconds.toString(), 10); // don't forget the second param
const hours = Math.floor(secNum / 3600); const hours = Math.floor(secNum / 3600);
const minutes = Math.floor((secNum - (hours * 3600)) / 60); const minutes = Math.floor((secNum - hours * 3600) / 60);
const seconds = secNum - (hours * 3600) - (minutes * 60); const seconds = secNum - hours * 3600 - minutes * 60;
let hoursString = ''; let hoursString = '';
let minutesString = ''; let minutesString = '';
let secondsString = ''; let secondsString = '';
hoursString = (hours < 10) ? '0' + hours : hours.toString(); hoursString = hours < 10 ? '0' + hours : hours.toString();
minutesString = (minutes < 10) ? '0' + minutes : minutes.toString(); minutesString = minutes < 10 ? '0' + minutes : minutes.toString();
secondsString = (seconds < 10) ? '0' + seconds : seconds.toString(); secondsString = seconds < 10 ? '0' + seconds : seconds.toString();
return hoursString + ':' + minutesString + ':' + secondsString; return hoursString + ':' + minutesString + ':' + secondsString;
} }
getDeviceLocation() { getDeviceLocation() {
const isVirtual = this.device.isVirtual; const isVirtual = this.device.isVirtual;
if (isVirtual === true){ if (isVirtual === true) {
alert('emulater>>>>>>>' + isVirtual); alert('emulater>>>>>>>' + isVirtual);
alert('You are using virtual device'); alert('You are using virtual device');
return false; return false;
@ -227,7 +246,11 @@ export class HomePage implements OnInit {
this.location = granted as boolean; this.location = granted as boolean;
if (this.location) { if (this.location) {
this.geolocation this.geolocation
.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }) .getCurrentPosition({
maximumAge: 3000,
timeout: 10000,
enableHighAccuracy: true
})
.then(resp => { .then(resp => {
this.lat = resp.coords.latitude; this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude; this.longt = resp.coords.longitude;
@ -240,30 +263,32 @@ export class HomePage implements OnInit {
return false; return false;
} }
}); });
} }
setServicesPrivilage() { setServicesPrivilage() {
for (const servicePrivilage of AuthenticationService.servicePrivilage) { for (const servicePrivilage of AuthenticationService.servicePrivilage) {
if (servicePrivilage.Previlege === false) { if (servicePrivilage.Previlege === false) {
document.getElementById(servicePrivilage.ServiceName).setAttribute('disabled', 'disabled'); document
document.getElementById(servicePrivilage.ServiceName).style.filter = 'grayscale(1)'; .getElementById(servicePrivilage.ServiceName)
.setAttribute('disabled', 'disabled');
document.getElementById(servicePrivilage.ServiceName).style.filter =
'grayscale(1)';
} }
} }
} }
// getCount() { // getCount() {
// const req: any = {}; // const req: any = {};
// this.menuService.getNotificationCount(req).subscribe((result: any) => { // this.menuService.getNotificationCount(req).subscribe((result: any) => {
// if (this.common.validResponse(result)) { // if (this.common.validResponse(result)) {
// this.notBadge = // this.notBadge =
// result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM; // result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM;
// if (this.notBadge <= 0) { // if (this.notBadge <= 0) {
// this.notBadge = null; // this.notBadge = null;
// } // }
// this.events.publish("getNotCount", this.notBadge); // this.events.publish("getNotCount", this.notBadge);
// } // }
// }); // });
// } // }
ionViewDidEnter() { ionViewDidEnter() {
@ -283,284 +308,328 @@ export class HomePage implements OnInit {
} }
private getUserDetails() { private getUserDetails() {
this.authService this.authService
.loadAuthenticatedUser() .loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => { .subscribe((user: AuthenticatedUser) => {
if (user) { if (user) {
this.events.publish('setMenu'); this.events.publish('setMenu');
this.userData = user; this.userData = user;
this.sharedData.setSharedData(this.userData, AuthenticatedUser.SHARED_DATA); this.sharedData.setSharedData(
this.userImage = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : this.userImage; this.userData,
AuthenticatedUser.SHARED_DATA
);
this.userImage = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage;
this.callDashboardServices(); this.callDashboardServices();
} else { } else {
console.log(user); console.log(user);
} }
}); });
} }
callDashboardServices() { callDashboardServices() {
this.getMenu(); this.getMenu();
this.setServicesPrivilage(); this.setServicesPrivilage();
this.openNotificationsDashbored(); this.openNotificationsDashbored();
this.showOpenMissingSwipes(); this.showOpenMissingSwipes();
this.showAttendanceTracking(); this.showAttendanceTracking();
this.getAccrualBalance(); this.getAccrualBalance();
} }
public Vacation_Rule() { public Vacation_Rule() {
this.common.navigateForward('/vacation-rule/home'); this.common.navigateForward('/vacation-rule/home');
} }
private getMenu() { private getMenu() {
this.menuService.getMenu().subscribe((result: MenuResponse) => { this.menuService.getMenu().subscribe((result: MenuResponse) => {
this.handleMenuResult(result); this.handleMenuResult(result);
}); });
} }
private handleMenuResult(result) { private handleMenuResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) { if (this.common.hasData(result.List_Menu)) {
console.log('list menu'); console.log('list menu');
this.menuList = result.List_Menu; this.menuList = result.List_Menu;
this.getMenuDetails(); this.getMenuDetails();
}
} }
} }
}
private accrualBalance() { private accrualBalance() {
this.common.openAccuralPage(); this.common.openAccuralPage();
} }
private changeImage() { private changeImage() {
this.common.openChangeImagePage(); this.common.openChangeImagePage();
} }
public getMenuDetails() { public getMenuDetails() {
const item = this.menuList[0]; const item = this.menuList[0];
const selMenu: MenuResponse = new MenuResponse(); const selMenu: MenuResponse = new MenuResponse();
selMenu.List_Menu = item; selMenu.List_Menu = item;
selMenu.userid = this.userData.EMPLOYEE_NUMBER; selMenu.userid = this.userData.EMPLOYEE_NUMBER;
console.log('menu: ' + selMenu.List_Menu); console.log("menu: " + selMenu.List_Menu);
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.getMenuEntries(item); this.getMenuEntries(item);
// if (item.MENU_TYPE === 'M') { // if (item.MENU_TYPE === 'M') {
// this.common.openMyTeamPage(); // this.common.openMyTeamPage();
// // this.navCtrl.push("MySubordinatePage"); // // this.navCtrl.push("MySubordinatePage");
// } else if (item.MENU_TYPE === 'S') { // } else if (item.MENU_TYPE === 'S') {
// this.common.sharedService.setSharedData(item, 'mySpecList'); // this.common.sharedService.setSharedData(item, 'mySpecList');
// this.common.openMySpecialistPage(); // this.common.openMySpecialistPage();
// // this.navCtrl.push('MySpecialistPage',{"mySpecList":item}); // // this.navCtrl.push('MySpecialistPage',{"mySpecList":item});
// } else { // } else {
// this.getMenuEntries(item); // this.getMenuEntries(item);
// } // }
} }
getMenuEntries(item) { openMyTeamPage() {
const request: any = {}; this.common.openMyTeamPage();
let selEmpNo: string = null; }
let nationality: string = null;
request.P_SELECTED_RESP_ID = -999; openTimeCard() {
if (item.MENU_TYPE === 'S') { this.common.openTimeCardPage();
request.P_SELECTED_RESP_ID = item.RESP_ID; }
} else {
selEmpNo = this.common.sharedService.getSharedData( getMenuEntries(item) {
LoginRequest.SHARED_DATA, const request: any = {};
false let selEmpNo: string = null;
); let nationality: string = null;
} request.P_SELECTED_RESP_ID = -999;
nationality = this.common.sharedService.getSharedData( if (item.MENU_TYPE === 'S') {
LoginRequest.NATIONALITY_CODE, request.P_SELECTED_RESP_ID = item.RESP_ID;
} else {
selEmpNo = this.common.sharedService.getSharedData(
LoginRequest.SHARED_DATA,
false false
); );
request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo;
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
// set emp and resp id
console.log('set data');
this.common.sharedService.setSharedData(
selEmpNo,
MenuResponse.SHARED_SEL_EMP
);
this.common.sharedService.setSharedData(
request.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID
);
this.eitService
.getMenuEntries(request)
.subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
} }
nationality = this.common.sharedService.getSharedData(
LoginRequest.NATIONALITY_CODE,
false
);
request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo;
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
// set emp and resp id
console.log("set data");
this.common.sharedService.setSharedData(
selEmpNo,
MenuResponse.SHARED_SEL_EMP
);
this.common.sharedService.setSharedData(
request.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID
);
this.eitService
.getMenuEntries(request)
.subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
}
sortMenuEntires(list) { sortMenuEntires(list) {
const tree = this.common.list_to_tree(list); const tree = this.common.list_to_tree(list);
this.menuEntries = tree; this.menuEntries = tree;
console.log(this.menuEntries); console.log(this.menuEntries);
this.common.sharedService.setSharedData(tree, 'menuEntries'); this.common.sharedService.setSharedData(tree, "menuEntries");
// this.common.navigateForward("/eit/homepage"); this.common.sharedService.setSharedData("home", "homemenuentries");
// this.common.openEITPage(); // this.common.navigateForward("/eit/homepage");
} // this.common.openEITPage();
}
private handleMenuEntiresResult(result) { private handleMenuEntiresResult(result) {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetMenuEntriesList)) { if (this.common.hasData(result.GetMenuEntriesList)) {
this.sortMenuEntires(result.GetMenuEntriesList); for(let i=0;i<result.GetMenuEntriesList.length;i++){
if(result.GetMenuEntriesList[i].FUNCTION_NAME=="HMG_TKT_NEW_EIT_SS"){
this.ticketRequestObject=result.GetMenuEntriesList[i];
}else if(result.GetMenuEntriesList[i].FUNCTION_NAME=="HR_LOA_SS"){
this.leaveRequestObject=result.GetMenuEntriesList[i];
} else if(result.GetMenuEntriesList[i].FUNCTION_NAME=="HMG_OTL_MISSING_SWIPE_EIT_SS"){
this.missingSwipeRequestObject=result.GetMenuEntriesList[i];
}
} }
this.sortMenuEntires(result.GetMenuEntriesList);
} }
} }
}
parentFn($event: string) { parentFn($event: string) {
console.log($event); // this will output 'hello from child' console.log($event); // this will output 'hello from child'
} }
private Change_password() { private Change_password() {
this.common.openChangePassword(); this.common.openChangePassword();
} }
private openPayslip() { private openPayslip() {
this.common.openPayslipPage(); this.common.openPayslipPage();
} }
private attendance() { private attendance() {
this.permissions.requestCameraAutherization().then(granted => { this.permissions.requestCameraAutherization().then(granted => {
this.camera = granted as boolean; this.camera = granted as boolean;
if (this.camera) { if (this.camera) {
this.scanCode(); this.scanCode();
} }
} });
); }
}
scanCode() { scanCode() {
this.barcodeScanner.scan().then(barcodeData => { this.barcodeScanner
.scan()
.then(barcodeData => {
this.scannedResult = barcodeData; this.scannedResult = barcodeData;
this.deviceID = this.device.uuid; this.deviceID = this.device.uuid;
this.swipeAttendance(); this.swipeAttendance();
}).catch(err => { })
console.log('Error', err); .catch(err => {
console.log("Error", err);
}); });
} }
swipeAttendance() {
const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat;
request.Longitude = this.longt;
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log(JSON.stringify(request));
this.attendanceService
.attendanceSwipeScanner(request, () => {
console.log('Error inside in swipe attendance');
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess'));
this.showAttendanceTracking();
}
// else {
// this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed'));
// }
});
}
openPersonalInfo() { swipeAttendance() {
this.common.openProfile(); const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
} request.Latitude = this.lat;
request.Longitude = this.longt;
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log(JSON.stringify(request));
this.attendanceService
.attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance");
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess"));
this.showAttendanceTracking();
}
// else {
// this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed'));
// }
});
}
openPersonalInfo() {
this.common.openProfile();
}
/*************************************Dashboards Services**********************************************************8 */ /*************************************Dashboards Services**********************************************************8 */
showOrganizationSalaries() { showOrganizationSalaries() {
this.DS.getOrganizationSalaries() .subscribe((result: OrganizationSalariesResponse ) => { this.DS.getOrganizationSalaries().subscribe(
}); (result: OrganizationSalariesResponse) => {}
);
} }
showOpenMissingSwipes() { showOpenMissingSwipes() {
this.DS.getOpenMissingSwipes() .subscribe((result: OpenMissingSwipesResponse) => { this.DS.getOpenMissingSwipes().subscribe(
if (this.common.validResponse(result)) { (result: OpenMissingSwipesResponse) => {
const key = 'GetOpenMissingSwipesList'; if (this.common.validResponse(result)) {
this.statsButtons[2].statsValue = result[key].P_OPEN_MISSING_SWIPES; const key = "GetOpenMissingSwipesList";
this.statsButtons[1].statsValue = result[key].P_OPEN_MISSING_SWIPES;
}
} }
}); );
} }
showPerformanceAppraisal() { showPerformanceAppraisal() {
this.DS.getPerformanceAppraisal() .subscribe((result: PerformanceAppraisalResponse) => { this.DS.getPerformanceAppraisal().subscribe(
}); (result: PerformanceAppraisalResponse) => {}
);
} }
convertInSeconds(time: any) { convertInSeconds(time: any) {
const hours = parseInt(time[0], 10); const hours = parseInt(time[0], 10);
const minutes = parseInt(time[1], 10); const minutes = parseInt(time[1], 10);
let seconds = parseInt(time[2], 10); let seconds = parseInt(time[2], 10);
seconds = seconds + (hours * 60 * 60) + (minutes * 60); seconds = seconds + hours * 60 * 60 + minutes * 60;
return seconds; return seconds;
} }
convertAndAssignTime(data) { convertAndAssignTime(data) {
console.log(data); console.log(data);
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':')); this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':'));
this.initTimer(); this.isCheckedIn = this.spentHours === 0 ? false : true;
} if (this.isCheckedIn) {
this.initTimer();
}
}
showAttendanceTracking() { showAttendanceTracking() {
this.DS.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER
};
this.DS.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
const key = 'GetAttendanceTrackingList'; const key = 'GetAttendanceTrackingList';
this.convertAndAssignTime(result[key]); this.convertAndAssignTime(result[key]);
} }
}); });
} }
openPeriodDateDashbored() { openPeriodDateDashbored() {
this.DS.getOpenPeriodDates( () => {console.log('Error '); } ).subscribe((result: OpenPeriodDatesResponse) => { this.DS.getOpenPeriodDates(() => { console.log('Error '); }).subscribe((result: OpenPeriodDatesResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log('response'); console.log('response');
} }
}); });
} }
openNotificationsDashbored() { // work list openNotificationsDashbored() {
this.DS.getOpenNotifications( () => { console.log('Error '); }).subscribe((result: GetOpenNotificationsResponse) => { // work list
this.DS.getOpenNotifications(() => {
console.log("Error ");
}).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
const key = 'P_OPEN_NTF_NUMBER'; const key = 'P_OPEN_NTF_NUMBER';
this.countAllNotification = result[key]; this.countAllNotification = result[key];
this.ITGCountAllNotification(); this.ITGCountAllNotification();
this.common.sharedService.setSharedData(result, 'worklistNotifications'); this.common.sharedService.setSharedData(
result,
'worklistNotifications'
);
} }
}); });
} }
ITGCountAllNotification(){ ITGCountAllNotification() {
this.workListService.getITGDetails() this.workListService.getITGDetails().subscribe((result: any) => {
.subscribe((result: any) => { this.statsButtons[0].statsValue =
this.statsButtons[0].statsValue = this.countAllNotification + result.TotalCount; this.countAllNotification + result.TotalCount;
}); });
} }
getSubordinatesLeaves() { getSubordinatesLeaves() {
const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest(); const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = '/Date(1578603600000+0300)/'; // test request.P_DATE_FROM = "/Date(1578603600000+0300)/"; // test
request.P_DATE_TO = '/Date(1576011600000+0300)/'; // test request.P_DATE_TO = "/Date(1576011600000+0300)/"; // test
this.DS.getSubordinatesLeaves( request, () => {console.log('Error '); } ).subscribe((result: GetSubordinatesLeavesResponse) => { this.DS.getSubordinatesLeaves(request, () => {
console.log("Error ");
}).subscribe((result: GetSubordinatesLeavesResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log('response'); console.log('response');
console.log(result); console.log(result);
} }
}); });
} }
getSubordinatesAttStatus() { getSubordinatesAttStatus() {
const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest(); const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM = '/Date(1578603600000+0300)/'; // test request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; // test
request.P_SCHEDULE_DATE_TO = '/Date(1576011600000+0300)/'; // test request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/"; // test
this.DS.getSubordinatesAttStatus( request, () => {console.log('Error '); }).subscribe((result: GetSubordinatesAttdStatusResponse) => { this.DS.getSubordinatesAttStatus(request, () => {
console.log("Error ");
}).subscribe((result: GetSubordinatesAttdStatusResponse) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log('response'); console.log('response');
console.log(result); console.log(result);
@ -571,7 +640,10 @@ export class HomePage implements OnInit {
openPage(subMenu) { openPage(subMenu) {
console.log("openPage"); console.log("openPage");
let selMenu: MenuResponse = new MenuResponse(); let selMenu: MenuResponse = new MenuResponse();
selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); selMenu = this.common.sharedService.getSharedData(
MenuResponse.SHARED_DATA,
false
);
selMenu.GetMenuEntriesList = subMenu; selMenu.GetMenuEntriesList = subMenu;
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
if (subMenu.REQUEST_TYPE === 'ABSENCE') { if (subMenu.REQUEST_TYPE === 'ABSENCE') {
@ -581,58 +653,80 @@ export class HomePage implements OnInit {
} else if (subMenu.REQUEST_TYPE === 'PAYSLIP') { } else if (subMenu.REQUEST_TYPE === 'PAYSLIP') {
this.common.openPayslipPage(); this.common.openPayslipPage();
} else if (subMenu.MENU_ENTRY_TYPE === 'MENU') { } else if (subMenu.MENU_ENTRY_TYPE === 'MENU') {
this.common.sharedService.setSharedData(selMenu.GetMenuEntriesList, "menuEntries"); this.common.sharedService.setSharedData(
selMenu.GetMenuEntriesList,
'menuEntries'
);
this.common.openEITPage(); this.common.openEITPage();
} }
if (subMenu.REQUEST_TYPE === 'TIME_CARD') {
this.common.openTimeCardPage();
}
} }
getAccrualBalance() { getAccrualBalance() {
const today = new Date(); const today = new Date();
const day = today.getDate(); const day = today.getDate();
const month = today.getMonth() + 1; const month = today.getMonth() + 1;
const year = today.getFullYear(); const year = today.getFullYear();
const todayDate = month + '/' + day + '/' + year; const todayDate = month + "/" + day + "/" + year;
const effectiveDate = todayDate; const effectiveDate = todayDate;
const request = { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER, P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER,
P_EFFECTIVE_DATE: effectiveDate P_EFFECTIVE_DATE: effectiveDate
}; };
this.accrualService this.accrualService.getAccrualBalances(request).subscribe((result: any) => {
.getAccrualBalances(request) if (this.common.validResponse(result)) {
.subscribe((result: any) => { let totalTicketsLeft = 0;
if (this.common.validResponse(result)) { this.accrualBalancesList = result.GetAccrualBalancesList;
let totalTicketsLeft = 0; for (const accrualBalance of result.GetAccrualBalancesList) {
this.accrualBalancesList = result.GetAccrualBalancesList; if (
for (const accrualBalance of result.GetAccrualBalancesList) { accrualBalance.ACCURAL_PLAN_NAME ===
"HMG Annual Vacation Accrual Plan"
if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') { ) {
this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT; this.statsButtons[2].statsValue =
this.common.sharedService.setSharedData( accrualBalance, 'leaveAccrualBalance'); accrualBalance.ACCRUAL_NET_ENTITLEMENT;
this.common.sharedService.setSharedData( request, 'leaveAccrualBalanceDate'); this.common.sharedService.setSharedData(
this.common.sharedService.setSharedData( this.accrualBalancesList, 'tickitsbalance') accrualBalance,
} else { "leaveAccrualBalance"
totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; );
} this.common.sharedService.setSharedData(
} request,
this.statsButtons[4].statsValue = totalTicketsLeft; "leaveAccrualBalanceDate"
);
this.common.sharedService.setSharedData(
this.accrualBalancesList,
"tickitsbalance"
);
} else {
totalTicketsLeft =
totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
} }
}); }
this.statsButtons[3].statsValue = totalTicketsLeft;
}
});
} }
openattentracking() { openattentracking() {
this.common.openAttenTrackingpage(); this.common.openAttenTrackingpage();
} }
openProfilePage() { openProfilePage() {
this.common.openEditProfile(); this.common.openEditProfile();
} }
openStatsButton(link: string) {
console.log(link);
this.common.openPage(link);
}
openStatsButton(link: any) {
// console.log(link);
if (link == "1") {
this.common.openNotificationPage();
} else if (link == "2") {
this.openPage(this.missingSwipeRequestObject);
} else if (link == "3") {
this.openPage(this.leaveRequestObject);
} else if (link =="4") {
this.openPage(this.ticketRequestObject);
}
}
} }

@ -1,158 +1,282 @@
<ion-header>
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<nav-buttons (backClick)="goback()" [navigate]="false"></nav-buttons>
</ion-buttons>
<ion-title>EMPLOYEE DETAIL</ion-title>
</ion-toolbar>
</ion-header>
<ion-header> <ion-content>
<ion-toolbar class="header-toolbar"> <div class="contentBg">
<ion-buttons slot="start"> <div class="result-graph" style="padding-top: 12px;">
<nav-buttons [navigate] = "false" (backClick)="goback()"></nav-buttons> <div class="user-info">
<ion-icon class="search-icons" color="light" name="arrow-back" *ngIf="modalFlag" (click)="dismiss()"></ion-icon> <div class="user-image-container">
</ion-buttons> <div class="user-image">
<ion-title color="light" >{{headerTitle}}</ion-title> <img [src]="employee.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+employee.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'" alt="Team Member Image"/>
<!-- <ion-buttons slot="end"> </div>
<button ion-button icon-only class="btnBack" *ngIf="isSpecialist == false" (click)="goToSubordinate();"> </div>
<ion-icon class="search-icons" color="light" name="search"></ion-icon> <h1>{{employee.EMPLOYEE_NAME}}</h1>
</button> <span>{{employee.JOB_NAME}}</span>
</ion-buttons> --> </div>
</ion-toolbar> <div class="user-actions">
</ion-header> <ion-row class="ion-justify-content-center">
<ion-content padding> <ion-col [size]="4">
<div *ngIf="employee"> <div class="action-button col-button">
<ion-card> <a class="action-button-icon" href="tel:{{employee.EMPLOYEE_MOBILE_NUMBER}}">
<img src="../assets/imgs/call_icon.png">
<ion-card-header class="boxHdr"> </a>
<div class="hrTitle">{{employee.EMPLOYEE_NAME}}</div> <span>Call</span>
</ion-card-header> </div>
<ion-card-content> </ion-col>
<div> <ion-col [size]="4" (click)="getMenuEntries(employee)">
<div class="centerDiv profileDiv"> <div class="action-button col-button">
<!-- <p class="TxtPlace boldTxt">{{User_name_Emp}}</p> --> <span class="action-button-icon">
<ion-img class="profileImg" <img src="../assets/imgs/create_request_icon.png">
[src]="employee.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+employee.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"> </span>
</ion-img> <span>Create Request</span>
</div> </div>
<ion-grid class="profile-grid"> </ion-col>
<ion-row> <ion-col [size]="4" style="opacity:0.3;">
<ion-col class="colBold" col-5> <div class="action-button col-button">
<label>{{ts.trPK('userProfile','empNo')}}</label> <span class="action-button-icon">
</ion-col> <img src="../assets/imgs/message_icon.png">
<ion-col col-7> </span>
<label>{{employee.EMPLOYEE_NUMBER}}</label> <span>Message</span>
</ion-col> </div>
</ion-row> </ion-col>
<!-- <ion-row>
<ion-col class="colBold" col-5>
<label>{{"userProfile.name" | translate}}</label>
</ion-col>
</ion-row> </ion-row>
<ion-row> </div>
<ion-col col-7> </div>
<label>{{employee.EMPLOYEE_NAME}}</label>
</ion-col> <div class="segments-container">
</ion-row> --> <ion-segment
<ion-row> (ionChange)="segmentChanged($event)"
<ion-col class="colBold" col-5> [value]="activeSegment">
<label>{{ts.trPK('userProfile','busG')}}</label> <ion-segment-button
</ion-col> value="Attendance"
<ion-col col-7> [ngClass]="activeSegment == 'Attendance' ? 'active-Segment' : 'normal-Segment'" >
<label>{{employee.BUSINESS_GROUP_NAME}}</label> <ion-label>Attendance</ion-label>
</ion-col> </ion-segment-button>
</ion-row> <ion-segment-button
<ion-row> value="Team Members"
<ion-col class="colBold" col-5> [ngClass]="activeSegment == 'Team Members' ? 'active-Segment' : 'normal-Segment'">
<label>{{ts.trPK('userProfile','job')}}</label> <ion-label>Team Members</ion-label>
</ion-col> </ion-segment-button>
<ion-col col-7> <ion-segment-button
<label>{{employee.JOB_NAME}}</label> value="About"
</ion-col> [ngClass]="activeSegment == 'About' ? 'active-Segment' : 'normal-Segment'">
</ion-row> <ion-label>About</ion-label>
<ion-row> </ion-segment-button>
<ion-col class="colBold" col-5> </ion-segment>
<label>{{ts.trPK('userProfile','locName')}} </label> </div>
</ion-col>
<ion-col col-7> <div *ngIf="activeSegment === 'Attendance'">
<label>{{employee.LOCATION_NAME}}</label> <div>
</ion-col> <p style="margin-bottom: 1px;">
</ion-row> {{ts.trPK('myTeam','todayAttendance')}}
<ion-row> </p>
<ion-col class="colBold" col-5> <ion-row style="margin: 0 -5px;">
<label>{{ts.trPK('userProfile','payrol')}} </label> <ion-col [size]="4">
</ion-col> <div class="attendance-information">
<ion-col col-7> <span>{{ts.trPK('myTeam','checkIn')}}</span>
<label>{{employee.PAYROLL_NAME}}</label> <h2 *ngIf="attendanceTrackingList.P_SWIPE_IN !== null">{{attendanceTrackingList.P_SWIPE_IN | slice:0:-3}}</h2>
</ion-col> <h2 *ngIf="attendanceTrackingList.P_SWIPE_IN === null">--:--</h2>
</ion-row> </div>
<ion-row> </ion-col>
<ion-col class="colBold" col-5> <ion-col [size]="4">
<label>{{ts.trPK('userProfile','orgEmail')}}</label> <div class="attendance-information">
</ion-col> <span>{{ts.trPK('myTeam','checkOut')}}</span>
<ion-col col-7> <h2 *ngIf="attendanceTrackingList.P_SWIPE_OUT !== null">{{attendanceTrackingList.P_SWIPE_OUT | slice:0:-3}}</h2>
<label>{{employee.EMPLOYEE_EMAIL_ADDRESS}}</label> <h2 *ngIf="attendanceTrackingList.P_SWIPE_OUT === null">--:--</h2>
</ion-col> </div>
</ion-row> </ion-col>
<ion-row> <ion-col [size]="4">
<ion-col class="colBold" col-5> <div class="attendance-information">
<label>{{ts.trPK('userProfile','orgName')}}</label> <span>{{ts.trPK('myTeam','late')}}</span>
</ion-col> <h2>{{attendanceTrackingList.P_LATE_IN_HOURS | slice:0:-3}} </h2>
<ion-col col-7> </div>
<label>{{employee.ORGANIZATION_NAME}}</label> </ion-col>
</ion-col> </ion-row>
</ion-row> </div>
<ion-row>
<ion-col class="colBold" col-5> <div class="header">
<label>{{ts.trPK('userProfile','position')}}</label> <div>
</ion-col> <ion-row>
<ion-col col-7> <ion-col [size]="2" style="text-align: left;">
<label>{{employee.POSITION_NAME}}</label> <ion-icon class="activeArrow" ios="ios-arrow-dropleft-circle" md="md-arrow-dropleft-circle" (click)="previousSlide()"></ion-icon>
</ion-col> </ion-col>
</ion-row> <ion-col [size]="8" style="text-align: center;">
<ion-row> <span class="month-year-span">{{month}} {{year}}</span>
<ion-col class="colBold" col-5> </ion-col>
<label>{{ts.trPK('userProfile','grade')}}</label> <ion-col [size]="2" style="text-align: right;">
</ion-col> <ion-icon [ngClass]=" currentMonthName === month ? 'disabledArrow' : 'activeArrow'" ios="ios-arrow-dropright-circle" md="md-arrow-dropright-circle" (click)="nextSlide()"></ion-icon>
<ion-col col-7> </ion-col>
<label>{{employee.GRADE_NAME}}</label> </ion-row>
</ion-col> </div>
</ion-row> </div>
<ion-row>
<ion-col class="colBold" col-5> <div class="result-graph">
<label>{{ts.trPK('userProfile','category')}}</label> <div class="request-heading">
</ion-col> <span>{{ts.trPK('myTeam','attendance-statistics')}}</span>
<ion-col col-7> </div>
<label>{{employee.EMPLOYMENT_CATEGORY_MEANING}}</label> <div style="position: relative;">
</ion-col> <div class="label-container">
</ion-row> <div class="green-label-container">
<!-- <ion-row (click)="getMenuEntries(employee);"> <span class="span-one">{{ts.trPK('attendance','present')}}</span>
<ion-col col-7> --> <span class="span-two">{{attendedDays}}</span>
<!-- <label for="">Request for {{employee.EMPLOYEE_NAME}}</label> --> </div>
<!-- </ion-col> <div class="blue-label-container">
</ion-row> --> <span class="span-one">{{ts.trPK('attendance','absent')}}</span>
</ion-grid> <span class="span-two">{{absentDays}}</span>
</div>
</div>
<div class="graph-container">
<div class="result-text-container">
<h2>{{totalAttendancePrecentage}}</h2>
<span>{{ts.trPK('absenceList','days')}}</span>
</div> </div>
</ion-card-content> <p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</ion-card> </div>
<div class="centerDiv">
<ion-button color="customnavy" (click)="getMenuEntries(employee)">{{ts.trPK('myTeam','requestFor')}}
{{employee.EMPLOYEE_NAME}}</ion-button>
</div> </div>
</div> </div>
<div *ngIf="isSpecialist == false" >
<ion-list no-lines *ngIf="empSubordinate && empSubordinate.length>0"> <ion-row class="attendance-summary">
<ion-item no-border *ngFor="let subordinate of empSubordinate;let i=index" (click)="getDetails(i);"> <ion-col [size]="3">
<ion-avatar slot="start"> <div class="attendance-information">
<!-- <img *ngIf="subordinate.EMPLOYEE_IMAGE" src="data:image/*;base64,{{ subordinate.EMPLOYEE_IMAGE}}"> --> <span>{{ts.trPK('attendance-tracking','schedule')}}</span>
<img <h2>{{timeCardSummaryData.SCHEDULE_DAYS}}</h2>
[src]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"> </div>
</ion-avatar> </ion-col>
<p class="boldTxt">{{subordinate.EMPLOYEE_NAME}}</p>
<p>{{subordinate.POSITION_NAME}}</p> <ion-col [size]="3">
<ion-badge slot="end">{{subordinate.NUM_OF_SUBORDINATES}}</ion-badge> <div class="attendance-information">
</ion-item> <span>{{ts.trPK('attendance-tracking','off-days')}}</span>
</ion-list> <h2>{{timeCardSummaryData.OFF_DAYS}}</h2>
</div>
<ion-infinite-scroll threshold="100px" (ionInfinite)="doInfinite($event)"> </ion-col>
<ion-infinite-scroll-content
loadingSpinner="bubbles" <ion-col [size]="3">
loadingText="Loading more data..."> <div class="attendance-information">
</ion-infinite-scroll-content> <span>{{ts.trPK('attendance-tracking','non-analyzed')}}</span>
</ion-infinite-scroll> <h2>{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}</h2>
</div>
</ion-col>
<ion-col [size]="3">
<div class="attendance-information">
<span>{{ts.trPK('attendance-tracking','shortage-hours')}}</span>
<h2>{{timeCardSummaryData.SHORTAGE_HRS}}</h2>
</div>
</ion-col>
</ion-row>
<div *ngIf="showData" class="calendar-container">
<span> {{ts.trPK('attendance','monthly-attendance-calendar')}}</span>
<app-circle-calendar
[eventsdateAttend]='arrDaysAttendance'
[eventsdateAbsent]='arrDaysAbsent'
[eventsdateDayOff]='arrDaysOff'
[currentDateParent]="currentDate"
[dayHoursTypeDetailsList]="dayHoursTypeDetailsList"
[normalDays]="normalDays"
(monthTitle)='changeMonthTitle($event)'
(currentYear)=changeYear($event)>
</app-circle-calendar>
</div>
</div> </div>
</ion-content>
<div *ngIf="activeSegment === 'Team Members'">
<div style="margin-top: 15px;background: white;border-radius: 100px;overflow: hidden;">
<ion-row no-padding>
<ion-col [size]="3" class="search-dropdown" no-padding>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)">
<ion-select-option value="Name" selected="true">{{ts.trPK('searchForReplacment','name')}}</ion-select-option>
<ion-select-option value="User Name">{{ts.trPK('searchForReplacment','userName')}} </ion-select-option>
<ion-select-option value="Email">{{ts.trPK('searchForReplacment','email')}} </ion-select-option>
</ion-select>
</ion-col>
<ion-col [size]="7" class="input-container" no-padding>
<ion-input *ngIf="showEmailInput" placeholder="Employee Email" [(ngModel)]="searchEmail" pattern="email"></ion-input>
<ion-input *ngIf="showUserNameOrNameInput" placeholder="Search" [(ngModel)]="searchNameOrUserName"></ion-input>
</ion-col>
<ion-col [size]="2" style="background: #ccc;text-align: center;" no-padding (click)="searchEmployeeTwo()">
<ion-icon style="margin-top: 10px;font-size: 20px;" class="search-icons" color="light" name="search"></ion-icon>
</ion-col>
</ion-row>
</div>
<div *ngIf="isSearch">
<ion-row class="search-container">
<ion-col style="float: left;" size=[6] (click)="clearSearchTwo()">
<span style="margin-left: 5px;">Clear Search</span>
<ion-icon name="close" ></ion-icon>
</ion-col>
</ion-row>
</div>
<ng-container *ngFor="let subordinate of empSubordinate;let i=index">
<app-employee-information
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(click)="getDetails(i)">
</app-employee-information>
</ng-container>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</div>
<div class="employee-information-indetail" *ngIf="activeSegment === 'About'">
<ion-row>
<ion-col [size]="6" style="border-right: 1px solid #ccc;">
<h2>Employee ID</h2>
<p>{{employee.EMPLOYEE_NUMBER}}</p>
</ion-col>
<ion-col [size]="6">
<h2>Category</h2>
<p>{{employee.EMPLOYMENT_CATEGORY_MEANING}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Address</h2>
<p>{{employee.LOCATION_NAME}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Phone Number</h2>
<p>{{employee.EMPLOYEE_MOBILE_NUMBER}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Business Group</h2>
<p>{{employee.ORGANIZATION_NAME}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Job</h2>
<p>{{employee.JOB_NAME}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Payroll</h2>
<p>{{employee.PAYROLL_NAME}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Organization Email Address</h2>
<p>{{employee.EMPLOYEE_EMAIL_ADDRESS}}</p>
</ion-col>
<ion-col [size]="12">
<h2>Position</h2>
<p>{{employee.POSITION_NAME}}</p>
</ion-col>
<ion-col [size]="12" style="border-bottom: none;">
<h2>Grade</h2>
<p>{{employee.GRADE_NAME}}</p>
</ion-col>
</ion-row>
</div>
</div>
</ion-content>

@ -1 +1,415 @@
.search-icons{font-size:.7cm} ion-content {
--ion-background-color: whitesmoke;
}
ion-title{
color: white;
position: absolute;
top: 0;
text-align: center;
left: 15%;
right: 15%;
font-size: 0.42cm;
font-weight: bold;
height: 100%;
}
.contentBg{
padding: 0px 20px;
}
.contentBg:before {
position: absolute;
content: "";
background: #22c6b3;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
.user-info{
text-align: center;
margin-bottom: 15px;
.user-image-container{
position: relative;
width: 80px;
height: 80px;
display: block;
margin: 0 auto;
// &:before{
// position: absolute;
// content: "";
// width: 20px;
// height: 20px;
// border-radius: 20px;
// border: 1px solid white;
// top: 0;
// right: 0;
// background-color: red;
// z-index: 9;
// }
// &.present:before{
// background-color: green !important;
// }
}
.user-image{
overflow: hidden;
position: relative;
display: block;
width: 100%;
height: 100%;
border-radius: 80px;
border: 1px solid #ccc;
margin: 0px auto 6px;
}
h1{
margin: 0;
padding: 0;
font-family: WorkSans-Bold;
font-size: 18px;
margin-bottom: 4px;
}
span{
font-size: 14px;
display: block;
color: #888
}
}
$actionBtnSize : 36px;
.user-actions{
text-align: center;
.action-button{
font-size: 11px;
white-space: nowrap;
color: #888;
.action-button-icon{
width: $actionBtnSize;
height: $actionBtnSize;
border-radius: $actionBtnSize;
margin: 0 auto;
display: block;
background-color: #22c6b3;
line-height: $actionBtnSize;
margin-bottom: 3px;
img{
margin: 0 auto;
vertical-align: middle;
}
}
}
}
.employee-information-indetail{
background: white;
margin-top: 15px;
border-radius: 20px;
margin-bottom: 15px;
ion-col{
padding: 15px;
border-bottom: 1px solid #ccc;
}
h2{
font-size: 13px;
font-family: WorkSans-Bold;
margin: 0;
}
p{
font-size: 13px;
margin: 0;
}
}
.segments-container {
border-radius: 100px;
overflow: hidden;
margin-top: 15px;
background: white;
color: black;
}
.active-Segment {
font-size: 0.3cm !important;
background: #22c6b3 !important;
text-transform: none;
--color-checked: none;
border-radius: 100px;
border:0;
}
.active-Segment ion-label{
font-size: 11px;
color: white !important;
}
.normal-Segment ion-label{
color: black !important;
font-size: 11px;
}
.normal-Segment {
font-size: 0.3cm !important;
text-transform: none;
--color-checked: none;
border: 0;
}
.colum-container{
padding: 15px;
border-bottom: 1px solid #ccc;
}
///////////////////////// Team Members css //////////////////////@extend
.filters-row {
margin-top: 10px;
}
.search-dropdown{
background: #22c6b3;
ion-select {
.select-text{
margin-left: -10px;
}
.select-icon{
.select-icon-inner{
opacity: 1;
color: white;
margin-top: -1px;
}
}
}
}
.input-container{
background: white;
ion-input{
border-bottom-color: transparent;
}
}
.search-container{
margin-top: 15px;
ion-col{
background: white;
border-radius: 12px;
padding-right: 10px;
flex: none;
ion-icon{
margin-right: 3px;
font-size: 14px;
margin-left: 3px;
vertical-align: middle;
}
span{
font-size: 12px;
vertical-align: middle;
}
}
}
/////////////////////////////////////////////////////// Attendance ///////////////////////
.header{
margin-top: 20px;
}
.slidPrev{
margin-left: 10px;
background: transparent;
}
.slidNext{
background: transparent;
margin-top: -1px;
margin-left: 43px;
}
.activeArrow{
height: 20px;
width: 20px;
color: #22c6b3;
}
.disabledArrow{
height: 20px;
width: 20px;
color: gray;
}
.result-graph {
position: relative;
background: white;
margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
margin-bottom: 10px;
}
.request-heading {
span {
text-align: left;
display: block;
padding-top: 8px;
margin-bottom: 10px;
margin-left: 10px;
}
}
.result-text-container {
padding: 0;
margin: 0;
position: absolute;
left: 50%;
top: 50%;
display: block;
text-align: center;
transform: translate(-50%, -50%);
h2 {
font-size: 38px;
font-family: WorkSans-Bold;
margin: 0 auto;
line-height: 36px;
}
span {
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
font-family: workSans-Regular;
}
}
.today-graph {
width: 100%;
max-height: 4cm;
}
.green-label{
font-size: 12px;
margin-top: -13px;
}
.green-amount{
font-size: 17px;
font-family: WorkSans-Bold;
margin-top: -3px;
}
.blue-label{
font-size: 12px;
margin-top: -13px;
}
.blue-amount{
font-size: 17px;
font-family: WorkSans-Bold;
margin-top: -4px;
}
.labelGrid{
background-color: white !important;
border-radius: 20px !important;
height: 88px !important;
border: 1px solid #d6d4d4;
position: relative;
padding: 10px;
label {
font-size: 9px;
line-height: 11px !important;
display: block;
}
h2 {
font-size: 25px;
font-weight: bold;
display: block;
text-align: right;
margin:0;
position: absolute;
bottom: 0;
left:0;
width: 100%;
padding: 10px;
}
}
.bodyGrid{
margin-top: 7px !important;
margin-left: 15px !important;
margin-right: 15px !important;
background-color: white !important;
border-radius: 20px !important;
height: 321px !important;
border: 1px solid #d6d4d4 !important;
}
.attendance-information{
background: white;
border-radius: 20px;
padding: 10px;
h2{
padding: 0;
margin: 0;
font-size: 22px;
}
span{
font-size: 11px;
}
}
.month-year-span{
font-size: 20px;
font-family: WorkSans-Bold;
}
.green-label-container{
border-top: 5px solid #22c6b3;
padding: 1px 0px;
margin: 15px 0px
}
.blue-label-container{
border-top: 5px solid #094875;
padding: 1px 0px;
margin: 15px 0px
}
.span-one{
display: block;
font-size: 12px;
color: black;
}
.span-two{
display: block;
font-size: 22px;
font-family: WorkSans-Bold;
}
.graph-container{
margin-left: -50px;
position: relative;
margin-right: 50px;
}
.label-container{
position: absolute;
width: 20%;
right: 30px;
top: 50%;
margin-top: -60px;
}
.attendance-summary .attendance-information {
span{
height: 32px;
display: block;
line-height: 14px;
}
h2{
text-align: right;
font-family: WorkSans-Bold;
}
}
.calendar-container{
background: white;
margin-bottom: 100px;
margin-top: 20px;
border-radius: 20px;
span{
text-align: left;
display: block;
padding-top: 8px;
margin-bottom: 10px;
margin-left: 10px;
}
}

@ -1,36 +1,94 @@
import { Component, OnInit,ViewChild } from "@angular/core"; import { Component, OnInit, ViewChild } from '@angular/core';
import { Location } from "@angular/common"; import { Location } from '@angular/common';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { MyTeamService } from "../service/my-team.service"; import { MyTeamService } from '../service/my-team.service';
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
import { ModalController } from "@ionic/angular"; import { ModalController } from '@ionic/angular';
import { IonInfiniteScroll } from '@ionic/angular'; import { IonInfiniteScroll } from '@ionic/angular';
import * as moment from 'moment';
import { TimeCardService } from 'src/app/time-card/service/time-card.service';
import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request';
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response';
@Component({ @Component({
selector: "app-details", selector: 'app-details',
templateUrl: "./details.component.html", templateUrl: './details.component.html',
styleUrls: ["./details.component.scss"] styleUrls: ['./details.component.scss']
}) })
export class DetailsComponent implements OnInit { export class DetailsComponent implements OnInit {
public static opendEmployeesARR='opend_employees_arr'; public static opendEmployeesARR = 'opend_employees_arr';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
pageNum: number = 1; public activeSegment = 'Attendance';
pageLimit: number = 50; pageNum = 1;
modalFlag: any = false; pageLimit = 50;
empSubordinate: any; empSubordinate: any;
employee: any; employee: any;
IsReachEnd: boolean = false; isReachEnd = false;
searchKey: any; searchKey: any;
public searchKeySelect: any; public isSearch = false;
public searchKeySelect = 'Name';
public getEmployeeSubordinatesRequestObject: any;
infiniteRequest: any; infiniteRequest: any;
isSpecialist: boolean = false; isSpecialist = false;
selMenu: MenuResponse = new MenuResponse(); selMenu: MenuResponse = new MenuResponse();
public opendEmployees :any=[]; public opendEmployees: any = [];
public headerTitle: string = ""; public headerTitle = '';
public userImage: any = '../assets/imgs/profile.png';
public menuType: any;
public selEmp: string;
public dateFrom: any = new Date();
public dateTo: any = new Date();
public respID: number;
public timeCardSummaryData: any = [];
public dayHoursData: any = [];
public selectedShift: any;
public dayAndHoursPageNumber = 1;
public monthName: any;
public yearDate: any;
public absentDays: number;
public attendedDays: number;
public futrueDays = 0;
public totalAttendancePrecentage = 0;
public arrDaysAttendance: any = [];
public arrDaysAbsent: any = [];
public arrDaysOff: any = [];
public normalDays: any = [];
public monthTitle: string = moment().format('MMMM');
public yearTitle: string;
public activeMonth: any;
public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
public showData = false;
public currentYear = new Date().getFullYear();
public attendanceTrackingList: any = [];
public currentDate = new Date();
public dayHoursTypeDetailsList = [];
month: any;
year: any;
preMonth: number;
nextMonth: any;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
public data = {};
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
public searchEmail = '';
public showEmailInput = false;
public showUserNameOrNameInput = true;
constructor( constructor(
public timeCardService: TimeCardService,
public menuService: MenuService, public menuService: MenuService,
public common: CommonService, public common: CommonService,
public myTeamService: MyTeamService, public myTeamService: MyTeamService,
@ -38,58 +96,281 @@ export class DetailsComponent implements OnInit {
public modalController: ModalController, public modalController: ModalController,
private location: Location, private location: Location,
public authService: AuthenticationService, public authService: AuthenticationService,
) { public dashboardService: DashboredService,
console.log("Constuctor called"); ) { }
}
ngOnInit() { ngOnInit() {
this.intializeMemberDetail(); this.intializeMemberDetail();
this.showAttendanceTracking();
}
showAttendanceTracking() {
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
};
this.dashboardService.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => {
if (this.common.validResponse(result)) {
const key = 'GetAttendanceTrackingList';
this.attendanceTrackingList = result[key];
}
});
}
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if (this.activeSegment === 'Attendance') {
this.normalDays = [];
this.initAttendance();
}
}
initAttendance() {
this.data = {};
this.currentMonthName = this.getMonthName(new Date().getMonth() + 1);
this.currentYear = new Date().getFullYear();
this.currentDate = new Date();
this.showData = false;
this.nextMonth = new Date().getMonth() + 2;
this.preMonth = new Date().getMonth() - 2;
if (this.preMonth < 0) {
this.preMonth = this.preMonth * - 1;
} else {
this.preMonth = this.preMonth * - 1;
}
this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear());
}
calendarConfig(month?, year?) {
this.arrDaysOff = [];
this.arrDaysAttendance = [];
this.arrDaysAbsent = [];
this.month = month;
this.year = year;
this.getTimeCardSummaryDetails(month, year);
this.getDayHoursTypeDetails(month, year);
}
public getDayHoursTypeDetails(month?, year?) {
console.log('getDayHoursTypeDetails');
const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
this.monthName = month;
this.yearDate = year;
this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER;
dayAndHoursReqObj.P_MENU_TYPE = 'M';
dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID;
dayAndHoursReqObj.SearchMonth = this.monthName;
dayAndHoursReqObj.SearchYear = this.yearDate;
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
if (this.common.validResponse(result)) {
console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
}
});
}
nextSlide() {
this.normalDays = [];
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
this.currentYear = this.currentYear + 1;
this.nextMonth = 1;
}
this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1);
this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
this.nextMonth = this.nextMonth + 1;
this.preMonth = this.nextMonth - 2;
}
}
previousSlide() {
this.normalDays = [];
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
this.preMonth = 12;
}
this.currentDate = new Date(this.currentYear, (this.preMonth - 1), 1);
console.log(this.currentDate);
this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
this.preMonth = this.preMonth - 1;
this.nextMonth = this.preMonth + 2;
}
changeMonthTitle(title) {
this.monthTitle = title;
this.getTimeCardSummaryDetails();
}
changeYear(year) {
this.yearTitle = year;
}
countAllAttendDays(allDays) {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < allDays.length; i++) {
// tslint:disable-next-line: triple-equals
if (allDays[i].ATTENDED_FLAG == 'Y') {
allDays[i].present = true;
allDays[i].absent = false;
allDays[i].daysOff = false;
allDays[i].schedule = false;
this.arrDaysAttendance.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
// tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
allDays[i].present = false;
allDays[i].absent = true;
allDays[i].daysOff = false;
allDays[i].schedule = false;
this.arrDaysAbsent.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE),
isoTime: '09:00:00',
allDay: false
});
// tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
allDays[i].present = false;
allDays[i].absent = false;
allDays[i].daysOff = true;
allDays[i].schedule = false;
this.arrDaysOff.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} else {
allDays[i].present = false;
allDays[i].absent = false;
allDays[i].daysOff = false;
allDays[i].schedule = true;
this.normalDays.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
}
}
this.showData = true;
}
public getTimeCardSummaryDetails(month?, year?) {
const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
this.monthName = month;
this.yearDate = year;
this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER;
timeCardSummaryReqObj.P_MENU_TYPE = 'M';
timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID;
timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate;
this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
if (this.common.validResponse(result)) {
this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
// this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
// if (this.absentDays === 0 && this.attendedDays === 0) {
// this.futrueDays = this.totalAttendancePrecentage;
// }
this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) {
this.data = {
datasets: [
{
data: [this.absentDays, this.attendedDays],
backgroundColor: [
'#094875',
'#22c6b3'
],
borderWidth: 2
}]
};
}
}
});
} }
intializeMemberDetail(userID?){ public getMonthName(value: any): any {
switch (value) {
case 1:
return 'January';
case 2:
return 'February';
case 3:
return 'March';
case 4:
return 'April';
case 5:
return 'May';
case 6:
return 'June';
case 7:
return 'July';
case 8:
return 'August';
case 9 :
return 'September';
case 10:
return 'October';
case 11:
return 'November';
case 12:
return 'December';
}
}
intializeMemberDetail(userID?) {
this.empSubordinate = [];
this.activeSegment = 'About';
this.pageLimit = 50; this.pageLimit = 50;
this.pageNum = 1; this.pageNum = 1;
this.employee = this.common.sharedService.getSharedData( this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
MyTeamService.EMPLOYEE_SHARED_DATA, const employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false);
false if ( employees ) {
);
let employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false);
if( employees ){
this.opendEmployees.push(this.employee); this.opendEmployees.push(this.employee);
this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR); this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR);
} }
//this.opendEmployees = employees; this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
console.log(this.employee); this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false;
this.selMenu = this.common.sharedService.getSharedData( if (this.employee) {
MenuResponse.SHARED_DATA, this.getEmpSubordinate(userID);
false }
);
this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
this.isSpecialist = this.common.sharedService.getSharedData(
'isSpecialist',
false
) ? true :false;
// this.isSpecialist = this.navParams.get("isSpecialist")
// ? this.navParams.get("isSpecialist")
// : false;
if (this.employee) this.getEmpSubordinate(userID);
} }
goback() { goback() {
//this.location.back();
const user = this.authService.getAuthenticatedUser(); const user = this.authService.getAuthenticatedUser();
if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){ if (this.employee.SUPERVISOR_NUMBER === user.EMPLOYEE_NUMBER || this.opendEmployees.length === 1) {
this.opendEmployees=[]; this.opendEmployees = [];
this.common.openMyTeamPage(); this.common.openMyTeamPage();
}else{ } else {
for(let i=0;i<this.opendEmployees.length;i++){ // tslint:disable-next-line: prefer-for-of
if(this.opendEmployees[i].EMPLOYEE_NUMBER==this.employee.SUPERVISOR_NUMBER){ for (let i = 0; i < this.opendEmployees.length; i++) {
if (this.opendEmployees[i].EMPLOYEE_NUMBER === this.employee.SUPERVISOR_NUMBER) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.opendEmployees[i], this.opendEmployees[i],
MyTeamService.EMPLOYEE_SHARED_DATA MyTeamService.EMPLOYEE_SHARED_DATA
@ -100,50 +381,33 @@ export class DetailsComponent implements OnInit {
this.intializeMemberDetail(this.employee.SUPERVISOR_NUMBER); this.intializeMemberDetail(this.employee.SUPERVISOR_NUMBER);
} }
} }
searchEmployeeTwo() {
this.isSearch = true;
this.empSubordinate = [];
this.getEmpSubordinate('');
}
clearSearchTwo() {
this.isSearch = false;
this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
this.empSubordinate = [];
this.isReachEnd = false;
this.searchNameOrUserName = '';
this.searchEmail = '';
this.getEmpSubordinate('');
}
getEmpSubordinate(userID) { getEmpSubordinate(userID) {
this.modalFlag = this.employee.isModal;
let selEmpNo: string = null; let selEmpNo: string = null;
this.pageNum = 1; this.pageNum = 1;
this.IsReachEnd = false; this.isReachEnd = false;
let searchEmpNum = ""; const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchNameOrUserName : '';
let searchEmpName = ""; const searchEmpName = (this.searchKeySelect === 'Name') ? this.searchNameOrUserName : '';
let searchEmpEmail = ""; const searchEmpEmail = (this.searchKeySelect === 'Email') ? this.searchEmail : '';
if (this.searchKey) { if (userID) {
switch (this.searchKeySelect) { selEmpNo = userID;
case "1": {
searchEmpName = this.searchKey;
searchEmpNum = "";
searchEmpEmail = "";
break;
}
case "2": {
searchEmpNum = this.searchKey;
searchEmpName = "";
searchEmpEmail = "";
break;
}
case "3": {
searchEmpEmail = this.searchKey;
searchEmpNum = "";
searchEmpName = "";
break;
}
default: {
searchEmpNum = "";
searchEmpName = "";
searchEmpEmail = "";
break;
}
}
} else { } else {
searchEmpNum = "";
searchEmpName = "";
searchEmpEmail = "";
}
if(userID){
selEmpNo=userID;
}else{
selEmpNo = this.employee.EMPLOYEE_NUMBER; selEmpNo = this.employee.EMPLOYEE_NUMBER;
} }
const body = { const body = {
@ -154,118 +418,84 @@ export class DetailsComponent implements OnInit {
P_PAGE_NUM: this.pageNum, P_PAGE_NUM: this.pageNum,
P_PAGE_LIMIT: this.pageLimit P_PAGE_LIMIT: this.pageLimit
}; };
this.infiniteRequest = body; this.getEmployeeSubordinatesRequestObject = body;
this.myTeamService this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
.getEmployeeSubordinates(body) console.log('one');
.subscribe((result: any) => { if (this.common.validResponse(result)) {
this.handleEmpResult(result); this.handleEmpResult(result.GetEmployeeSubordinatesList);
}); }
});
} }
handleEmpResult(result) { handleEmpResult(result) {
//let employeeSubordinate=resFlag.GetEmployeeSubordinatesList; const lastItemIndex = result.length - 1;
//this.nav.push("MyTeamPage",{empSubordinate:employeeSubordinate}); const lastItem = result[lastItemIndex];
if (this.common.validResponse(result)) { if (lastItem) {
if (this.common.hasData(result.GetEmployeeSubordinatesList)) { if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) {
this.empSubordinate = result.GetEmployeeSubordinatesList; this.isReachEnd = true;
// this.pageNum++; if (this.infiniteScroll) {
this.infiniteRequest.P_PAGE_NUM= this.pageNum++; this.infiniteScroll.complete();
let lastItemIndex = this.empSubordinate.length - 1;
if (result.GetEmployeeSubordinatesList[lastItemIndex]) {
let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
} }
} else { } else {
this.empSubordinate = []; this.isReachEnd = false;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
} }
} }
} if (this.common.hasData(result)) {
doInfinite(infiniteScroll) { this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++;
if (!this.IsReachEnd && this.infiniteRequest) { if (this.empSubordinate.length === 0) {
// this.infiniteRequest.P_PAGE_NUM = this.pageNum; this.empSubordinate = result;
this.myTeamService } else {
.getEmployeeSubordinates(this.infiniteRequest) this.empSubordinate = this.empSubordinate.concat(result);
.subscribe( }
(result: any) => {
if (this.common.validResponse(result)) {
this.infiniteRequest.P_PAGE_NUM= this.pageNum++;
if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.empSubordinate.push(vr);
// this.pro.GetVacationRulesList.push(vr);
});
} else {
this.IsReachEnd = true;
}
}
//this.P_PAGE_NUM++;
if (infiniteScroll) this.infiniteScroll.complete();
// console.log(resFlag);
},
Error => console.log(Error),
() => this.infiniteScroll.complete()
);
} else { } else {
if (infiniteScroll) this.infiniteScroll.complete(); this.empSubordinate = [];
}
}
doInfinite(infiniteScroll) {
if (!this.isReachEnd) {
this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
console.log('two');
if (this.common.validResponse(result)) {
this.handleEmpResult(result.GetEmployeeSubordinatesList);
}
this.infiniteScroll.complete();
});
} else {
if (this.infiniteScroll) {
this.infiniteScroll.complete();
} }
} }
}
getDetails(index) { getDetails(index) {
//this.empSubordinate[index].isModal = true; this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
this.common.sharedService.setSharedData(
this.empSubordinate[index],
MyTeamService.EMPLOYEE_SHARED_DATA
);
this.intializeMemberDetail(); this.intializeMemberDetail();
// this.presentModal();
}
async presentModal() {
//this.modalFlag = true;
const modal = await this.modalController.create({
component: DetailsComponent,
keyboardClose: true,
animated: false
});
let dismissed = modal.onDidDismiss();
dismissed.then(() => {
this.modalFlag = false;
});
return await modal.present();
} }
getMenuEntries(item) { getMenuEntries(item) {
let selEmpNo: String = null; let selEmpNo = null;
let respID: any = -999; const respID: any = -999;
let menuType: string = "M"; let menuType = 'M';
let nationality: string; let nationality: string;
if (this.isSpecialist == true) { if (this.isSpecialist === true) {
// respID = this.sharedData.getSharedData( menuType = 'S';
// MenuResponse.SHARED_SEL_RESP_ID,
// true
// );
menuType = "S";
} }
selEmpNo = item.EMPLOYEE_NUMBER; selEmpNo = item.EMPLOYEE_NUMBER;
nationality = item.NATIONALITY_CODE; nationality = item.NATIONALITY_CODE;
const body = { const body = {
P_MENU_TYPE: menuType, //to check P_MENU_TYPE: menuType, // to check
P_SELECTED_EMPLOYEE_NUMBER: selEmpNo, P_SELECTED_EMPLOYEE_NUMBER: selEmpNo,
P_SELECTED_RESP_ID: respID, P_SELECTED_RESP_ID: respID,
NationalityCode: nationality NationalityCode: nationality
}; };
//set emp and resp id // set emp and resp id
this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP); this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP);
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
body.P_SELECTED_RESP_ID, body.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID MenuResponse.SHARED_SEL_RESP_ID
); );
@ -283,35 +513,29 @@ export class DetailsComponent implements OnInit {
} }
sortMenuEntires(list) { sortMenuEntires(list) {
this.close().then(() => { const tree = this.common.list_to_tree(list);
}); this.common.sharedService.setSharedData(tree, 'menuEntries');
let tree = this.common.list_to_tree(list); this.common.sharedService.setSharedData("myteam", "homemenuentries");
this.common.sharedService.setSharedData(tree, "menuEntries");
// this.common.navigateForward("/eit/homepage");
this.common.openEITPage(); this.common.openEITPage();
// let tree = this.common.list_to_tree(list);
// this.navCtrl.push("MenuEntriesPage", { menuEntries: tree });
} }
public async close() {
const modal = await this.modalController.getTop();
if (modal) {
modal.dismiss();
}
}
goToSubordinate() { goToSubordinate() {
this.selMenu.search=true; this.selMenu.search = true;
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.selMenu, this.selMenu,
MenuResponse.SHARED_DATA MenuResponse.SHARED_DATA
); );
this.common.openMyTeamPage(); this.common.openMyTeamPage();
//this.navCtrl.push("MySubordinatePage", { isSearch: true });
} }
dismiss() {
this.modalController.dismiss({ showSelectedField(value: any) {
dismissed: true if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') {
}); this.showEmailInput = false;
this.showUserNameOrNameInput = true;
} else if (this.searchKeySelect === 'Email') {
this.showUserNameOrNameInput = false;
this.showEmailInput = true;
}
} }
} }

@ -1,76 +1,82 @@
<!-- <ion-header>
<ion-toolbar class="header-toolbar">
<div slot="start">
<nav-buttons></nav-buttons>
<ion-title color="light">{{headerTitle}}</ion-title>
</div>
<ion-buttons slot="end">
<ion-button style="background: none !important;" *ngIf="!isSearch" (click)="goToSubordinate()">
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header> -->
<ion-header> <ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/home" *ngIf="!isSearch"></nav-buttons> <nav-buttons backLink="/home"></nav-buttons>
<ion-icon class="search-icons" color="light" name="arrow-back" *ngIf="isSearch" (click)="dismiss()"></ion-icon> </ion-buttons>
</ion-buttons> <ion-title>{{ts.trPK('myTeam','myTeam-header')}}</ion-title>
<ion-title color="light" >{{headerTitle}}</ion-title>
<ion-buttons slot="end">
<button ion-button icon-only class="btnBack" *ngIf="!isSearch" (click)="goToSubordinate();">
<ion-icon class="search-icons" color="light" name="search"></ion-icon>
</button>
</ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header>
<ion-content>
<div class="contentBg">
<div class="result-graph">
<div class="request-heading">
<span>{{ts.trPK('myTeam','todayAttendance')}}</span>
</div>
<div class="result-text-container">
<h2>{{totalEmployees}}</h2>
<span>{{ts.trPK('myTeam','total')}} <br> {{ts.trPK('myTeam','team-members')}}</span>
</div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<!-- <ion-row class="filters-row">
<ion-slides [options]="slideOptsOne">
<ion-slide *ngFor="let filter of filters; let i=index">
<app-card-filter
[value]="filter.value"
[text]="filter.name"
[color]="filter.color"
[active]="filter.active"
(click)="activeFilter(i)"
></app-card-filter>
</ion-slide>
</ion-slides>
</ion-row> -->
</ion-header> <div style="margin-top: 15px;background: white;border-radius: 100px;overflow: hidden;">
<ion-content padding> <ion-row no-padding>
<ion-list *ngIf="isSearch"> <ion-col [size]="3" class="search-dropdown" no-padding>
<ion-item>
<ion-label>{{ts.trPK('general','search')}} </ion-label>
<ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}" <ion-select okText="{{ts.trPK('general','ok')}}" cancelText="{{ts.trPK('general','cancel')}}"
[(ngModel)]="searchKeySelect"> [(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)">
<ion-select-option value="1" selected="true" selected>{{ts.trPK('searchForReplacment','name')}}</ion-select-option> <ion-select-option value="Name" selected="true">{{ts.trPK('searchForReplacment','name')}}</ion-select-option>
<ion-select-option value="2">{{ts.trPK('searchForReplacment','userName')}} </ion-select-option> <ion-select-option value="User Name">{{ts.trPK('searchForReplacment','userName')}} </ion-select-option>
<ion-select-option value="3">{{ts.trPK('searchForReplacment','email')}} </ion-select-option> <ion-select-option value="Email">{{ts.trPK('searchForReplacment','email')}} </ion-select-option>
</ion-select> </ion-select>
</ion-item> </ion-col>
<ion-item> <ion-col [size]="7" class="input-container" no-padding>
<ion-input [(ngModel)]="searchKey" placeholder="{{ts.trPK('general','enter')}}"></ion-input> <ion-input *ngIf="showEmailInput" placeholder="Employee Email" [(ngModel)]="searchEmail" pattern="email"></ion-input>
</ion-item> <ion-input *ngIf="showUserNameOrNameInput" placeholder="Search" [(ngModel)]="searchNameOrUserName"></ion-input>
</ion-list> </ion-col>
<!-- <div> --> <ion-col [size]="2" style="background: #ccc;text-align: center;" no-padding (click)="searchEmployee()">
<ion-list no-lines *ngIf="empSubordinate && empSubordinate.length>0"> <ion-icon style="margin-top: 10px;font-size: 20px;" class="search-icons" color="light" name="search"></ion-icon>
<ion-item no-border *ngFor="let subordinate of empSubordinate;let i=index" (click)="getDetails(i);"> </ion-col>
<ion-avatar slot="start"> </ion-row>
<!-- <img *ngIf="subordinate.EMPLOYEE_IMAGE" src="data:image/*;base64,{{ subordinate.EMPLOYEE_IMAGE}}"> --> </div>
<img [src]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'">
</ion-avatar>
<p class="boldTxt">{{subordinate.EMPLOYEE_NAME}}</p>
<p>{{subordinate.POSITION_NAME}}</p>
<ion-badge slot="end" class="badge">{{subordinate.NUM_OF_SUBORDINATES}}</ion-badge>
</ion-item>
</ion-list>
<!-- </div> -->
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <div *ngIf="isSearch">
<ion-infinite-scroll-content></ion-infinite-scroll-content> <ion-row class="search-container">
</ion-infinite-scroll> --> <ion-col style="float: left;" size=[6] (click)="clearSearch()">
<span style="margin-left: 5px;">Clear Search</span>
<ion-icon name="close" ></ion-icon>
</ion-col>
</ion-row>
</div>
<ng-container *ngFor="let subordinate of empSubordinate;let i=index">
<app-employee-information
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(click)="getDetails(i)">
</app-employee-information>
</ng-container>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)"> </div>
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content> </ion-content>
<ion-footer *ngIf="isSearch">
<div class="centerDiv">
<ion-button color="customnavy" (click)="getEmpSubordinate()">{{ts.trPK('general','search')}} </ion-button>
</div>
</ion-footer>

@ -1,6 +1,163 @@
.search-icons{font-size:.7cm} ion-title{
.badge{ color: white;
padding: 10px; position: absolute;
border-radius: 50%; top: 0;
width: 50px; text-align: center;
} left: 15%;
right: 15%;
font-size: 0.42cm;
font-weight: bold;
height: 100%;
}
.contentBg{
padding: 0px 20px;
}
.contentBg:before {
position: absolute;
content: "";
background: #22c6b3;
height: 140px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
ion-content {
--ion-background-color: whitesmoke;
}
.request-heading {
span {
text-align: center;
display: block;
padding-top: 8px;
font-family: workSans-Regular;
}
}
.result-graph {
position: relative;
background: white;
margin-top: 20px;
padding-bottom: 20px;
border-radius: 20px;
z-index: 1;
}
.result-text-container {
padding: 0;
margin: 0;
position: absolute;
left: 50%;
top: 50%;
display: block;
text-align: center;
transform: translate(-50%, -50%);
h2 {
font-size: 38px;
font-family: WorkSans-Bold;
margin: 0 auto;
line-height: 36px;
}
span {
width: 125px;
display: block;
margin: 0 auto;
font-size: 12px;
font-family: workSans-Regular;
}
}
.today-graph {
width: 100%;
max-height: 4cm;
}
.swiper-container {
margin: 0 !important;
width: 100% !important;
}
.filters-row {
margin-top: 10px;
}
.search-input {
margin-top: 15px;
background: white;
border-radius: 15px;
ion-input {
border-bottom-color: transparent;
}
}
.search-dropdown{
background: #22c6b3;
ion-select {
.select-text{
margin-left: -10px;
}
.select-icon{
.select-icon-inner{
opacity: 1;
color: white;
margin-top: -1px;
}
}
}
}
.input-container{
background: white;
ion-input{
border-bottom-color: transparent;
}
}
.user-image-container{
position: relative;
width: 80px;
height: 80px;
display: block;
margin: 0 auto;
&:before{
position: absolute;
content: "";
width: 20px;
height: 20px;
border-radius: 20px;
border: 1px solid white;
top: 0;
right: 0;
background-color: red;
z-index: 9;
}
&.present:before{
background-color: green !important;
}
}
.user-image{
overflow: hidden;
position: relative;
display: block;
width: 100%;
height: 100%;
border-radius: 80px;
border: 1px solid #ccc;
margin: 0px auto 6px;
}
.search-container{
margin-top: 15px;
ion-col{
background: white;
border-radius: 12px;
padding-right: 10px;
flex: none;
ion-icon{
margin-right: 3px;
font-size: 14px;
margin-left: 3px;
vertical-align: middle;
}
span{
font-size: 12px;
vertical-align: middle;
}
}
}

@ -1,32 +1,87 @@
import { Component, OnInit, ViewChild } from "@angular/core"; import { Component, OnInit, ViewChild } from '@angular/core';
import { Location } from "@angular/common"; import { Location } from '@angular/common';
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { MyTeamService } from "../service/my-team.service"; import { MyTeamService } from '../service/my-team.service';
import { ModalController, IonInfiniteScroll } from "@ionic/angular"; import { ModalController, IonInfiniteScroll } from '@ionic/angular';
import { DetailsComponent } from '../details/details.component'; import { DetailsComponent } from '../details/details.component';
@Component({ @Component({
selector: "app-home", selector: 'app-home',
templateUrl: "./home.component.html", templateUrl: './home.component.html',
styleUrls: ["./home.component.scss"] styleUrls: ['./home.component.scss']
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
pageNum: number = 1; public pageNum = 1;
pageLimit: number = 50; public pageLimit = 50;
empSubordinate: any; public empSubordinate = [];
employee: any; public employee: any;
public headerTitle: string = ""; public isReachEnd = false;
IsReachEnd: boolean = false; public searchKey: any;
searchKey: any; public isSearch = false;
public isSearch: boolean = false; public searchKeySelect = 'Name';
public searchKeySelect: any; public getEmployeeSubordinatesRequestObject: any;
infiniteRequest: any; public selMenu: any;
selMenu: any; public selEmpNo: any;
selEmpNo: any; public totalEmployees = 0;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
public data = {
datasets: [
{
data: [100],
backgroundColor: [
'#22c6b3'
],
borderWidth: 5
}]
};
// public filters = [
// {
// value: 0,
// name: 'All',
// active: true,
// color: '#124375'
// },
// {
// value: 0,
// name: 'Present',
// active: false,
// color: '#18a169'
// },
// {
// value: 0,
// name: 'Absent',
// active: false,
// color: '#38c9b3'
// },
// {
// value: 0,
// name: 'Late',
// active: false,
// color: '#114475'
// }
// ];
public slideOptsOne = {
slidesPerView: 4,
spaceBetween: 10
};
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
public searchEmail = '';
public showEmailInput = false;
public showUserNameOrNameInput = true;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
public authService: AuthenticationService, public authService: AuthenticationService,
@ -40,63 +95,44 @@ export class HomeComponent implements OnInit {
this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR); this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR);
this.setIntitial(); this.setIntitial();
} }
// activeFilter(index: number) {
// this.previousActiveIndex = this.currentActiveIndex;
// this.currentActiveIndex = index;
// this.filters[this.previousActiveIndex].active = false;
// this.filters[this.currentActiveIndex].active = true;
// }
goback() { goback() {
this.location.back(); this.location.back();
} }
getData() {}
setIntitial() { setIntitial() {
this.selMenu = this.common.sharedService.getSharedData( this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
MenuResponse.SHARED_DATA,
false
);
this.headerTitle = this.selMenu.List_Menu.MENU_NAME;
this.selEmpNo = this.selMenu.userid; this.selEmpNo = this.selMenu.userid;
this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch; this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch;
// this.isSearch=this.navParams.get("isSearch")?this.navParams.get("isSearch") : false; if (!this.isSearch) {
if (!this.isSearch) this.getEmpSubordinate(); this.getEmpSubordinate();
}
}
searchEmployee() {
this.isSearch = true;
this.empSubordinate = [];
this.getEmpSubordinate();
} }
getEmpSubordinate() { getEmpSubordinate() {
console.log("getEmpSubordinate my team home");
this.pageNum = 1; this.pageNum = 1;
this.IsReachEnd = false; this.isReachEnd = false;
let searchEmpNum = ""; const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchNameOrUserName : '';
let searchEmpName = ""; const searchEmpName = (this.searchKeySelect === 'Name') ? this.searchNameOrUserName : '';
let searchEmpEmail = ""; const searchEmpEmail = (this.searchKeySelect === 'Email') ? this.searchEmail : '';
if (this.searchKey) {
switch (this.searchKeySelect) {
case "1": {
searchEmpName = this.searchKey;
searchEmpNum = "";
searchEmpEmail = "";
break;
}
case "2": {
searchEmpNum = this.searchKey;
searchEmpName = "";
searchEmpEmail = "";
break;
}
case "3": {
searchEmpEmail = this.searchKey;
searchEmpNum = "";
searchEmpName = "";
break;
}
default: {
searchEmpNum = "";
searchEmpName = "";
searchEmpEmail = "";
break;
}
}
} else {
searchEmpNum = "";
searchEmpName = "";
searchEmpEmail = "";
}
if (this.isSearch) { if (this.isSearch) {
this.selEmpNo = null; this.selEmpNo = null;
} else {
this.selEmpNo = this.selMenu.userid;
} }
const body = { const body = {
@ -107,172 +143,85 @@ export class HomeComponent implements OnInit {
P_PAGE_NUM: this.pageNum, P_PAGE_NUM: this.pageNum,
P_PAGE_LIMIT: this.pageLimit P_PAGE_LIMIT: this.pageLimit
}; };
this.infiniteRequest = body; this.getEmployeeSubordinatesRequestObject = body;
this.myTeamService this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => {
.getEmployeeSubordinates(body) if (this.common.validResponse(result)) {
.subscribe((result: any) => { this.totalEmployees = result.P_NUM_OF_SUBORDINATES;
this.handleEmpResult(result); this.handleEmpResult(result.GetEmployeeSubordinatesList);
}); }
});
} }
handleEmpResult(result) { handleEmpResult(result) {
if (this.common.validResponse(result)) { const lastItemIndex = result.length - 1;
if (this.common.hasData(result.GetEmployeeSubordinatesList)) { const lastItem = result[lastItemIndex];
if (lastItem) {
this.empSubordinate = result.GetEmployeeSubordinatesList; if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) {
this.infiniteRequest.P_PAGE_NUM++; this.isReachEnd = true;
const lastItemIndex = this.empSubordinate.length - 1; if (this.infiniteScroll) {
if (result.GetEmployeeSubordinatesList[lastItemIndex]) { this.infiniteScroll.complete();
const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
} }
} else {
this.isReachEnd = false;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
}
}
if (this.common.hasData(result)) {
this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++;
if (this.empSubordinate.length === 0) {
this.empSubordinate = result;
} else {
this.empSubordinate = this.empSubordinate.concat(result);
} }
} else { } else {
this.empSubordinate = []; this.empSubordinate = [];
} }
}
}
doInfinite1(infiniteScroll) {
console.log("test");
if (!this.IsReachEnd && this.infiniteRequest) {
console.log("not ReachEnd");
this.infiniteRequest.P_PAGE_NUM = this.pageNum;
this.myTeamService
.getEmployeeSubordinates(this.infiniteRequest)
.subscribe(
(result: any) => {
if (this.common.validResponse(result)) {
this.pageNum++;
if (this.common.hasData(result.GetEmployeeSubordinatesList)) {
result.GetEmployeeSubordinatesList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.empSubordinate.push(vr);
// this.pro.GetVacationRulesList.push(vr);
});
} else {
this.IsReachEnd = true;
}
}
//this.P_PAGE_NUM++;
if (infiniteScroll) {
infiniteScroll.complete();
}
// console.log(resFlag);
},
Error => console.log(Error),
() => infiniteScroll.complete()
);
} else {
if (infiniteScroll) {
infiniteScroll.complete();
}
}
} }
doInfinite(infiniteScroll) { doInfinite(infiniteScroll) {
//this.pageNum= this.pageNum + 1; if (!this.isReachEnd) {
console.log("test doInfinite"); this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => {
if (!this.IsReachEnd) {
console.log("test doInfinite not ReachEnd");
this.myTeamService
.getEmployeeSubordinates(this.infiniteRequest).subscribe(
(result: any) => {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
this.infiniteRequest.P_PAGE_NUM++; this.handleEmpResult(result.GetEmployeeSubordinatesList);
if (this.common.hasData(result.GetEmployeeSubordinatesList)) { }
result.GetEmployeeSubordinatesList.forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.empSubordinate.push(element);
});
} // if list length >0
else {
this.IsReachEnd = true;
}
} // if response == 1
//this.pageNum++;
this.infiniteScroll.complete(); this.infiniteScroll.complete();
} });
);
} else { } else {
if (this.infiniteScroll) if (this.infiniteScroll) {
this.infiniteScroll.complete(); this.infiniteScroll.complete();
}
} }
} //end infiniteScroll }
clearSearch() {
this.isSearch = false;
this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1;
this.empSubordinate = [];
this.isReachEnd = false;
this.searchNameOrUserName = '';
this.searchEmail = '';
this.getEmpSubordinate();
}
getDetails(index) { getDetails(index) {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA);
this.empSubordinate[index], this.common.sharedService.setSharedData(this.selMenu, MenuResponse.SHARED_DATA);
MyTeamService.EMPLOYEE_SHARED_DATA this.common.openMyTeamDetails();
);
this.common.sharedService.setSharedData(
this.selMenu,
MenuResponse.SHARED_DATA
);
this.close().then(() => {
this.common.openMyTeamDetails();
});
//this.modalController.dismiss();
//this.navCtrl.push("MyTeamPage",{employee:this.empSubordinate[index]});
}
public async close() {
const modal = await this.modalController.getTop();
if (modal) {
modal.dismiss();
}
}
toggleSearch() {
this.isSearch = !this.isSearch;
} }
goToSubordinate() { goToSubordinate() {
//this.navCtrl.push("MySubordinatePage",{isSearch:true}); // this.presentModal();
//this.getEmpSubordinate();
this.presentModal();
}
async presentModal() {
const modal = await this.modalController.create({
component: HomeComponent,
keyboardClose: true,
animated: false,
componentProps: { isSearch: true }
});
modal.cssClass="full-modal";
let dismissed = modal.onDidDismiss();
dismissed.then(() => {
this.isSearch = false;
});
return await modal.present();
} }
dismiss() {
this.modalController.dismiss({ showSelectedField(value: any) {
dismissed: true if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') {
}); this.showEmailInput = false;
this.showUserNameOrNameInput = true;
} else if (this.searchKeySelect === 'Email') {
this.showUserNameOrNameInput = false;
this.showEmailInput = true;
}
} }
} }

@ -1,18 +1,36 @@
<ion-content>
<div>
<div id="notificationDynamicFields"> <ion-header>
<ion-toolbar>
<!-- class="header-toolbar" <nav-buttons></nav-buttons> -->
<ion-title style="text-align: center;font-weight: bold;" color="dark">Confirmation</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="dynamicFields" id="notificationDynamicFieldsModal">
</div> </div>
</div> <!-- <div class="msgConfirm">
{{confirmMsg}}
</div> -->
<div class="msgConfirm">
<div *ngIf="getPassActionMode === 'APPROVED'" [innerHTML]='"worklistMain, approveMsg" | translate'></div>
<div *ngIf="getPassActionMode === 'REJECTED'" [innerHTML]='"worklistMain, rejectMsg" | translate'></div>
<div *ngIf="getPassActionMode === 'DEL'" [innerHTML]='"worklistMain, delMsg" | translate'></div>
<div *ngIf="getPassActionMode === 'CLOSE'" [innerHTML]='"worklistMain, closeMsg" | translate'></div>
</div>
<ion-footer> <ion-footer>
<ion-row style="text-align: center;"> <ion-row style="text-align: center;">
<ion-col> <ion-col size="12">
<ion-button color="customnavy" class="confirmBtn" (click)="applyAction()"> {{ts.trPK('general','confirm')}} <ion-button class="checkOutOkBtn" (click)="actionButton()"> {{ts.trPK('general','confirm')}}
</ion-button> </ion-button>
</ion-col> </ion-col>
<ion-col> <ion-col size="12">
<ion-button color="customnavy" class="cancelBtn" (click)="closeModel()"> {{ts.trPK('general','cancel')}} <ion-button class="checkOutCancelBtn" (click)="closeModel()"> {{ts.trPK('general','cancel')}}
</ion-button> </ion-button>
</ion-col> </ion-col>

@ -1 +1,14 @@
.dynamicFields{
width: 93%;
border: #dbdbdb solid 1px;
border-radius: 16px;
margin: 10px;
padding: 10px;
}
.msgConfirm{
text-align: center;
font-size: 20px !important;
// font-weight: bold;
}

@ -4,6 +4,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
import { WorklistMainService } from '../service/work-list.main.service'; import { WorklistMainService } from '../service/work-list.main.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
import { WorkListActionRequest } from '../models/NotificationActionReq';
@Component({ @Component({
selector: 'app-apply-action-modal', selector: 'app-apply-action-modal',
@ -15,51 +16,57 @@ export class ApplyActionModalComponent implements OnInit {
getpassResAttr: any; getpassResAttr: any;
getPassNotificationDetails: any; getPassNotificationDetails: any;
getPassNotification: any; getPassNotification: any;
confirmMsg: string;
getPassActionMode: any;
P_RESPOND_ATTRIBUTES_TBL: any;
selEmployeeID: any;
hideForwordEmployee: any;
private WorkListActionObj: WorkListActionRequest;
messageSuccess: boolean;
constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService, constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService,
) { ) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false); this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false);
this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr' ,false); this.getpassResAttr = this.cs.sharedService.getSharedData('notificationDynamicAttributeArr' ,false);
this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage',false); this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage',false);
this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode',false);
this.WorkListActionObj = new WorkListActionRequest();
} }
ngOnInit() { ngOnInit() {
document.getElementById("notificationDynamicFields").innerHTML=""; document.getElementById("notificationDynamicFieldsModal").innerHTML="";
console.log(this.getPassNotificationDetails); console.log(this.getPassNotificationDetails);
//this.applyAction(this.getPassNotificationDetails); //this.applyAction(this.getPassNotificationDetails);
this.notificationDynamicFields(this.getpassResAttr); this.notificationDynamicFields(this.getpassResAttr);
} console.log("confirmMsg" + this.confirmMsg)
if (this.getPassActionMode === "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
}
else if (this.getPassActionMode === "REJECTED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg')
applyAction() { }
this.worklistMainService else if (this.getPassActionMode === "DEL") {
.actionButton(this.getPassNotification) this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg')
.subscribe((result: any) => {
this.handleApplayActionResult(result); }
}); else if (this.getPassActionMode === "CLOSE") {
} this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
}
handleApplayActionResult(result) {
if (this.cs.validResponse(result)) {
if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
//this.common.openHome();
//this.common.openNotificationPage();
// for( var i = 0; i < this.notificationArray.length; i++){
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) {
// this.notificationArray.splice(i, 1);
// }
// }
////////////// this.getNotificationCountAfterSubmit();
///////////// this.nextNotfification();
}
} // valid it
} }
notificationDynamicFields(notificationAttr){ notificationDynamicFields(notificationAttr){
const containerId = 'notificationDynamicFields'; const containerId = 'notificationDynamicFieldsModal';
for(let i=0;i<notificationAttr.length;i++){ for(let i=0;i<notificationAttr.length;i++){
if(notificationAttr[i].ATTRIBUTE_TYPE=="VARCHAR2"){ if(notificationAttr[i].ATTRIBUTE_TYPE=="VARCHAR2"){
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId,"","",""); this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId,"","","");
@ -78,4 +85,80 @@ export class ApplyActionModalComponent implements OnInit {
} }
actionButton() {
let ButtonAction: string = this.getPassActionMode;
this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let i = 0; i < this.getpassResAttr.length; i++) {
let obj: any = {};
obj.ATTRIBUTE_NAME = this.getpassResAttr[i].ATTRIBUTE_NAME;
if (this.getpassResAttr[i].ATTRIBUTE_TYPE === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.getpassResAttr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
else if (this.getpassResAttr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.getpassResAttr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
let repUserName = this.selEmployeeID;
if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) {
let obj: any = {};
repUserName = "";
obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME;
obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID;
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
this.WorkListActionObj.P_COMMENTS = "";
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
this.applyAction(this.WorkListActionObj);
}
applyAction(WorkListActionObj) {
this.worklistMainService
.actionButton(WorkListActionObj)
.subscribe((result: any) => {
this.handleApplayActionResult(result);
});
}
handleApplayActionResult(result) {
if (this.cs.validResponse(result)) {
if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
//this.common.openHome();
//this.common.openNotificationPage();
// for( var i = 0; i < this.notificationArray.length; i++){
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) {
// this.notificationArray.splice(i, 1);
// }
// }
this.messageSuccess = true;
setTimeout(() => {
this.messageSuccess = false;
}, 5000);
this.cs.openNotificationPage();
// this.getNotificationCountAfterSubmit();
//this.nextNotfification();
}
} // valid it
}
} }

@ -6,17 +6,22 @@
} }
.Header{ .Header{
// color: black !important;
// font-size: 16px !important;
// font-weight: bold !important;;
// margin: 0;
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-58px, 2px);
color: black !important; color: black !important;
font-size: 16px !important; font-size: 16px !important;
font-weight: bold !important;; font-weight: bold !important;
margin: 0; margin: auto;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-58px, 2px);
} }
.labelRadio{ .labelRadio{
color: black !important; color: black !important;
font-weight: bold !important; font-weight: bold !important;
} }

@ -42,17 +42,7 @@
</div> --> </div> -->
</ion-list> </ion-list>
<div class="noteInput">
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} :
{{pQuestion}} ?</ion-label>
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}}
</ion-label>
<ion-label [hidden]="isAnswer==true" class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<ion-item [hidden]="isAnswer==true"> <ion-item [hidden]="isAnswer==true">
<!-- <ion-list *ngIf="ReplacementList"> --> <!-- <ion-list *ngIf="ReplacementList"> -->
@ -122,6 +112,19 @@
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="noteInput">
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, question" | translate}} :
{{pQuestion}} ?</ion-label>
<ion-label [hidden]="isAnswer==false" class="boldTxtNav" padding>{{"replacementRoll, answer" | translate}}
</ion-label>
<ion-label [hidden]="isAnswer==true" class="boldTxtNav" padding>{{"replacementRoll, enterNote" | translate}}
</ion-label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<br/>
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()"> <ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button> {{'general, submit' | translate}}</ion-button>

@ -116,6 +116,7 @@ button.item-button.button.button-md.button-clear.button-clear-md {
color: white; color: white;
border-radius: 9px; border-radius: 9px;
text-align: center; text-align: center;
min-height: 92px;
// background-color: #0095ff; // background-color: #0095ff;
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
} }

@ -63,34 +63,6 @@ export class WorkListReplacementRollComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.demoeAttach = [{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj",
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
},
{
USER_NAME: '18888',
EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ",
EMAIL_ADDRESS: "test@yuyuu.hjj"
}
];
} }
getreplacmentemployee() { getreplacmentemployee() {

@ -1,13 +1,14 @@
<ion-header> <ion-header>
<ion-toolbar > <ion-toolbar >
<ion-title color="dark">{{ 'workListMain, rfc' | translate}}</ion-title> <ion-title color="dark">{{ 'workListMain, rfc' | translate}}</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content padding> <ion-content padding>
<div class="tipsPadding boldTxtNav"> <div class="tipsPadding boldTxtNav">
{{"replacementRoll.msgRFC" | translate}} {{'replacementRoll , msgRFC' | translate}}
</div> </div>
<!-- <ion-list (ionChange)="radioChecked($event)" radio-group> <!-- <ion-list (ionChange)="radioChecked($event)" radio-group>
<ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;"> <ion-item *ngFor="let rfcEmployeeList of RFCEmployeeListListRes; let i = index;">
@ -18,13 +19,7 @@
</ion-list> --> </ion-list> -->
<div class="noteInput">
<label class="boldTxtNav" padding>{{"replacementRoll.enterNote" | translate}}</label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<ion-item> <ion-item>
@ -59,7 +54,14 @@
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="noteInput">
<label class="boldTxtNav" padding>{{'replacementRoll , enterNote' | translate}}</label>
<ion-item>
<ion-textarea [(ngModel)]="userNote"></ion-textarea>
</ion-item>
</div>
<br/>
<div class="centerDiv"> <div class="centerDiv">
<ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()"> <ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="submitAction()">
{{'general, submit' | translate}}</ion-button> {{'general, submit' | translate}}</ion-button>

@ -1,5 +1,5 @@
<ion-header *ngIf="!messageSuccess"> <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
@ -19,21 +19,22 @@
<ion-segment-button value="item-req" [ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'"> <ion-segment-button value="item-req" [ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','itemReq')}} <ion-label>{{ts.trPK('worklistMain','itemReq')}}</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="action-history" <ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
{{'worklistMain, action' | translate}} <ion-label> {{'worklistMain, action' | translate}}</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'"> <ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
{{'general, file' | translate}} <ion-label> {{'general, file' | translate}}</ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'"> <ion-segment-button value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','info')}} <ion-label> {{ts.trPK('worklistMain','info')}}</ion-label>
</ion-segment-button> </ion-segment-button>
</ion-segment> </ion-segment>
@ -179,7 +180,7 @@
</ion-grid> </ion-grid>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreNotificationBody()">Load <button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreNotificationBody()">Load
More</button> More</button>
</ion-card-content> </ion-card-content>
@ -502,7 +503,7 @@
</ion-list> </ion-list>
</div> </div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load More</button> <button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load More</button>
</ion-card-content> </ion-card-content>
</ion-card> </ion-card>

@ -104,4 +104,5 @@
// padding-top: 10px; // padding-top: 10px;
// font-weight: bold; // font-weight: bold;
// } // }

@ -88,7 +88,7 @@ export class WorklistMainMRComponent implements OnInit {
delMsg: string; delMsg: string;
closeMsg: string; closeMsg: string;
activeSegment: any = "info"; activeSegment: any = "info";
lines_note_limit: any = 15; lines_note_limit: any = 24;
orgNote: string; orgNote: string;
truncating: boolean; truncating: boolean;
selectedIndex: any; selectedIndex: any;
@ -99,6 +99,7 @@ export class WorklistMainMRComponent implements OnInit {
approveDis: boolean = false; approveDis: boolean = false;
rejectDis: boolean = false; rejectDis: boolean = false;
requestDis: boolean = false; requestDis: boolean = false;
direction: string;
@ -386,14 +387,15 @@ export class WorklistMainMRComponent implements OnInit {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
} }
this.openApplyModal(this.WorkListActionObj);
this.common.confirmAlertDialogAction(
() => { // this.common.confirmAlertDialogAction(
this.applyAction(this.WorkListActionObj); // () => {
}, this.ts.trPK('general', 'ok'), // this.applyAction(this.WorkListActionObj);
() => { }, this.ts.trPK('general', 'cancel'), // }, this.ts.trPK('general', 'ok'),
this.ts.trPK('vacation-rule', 'confirmation'), // () => { }, this.ts.trPK('general', 'cancel'),
this.confirmMsg); // this.ts.trPK('vacation-rule', 'confirmation'),
// this.confirmMsg);
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////

@ -1,5 +1,5 @@
<ion-header *ngIf="!messageSuccess"> <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
@ -24,21 +24,21 @@
<ion-segment-button value="line_details" <ion-segment-button value="line_details"
[ngClass]="activeSegment == 'line_details' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'line_details' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','line_details')}} <ion-label> {{ts.trPK('worklistMain','line_details')}} </ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="action-history" <ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
{{'worklistMain, action' | translate}} <ion-label> {{'worklistMain, action' | translate}} </ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="attach" <ion-segment-button value="attach"
[ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
{{'general, file' | translate}} <ion-label> {{'general, file' | translate}} </ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button checked value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'" > <ion-segment-button checked value="info" [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'" >
{{ts.trPK('worklistMain','info')}} <ion-label> {{ts.trPK('worklistMain','info')}} </ion-label>
</ion-segment-button> </ion-segment-button>
</ion-segment> </ion-segment>
@ -342,7 +342,7 @@
</ion-grid> </ion-grid>
<!-- --> <!-- -->
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreNotificationBody()">Load More</button> <button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreNotificationBody()">Load More</button>
</ion-card-content> </ion-card-content>
@ -618,7 +618,7 @@
<div *ngIf="checkLines(actionHistory.NOTE)"> <div *ngIf="checkLines(actionHistory.NOTE)">
<div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' " > <div class="containerNote" [ngClass]="actionHistory.visible ? 'show' : '' " >
Note: {{actionHistory.NOTE}} {{actionHistory.NOTE}} Note: {{actionHistory.NOTE}}
</div> </div>
@ -642,7 +642,7 @@
</div> </div>
</ion-list> </ion-list>
</div> </div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load More</button> <button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load More</button>
</ion-card-content> </ion-card-content>

@ -101,7 +101,7 @@ export class WorklistMainPoComponent implements OnInit {
itemHistoryRes: any; itemHistoryRes: any;
QutationAnalysisRes: any; QutationAnalysisRes: any;
activeSegment: any = "info"; activeSegment: any = "info";
lines_note_limit: number = 15; lines_note_limit: number = 24;
notiActionBtnMore: any = []; notiActionBtnMore: any = [];
demoeAttach: any = []; demoeAttach: any = [];
orgNote: any; orgNote: any;

@ -1,5 +1,5 @@
<ion-header *ngIf="!messageSuccess"> <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
@ -17,21 +17,21 @@
<ion-segment-button value="item-req" <ion-segment-button value="item-req"
[ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'item-req' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','itemReq')}} <ion-label> {{ts.trPK('worklistMain','itemReq')}} </ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="action-history" <ion-segment-button value="action-history"
[ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'">
{{'worklistMain, action' | translate}} <ion-label> {{'worklistMain, action' | translate}} </ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'"> <ion-segment-button value="attach" [ngClass]="activeSegment == 'attach' ? 'active-Segment' : 'normal-Segment'">
{{'general, file' | translate}} <ion-label> {{'general, file' | translate}} </ion-label>
</ion-segment-button> </ion-segment-button>
<ion-segment-button checked value="info" <ion-segment-button checked value="info"
[ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'"> [ngClass]="activeSegment == 'info' ? 'active-Segment' : 'normal-Segment'">
{{ts.trPK('worklistMain','info')}} <ion-label> {{ts.trPK('worklistMain','info')}} </ion-label>
</ion-segment-button> </ion-segment-button>
</ion-segment> </ion-segment>
@ -165,7 +165,7 @@
</ion-grid> </ion-grid>
<button [hidden]="IsReachEnd" ion-button class="itemHISBtn" (click)="loadMoreNotificationBody()">Load <button *ngIf="!IsReachEnd" ion-button class="itemHISBtn" (click)="loadMoreNotificationBody()">Load
More</button> More</button>
</ion-card-content> </ion-card-content>
@ -361,7 +361,7 @@
</div> </div>
</ion-list> </ion-list>
</div> </div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load <button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load
More</button> More</button>
</ion-card-content> </ion-card-content>

@ -89,7 +89,7 @@ export class WorklistMainPRComponent implements OnInit {
closeMsg: string; closeMsg: string;
truncating: boolean; truncating: boolean;
orgNote: any; orgNote: any;
lines_note_limit: any = 15; lines_note_limit: any = 24;
selectedIndex: any; selectedIndex: any;
showLessBtn: boolean; showLessBtn: boolean;
showMoreBtn: boolean; showMoreBtn: boolean;

@ -1,5 +1,5 @@
<ion-header *ngIf="!messageSuccess"> <ion-header *ngIf="!messageSuccess">
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar-new">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons backLink="/notification/homepage"></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
@ -75,8 +75,13 @@
<ion-grid class="gridSubordinates"> <ion-grid class="gridSubordinates">
<div class="subOrdinateDiv"> <div class="subOrdinateDiv">
<img class="subOrdinateImg" src="../assets/imgs/profile.png"></div> <!-- <img class="subOrdinateImg" src="../assets/imgs/profile.png"> -->
<img *ngIf="List.EMPLOYEE_IMAGE" class="empImgeSub"
[src]="'data:image/png;base64,'+List.EMPLOYEE_IMAGE">
<img *ngIf="List.EMPLOYEE_IMAGE == null"
class="empImgeSub" src="../assets/imgs/profile.png">
</div>
<ion-row class="rowHeader subOrdinateRow"> <ion-row class="rowHeader subOrdinateRow">
<ion-col size="9"> <ion-col size="9">
@ -377,7 +382,7 @@
</ion-list> </ion-list>
</div> </div>
<button ion-button [hidden]="IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load <button ion-button *ngIf="!IsReachEnd" class="itemHISBtn" (click)="loadMoreActionHistory()">Load
More</button> More</button>
</ion-card-content> </ion-card-content>

@ -92,12 +92,12 @@
.rowBorder{ .rowBorder{
border-bottom: solid 0.03cm var(--grayBG); border-bottom: solid 0.02cm var(--grayBG);
} }
.colBorder{ .colBorder{
border-right: solid 0.03cm var(--grayBG); border-right: solid 0.02cm var(--grayBG);
} }
@ -183,7 +183,7 @@
// border: var(--cusgray) 1px solid !important; // border: var(--cusgray) 1px solid !important;
--background: transparent; --background: transparent;
margin-left: -15px; margin-left: -15px;
margin-right: 7px; margin-right: 6px;
} }
.status{ .status{
text-align: center; text-align: center;
@ -231,7 +231,7 @@ color: white;
.subOrdinateDiv{ .subOrdinateDiv{
z-index: 4; z-index: 4;
margin-left: -44px; margin-left: -32px;
position: absolute; position: absolute;
top: -2px; top: -2px;
} }
@ -244,7 +244,7 @@ color: white;
} }
.subOrdinateRow{ .subOrdinateRow{
margin-left: 40px; margin-left: 55px;
} }
.label{ .label{

@ -78,7 +78,7 @@ export class WorklistMainComponent implements OnInit {
P_PAGE_LIMIT: number = 100; P_PAGE_LIMIT: number = 100;
notificationCount: any; notificationCount: any;
activeSegment: any = "info"; activeSegment: any = "info";
lines_note_limit: any = 15; lines_note_limit: any = 24;
attachmentRes: any; attachmentRes: any;
private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest;
IsReachEnd: boolean = false; IsReachEnd: boolean = false;
@ -403,6 +403,7 @@ export class WorklistMainComponent implements OnInit {
obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID;
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
if ( if (
ButtonAction == "APPROVED" || ButtonAction == "APPROVED" ||
ButtonAction == "REJECTED" || ButtonAction == "REJECTED" ||
@ -412,7 +413,7 @@ export class WorklistMainComponent implements OnInit {
this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = "";
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_COMMENTS = "";
this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; // this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.getPassNotificationDetails, this.getPassNotificationDetails,
@ -422,6 +423,7 @@ export class WorklistMainComponent implements OnInit {
ButtonAction, ButtonAction,
WorklistMainComponent.PASS_ACTION_MODE WorklistMainComponent.PASS_ACTION_MODE
); );
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
@ -452,11 +454,14 @@ export class WorklistMainComponent implements OnInit {
this.ts.trPK('vacation-rule', 'confirmation'), this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg) this.confirmMsg)
// this.openApplyModal(this.WorkListActionObj); // this.openApplyModal(this.WorkListActionObj);
} }
if (ButtonAction == "RFC") { if (ButtonAction == "RFC") {
// alert("Return For Correction"); // alert("Return For Correction");
this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
@ -616,6 +621,10 @@ export class WorklistMainComponent implements OnInit {
} }
this.notificationDynamicFields(result.NotificationGetRespondAttributesList); this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList;
this.common.sharedService.setSharedData(
this.notificationDynamicAttributeArr,
"notificationDynamicAttributeArr"
);
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
@ -703,6 +712,7 @@ export class WorklistMainComponent implements OnInit {
} }
handleWorkListActionHistoryResult(result) { handleWorkListActionHistoryResult(result) {
console.log( "1"+ this.IsReachEnd);
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetActionHistoryList)) { if (this.common.hasData(result.GetActionHistoryList)) {
this.actionHistoryRes = result.GetActionHistoryList; this.actionHistoryRes = result.GetActionHistoryList;
@ -713,8 +723,12 @@ export class WorklistMainComponent implements OnInit {
let lastitem = result.GetActionHistoryList[lastItemIndex]; let lastitem = result.GetActionHistoryList[lastItemIndex];
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true; this.IsReachEnd = true;
console.log( "2"+ this.IsReachEnd);
} else { } else {
this.IsReachEnd = false; this.IsReachEnd = false;
console.log( "3"+ this.IsReachEnd);
} }
} }
this.turnCateFun(this.actionHistoryRes); this.turnCateFun(this.actionHistoryRes);
@ -946,6 +960,40 @@ export class WorklistMainComponent implements OnInit {
loadMoreActionHistory() {
console.log("doInfinite action history MR");
if (!this.IsReachEnd) {
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
} else {
this.IsReachEnd = false;
}
this.actionHistoryRes.push(element);
}, (Error) => console.log(Error), () =>
//infiniteScroll.target.complete()
console.log("TEST"));
}// if list length >0
else {
this.IsReachEnd = true;
}
}// if response == 1
//this.pageNum++;
// infiniteScroll.target.complete();
});
} else {
//if (infiniteScroll)
//infiniteScroll.target.complete();
}
}//end infiniteScroll
} }

@ -1,7 +1,6 @@
<!-- <!-- <ion-header>
<ion-header>
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button> <ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
@ -9,17 +8,25 @@
<ion-title color="light" >{{ts.trPK('payslip','title')}}</ion-title> <ion-title color="light" >{{ts.trPK('payslip','title')}}</ion-title>
</ion-toolbar> </ion-toolbar>
</ion-header> --> </ion-header> -->
<ion-header>
<ion-toolbar class="header-toolbar-new">
<nav-buttons [enableMenu]="false" [enableBack]="true" [navigate]="true"></nav-buttons>
<ion-title style="color: white;">{{ts.trPK('payslip','monthly-payslip')}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="colorBG"> <ion-content class="colorBG">
<div class="header-div"> <div class="header-div">
<ion-buttons slot="start"> <!-- <ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button> <ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons> </ion-buttons>
<p class="Title">{{ts.trPK('payslip','monthly-payslip')}}</p> <p class="Title">{{ts.trPK('payslip','monthly-payslip')}}</p>
<div class="Imgdiv"> <div class="Imgdiv">
<img class="Imgsrc"> <img class="Imgsrc">
</div> </div> -->
</div> </div>
<!-- <ion-img class="profileImg" [src]="imageSrc"></ion-img> --> <!-- <ion-img class="profileImg" [src]="imageSrc"></ion-img> -->

@ -58,19 +58,20 @@
color: var(--red); color: var(--red);
} }
.header-toolbar-new{
--background: #22c6b3;
}
.colorBG{ .colorBG{
--background: #f0efef; --background: #f0efef;
} }
.header-div { .header-div {
background-color: #22C6B3;
background-color: #22C6B3; text-transform: capitalize;
text-transform: capitalize; height: 119px;
height: 180px; position: relative;
position: relative; display: block;
display: block; margin-bottom: -28px;
margin-bottom: -28px;
} }
.Title{ .Title{
text-align: center; text-align: center;
@ -142,8 +143,8 @@
border-radius: 20px !important; border-radius: 20px !important;
padding-top: 13px; padding-top: 13px;
padding-bottom: 14px; padding-bottom: 14px;
margin-left: 30px; margin-left: 26px;
margin-right: 32px; margin-right: 28px;
margin-top: -2px; margin-top: -2px;
margin-bottom: 10px; margin-bottom: 10px;
padding-right: 21px; padding-right: 21px;
@ -214,7 +215,7 @@ margin-top: -13px;
.header{ .header{
margin-top: -126px; margin-top: -119px;
} }
.bgcolor { .bgcolor {

@ -1,3 +1,34 @@
<p> <ion-header>
home works! <ion-toolbar class="header-toolbar-new">
</p> <ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" ></ion-back-button>
</ion-buttons>
<ion-title color="light" >Time and Attendance</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="time-card-home-container">
<ion-card
(click)="openDetailPage(timeCard.pageLink)"
*ngFor="let timeCard of timeCardOptions ; let i = index">
<ion-card-content>
<ion-grid>
<ion-row>
<ion-col [size]="4" class="time-card-image">
<img src="../assets/imgs/time-card/{{timeCard.imageName}}">
</ion-col>
<ion-col [size]="6" class="time-card-details">
<h1 class="time-card-heading">{{timeCard.heading}}</h1>
<span class="time-card-description">{{timeCard.description}}</span>
</ion-col>
<ion-col [size]="2">
<img class="time-card-rightIcon"
src="../assets/imgs/time-card/ArrowRight.png">
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</div>
</ion-content>

@ -0,0 +1,59 @@
ion-header{
overflow: hidden;
}
ion-content{
--ion-background-color: #f2f2f3;
}
ion-card-content {
padding: 0px;
}
ion-card {
box-shadow: none !important;
background-color: white;
margin-bottom: 15px;
}
ion-header {
background: #f2f2f3;
}
ion-title{
text-align: center;
font-family: WorkSans-Bold;
font-size: 18px;
}
.time-card-home-container{
margin-right: 10px;
margin-left: 10px;
margin-top: 20px
}
.header-toolbar-new{
--background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%);
border-bottom-right-radius: 30px;
border-bottom-left-radius: 30px;
}
.time-card-image{
padding: 10px;
}
.time-card-details{
padding: 0px;
margin-top: 25px;
line-height: 10px;
}
.time-card-heading{
font-weight: bold;
font-size: 13px;
color: #666666;
font-family: WorkSans-Bold;
}
.time-card-description{
font-size: 10px;
}
.time-card-rightIcon{
padding: 8px;
margin-top: 18px;
}

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -7,8 +8,38 @@ import { Component, OnInit } from '@angular/core';
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
constructor() { } public timeCardOptions: any = [
{
imageName: 'MyTimeCard.png',
heading: 'My Time Card',
description: 'View your attendance records.',
pageLink: '/time-card/time-card-details'
},
{
imageName: 'Timeback.png',
heading: 'Time Back',
description: 'View and use your extra work time.',
pageLink: '/time-card/home'
},
{
imageName: 'MissingSwipe.png',
heading: 'Missing Swipe',
description: 'Resolve swipe and attendance records',
pageLink: '/time-card/home'
},
{
imageName: 'WorkOnBreak.png',
heading: 'Work on Break',
description: 'Record your work time in during break.',
pageLink: '/time-card/home'
}
];
constructor(public common: CommonService) {}
ngOnInit() {} ngOnInit() {}
public openDetailPage(path) {
this.common.navigatePage(path);
}
} }

@ -0,0 +1,61 @@
<ion-content>
<div class="date-container">
<ion-row class="ion-justify-content-center">
<ion-col [size]="11">
<ion-item>
<div class="date-time-icon date-primary"></div>
<ion-label>Date From</ion-label>
<ion-datetime
[placeholder]="Select"
display-format="DD/MM/YYYY"
[min]="1900"
[max]="2100"
[(ngModel)]="dateFrom"
doneText="Done"
cancelText="Cancel"
></ion-datetime>
</ion-item>
</ion-col>
<ion-col [size]="11">
<ion-item>
<div class="date-time-icon date-primary"></div>
<ion-label>Date To</ion-label>
<ion-datetime
[placeholder]="Select"
display-format="DD/MM/YYYY"
[min]="1900"
[max]="2100"
[(ngModel)]="dateTo"
doneText="Done"
cancelText="Cancel"
></ion-datetime>
</ion-item>
</ion-col>
</ion-row>
</div>
<div class="filters-container">
<span
*ngFor="let filter of filtersArray; let i = index"
[ngClass]="{'selected': filter.active == true,'notSelected': filter.active == false }"
class="filter-tag-button"
(click)="changeFiltersSelection(i)">
{{filter.name}}
</span>
</div>
<ion-list>
<ion-radio-group [(ngModel)]="selectedShiftType">
<ion-list-header>
Shift type
</ion-list-header>
<ion-item *ngFor="let shift of shiftTypesArray">
<ion-label>{{shift.SHT_TYPE_DESC}}</ion-label>
<ion-radio value="{{shift.SHT_TYPE}}"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
<ion-button (click)="dismissModal()">Search</ion-button>
</ion-content>

@ -0,0 +1,30 @@
.footer-modal-button{
position: absolute;
bottom: 0;
color: white;
width: 100%;
text-align: center;
}
.footer-modal-button button{
font-size: 20px;
background: white;
line-height: 2;
}
.filters-container{
display: inline-block;
text-align: center;
margin-top: 10px;
}
.filter-tag-button{
display: inline-block;
border-radius: 5px;
border: 2px solid #A3D077;
color: #606161;
text-align: center;
font-size: 18px;
padding: 5px;
margin: 5px;
}
.filters-container .selected {
background-color: #d4f0e4;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SelectPeriodComponent } from './select-period.component';
describe('SelectPeriodComponent', () => {
let component: SelectPeriodComponent;
let fixture: ComponentFixture<SelectPeriodComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SelectPeriodComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(SelectPeriodComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,128 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TimeCardService } from 'src/app/time-card/service/time-card.service';
@Component({
selector: 'app-select-period',
templateUrl: './select-period.component.html',
styleUrls: ['./select-period.component.scss'],
})
export class SelectPeriodComponent implements OnInit {
public shiftTypesArray: any = [];
public dateFrom: any;
public dateTo: any;
public selectedShiftType: any;
public filtersArray: any = [
{
name: 'Excess',
active: false,
key: 'P_EXCESS_FLAG',
value: ''
},
{
name: 'Timeback',
active: false,
key: 'P_TIMEBACK_FLAG',
value: ''
},
{
name: 'Comp Off',
active: false,
key: 'P_COMP_OFF_FLAG',
value: ''
},
{
name: 'Non scheduled',
active: false,
key: 'P_NON_SCHEDULED_FLAG',
value: ''
},
{
name: 'Late In',
active: false,
key: 'P_LATE_IN_FLAG',
value: ''
},
{
name: 'Early Out',
active: false,
key: 'P_EARLY_OUT_FLAG',
value: ''
},
{
name: 'Shortage',
active: false,
key: 'P_SHORTAGE_FLAG',
value: ''
},
{
name: 'Missing Swipe',
active: false,
key: 'P_MISSING_SWIPE_FLAG',
value: ''
},
{
name: 'Work On Break',
active: false,
key: 'P_ACTUAL_WOB_SEC',
value: ''
},
{
name: 'Analyzed',
active: false,
key: 'P_ANALAYZED_FLAG',
value: ''
},
{
name: 'Approved Timeback',
active: false,
key: 'P_APPR_TIMEBACK_FLAG',
value: ''
},
];
constructor(
public modalController: ModalController,
public common: CommonService,
public timeCardService: TimeCardService,
public navParams: NavParams) { }
ngOnInit() {
this.getShiftTypes();
this.dateFrom = this.navParams.get('dateFrom');
this.dateTo = this.navParams.get('dateTo');
}
public dismissModal() {
const selectedFilters: any = {};
for (const filter of this.filtersArray) {
selectedFilters[filter.key] = filter;
}
this.modalController.dismiss({
dismissed: true,
keySelectedFilters: selectedFilters,
selectedShiftType: this.selectedShiftType,
dateFrom: this.dateFrom,
dateTo: this.dateTo
});
}
public changeFiltersSelection(i: any) {
this.filtersArray[i].active = !this.filtersArray[i].active;
if (this.filtersArray[i].active) {
this.filtersArray[i].value = 'Y';
} else {
this.filtersArray[i].value = '';
}
}
public getShiftTypes() {
this.timeCardService.getShiftType().subscribe((result) => {
if (this.common.validResponse(result)) {
this.shiftTypesArray = result.GetShiftTypesList;
}
});
}
}

@ -5,8 +5,8 @@ export class GetDayAndHoursDetailsRequest extends Request {
public P_SELECTED_EMPLOYEE_NUMBER: string; public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_MENU_TYPE: string; public P_MENU_TYPE: string;
public P_SELECTED_RESP_ID: number; public P_SELECTED_RESP_ID: number;
public P_SCHEDULE_DATE_FROM: DateTimeInput; public P_SCHEDULE_DATE_FROM: string;
public P_SCHEDULE_DATE_TO: DateTimeInput; public P_SCHEDULE_DATE_TO: string;
public P_EXCESS_FLAG: string; public P_EXCESS_FLAG: string;
public P_TIMEBACK_FLAG: string; public P_TIMEBACK_FLAG: string;
public P_COMP_OFF_FLAG: string; public P_COMP_OFF_FLAG: string;
@ -21,4 +21,6 @@ export class GetDayAndHoursDetailsRequest extends Request {
public P_ACTUAL_WOB_SEC: string; public P_ACTUAL_WOB_SEC: string;
public P_PAGE_NUM: number; public P_PAGE_NUM: number;
public P_PAGE_LIMIT: number; public P_PAGE_LIMIT: number;
public SearchMonth: string;
public SearchYear: number;
} }

@ -3,7 +3,7 @@ import { DateTimeInput } from "src/app/uI-elements/date-time.input";
export class GetSwipesRequest extends Request { export class GetSwipesRequest extends Request {
public P_SELECTED_EMPLOYEE_NUMBER: string; public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_SCHEDULE_DATE: DateTimeInput; public P_SCHEDULE_DATE: string;
public P_PAGE_NUM: number; public P_PAGE_NUM: number;
public P_PAGE_LIMIT: number; public P_PAGE_LIMIT: number;
} }

@ -5,8 +5,8 @@ export class GetTimeCardSummaryRequest extends Request {
public P_SELECTED_EMPLOYEE_NUMBER: string; public P_SELECTED_EMPLOYEE_NUMBER: string;
public P_MENU_TYPE: string; public P_MENU_TYPE: string;
public P_SELECTED_RESP_ID: number; public P_SELECTED_RESP_ID: number;
public P_SCHEDULE_DATE_FROM: DateTimeInput; public P_SCHEDULE_DATE_FROM: string;
public P_SCHEDULE_DATE_TO: DateTimeInput; public P_SCHEDULE_DATE_TO: string;
public P_EXCESS_FLAG: string; public P_EXCESS_FLAG: string;
public P_TIMEBACK_FLAG: string; public P_TIMEBACK_FLAG: string;
public P_COMP_OFF_FLAG: string; public P_COMP_OFF_FLAG: string;
@ -19,4 +19,6 @@ export class GetTimeCardSummaryRequest extends Request {
public P_APPR_TIMEBACK_FLAG: string; public P_APPR_TIMEBACK_FLAG: string;
public P_SHT_TYPE: string; public P_SHT_TYPE: string;
public P_ACTUAL_WOB_SEC: string; public P_ACTUAL_WOB_SEC: string;
public SearchMonth: string;
public SearchYear: number;
} }

@ -1,27 +1,27 @@
import { Injectable } from "@angular/core"; import { Injectable } from '@angular/core';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { Request } from "src/app/hmg-common/services/models/request"; import { Request } from 'src/app/hmg-common/services/models/request';
import { Observable } from "rxjs"; import { Observable } from 'rxjs';
import { GetShiftTypeResponse } from "./models/get-shift-type.response"; import { GetShiftTypeResponse } from './models/get-shift-type.response';
import { GetDayAndHoursDetailsResponse } from "./models/get-day-hours-type-details.response"; import { GetDayAndHoursDetailsResponse } from './models/get-day-hours-type-details.response';
import { GetTimeCardSummaryResponse } from "./models/get-time-card-summary.response"; import { GetTimeCardSummaryResponse } from './models/get-time-card-summary.response';
import { GetShiftDetailResponse } from "./models/get-shift-detail.response"; import { GetShiftDetailResponse } from './models/get-shift-detail.response';
import { GetSwipesResponse } from "./models/get-swipes-response"; import { GetSwipesResponse } from './models/get-swipes-response';
@Injectable({ @Injectable({
providedIn: "root" providedIn: 'root'
}) })
export class TimeCardService { export class TimeCardService {
public static getShiftTypeUrl = "Services/ERP.svc/REST/GET_SHIFT_TYPES"; public static getShiftTypeUrl = 'Services/ERP.svc/REST/GET_SHIFT_TYPES';
public static getTimeCardSummaryUrl = public static getTimeCardSummaryUrl =
"Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY"; 'Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY';
public static getDayHourDetailsUrl = public static getDayHourDetailsUrl =
"Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS"; 'Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS';
public static getShiftDetailUrl = public static getShiftDetailUrl =
"Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS"; 'Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS';
public static getSwipeUrl = "Services/ERP.svc/REST/GET_SWIPES"; public static getSwipeUrl = 'Services/ERP.svc/REST/GET_SWIPES';
constructor( constructor(
public con: ConnectorService, public con: ConnectorService,

@ -0,0 +1,191 @@
<ion-header>
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" ></ion-back-button>
</ion-buttons>
<ion-title color="light" >Shift Details</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="ion-padding shift-container" *ngIf="shiftDetailsData.length > 0 && selectedShift.origin === 'shiftDetails'">
<ion-card *ngFor="let shiftData of shiftDetailsData;">
<ion-card-content>
<h2 class="card-summary-heading">Shift details</h2>
<h2 class="card-summary-heading">{{ shiftData.SCHEDULE_DATE | date }}</h2>
<ion-grid style="line-height: 10px;">
<ion-row>
<ion-col [size]="8">
Shift type
</ion-col>
<ion-col [size]="4">
{{shiftData.SHT_TYPE_DESC}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Shift
</ion-col>
<ion-col [size]="4">
{{shiftData.SHT_NAME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Break
</ion-col>
<ion-col [size]="4">
{{shiftData.BREAK_NAME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Work On Break
</ion-col>
<ion-col [size]="4">
{{shiftData.ACTUAL_WOB_HRS}}
</ion-col>
</ion-row>
<ion-row>
<h2 class="card-summary-heading">Actual Swipe(s)</h2>
</ion-row>
<ion-row>
<ion-col [size]="8">
Start
</ion-col>
<ion-col [size]="4">
{{shiftData.SHT_ACTUAL_START_TIME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
End
</ion-col>
<ion-col [size]="4">
{{shiftData.SHT_ACTUAL_END_TIME}}
</ion-col>
</ion-row>
<ion-row>
<h2 class="card-summary-heading">Approved Swipe(s)</h2>
</ion-row>
<ion-row>
<ion-col [size]="8">
Start
</ion-col>
<ion-col [size]="4">
{{shiftData.APPROVED_START_TIME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Start Reason
</ion-col>
<ion-col [size]="4">
{{shiftData.APPROVED_START_REASON_DESC}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
End
</ion-col>
<ion-col [size]="4">
{{shiftData.APPROVED_END_TIME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
End Reason
</ion-col>
<ion-col [size]="4">
{{shiftData.APPROVED_END_REASON_DESC}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Actual Hours
</ion-col>
<ion-col [size]="4">
{{shiftData.SHT_ACTUAL_HRS}}
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</div>
<div class="ion-padding shift-container" *ngIf="swipeDetailsData && selectedShift.origin === 'shiftSwipes'">
<ion-card *ngFor="let swipeData of swipeDetailsData;">
<ion-card-content>
<h2 class="card-summary-heading">Employee Swipe(s)</h2>
<h2 class="card-summary-heading">{{ swipeData.SCHEDULE_DATE | date }}</h2>
<ion-grid style="line-height: 10px;">
<ion-row>
<ion-col [size]="8">
Swipe Date
</ion-col>
<ion-col [size]="4">
{{swipeData.SWIPE_DATE}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Swipe Time
</ion-col>
<ion-col [size]="4">
{{swipeData.SWIPE_TIME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Swipe Status
</ion-col>
<ion-col [size]="4">
{{swipeData.SWIPE_STATUS}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Machine Location
</ion-col>
<ion-col [size]="4">
{{swipeData.MACHINE_LOCATION}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Unit Number
</ion-col>
<ion-col [size]="4">
{{swipeData.UNIT_NUMBER}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Unit Name
</ion-col>
<ion-col [size]="4">
{{swipeData.UNIT_NAME}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Exclude
</ion-col>
<ion-col [size]="4">
{{swipeData.EXCLUDE_FLAG}}
</ion-col>
</ion-row>
<ion-row>
<ion-col [size]="8">
Error Message
</ion-col>
<ion-col [size]="4">
{{swipeData.RETURN_MESSAGE}}
</ion-col>
</ion-row>
</ion-grid>
</ion-card-content>
</ion-card>
</div>
</ion-content>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save