fix conflict worlist

MOE_DEV_NEW_TEMPORARY_DESIGN
ashwaq 6 years ago
commit ffc298d123

@ -15,11 +15,15 @@
<preference name="ScrollEnabled" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
<preference name="fullscreen" value="false" />
<preference name="FadeSplashScreen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="orientation" value="portrait" />
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/network_security_config" />

17084
Mohem/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -106,6 +106,7 @@
"ng-circle-progress": "^1.5.1",
"ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2",
"ngx-gauge": "^1.0.0-beta.10",
"npm": "^6.13.7",
"phonegap-plugin-barcodescanner": "^8.1.0",
"phonegap-plugin-multidex": "^1.0.0",
@ -201,4 +202,4 @@
"android"
]
}
}
}

@ -13,7 +13,7 @@
</ion-header>
<ion-content >
<ion-content class="colorBG">
<!-- colorBG -->
<div class="contentEit" style="background: #f3f1f1;">
<div class="header-div">
@ -148,7 +148,7 @@
<div class="no-dataDiv" *ngIf="!GetAbsenceTransactionList || GetAbsenceTransactionList.length <= 0" >
<ion-row>
<img class="empty-data" src="../assets/imgs/noData.png"/>
<img class="empty-data" src="../assets/imgs/box.png"/>
</ion-row>

@ -55,7 +55,9 @@ export class HomeComponent implements OnInit {
public absService: AbsenceListService,
public accrualService: AccrualService,
public authService: AuthenticationService
) {}
) {
// this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false);
}
ngOnInit() {
@ -66,8 +68,8 @@ export class HomeComponent implements OnInit {
private getUserDetails(){
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.emp_no=user.EMPLOYEE_NUMBER;
this.getAccrualBalance();
// this.emp_no=user.EMPLOYEE_NUMBER;
// this.getAccrualBalance();
}
});
@ -236,7 +238,7 @@ createAbsence() {
let todayDate = month + '/' + day + '/' + year;
let effectiveDate = todayDate;
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.emp_no,
P_SELECTED_EMPLOYEE_NUMBER: this.selEmp,
P_EFFECTIVE_DATE: effectiveDate
};

@ -114,6 +114,15 @@
</button> -->
</ion-item>
<ion-item [hidden]="TeamFlag!='true'" (click)="openMyTeamPage()">
<ion-thumbnail slot="start" class="menu-thumb">
<img style= "height: 14px !important;" src="../assets/imgs/my_team_icon.png" item-left>
</ion-thumbnail>
<ion-label class="profile">
{{ts.trPK('myTeam','myTeam-header')}}
</ion-label>
</ion-item>
<!-- <ion-item (click)="profile()">
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/profile_icon.png" item-left>

@ -10,6 +10,9 @@ import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/mod
import { PushService } from '../../src/app/hmg-common/services/push/push.service';
import { LazyLoadingService } from "./hmg-common/services/lazy-loading/lazy-loading.service";
import { DomSanitizer } from '@angular/platform-browser';
// import { SplashScreen } from '@ionic-native/splash-screen';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
@Component({
selector: "app-root",
@ -29,10 +32,13 @@ export class AppComponent implements OnInit, AfterViewInit {
companyDesc: string = "Powered By Cloud Solutions";
public direction = "ltr";
User_Job_name: string;
public logoutFlage: any =false;
requestGetLoginInfo: {
DeviceType: string; DeviceToken: string; //this.deviceToken
};
user: boolean;
deviceToken: string;
TeamFlag :string = "false";
constructor(
public ts: TranslatorService,
private cs: CommonService,
@ -43,7 +49,9 @@ export class AppComponent implements OnInit, AfterViewInit {
private menu: MenuController,
private authService: AuthenticationService,
private sanitizer: DomSanitizer,
public pushService: PushService
public pushService: PushService,
private splashScreen: SplashScreen
) {
this.events.subscribe("img-change", displayImg => {
console.log("app compont: "+displayImg);
@ -55,11 +63,13 @@ export class AppComponent implements OnInit, AfterViewInit {
}
ngOnInit() {
this.initializeApp();
}
ngAfterViewInit() {}
initializeApp() {
this.start = false;
this.menu.enable(false)
this.lazyLoadingService.monitorLazyLoading(15, true);
this.platform.ready().then(() => {
this.ts.loadResources(() => {
@ -77,6 +87,11 @@ export class AppComponent implements OnInit, AfterViewInit {
private startReceivingPushService() {
console.log("platform.ready")
this.pushService.startReceiving();
setTimeout(() => {
console.log(" in setTimeout startReceiving");
this.getLastLoginInfo();
},4000);
}
subscribeEvents() {
this.events.subscribe("setMenu", () => {
@ -92,9 +107,13 @@ export class AppComponent implements OnInit, AfterViewInit {
? user.CompanyImageDescription
: "Powered By Cloud Solutions";
this.User_name_Emp = user.EMPLOYEE_DISPLAY_NAME;
if(this.cs.getUpdateImage().status){
this.user_image =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img);
}else{
this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png";
}
this.User_Job_name=user.JOB_NAME;
console.log(user);
@ -106,6 +125,11 @@ export class AppComponent implements OnInit, AfterViewInit {
this.events.subscribe("getNotCount", badge => {
this.notBadge = badge;
});
this.events.subscribe('myTeamFlag', myTeamFlag => {
this.TeamFlag = myTeamFlag;
});
console.log("this.TeamFlag>>>>>>>>>"+ this.TeamFlag);
}
private initializeDirection() {
this.direction = TranslatorService.getCurrentDirection();
@ -127,9 +151,21 @@ export class AppComponent implements OnInit, AfterViewInit {
}
logout() {
this.cs.sharedService.clearAll();
this.menu.toggle();
this.cs.openLogin();
//this.menu.toggle();
this.menu.enable(false);
this.logoutFlage=true;
this.events.publish('logoutFlage', this.logoutFlage);
this.getLastLoginInfo();
// this.cs.openLogin();
}
openMyTeamPage() {
this.menu.toggle();
this.cs.openMyTeamPage();
}
// profile() {
// this.cs.openProfile();
@ -165,6 +201,86 @@ export class AppComponent implements OnInit, AfterViewInit {
this.menu.toggle();
}
getLastLoginInfo(){
console.log(" getLastLoginInfo");
console.log("get method :"+this.cs.getDeviceToken());
this.deviceToken= this.cs.getDeviceToken();
//this.cs.sharedService.getSharedData("new-device-token",false);// localStorage.getItem('devicyeToken');
console.log("let deviceToken app" + this.cs.sharedService.getSharedData("new-device-token",false));
console.log("localStorage.getItem app" + localStorage.getItem('devicyeToken'));
console.log("sheard DEVICE_TOKEN" + this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false));
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);
}
this.requestGetLoginInfo= {
DeviceType:this.cs.getDeviceType(),//'Android',
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;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
},3000);
if(this.logoutFlage){
this.cs.openLogin();
}
}
else{
this.user = false;
this.events.publish('user', this.user);
setTimeout(() => {
this.splashScreen.hide();
},3000);
if(this.logoutFlage){
this.cs.openLogin();
}
}
}else{
// this.user = false;
// this.splashScreen.hide();
// if(this.logoutFlage){
// this.cs.openLogin();
// }
}
});
}
}

@ -67,19 +67,19 @@
<ion-row class="rowBorder">
<ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-in')}}</ion-label>
<ion-label class="shift-text shift-title">08:00</ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SWIPE_IN | slice:0:-3}}</ion-label>
</ion-col>
<ion-col [size]="6" class="colBorder">
<ion-col [size]="6" class="colBorder" style="border-right: none;">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-out')}}</ion-label>
<ion-label class="shift-text shift-title">08:00 </ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SWIPE_OUT | slice:0:-3}}</ion-label>
</ion-col>
</ion-row>
<ion-row style="text-align: center">
<ion-col [size]="6" class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','late-in')}}</ion-label>
<ion-label class="shift-text shift-title">08:00 </ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_LATE_IN_HOURS | slice:0:-3}}</ion-label>
</ion-col>
<ion-col [size]="6" class="colBorder">
<ion-col [size]="6" class="colBorder" style="border-right: none;">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','regular')}}</ion-label>
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SCHEDULED_HOURS | slice:0:-3}} </ion-label>
</ion-col>

@ -13,11 +13,11 @@
[ngClass]="{'content-class':accessFromOutSide, 'ion-padding': !accessFromOutSide}" has-bouncing="false" forceOverscroll="false" scrollY="false" class="ion-no-padding">
<ion-grid class="ion-justify-content-center">
<ion-row *ngIf="!accessFromOutSide">
<!-- <ion-row *ngIf="!accessFromOutSide">
<ion-col [size]="4">
<img [src]="logo" class="logo" />
</ion-col>
</ion-row>
</ion-row> -->
<ion-row class="description" *ngIf="!accessFromOutSide">
<ion-col size="12">
<!-- <type-writer *ngIf="onlySMSBox" [text]="'login,verify-login-with' | translate" class="description"

@ -634,23 +634,26 @@ export class ConfirmLoginComponent implements OnInit {
// this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
let request = new GetLoginInfoRequest();
let request ={
DeviceType: this.cs.getDeviceType(),
this.authService.setPublicFields(request);
DeviceToken:this.deviceToken
request.MobileNumber = this.loginData.MobileNumber;
} ;
request.P_USER_NAME=this.loginData.P_USER_NAME;
// this.authService.setPublicFields(request);
request.UserName=this.loginData.P_USER_NAME;
// request.MobileNumber = this.loginData.MobileNumber;
request.LogInTokenID =this.loginData.LogInTokenID;
// request.P_USER_NAME=this.loginData.P_USER_NAME;
request.CompanyID =1;//cs=1 , HMG=2
// request.UserName=this.loginData.P_USER_NAME;
request.DeviceType= this.cs.getDeviceType();
// request.LogInTokenID =this.loginData.LogInTokenID;
request.DeviceToken=this.deviceToken;
// request.CompanyID =1;//cs=1 , HMG=2
@ -668,7 +671,7 @@ export class ConfirmLoginComponent implements OnInit {
private getMobileInfo(request: GetLoginInfoRequest) {
private getMobileInfo(request: any) {
console.log("2");

@ -19,13 +19,13 @@
</div>
</ion-row>
<ion-row *ngIf="user ">
<!-- <ion-row *ngIf="user ">
<ion-col [size]="4">
<img [src]="logo" class="logo" />
<!-- <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img> -->
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col>
</ion-row>
</ion-row> -->

@ -2,7 +2,7 @@ import { Component, OnInit, NgZone, OnDestroy } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { Router } from "@angular/router";
import { AlertController, Platform } from "@ionic/angular";
import { AlertController, Platform, Events } from "@ionic/angular";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response";
import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service";
@ -49,6 +49,8 @@ export class LoginComponent implements OnInit, OnDestroy {
user: boolean =false;
DeviceType: string;
requestGetLoginInfo:any;
logoutFlage: boolean ;
getuser:any="";
constructor(
public cs: CommonService,
@ -58,40 +60,89 @@ export class LoginComponent implements OnInit, OnDestroy {
public ts: TranslatorService,
public smsService: SmsReaderService,
private faio: FingerprintAIO,
public events:Events,
public ngZone: NgZone,
public device: Device,
public splash: SplashScreen,
public sharedData: SharedDataService,
public plt: Platform,
public pushService: PushService
) { }
) {
this.events.subscribe("logoutFlage", logoutFlage => {
console.log("login compont logoutFlage: "+logoutFlage);
if(logoutFlage == true){
console.log(" subscribe check logoutFlage: "+logoutFlage);
this.logoutFlage = logoutFlage;
localStorage.setItem('logoutFlage',logoutFlage);
}
});
this.getuser = this.cs.sharedService.getSharedData(
AuthenticationService.IMEI_USER_DATA,
false
);
// alert(" this.getuser "+this.getuser);
if(this.getuser){
this.user = true;
}
else{
this.user = false;
}
}
ngOnInit() {
// this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
// console.log("get deviceToken login"+ this.deviceToken)
// this.getuser = this.cs.sharedService.getSharedData(
// AuthenticationService.IMEI_USER_DATA,
// false
// );
// if(this.getuser){
// console.log("this.getuser"+this.getuser);
// this.logoutFlage = true;
// }
this.events.subscribe("user", user => {
console.log("login compont: "+user);
this.user = user;
});
this.deviceToken= localStorage.getItem('devicyeToken');
console.log("let deviceToken" + this.deviceToken);
console.log("let deviceToken" + this.deviceToken);
if (this.deviceToken) {
console.log('login enabled first time: ' + 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);
// alert('login enabled second time: ' + this.deviceToken);
}, 1000);
}
setTimeout(() => {
// setTimeout(() => {
// alert("this.logoutFlage in setTime" +localStorage.getItem('logoutFlage'));
// alert("this.this.user in setTime" + this.user);
// if(localStorage.getItem('logoutFlage')== "true"){
// this.getLastLoginInfo();
this.getLastLoginInfo();
},5000);
// }
// },1000);
@ -237,12 +288,12 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log("success");
this.cs.stopLoading();
if (this.cs.validResponse(result)) {
// alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList.EMPLOYEE_NAME);
// alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList[0].EMPLOYEE_NAME);
this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
this.loginData.P_USER_NAME = this.username;
// this.loginData.EMPLOYEE_NAME =result.MemberLoginList[0].EMPLOYEE_NAME;
// this.loginData.EMPLOYEE_NAME =result.MemberLoginList[0].EMPLOYEE_NAME;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo();
@ -355,12 +406,14 @@ export class LoginComponent implements OnInit, OnDestroy {
getLastLoginInfo(){
this.requestGetLoginInfo= {
DeviceType:this.cs.getDeviceType(),
DeviceType:this.cs.getDeviceType(),//"Android",//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],

@ -9,13 +9,13 @@
<ion-content padding>
<ion-grid>
<ion-row>
<!-- <ion-row>
<ion-col [size]="4">
<img [src]="logo" class="logo" />
<!-- <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img> -->
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col>
</ion-row>
</ion-row> -->
<br/>
<br/>
<ion-row>

@ -496,9 +496,13 @@ console.log("successful insertMobileLogin" );
const key = e.which;
const t = e.target;
let sib = t.nextElementSibling;
let sibPre =t.previousElementSibling;
if (key !== 9 && (key < 48 || key > 57)) {
if (key === 8 || key === 46) {
return true;
} else {
e.preventDefault();
@ -509,11 +513,13 @@ console.log("successful insertMobileLogin" );
if (key === 9) {
return true;
}
if (sib) {
//sib = document.querySelector('input');
if (e.target.value) {
if (e.target.value ==="") {
sibPre.setFocus()}
else{
sib.setFocus();
}
}
}
// } else {
@ -523,6 +529,6 @@ console.log("successful insertMobileLogin" );
}
}

@ -5,7 +5,7 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-content class="colorBG">
<div class="">
<!-- class="colorBG" -->
<div class="content" [hidden]="functionName!='HMG_TKT_NEW_EIT_SS'">
@ -157,7 +157,7 @@
*ngIf="!getResEITTransactionList || getResEITTransactionList[0]?.Collection_Transaction.length <= 0">
<!-- <div class="no-dataDiv"> -->
<ion-row>
<img class="empty-data" src="../assets/imgs/noData.png" />
<img class="empty-data" src="../assets/imgs/box.png" />
</ion-row>
<h4> {{'general, noData' | translate}}</h4>
</div>
@ -228,12 +228,12 @@
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<!-- <ion-footer>
<div class="centerDiv"> -->
<!-- <button *ngIf="getPassMnuEntryObj.ADD_BUTTON == 'Y'" ion-button (click)="addEITRrq()">{{'requestEit.add'
| translate}} </button> -->
<!-- <ion-button class="footer-button" color="customnavy" ion-button (click)="addEITRrq()">
{{'general, add' | translate}}</ion-button> -->
</div>
<!-- </div>
</ion-footer>
</ion-footer> -->

@ -12,7 +12,9 @@
<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"
(click)="openPage(menuItem, i);">
<ion-row style="width: 100%;">
@ -46,4 +48,44 @@
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end" class="arrow-down"></ion-icon> -->
</ion-item>
</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>

@ -16,9 +16,11 @@ export class HomeComponent implements OnInit {
selMenu: MenuResponse = new MenuResponse();
// Selected Side Menu
selectedMenu: any;
pageType :string;
constructor(private cs: CommonService, private ts: TranslatorService) {
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);
const title: string = this.ts.trPK('eit', 'my-requests');
this.headerTitle = this.menu.PROMPT ? this.menu.PROMPT : title;

@ -80,6 +80,7 @@ export class CommonService {
private loadingProgress: any;
public updateImage:boolean=false;
public setUpdateImg:any;
DT: any;
constructor(
public nav: NavController,
public router: Router,
@ -1412,6 +1413,13 @@ public getMonthNameAr(value: number): string {
return objImg;
}
setDeviceToken(deviceToken){
this.DT=deviceToken;
}
getDeviceToken(){
return this.DT;
}
}

@ -221,8 +221,13 @@ export class PushService {
console.log("processStartReceivingWithFirebase");
this.firebasex.getToken().then(token => {
alert("token: "+ token);
// alert("token: "+ token);
this.cs.sharedService.setSharedData(token, "new-device-token");
localStorage.setItem('deviceToken', token);
this.cs.setDeviceToken(token); //last way to set the device Token to get it through getDeviceToken
this.registerInBackend(token);
}).catch(error => console.error('Error getting token', error));

@ -1,5 +1,5 @@
<div class="main-container" [ngStyle]="active === true ? {'background': color} : {}">
<div class="main-container-radius" [ngStyle]="active === true ? {'background-color': '#ffffff'} : {'background-color': color}"></div>
<span class="number-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{value}}</span>
<span *ngIf="text != 'All'" class="number-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{value}}</span>
<span class="text-span" [ngStyle]="active === true ? {'color': '#ffffff'} : {}">{{text}}</span>
</div>

@ -1,11 +1,3 @@
// .modalCss .modal-Wrapper {
// width: 600px;
// height: 300px;
// }
.chart-modal .modal-Wrapper {
--background: rgb(116, 108, 108) !important;
--border-color:white!important ;
@ -18,12 +10,9 @@
font-size: 10px !important;
--background: #22C6B3 !important;
color: aliceblue !important;
// margin-top: 10px !important;
}
.menu{
// margin-left:330px !important;
.menu {
margin-top: 0px !important;
font-size: 35px !important;
background: #22C6B3;
@ -33,7 +22,6 @@
}
.person{
margin-left:100px !important;
margin-top: 0px !important;
font-size: 23px !important;
@ -43,20 +31,19 @@
}
.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;
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;
}
.ionSliders{
margin: 0px !important;
padding: 0px !important;
}
.ionSlide{

@ -17,11 +17,6 @@ import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-re
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();
@ -86,10 +81,7 @@ export class CircleCalendarComponent implements OnInit {
}
reRenderCalendar() {
this.renderDate(this.eventsdateAbsent, 'absent');
this.renderDate(this.eventsdateAttend, 'present');
this.renderDate(this.eventsdateDayOff, 'dayoff');
this.renderDate(this.normalDays, 'scheduleDay');
this.renderDate(this.dayHoursTypeDetailsList);
}
public async dateModal(shiftDetails) {
@ -106,14 +98,23 @@ export class CircleCalendarComponent implements OnInit {
await modal.present();
}
public renderDate(arrayDays, cssClass) {
public renderDate(arrayDays) {
const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)');
arrayDays.forEach(dateObj => {
const date = dateObj.startTime;
const date = dateObj.customScheduleDate;
td.forEach(element => {
// tslint:disable-next-line: triple-equals
if (date.getDate() == element.textContent.trim()) {
element.classList.add(cssClass);
if (date.getDate() == element.textContent.trim() && dateObj.customPresent === true) {
element.classList.add('present');
// tslint:disable-next-line: triple-equals
} else if (date.getDate() == element.textContent.trim() && dateObj.customAbsent === true) {
element.classList.add('absent');
// tslint:disable-next-line: triple-equals
} else if (date.getDate() == element.textContent.trim() && dateObj.customDaysOff === true) {
element.classList.add('dayoff');
// tslint:disable-next-line: triple-equals
} else if (date.getDate() == element.textContent.trim() && dateObj.customSchedule === true) {
element.classList.add('scheduleDay');
}
});
});
@ -124,7 +125,7 @@ export class CircleCalendarComponent implements OnInit {
console.log(event.selectedTime.getDate());
const selectedIndex = event.selectedTime.getDate();
this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1];
if (this.selectedIndexData.present) {
if (this.selectedIndexData.customPresent) {
const rtpID = this.selectedIndexData.RTP_ID;
this.getScheduleShiftDetails(rtpID);
}

@ -1,104 +1,100 @@
<!-- <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>
<ion-content>
<ion-slides [options]="slideOptsOne" (ionSlideDidChange)="slideChanged($event)" #slides>
<ion-slide *ngFor="let shift of SHIFTDETAILS.GetScheduleShiftsDetailsList; let i=index">
<ion-grid class="headerGrid">
<ion-row style="padding: 5px 10px;">
<ion-col size="8">
<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>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
</div>
</ion-col>
<ion-col size="2">
<div class="div" >
</div>
</ion-col>
<ion-col size="4">
<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="p0">{{nameDay}}</p>
</ion-row>
<p class="p2">{{nameMonth}}</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">
<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-row class="gridrow">
<ion-col class="liftcol">
<ion-col [size]="6" style="border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;">
<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-col [size]="6" style="border-bottom: 1px solid #ccc;">
<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-col [size]="6" style="border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;">
<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-col [size]="6" style="border-bottom: 1px solid #ccc;">
<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-col [size]="6" style="border-bottom: 1px solid #ccc; border-right: 1px solid #ccc;">
<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-col [size]="6" style="border-bottom: 1px solid #ccc;">
<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-col [size]="6" style="border-right: 1px solid #ccc;">
<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-col [size]="6">
<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> -->
</ion-slide>
</ion-slides>
</ion-content>

@ -1,54 +1,23 @@
.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%;
left: 42%;
top: 60%;
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;
}
@ -57,20 +26,26 @@
.today-graph{
display: block;
height: 127px;
width: 288px;
width: 270px;
margin-left: -60px;
}
.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;
color: black !important;
font-weight: bold !important;
font-size: 13px !important;
margin-bottom: -29px !important;
width: 100%;
display: block;
text-align: center;
}
.rowlabel{
color: rgb(163, 163, 163) !important;
font-size: 13px !important;
font-family: WorkSans-Bold;
color: #a3a3a3 !important;
font-size: 13px !important;
font-family: WorkSans-Bold;
display: block;
width: 100%;
text-align: center;
padding: 1px;
}
.grid{
padding-bottom: -20px !important;
@ -95,24 +70,15 @@ height: 360px !important;
}
.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;
border-radius: 10px;
margin-bottom:10px;
}
.p0{
margin-bottom: -13px !important;
color: black !important;
font-weight: bold !important;
font-size: 15px !important;
font-size: 14px !important;
margin-top: 8px;
text-align: center;
display: block;
@ -128,22 +94,28 @@ height: 360px !important;
display: block;
width: 100%;
}
.p2{ font-weight: bold !important;
.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; */
text-align: center;
display: block;
width: 100%;
}
.p3{
color: black !important;
font-weight: bold !important;
font-size: 19px;
margin-top: -43px;
margin-left: 27px;
text-align: center;
display: block;
width: 100%;
}
.p4{ margin-bottom: 56px !important;
.p4{
margin-bottom: 56px !important;
margin-top: -26px !important;
color: black !important;
}
@ -158,23 +130,7 @@ height: 360px !important;
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;
// }
}

@ -89,7 +89,7 @@ export class DateInfoModalComponent implements OnInit {
{
data: [this.percChart],
backgroundColor: [
'#22C6B3'
'#094875'
],
borderWidth: 2
}]
@ -98,7 +98,7 @@ export class DateInfoModalComponent implements OnInit {
slideChanged(ev) {
this.slides.getActiveIndex().then(index => {
const shiftDetails = this.SHIFTDETAILS[index];
const shiftDetails = this.SHIFTDETAILS.GetScheduleShiftsDetailsList[index];
this.assignData(shiftDetails);
});
}

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

@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
@Component({
selector: 'app-employee-information',
@ -11,9 +11,16 @@ export class EmployeeInformationComponent implements OnInit {
@Input() name: string;
@Input() title: string;
@Input() employeeImage: string;
@Input() employeePhoneNumber: string;
// tslint:disable-next-line: no-output-on-prefix
@Output() onGetDetails = new EventEmitter();
constructor() { }
ngOnInit() {}
getDetails() {
this.onGetDetails.emit();
}
}

@ -3,10 +3,16 @@
<div class="circle">
<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" /> -->
<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>
</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>

@ -19,6 +19,22 @@ ion-fab-button{
--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{
// position: absolute;
@ -51,7 +67,7 @@ button-inner{
}
.iconFab{
margin-top: -37px;
margin-top: -37px;
width: 100px;
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';
@Component({
@ -7,13 +7,14 @@ import { TranslatorService } from '../../services/translator/translator.service'
styleUrls: ['./fab-button.component.scss'],
})
export class FabButtonComponent implements OnInit {
@Input() type:string;
@Output() trigger = new EventEmitter();
public direction: any;
constructor(
) { }
ngOnInit() {
console.log("type" + this.type);
this.direction = TranslatorService.getCurrentDirection();
}

@ -1,6 +1,7 @@
<div feedback class="custom-button">
<div class="iconBox">
<img [src]="'data:image/png;base64,'+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 class="titleBox">
<p class="pClass">{{title}}</p>

@ -87,7 +87,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
false
);
console.log( "this.user in welcome login"+ this.user);
this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password");
@ -96,6 +96,8 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
this.logintype= localStorage.getItem("login-type");
this.lastLoginDate= localStorage.getItem("login-at");
// this.lastLoginDate= new Date(this.lastLoginDate).toISOString()
@ -185,7 +187,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
console.log(this.confimLogin.buttons[0]);
this.confimLogin.buttons[0].forEach(element => {
if (this.logintype === element.value) {
if (this.user.LoginType === element.value) {
console.log(this.logintype );
console.log(element.value);
console.log("this.logintype === element.value");
@ -199,7 +201,7 @@ export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
});
}
}, 200);
}, 100);
}
public moreLoginOptions() {}

@ -23,7 +23,7 @@
</ion-slides>
</ion-row>
<ion-row *ngFor="let item of menuList; let i=index">
<!-- <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>
@ -34,7 +34,7 @@
icon="assets/icon/new-design/leave_balance.png">
</app-services-button>
</ng-container>
</ion-row>
</ion-row> -->
<ion-row *ngFor="let menuItem of menuEntries; let i=index">
@ -42,7 +42,7 @@
<ion-col [size]="8">
<h3>Monthly Attendance</h3>
<span>View your Monthly Time Sheet</span>
<ion-button (click)="Vacation_Rule()">
<ion-button (click)="openTimeCard()">
View Detail
</ion-button>
</ion-col>
@ -62,6 +62,15 @@
[icon]="subMenu.ICON">
</app-services-button>
</ion-slide>
<ion-slide *ngIf="i == 2">
<app-services-button
(click)="Vacation_Rule()"
title="Vacation Rule"
icon="assets/icon/new-design/vacation_rules_icon.png">
</app-services-button>
</ion-slide>
</ion-slides>
</ion-row>

@ -172,11 +172,13 @@ export class HomePage implements OnInit {
}
ngOnInit() {
this.menu.enable(true)
// this.getUserDetails();
// this.getCount();
// this.events.subscribe('getNotCount', badge => {
// this.notBadge = badge;
// });
this.events.subscribe('getNotCount', badge => {
this.notBadge = badge;
});
}
ionViewWillEnter() {
@ -318,9 +320,13 @@ export class HomePage implements OnInit {
this.userData,
AuthenticatedUser.SHARED_DATA
);
if(this.common.getUpdateImage().status){
this.userImage =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.common.getUpdateImage().img);
}else{
this.userImage = user.EMPLOYEE_IMAGE
? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE
: this.userImage;
}
this.callDashboardServices();
} else {
console.log(user);
@ -373,6 +379,12 @@ export class HomePage implements OnInit {
console.log("menu: " + selMenu.List_Menu);
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.getMenuEntries(item);
for(let i=0;i<this.menuList.length;i++){
if(this.menuList[i].MENU_TYPE=="M"){
this.events.publish("myTeamFlag","true");
}
}
// if (item.MENU_TYPE === 'M') {
// this.common.openMyTeamPage();
// // this.navCtrl.push("MySubordinatePage");
@ -388,6 +400,11 @@ export class HomePage implements OnInit {
openMyTeamPage() {
this.common.openMyTeamPage();
}
openTimeCard() {
this.common.openTimeCardPage();
}
getMenuEntries(item) {
const request: any = {};
let selEmpNo: string = null;
@ -431,6 +448,7 @@ export class HomePage implements OnInit {
this.menuEntries = tree;
console.log(this.menuEntries);
this.common.sharedService.setSharedData(tree, "menuEntries");
this.common.sharedService.setSharedData("home", "homemenuentries");
// this.common.navigateForward("/eit/homepage");
// this.common.openEITPage();
}
@ -528,7 +546,7 @@ export class HomePage implements OnInit {
(result: OpenMissingSwipesResponse) => {
if (this.common.validResponse(result)) {
const key = "GetOpenMissingSwipesList";
this.statsButtons[1].statsValue = result[key].P_OPEN_MISSING_SWIPES;
this.statsButtons[1].statsValue = Math.floor(result[key].P_OPEN_MISSING_SWIPES);
}
}
);
@ -599,7 +617,7 @@ openPeriodDateDashbored() {
ITGCountAllNotification() {
this.workListService.getITGDetails().subscribe((result: any) => {
this.statsButtons[0].statsValue =
this.countAllNotification + result.TotalCount;
Math.floor(this.countAllNotification + result.TotalCount);
});
}
@ -679,7 +697,7 @@ getSubordinatesAttStatus() {
"HMG Annual Vacation Accrual Plan"
) {
this.statsButtons[2].statsValue =
accrualBalance.ACCRUAL_NET_ENTITLEMENT;
Math.floor(accrualBalance.ACCRUAL_NET_ENTITLEMENT);
this.common.sharedService.setSharedData(
accrualBalance,
"leaveAccrualBalance"
@ -697,7 +715,7 @@ getSubordinatesAttStatus() {
totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
}
}
this.statsButtons[3].statsValue = totalTicketsLeft;
this.statsButtons[3].statsValue = Math.floor(totalTicketsLeft);
}
});
}
@ -708,7 +726,8 @@ openattentracking() {
openProfilePage() {
this.common.openEditProfile();
}
}
openStatsButton(link: any) {
// console.log(link);

@ -23,9 +23,9 @@
<ion-row class="ion-justify-content-center">
<ion-col [size]="4">
<div class="action-button col-button">
<span class="action-button-icon">
<a [ngClass]="employee.EMPLOYEE_MOBILE_NUMBER == '' ? 'disable-phone action-button-icon' : 'action-button-icon'" href="tel:{{employee.EMPLOYEE_MOBILE_NUMBER}}">
<img src="../assets/imgs/call_icon.png">
</span>
</a>
<span>Call</span>
</div>
</ion-col>
@ -174,12 +174,8 @@
<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>
@ -222,7 +218,8 @@
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
(click)="getDetails(i)">
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(onGetDetails)="getDetails(i)">
</app-employee-information>
</ng-container>

@ -54,10 +54,6 @@ export class DetailsComponent implements OnInit {
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;
@ -80,11 +76,6 @@ export class DetailsComponent implements OnInit {
public data = {};
public slideOptsOne = {
slidesPerView: 4,
spaceBetween: 10
};
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
@ -125,27 +116,22 @@ export class DetailsComponent implements OnInit {
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.preMonth = new Date().getMonth();
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);
@ -175,14 +161,12 @@ export class DetailsComponent implements OnInit {
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) {
@ -197,7 +181,6 @@ export class DetailsComponent implements OnInit {
}
previousSlide() {
this.normalDays = [];
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
@ -211,6 +194,7 @@ export class DetailsComponent implements OnInit {
}
changeMonthTitle(title) {
this.monthTitle = title;
this.getTimeCardSummaryDetails();
@ -224,52 +208,35 @@ export class DetailsComponent implements OnInit {
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)
});
allDays[i].customPresent = true;
allDays[i].customAbsent = false;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = 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
});
allDays[i].customPresent = false;
allDays[i].customAbsent = true;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
// 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)
});
allDays[i].customPresent = false;
allDays[i].customAbsent = false;
allDays[i].customDaysOff = true;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = 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)
});
allDays[i].customPresent = false;
allDays[i].customAbsent = false;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = true;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
}
}
this.showData = true;
console.log(this.arrDaysOff);
console.log(this.arrDaysAttendance);
console.log(this.arrDaysAbsent);
console.log(this.normalDays);
this.dayHoursTypeDetailsList = allDays;
}
public getTimeCardSummaryDetails(month?, year?) {
@ -520,6 +487,7 @@ doInfinite(infiniteScroll) {
sortMenuEntires(list) {
const tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, 'menuEntries');
this.common.sharedService.setSharedData("myteam", "homemenuentries");
this.common.openEITPage();
}

@ -68,9 +68,8 @@
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
checkIn="08:15"
checkOut="-"
(click)="getDetails(i)">
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(onGetDetails)="getDetails(i)">
</app-employee-information>
</ng-container>

@ -14,11 +14,16 @@
<div class="request-heading">
<span>Open Request Analysis</span>
</div>
<div class="result-text-container">
<h2>{{totalRequestCount}}</h2>
<div class="result-text-container" [ngStyle]="showChart === false ? {'visibility': 'hidden'} : {}">
<span *ngIf="selectedFilter === 'ALL'">{{newWorkListResponse.length + ITGCount}} of </span>
<span *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse.length}} of </span>
<h2 *ngIf="!showSearchButton">{{totalRequestCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && itemType === ''">{{newWorkListResponse[0].NO_OF_ROWS + ITGCount}}</h2>
<h2 *ngIf="showSearchButton && newWorkListResponse.length > 0 && selectedFilter !== 'ALL' && itemType !== ''">{{newWorkListResponse[0].NO_OF_ROWS}}</h2>
<span>TOTAL <br> OPEN REQUEST</span>
</div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="!showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
<p-chart *ngIf="showChart" class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<ion-row class="filters-row">
@ -61,34 +66,36 @@
</ion-col>
</ion-row>
<div [ngClass]="isEmptyObject() ? 'work-list-container' : ''" *ngIf='selectedFilter != "ITG"'>
<div *ngFor="let data of showFormattedData | keyvalue; let i = index">
<span class="date-span">{{data.key}}</span>
<div class="date-data" *ngFor="let workList of data.value; let j = index">
<div (click)="openNotificationDetail(workList)">
<p>{{workList.SUBJECT}}</p>
<div style="position: relative;">
<div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf='selectedFilter != "ITG"'>
<div *ngFor="let formattedData of showFormattedData; let i = index">
<span class="date-span">{{formattedData.date}}</span>
<div class="date-data" *ngFor="let workList of formattedData.data; let j = index">
<p (click)="openNotificationDetail(workList)">{{workList.SUBJECT}}</p>
</div>
</div>
</div>
</div>
</div>
<div [ngClass]="isEmptyObject() ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'>
<span class="date-span">{{segmentInfo.ModifiedDate |date}}</span>
<div class="date-data">
<p>{{segmentInfo.Title}}</p>
<div [ngClass]="showFormattedData.length > 0 ? 'work-list-container' : ''" *ngIf="selectedFilter == 'ITG'" >
<div *ngFor='let segmentInfo of ITGItem[0]; let i= index' (click)='openITG(segmentInfo)'>
<span class="date-span">{{segmentInfo.ModifiedDate |date}}</span>
<div class="date-data">
<p>{{segmentInfo.Title}}</p>
</div>
</div>
</div>
</div>
<div class="no-data-available" *ngIf="showFormattedData.length === 0">
<span>No Data Available</span>
</div>
</div>
<div class="no-data-available" *ngIf="!isEmptyObject()">
<span>No Data Available</span>
</div>
</div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="selectedFilter === 'ALL' || itemType !== ''">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>

@ -333,6 +333,8 @@ ion-content {
margin-top: 15px;
display: block;
padding: 0 20px;
position: relative;
z-index: 99;
ion-col{
background: white;
border-radius: 12px;
@ -382,9 +384,8 @@ ion-content {
font-family: WorkSans-Regular;
padding: 30px;
position: absolute;
left: 50%;
margin-left: -100px;
margin-top: 100px;
left: 85px;
top: 50px;
}
.disable-filter {
pointer-events: none;

@ -9,6 +9,8 @@ import { IonInfiniteScroll } from '@ionic/angular';
import { WorklistMainService } from '../service/work-list.main.service';
import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component';
import { DatePipe } from '@angular/common';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
@Component({
selector: 'app-home',
@ -58,10 +60,18 @@ export class HomeComponent implements OnInit {
public worklistNotifications: any;
public totalRequestCount = 0;
public newWorkListResponse = [];
public showFormattedData = {};
public showFormattedData = [];
public allFormattedData = [];
public selectedFilter = 'ALL';
public showSearchButton = false;
public itemType = '';
public totalHR = 0;
public totalPO = 0;
public totalPR = 0;
public totalMR = 0;
public showChart = false;
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
@ -138,9 +148,11 @@ export class HomeComponent implements OnInit {
constructor(
public common: CommonService,
public ts: TranslatorService,
// tslint:disable-next-line: no-shadowed-variable
public WorklistService: WorklistService,
public workListService: WorklistMainService,
public modalController: ModalController
public modalController: ModalController,
public DS: DashboredService
) {
this.WorkListObj = new WorkListRequest();
this.WorkListObj.P_NOTIFICATION_TYPE = '1';
@ -153,61 +165,71 @@ export class HomeComponent implements OnInit {
}
ngOnInit(){
}
ionViewDidEnter() {
console.log("ionViewDidEnter");
this.openNotificationsDashboard();
// this.direction = TranslatorService.getCurrentDirection();
this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false);
}
ngOnInit() {
}
callWorkListServices() {
this.Details();
this.Count();
this.assignDataToFilters();
this.getAllPushNotificationFun();
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
}
openNotificationsDashboard() {
this.DS.getOpenNotifications().subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
this.worklistNotifications = result;
this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER;
this.common.sharedService.setSharedData(result, 'worklistNotifications');
this.callWorkListServices();
}
});
}
assignDataToFilters() {
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
for (const notification of openNotificationsArray) {
if (notification.ITEM_TYPE === 'HRSSA') {
this.filters[1].value = notification.OPEN_NTF_NUMBER;
this.filters[1].value = this.totalHR;
this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'POAPPRV') {
this.filters[2].value = notification.OPEN_NTF_NUMBER;
this.filters[2].value = this.totalPO;
this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'REQAPPRV') {
this.filters[3].value = notification.OPEN_NTF_NUMBER;
this.filters[3].value = this.totalPR;
this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'INVMOA') {
this.filters[4].value = notification.OPEN_NTF_NUMBER;
this.filters[4].value = this.totalMR;
this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER;
} else if (notification.ITEM_TYPE === 'ITG') {
this.filters[5].value = notification.OPEN_NTF_NUMBER;
this.data.datasets[0].data[4] = notification.OPEN_NTF_NUMBER;
}
}
}
this.showChart = true;
}
activeFilter(index: number) {
if (this.currentActiveIndex !== index) {
this.showFormattedData = {};
this.previousActiveIndex = this.currentActiveIndex;
this.currentActiveIndex = index;
this.filters[this.previousActiveIndex].active = false;
this.filters[this.currentActiveIndex].active = true;
if (this.filters[this.currentActiveIndex].value !== 0) {
const selectedKey = this.filters[this.currentActiveIndex].key;
this.resetData();
this.itemType = (selectedKey !== 'ITG' && selectedKey !== 'ALL') ? this.filters[this.currentActiveIndex].key : '';
this.getAllPushNotificationFun();
}
this.selectedFilter = this.filters[this.currentActiveIndex].key;
if (this.selectedFilter !== 'ITG') {
this.getFilteredData(this.selectedFilter);
}
}
}
@ -237,13 +259,13 @@ export class HomeComponent implements OnInit {
async openSearchModal() {
const modal = await this.modalController.create({
component: WorklistAdvancedSearchComponent,
cssClass: 'advanced-search-modal',
cssClass: 'advanced-search-modal-custom',
backdropDismiss: false,
componentProps: {}
});
modal.onDidDismiss().then(result => {
if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.showSearchButton = true;
this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
@ -252,7 +274,7 @@ export class HomeComponent implements OnInit {
this.inputSearch = result.data.inputSearch;
this.WorkListObj.P_PAGE_NUM = 1;
this.newWorkListResponse = [];
this.showFormattedData = {};
this.showFormattedData = [];
this.selectedFilter = 'ALL';
this.filters[this.currentActiveIndex].active = false;
this.currentActiveIndex = 0;
@ -275,7 +297,7 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : '';
this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3')
? moment(this.inputDate).format('DD-MMM-YYYY') : '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : ''; ;
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : '';
this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : '';
this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1';
if (this.selectedValue === '5') {
@ -284,7 +306,6 @@ export class HomeComponent implements OnInit {
this.WorkListObj.P_SEARCH_SENT_DATE = '';
this.WorkListObj.P_SEARCH_SUBJECT = '';
}
this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => {
if (this.common.validResponse(result)) {
this.handleWorkListResult(result.GetWorkList);
@ -293,25 +314,83 @@ export class HomeComponent implements OnInit {
);
}
categorizeData(arrayToCategorize: any) {
console.log("categorizeData");
const datePipe = new DatePipe('en-US');
const formattedData = {};
for (const workList of arrayToCategorize) {
workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
if (!(workList.FORMATTED_DATE in formattedData)) {
formattedData[workList.FORMATTED_DATE] = new Array();
formattedData[workList.FORMATTED_DATE].push(workList);
} else {
formattedData[workList.FORMATTED_DATE].push(workList);
getFilteredData(filter: string) {
if (filter === 'ALL') {
this.showFormattedData = this.allFormattedData;
} else {
let arrayToFilter;
arrayToFilter = this.newWorkListResponse.filter((workList) => {
return workList.ITEM_TYPE === filter;
});
const sortData = this.sortArray(arrayToFilter);
this.showFormattedData = this.categorizeData(sortData);
}
}
checkDateExistance(currentDate: any, formattedData: any) {
let existsBefore = false;
let index = 0;
for (let i = 0; i < formattedData.length; i++) {
if (formattedData[i].date === currentDate) {
existsBefore = true;
index = i;
break;
}
}
return {
exists: existsBefore,
indexNumber: index
};
}
addCountInFilters(workList: any) {
if (workList.ITEM_TYPE === 'HRSSA') {
this.totalHR = this.totalHR + 1;
} else if (workList.ITEM_TYPE === 'POAPPRV') {
this.totalPO = this.totalPO + 1;
} else if (workList.ITEM_TYPE === 'REQAPPRV') {
this.totalPR = this.totalPR + 1;
} else if (workList.ITEM_TYPE === 'INVMOA') {
this.totalMR = this.totalMR + 1;
}
}
categorizeData(arrayToCategorize: any) {
this.totalHR = 0;
this.totalPO = 0;
this.totalPR = 0;
this.totalMR = 0;
const datePipe = new DatePipe('en-US');
const formattedData = [];
for (const workList of arrayToCategorize) {
this.addCountInFilters(workList);
const currentDate = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y');
const currentObject = {
date: '',
data: []
};
if (formattedData.length === 0) {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
} else {
const existsBefore = this.checkDateExistance(currentDate, formattedData);
if (existsBefore.exists) {
formattedData[existsBefore.indexNumber].data.push(workList);
} else {
currentObject.date = currentDate;
currentObject.data.push(workList);
formattedData.push(currentObject);
}
}
}
return formattedData;
return formattedData;
}
sortArray(arrayToSort: any) {
return arrayToSort.sort((a: any, b: any) =>
new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime()
new Date(b.date).getTime() - new Date(a.date).getTime()
);
}
@ -338,9 +417,10 @@ export class HomeComponent implements OnInit {
} else {
this.newWorkListResponse = this.newWorkListResponse.concat(result);
}
this.newWorkListResponse = this.sortArray(this.newWorkListResponse);
console.log(this.newWorkListResponse);
this.showFormattedData = this.categorizeData(this.newWorkListResponse);
const categorizedWorkListResponse = this.categorizeData(this.newWorkListResponse);
this.assignDataToFilters();
this.showFormattedData = this.sortArray(categorizedWorkListResponse);
this.allFormattedData = this.showFormattedData;
this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR);
} else {
this.newWorkListResponse = [];
@ -348,7 +428,6 @@ export class HomeComponent implements OnInit {
}
openNotificationDetail(obj) {
console.log(obj);
this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA);
if (obj.REQUEST_TYPE === 'PR') {
this.common.openWorklistMainPRPage();
@ -361,10 +440,6 @@ export class HomeComponent implements OnInit {
}
}
isEmptyObject() {
return (this.showFormattedData && (Object.keys(this.showFormattedData).length > 0) || this.ITGItem.length > 0);
}
resetData() {
if (this.infiniteScroll) {
this.infiniteScroll.complete();
@ -375,7 +450,8 @@ export class HomeComponent implements OnInit {
this.inputDate = '';
this.inputSearch = '';
this.newWorkListResponse = [];
this.showFormattedData = {};
this.showFormattedData = [];
this.allFormattedData = [];
this.WorkListObj.P_SEARCH_FROM_USER = '';
this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = '';
this.WorkListObj.P_SEARCH_SENT_DATE = '';
@ -422,13 +498,13 @@ export class HomeComponent implements OnInit {
Details() {
this.workListService.getITGDetails()
.subscribe((result: any) => {
this.ITGCount = result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.filters[5].value = result.TotalCount;
});
}
ITGNotification() {
// this.Details();
this.isAll = false;
this.isPR = false;
this.isPO = false;

@ -257,6 +257,7 @@
<div class="hrTitle"> {{ts.trPK('payslip','payment-information')}} </div>
<div *ngIf="GetPaymentInformationList !=''">
<div *ngFor="let paymentInfo of GetPaymentInformationList">
<ion-grid class="grids" >
<ion-row class="rowtables">
<ion-col class="colPayslips">
@ -265,7 +266,7 @@
</ion-row>
<ion-row>
<label class="label" for="">{{GetPaymentInformationList.PAYMENT_METHOD_NAME}}</label>
<label class="label" for="">{{paymentInfo.PAYMENT_METHOD_NAME}}</label>
</ion-row>
</ion-col>
@ -276,7 +277,7 @@
<label class="label" for="">{{ts.trPK('payslip','bank-name')}} </label>
</ion-row>
<ion-row >
<label class="label" for="">{{GetPaymentInformationList.BANK_NAME}}</label>
<label class="label" for="">{{paymentInfo.BANK_NAME}}</label>
</ion-row>
</ion-col>
<ion-col class="colPayslips">
@ -285,7 +286,7 @@
</label>
</ion-row>
<ion-row >
<label class="label" for="">{{GetPaymentInformationList.BRANCH_NAME}}</label>
<label class="label" for="">{{paymentInfo.BRANCH_NAME}}</label>
</ion-row>
</ion-col>
</ion-row>
@ -297,7 +298,7 @@
</label>
</ion-row>
<ion-row >
<label class="label" for="">{{GetPaymentInformationList.ACCOUNT_NUMBER}}</label>
<label class="label" for="">{{paymentInfo.ACCOUNT_NUMBER}}</label>
</ion-row>
</ion-col>
<ion-col class="colPayslips">
@ -306,10 +307,11 @@
</label>
</ion-row>
<ion-row >
<label class="label" for="">{{GetPaymentInformationList.AMOUNT}}</label>
<label class="label" for="">{{paymentInfo.AMOUNT}}</label>
</ion-row>
</ion-col>
</ion-row>
</ion-grid>
</div>
</div>
</ion-content>

@ -257,7 +257,7 @@ getPaymentInfo(ActionContextID){
handleGetPaymentInfoResult(result){
if (result.GetPaymentInformationList != null) {
this.GetPaymentInformationList = result.GetPaymentInformationList[0];
this.GetPaymentInformationList = result.GetPaymentInformationList;
}
}

@ -2,12 +2,13 @@ import { NgModule } from '@angular/core';
import { DateStringPipe } from './date-string/date-string';
import { FilterLangPipe } from './filter-lang/filter-lang';
import { TurncatePipe } from './turncate/turncate.pipe';
import{ JsonDatePipe} from './json-date/json-date'
@NgModule({
declarations: [DateStringPipe,
declarations: [DateStringPipe,JsonDatePipe,
FilterLangPipe,
TurncatePipe],
imports: [],
exports: [DateStringPipe,
FilterLangPipe,TurncatePipe]
FilterLangPipe,TurncatePipe,JsonDatePipe]
})
export class PipesModule {}

@ -7,6 +7,7 @@ import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/mo
import { PerformanceAppraisalResponse } from 'src/app/hmg-common/services/dashbored/performance-appraisal.response';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { DomSanitizer } from '@angular/platform-browser';
// import { DomSanitizer } from '@angular/platform-browser';
@ -35,17 +36,19 @@ export class EditProfileComponent implements OnInit {
public cs: CommonService,
public authService: AuthenticationService,
public DS :DashboredService,
public sharedData: SharedDataService
public sharedData: SharedDataService,
public events: Events,
private sanitizer: DomSanitizer,
// private events: Events,
// private sanitizer: DomSanitizer,
)
{
// this.events.subscribe("img-change", displayImg => {
// console.log("app compont: "+displayImg);
// this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg);
this.events.subscribe("img-change", displayImg => {
console.log("app compont: "+displayImg);
this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg);
// });
});
}
@ -63,9 +66,13 @@ export class EditProfileComponent implements OnInit {
this.personalInfo = user;
this.User_name_Emp=this.personalInfo.EMPLOYEE_NAME;
this.User_Job_name=this.personalInfo.JOB_NAME;
if(this.cs.getUpdateImage().status){
this.user_image =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img);
}else{
this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: "../assets/imgs/profile.png";
}
console.log("name: "+ this.personalInfo.EMPLOYEE_NAME);
console.log("user name: "+ user.EMPLOYEE_NAME);
console.log("name: "+ this.personalInfo.JOB_NAME);

@ -51,8 +51,7 @@ export class HomeComponent implements OnInit {
if(this.cs.getUpdateImage().status){
// this.imageSrc = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+this.cs.getUpdateImage().img);
this.imageSrc = "data:image/png;base64,"+this.cs.getUpdateImage().img;
// alert("this.imageSrc"+ this.imageSrc);
this.imageSrc =this.sanitizer.bypassSecurityTrustUrl("data:image/png;base64,"+this.cs.getUpdateImage().img);
}else{
this.imageSrc = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE

@ -1,148 +1,96 @@
<ion-content class="colorBG">
<ion-header>
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<nav-buttons backLink="/home"></nav-buttons>
</ion-buttons>
<ion-title>MONTHLY ATTENDANCE</ion-title>
</ion-toolbar>
</ion-header>
<div class="header-div">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
</ion-buttons>
<ion-title class="Title"> {{ts.trPK('attendance','monthly-attendance')}}</ion-title>
</div>
<div>
<div class="header">
<div class="slider">
<ion-row>
<ion-col>
<button ion-button icon-start class="slidPrev" (click)="previousSlide(sliderOne,slideWithNav)">
<ion-icon class="activeArrow" ios="ios-arrow-dropleft-circle" md="md-arrow-dropleft-circle">
</ion-icon>
</button>
</ion-col>
<ion-col>
<p style="position: absolute; left: 27%; bottom: 0%; font-family: WorkSans-Bold;">{{month}}</p>
</ion-col>
<ion-col>
<p style="position: absolute; left: 25%; bottom: 0%; font-family: WorkSans-Bold;">{{year}}</p>
</ion-col>
<ion-col>
<button ion-button icon-end class="slidNext" (click)="nextSlide()">
<ion-icon [ngClass]=" currentMonthName === month ? 'disabledArrow' : 'activeArrow'"
ios="ios-arrow-dropright-circle" md="md-arrow-dropright-circle"></ion-icon>
</button>
</ion-col>
</ion-row>
<ion-content>
<div class="contentBg">
<div>
<div class="header">
<div>
<ion-row>
<ion-col [size]="2" style="text-align: left;">
<ion-icon class="activeArrow" ios="ios-arrow-dropleft-circle" md="md-arrow-dropleft-circle" (click)="previousSlide()"></ion-icon>
</ion-col>
<ion-col [size]="8" style="text-align: center;">
<span class="month-year-span">{{month}} {{year}}</span>
</ion-col>
<ion-col [size]="2" style="text-align: right;">
<ion-icon [ngClass]=" currentMonthName === month ? 'disabledArrow' : 'activeArrow'" ios="ios-arrow-dropright-circle" md="md-arrow-dropright-circle" (click)="nextSlide()"></ion-icon>
</ion-col>
</ion-row>
</div>
</div>
<ion-slides [options]="slideOptsOne" #slideWithNav (ionSlideDidChange)="SlideDidChange(sliderOne,slideWithNav)">
<ion-slide>
<ion-grid class="headerGrid">
<div style="color: black;">
<div class="result-graph">
<div class="request-heading">
<span> {{ts.trPK('attendance-tracking','attendance-statistics')}}</span>
</div>
<div class="result-text-container">
<h2>{{totalAttendancePrecentage}}</h2>
<p>{{ts.trPK('absenceList','days')}}</p>
</div>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
<div style="position: relative;
left: 74%;
bottom: 117px;
color: black;
background-color: #22c6b3;
width: 20%; height: 6px;">
<ion-col>
<ion-row>
<label class="green-label">{{ts.trPK('attendance','present')}}</label>
</ion-row>
<ion-row>
<label class="green-amount">{{attendedDays}}</label>
</ion-row>
</ion-col>
</div>
<div style="position: relative;
left: 74%;
bottom: 67px;
color: black;
background-color: #094875;
width: 20%; height: 6px;">
<ion-col>
<ion-row>
<label class="blue-label">{{ts.trPK('attendance','absent')}}</label>
</ion-row>
<ion-row>
<label class="blue-amount" for="">{{absentDays}}</label>
</ion-row>
</ion-col>
</div>
<div class="result-graph">
<div class="request-heading">
<span>{{ts.trPK('myTeam','attendance-statistics')}}</span>
</div>
<div style="position: relative;">
<div class="label-container">
<div class="green-label-container">
<span class="span-one">{{ts.trPK('attendance','present')}}</span>
<span class="span-two">{{attendedDays}}</span>
</div>
</ion-grid>
</ion-slide>
</ion-slides>
</div>
</div>
<div style="margin-top: 10%;">
<ion-grid>
<ion-row>
<ion-col>
<ion-grid class="labelGrid">
<ion-row>
<ion-col>
<label style="font-size: 12px;">{{ts.trPK('attendance-tracking','schedule')}}</label>
</ion-col>
<ion-col>
<h2 *ngIf="timeCardSummaryData" style="margin-left: 45%; font-size: 25px; font-weight: bold;">
{{timeCardSummaryData.SCHEDULE_DAYS}}</h2>
<h2 *ngIf="!timeCardSummaryData" style="margin-left: 45%; font-size: 25px;">0</h2>
</ion-col>
</ion-row>
</ion-grid>
<div class="blue-label-container">
<span class="span-one">{{ts.trPK('attendance','absent')}}</span>
<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>
<p-chart class="today-graph" type="doughnut" [data]="data" [options]="options"></p-chart>
</div>
</div>
</div>
<ion-row class="attendance-summary">
<ion-col [size]="3">
<div class="attendance-information">
<span>{{ts.trPK('attendance-tracking','schedule')}}</span>
<h2>{{timeCardSummaryData.SCHEDULE_DAYS}}</h2>
</div>
</ion-col>
<ion-col>
<ion-grid class="labelGrid">
<ion-row>
<ion-col>
<label style="font-size: 12px;">{{ts.trPK('attendance-tracking','off-days')}}</label>
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<h2 *ngIf="timeCardSummaryData"
style="margin-left: 37%; margin-top: 18px; font-size: 25px; font-weight: bold;">
{{timeCardSummaryData.OFF_DAYS}}</h2>
<h2 *ngIf="!timeCardSummaryData" style="margin-left: 37%; font-size: 25px;">0</h2>
</ion-col>
</ion-row>
</ion-grid>
<ion-col [size]="3">
<div class="attendance-information">
<span>{{ts.trPK('attendance-tracking','off-days')}}</span>
<h2>{{timeCardSummaryData.OFF_DAYS}}</h2>
</div>
</ion-col>
<ion-col>
<ion-grid class="labelGrid">
<label style="font-size: 12px;">{{ts.trPK('attendance-tracking','non-analyzed')}}</label>
<h2 *ngIf="timeCardSummaryData" style="margin-left: 36%; font-size: 25px; font-weight: bold;">
{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}</h2>
<h2 *ngIf="!timeCardSummaryData" style="margin-left: 36%; font-size: 25px;">0</h2>
</ion-grid>
<ion-col [size]="3">
<div class="attendance-information">
<span>{{ts.trPK('attendance-tracking','non-analyzed')}}</span>
<h2>{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}</h2>
</div>
</ion-col>
<ion-col>
<ion-grid class="labelGrid">
<label style="font-size: 12px;">{{ts.trPK('attendance-tracking','shortage-hours')}}</label>
<h2 *ngIf="timeCardSummaryData" style="margin-left: 18%; font-size: 25px; font-weight: bold;">
{{timeCardSummaryData.SHORTAGE_HRS}}</h2>
<h2 *ngIf="!timeCardSummaryData" style="margin-left: 45%; font-size: 25px;">0</h2>
</ion-grid>
<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>
</ion-grid>
</div>
<div>
<ion-grid class="bodyGrid" *ngIf="showData">
<p style="font-weight: bold; font-size: 17px;"> {{ts.trPK('attendance','monthly-attendance-calendar')}}</p>
<app-circle-calendar [eventsdateAttend]='arrDaysAttendance' [eventsdateAbsent]='arrDaysAbsent'
[eventsdateDayOff]='arrDaysOff' (monthTitle)='changeMonthTitle($event)' (currentYear)=changeYear($event)>
</app-circle-calendar>
</ion-grid>
<div *ngIf="showData" class="calendar-container">
<span> {{ts.trPK('attendance','monthly-attendance-calendar')}}</span>
<app-circle-calendar
[currentDateParent]="currentDate"
[dayHoursTypeDetailsList]="dayHoursTypeDetailsList"
(monthTitle)='changeMonthTitle($event)'
(currentYear)=changeYear($event)>
</app-circle-calendar>
</div>
</div>
</div>
</ion-content>

@ -8,7 +8,6 @@ import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/g
import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import * as moment from 'moment';
import { getDate } from 'date-fns';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
@ -19,13 +18,6 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
export class TimeCardDetailsComponent implements OnInit {
slideView: any;
sliderOne: any;
@ViewChild('slides') slides: IonSlides;
@ViewChild('slideWithNav') slideWithNav: IonSlides;
slideOptsOne = {
initialSlide: 0,
slidesPerView: 1,
autoplay: true
};
month: any;
year: any;
preMonth: number;
@ -37,9 +29,7 @@ export class TimeCardDetailsComponent implements OnInit {
public sharedData: SharedDataService,
public ts: TranslatorService
) { }
@ViewChild('sliderRef') protected sliderRef: IonSlides;
public activeSegment: any = 'time-card-summary';
public showMore: any = true;
public menuType: any;
public selEmp: string;
@ -63,9 +53,6 @@ export class TimeCardDetailsComponent implements OnInit {
public attendedDays: number;
public futrueDays = 0;
public totalAttendancePrecentage = 0;
public arrDaysAttendance: any = [];
public arrDaysAbsent: any = [];
public arrDaysOff: any = [];
public monthTitle: string = moment().format('MMMM');
public yearTitle: string;
public isChange = false;
@ -73,61 +60,31 @@ export class TimeCardDetailsComponent implements OnInit {
public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
public showData = false;
public currentYear = new Date().getFullYear();
public dayHoursTypeDetailsList = [];
public currentDate = new Date();
public options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
public data = {
datasets: [
{
data: [120, 50],
backgroundColor: [
'#22c6b3',
'#094875',
],
borderWidth: 2
}]
};
public data = {};
ngOnInit() {
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.preMonth = new Date().getMonth();
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 segmentChanged(event: any) {
console.log('segmentChanged');
this.activeSegment = event.detail.value;
if (this.activeSegment === 'time-card-details' && this.dayHoursData.length === 0) {
this.getDayHoursTypeDetails();
} else {
this.rightIconActive = true;
this.leftIconActive = false;
}
}
public toggleButton() {
this.showMore = !this.showMore;
}
public getDayHoursTypeDetails(month?, year?) {
console.log('getDayHoursTypeDetails');
const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
this.monthName = month;
this.yearDate = year;
@ -144,39 +101,11 @@ export class TimeCardDetailsComponent implements OnInit {
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
if (Object.keys(this.selectedFilters).length !== 0) {
dayAndHoursReqObj.P_SHT_TYPE = this.selectedShiftFilter;
dayAndHoursReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value;
dayAndHoursReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value;
dayAndHoursReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value;
dayAndHoursReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value;
dayAndHoursReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value;
dayAndHoursReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value;
dayAndHoursReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value;
dayAndHoursReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value;
dayAndHoursReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value;
dayAndHoursReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value;
dayAndHoursReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value;
}
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.loadMoreDateHoursData = false;
const daysDataLength = result.GetDayHoursTypeDetailsList.length;
this.loadMore = daysDataLength === 10 ? true : false;
if (this.dayAndHoursPageNumber > 1 && daysDataLength !== 0) {
this.rightIconActive = true;
this.dayHoursData = this.dayHoursData.concat(result.GetDayHoursTypeDetailsList);
setTimeout(() => {
this.nextSlide();
}, 1000);
} else if (this.dayAndHoursPageNumber === 1 && daysDataLength <= 10 && daysDataLength !== 0) {
this.rightIconActive = true;
this.dayHoursData = result.GetDayHoursTypeDetailsList;
}
}
});
@ -185,44 +114,43 @@ export class TimeCardDetailsComponent implements OnInit {
countAllAttendDays(allDays) {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < allDays.length; i++) {
if (allDays[i].DAY_TYPE === 'Off') {
// offDay
this.arrDaysOff.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} else if (allDays[i].DAY_TYPE === 'SCHEDULED') {
// attendace
this.arrDaysAttendance.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
// tslint:disable-next-line: triple-equals
if (allDays[i].ATTENDED_FLAG == 'Y') {
allDays[i].customPresent = true;
allDays[i].customAbsent = false;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = 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].customPresent = false;
allDays[i].customAbsent = true;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
// tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
allDays[i].customPresent = false;
allDays[i].customAbsent = false;
allDays[i].customDaysOff = true;
allDays[i].customSchedule = false;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
} else {
// absent
this.arrDaysAbsent.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE),
isoTime: '09:00:00',
allDay: false
});
allDays[i].customPresent = false;
allDays[i].customAbsent = false;
allDays[i].customDaysOff = false;
allDays[i].customSchedule = true;
allDays[i].customScheduleDate = new Date(allDays[i].SCHEDULE_DATE);
}
}
this.showData = true;
this.dayHoursTypeDetailsList = allDays;
}
public getTimeCardSummaryDetails(month?, year?) {
console.log('getTimeCardSummaryDetails');
const timeCardSummaryReqObj = new GetTimeCardSummaryRequest();
if (this.isChange) {
this.monthName = month;
console.log('' + this.monthName);
this.yearDate = year;
console.log('' + this.yearDate);
} else {
this.monthName = month;
this.yearDate = year;
}
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);
@ -235,154 +163,98 @@ export class TimeCardDetailsComponent implements OnInit {
timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate;
if (Object.keys(this.selectedFilters).length !== 0) {
timeCardSummaryReqObj.P_SHT_TYPE = this.selectedShiftFilter;
timeCardSummaryReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value;
timeCardSummaryReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value;
timeCardSummaryReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value;
timeCardSummaryReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value;
timeCardSummaryReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value;
timeCardSummaryReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value;
timeCardSummaryReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value;
timeCardSummaryReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value;
timeCardSummaryReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value;
timeCardSummaryReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value;
timeCardSummaryReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value;
}
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;
this.options = {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }
};
if (this.absentDays === 0 && this.attendedDays === 0) {
this.futrueDays = this.totalAttendancePrecentage;
}
this.data = {
datasets: [
{
data: [this.absentDays, this.attendedDays, this.futrueDays],
backgroundColor: [
'#094875',
'#22c6b3',
'#9e9e9e'
],
borderWidth: 2
}]
};
}
});
}
async openSelectPeriodModal() {
const modal = await this.modalController.create({
component: SelectPeriodComponent,
cssClass: 'select-period-custom-modal',
componentProps: {
dateFrom: this.dateFrom,
dateTo: this.dateTo
}
});
modal.onDidDismiss().then(result => {
this.loadMore = false;
this.rightIconActive = false;
this.leftIconActive = false;
this.dayHoursData = [];
this.timeCardSummaryData = [];
this.dayAndHoursPageNumber = 1;
this.loadMoreDateHoursData = false;
this.dateFrom = result.data.dateFrom;
this.dateTo = result.data.dateTo;
this.selectedFilters = result.data.keySelectedFilters;
this.selectedShiftFilter = result.data.selectedShiftType;
if (this.dateFrom && this.dateTo) {
this.getDayHoursTypeDetails();
this.getTimeCardSummaryDetails();
// 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
}]
};
}
}
});
return await modal.present();
}
showShiftDetails(origin: string) {
this.sliderRef.getActiveIndex().then((index: number) => {
this.selectedShift = this.dayHoursData[index];
this.selectedShift.origin = origin;
this.sharedData.setSharedData(this.selectedShift, 'selectedShift');
this.common.navigatePage('/time-card/shift-details');
});
}
nextSlide() {
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
this.currentYear = this.currentYear + 1;
this.nextMonth = 1;
}
this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
this.nextMonth = this.nextMonth + 1;
this.preMonth = this.nextMonth - 2;
nextSlide() {
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.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
this.preMonth = 12;
previousSlide() {
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;
}
this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
this.preMonth = this.preMonth - 1;
this.nextMonth = this.preMonth + 2;
}
changeMonthTitle(title) {
changeMonthTitle(title) {
this.monthTitle = title;
this.isChange = true;
this.getTimeCardSummaryDetails();
}
changeYear(year) {
this.yearTitle = year;
}
}
getHeaderMonth(date: any) {
return this.getMonthName(date.getMonth() + 1) + ' ' + date.getFullYear();
}
changeYear(year) {
this.yearTitle = year;
}
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';
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';
}
}
}
}

@ -31,7 +31,7 @@ export class TimeInput extends UiElement {
this.formatDate();
}
const template =
"<div class='custom-text-area-element' style='"+this.hidden+"'>" +
"<div class='custom-text-area-element dynamicField' style='"+this.hidden+"'>" +
" <label class='daynamicForm-Label "+requiredClass+"' id='title' >" + this.label + "</label>" +
// " <input class='daynamicForm-DateTime' type='time' id='" + this.elementId + "' value='" + this.value + "' "+this.disabled+" />"+
" <div class='daynamicForm-DateTime "+disaledClass+"' id='" + this.elementId + "' data-dtvalue='" + this.value + "' "+this.disabled+">"+this.value+"</div>"+

@ -1,6 +1,6 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<!-- <nav-buttons></nav-buttons> -->
<ion-toolbar class="header-toolbar-new">
<!-- <nav-buttons></nav-buttons> -->
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home"></ion-back-button>
@ -10,13 +10,13 @@
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-content class="colorBG" padding>
<!-- <div #containerDiv id="containerDiv"> -->
<!-- </div> -->
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, tip" | translate'></div>
<ion-card *ngFor="let item of GetVacationRulesList; let i = index;">
<!-- <div style="padding: 0 10px;" [innerHTML]='"vacation-rule, tip" | translate'></div> -->
<!-- <ion-card *ngFor="let item of GetVacationRulesList; let i = index;">
<ion-card-header class="boxHdr">
<ion-grid no-padding>
<ion-row class="hrTitle" nowrap>
@ -78,15 +78,55 @@
</ion-card-content>
</ion-card>
-->
<ion-list class="listVR">
<!-- Multi-line sliding item with icon options on both sides -->
<ion-item-sliding class="itemVR" *ngFor="let item of GetVacationRulesList; let i = index;">
<ion-item lines="none" >
<ion-label>
<ion-badge [ngClass]=" direction === 'rtl' ? 'end-badge' : 'start-badge'" slot="end" color="danger" class="main-badge">{{notBadge}}</ion-badge>
<p [ngClass]="item.RULE_STATUS === 'Inactive' ? 'red-status' : 'green-status' ">{{item.RULE_STATUS}}</p><br/>
<p class="textBold" > {{item.RULE_NAME}} | {{item.ITEM_TYPE_DISPLAY_NAME}}</p><br/>
<p class="label">{{item.BEGIN_DATE | dateString }} - {{item.END_DATE | dateString}}</p><br/>
<p class="createdOn">Created on:</p><br/>
</ion-label>
</ion-item>
<ion-item-options side="start">
<ion-item-option class="optionBtn" (click)="deleteFunc(i)">
<img class="imgSize" src="../assets/imgs/delete-circle.png">
</ion-item-option>
<ion-item-option class="optionBtn" (click)="updateFunc(i)">
<img class="imgSize" src="../assets/imgs/update-circle.png">
</ion-item-option>
</ion-item-options>
</ion-item-sliding>
</ion-list>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
<ion-footer>
<div class="centerDiv">
<div class="fixed-shift-timer" >
<fab-button [type]="add" (trigger)="Vacation_Type()"></fab-button>
<!-- <page-trailer [small] = "true"></page-trailer> -->
</div>
<ion-footer class="colorBG">
<!-- <div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="Vacation_Type()">
{{'vacation-rule, createRule' | translate}}</ion-button>
</div>
</div> -->
</ion-footer>

@ -69,3 +69,64 @@ ion-card-header {
margin: 0px 5px !important;
}
}
//////////new design////////////////////////
.itemVR
{
background: #f0efef !important;
--background: #f0efef !important;
border: #dbdbdb 1px solid;
border-radius: 10px;
margin-bottom: 7px;
}
.listVR{
background: transparent !important;
}
.red-status{
color: var(--light) !important;
font-weight:bold;
background: var( --red);
border-radius: 9px;
text-align: center;
margin-top: 10px;
position: relative;
width: auto;
height: 100%;
display: inline-block !important;
padding: 0px 15px 0px 15px;
}
.green-status{
color: var(--light) !important;
font-weight:bold;
background: var( --custgreen);
border-radius: 9px;
text-align: center;
margin-top: 10px;
position: relative;
width: auto;
height: 100%;
display: inline-block !important;
padding: 0px 15px 0px 15px;
}
.textBold{
color: black;
font-weight: bold;
font-size: 17px;
}
.label{
margin-top: -19px;
border-bottom: #eaeaea solid;
padding-bottom: 8px;
color: black !important;
}
.createdOn{
margin: -12px 0px -14px 0px;
}
.optionBtn{
background: transparent !important;
}

@ -25,7 +25,7 @@ export class HomeComponent implements OnInit {
isUpdate: boolean = false;
IsReachEnd: boolean = false;
RespondAttributeList: any;
add:any='add';
button: ButtonInput;
// dateTime: DateTimeInput;
// date: DateInput;
@ -37,7 +37,7 @@ export class HomeComponent implements OnInit {
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private router: Router) {
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 1;
this.P_PAGE_LIMIT = 50;
//this.button = new ButtonInput('btnSubmit', 'Submit', 'containerDiv', 'Y');
// this.dateTime = new DateTimeInput('Start Date', 'SDate', '', 'containerDiv', 'Y', 'Y', 'Y');
@ -141,7 +141,9 @@ export class HomeComponent implements OnInit {
this.isUpdate = true;
this.cs.sharedService.setSharedData(this.isUpdate, 'isUpdate');
this.router.navigate(['/vacation-rule/create-vacation-rule']);
// this.router.navigate(['/vacation-rule/create-vacation-rule']);
this.cs.navigateForward('/vacation-rule/vacation-type');
}

@ -10,25 +10,19 @@
<ion-content padding no-bounce>
<ion-grid no-padding>
<ul class="cusprogressbar">
<!-- <ul class="cusprogressbar">
<ion-row nowrap>
<ion-col size="4">
<!-- <ul class="cusprogressbar"> -->
<li>{{'vacation-rule, itemType' | translate}}</li>
<!-- </ul> -->
</ion-col>
<ion-col size="4">
<!-- <ul class="cusprogressbar"> -->
<li class="active">{{'vacation-rule, notification-type' | translate}}</li>
<!-- </ul> -->
</ion-col>
<ion-col size="4">
<!-- <ul class="cusprogressbar"> -->
<li>{{'vacation-rule, create-vacation-rule' | translate}}</li>
<!-- </ul> -->
</ion-col>
</ion-row>
</ul>
</ul> -->
<ion-row justify-content-center>
<div [innerHTML]='"vacation-rule, notification-tip" | translate'></div>

@ -1,17 +1,17 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-toolbar>
<!-- <nav-buttons></nav-buttons> -->
<ion-title color="light">{{ 'vacation-rule, search-employee' | translate}}</ion-title>
<ion-buttons slot="primary">
<ion-title color="dark">{{ 'vacation-rule, search-employee' | translate}}</ion-title>
<!-- <ion-buttons slot="primary">
<ion-button style="background: none !important;" (click)="closePage()">
<ion-icon slot="icon-only" name="close"></ion-icon>
</ion-button>
</ion-buttons>
</ion-buttons> -->
</ion-toolbar>
</ion-header>
<ion-content padding>
<div style="padding: 0 10px;" [innerHTML]='"vacation-rule, replacement-employee-tip" | translate'></div>
<ion-content >
<!-- <div style="padding: 0 10px;" [innerHTML]='"vacation-rule, replacement-employee-tip" | translate'></div> -->
<ion-item>
<ion-label class="boldTxtNav">{{'vacation-rule, search-by' | translate}}</ion-label>
@ -23,13 +23,16 @@
</ion-select>
</ion-item>
<ion-item>
<ion-input [(ngModel)]="searchKey" placeholder="{{'vacation-rule, search-employee' | translate}}"></ion-input>
<ion-button style="width: 19%;" button-type="clear" (click)="SearchReplacementList()">
<ion-icon slot="icon-only" name="search"></ion-icon>
<ion-item lines="none">
<ion-button class="filterBtn" button-type="clear" button-type="clear" (click)="SearchReplacementList()">
<ion-icon slot="icon-only" color="white" name="search"></ion-icon>
</ion-button>
<ion-input class="filterInput" [(ngModel)]="searchKey" placeholder="{{'vacation-rule, search-employee' | translate}}"></ion-input>
</ion-item>
<!-- <ion-item>
<ion-list [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
@ -40,7 +43,7 @@
</ion-list>
</ion-item> -->
<ion-list>
<!-- <ion-list>
<ion-radio-group mode="md" [(ngModel)]="selEmp" *ngIf="ReplacementList">
<ion-item *ngFor="let employee of ReplacementList;let i=index;">
<ion-label><span class="boldTxt">{{employee.EMPLOYEE_DISPLAY_NAME}}</span> <br>{{employee.USER_NAME}}<br>
@ -48,13 +51,55 @@
<ion-radio value="{{i}}"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</ion-list> -->
<ion-item>
<div *ngIf="ReplacementList" class="square-container">
<div (click)="select(employee,i)" *ngFor="let employee of ReplacementList;let i=index;" class="square">
<div class="profileImageDiv">
<!-- <img class="profileImage" src="../assets/imgs/profile.png"> -->
<img *ngIf="employee.EMPLOYEE_IMAGE" class="empImgeRep" [src]="'data:image/png;base64,'+employee.EMPLOYEE_IMAGE">
<img *ngIf="employee.EMPLOYEE_IMAGE == null" class="empImgeRep" src="../assets/imgs/profile.png">
</div>
<div *ngIf="active == i" class="selIEmpDiv">
<img class="selIEmpImage" src="../assets/imgs/green.png">
</div>
<div [ngClass]="{'activated': (active == i),'deactivated': (active != i)}"
class="content">
<ion-label class="labelRep">
<span style="font-weight: bold !important">{{employee.EMPLOYEE_DISPLAY_NAME}}</span>
<br>{{employee.USER_NAME}}<br>
{{employee.EMAIL_ADDRESS}}
</ion-label>
</div>
</div>
</div>
</ion-item>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
<ion-footer>
<div class="centerDiv">
<!-- <div class="centerDiv">
<ion-button (click)="closePage()" class="footer-button" color="customnavy">{{'general, save' | translate}}
</ion-button>
</div>
</div> -->
<div class="centerDiv">
<ion-button class="footer-button" style="background: var(--newgreen)!important;border-radius: 10px; --background: transparent; " ion-button (click)="closePage()">
{{'general, save' | translate}}</ion-button>
<ion-button class="footer-button" style="background: var(--darkblue)!important;border-radius: 10px; --background: transparent; " ion-button (click)="closeModal()">
{{'general, cancel' | translate}}</ion-button>
</div>
</ion-footer>

@ -2,7 +2,18 @@ ion-item {
margin-top: 5%;
margin-right: 7%;
}
.labelRep{
--color: initial;
display: block;
color: var(--color);
font-family: var(--ion-font-family,inherit);
font-size: inherit;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.footer-button {
border-radius: 3px;
padding: 0 1.1em;
@ -12,4 +23,145 @@ ion-item {
.item-radio-checked ion-label {
color: #3ac1f1 !important;
}
.boldTxt{font-weight:bold;}
.boldTxt{font-weight:bold;}
////////////////////////
button.item-button.button.button-md.button-clear.button-clear-md {
background-color: transparent;
}
.footer-button {
border-radius: 3px;
padding: 0 1.1em;
min-height: 45px;
min-width: 200px;
}
// ion-item {
// margin-top: 5%;
// margin-right: 7%;
// width: 100%;
// }
.ionItem{
border: #e4e4e4 solid;
/* margin: 6px; */
/* padding: 11px; */
height: 85px;
width: 164px;
border-radius: 5px;
text-align: center;
}
.profileImageDiv{
text-align: center;
margin-bottom: -27px;
z-index: 3;
position: relative;
top: 0;
}
.profileImage{
width:60px !important;
// margin-left: -25px;
// margin-right: 22px;
}
.activated{
border: #209a83 0.02cm solid ;
}
.deactivated{ border: #e4e4e4 0.02cm solid;
}
.repContentDiv{
text-align: center;
width: 85%;
font-size: 14px;
border: #e4e4e4 solid;
border-radius: 5px;
padding: 20px 8px 8px 8px;
margin-top: -9px;
margin-right: -35px
}
.selIEmpDiv{
text-align: right;
margin-bottom: -26px;
margin-right: 0px;
z-index: 3;
position: relative;
top: 0;
}
.selIEmpImage{
width:22px !important
}
.noteInput{
border: solid var(--gray) 1px;
border-radius: 15px;
margin: 8px 17px 0px 17px;
padding: 10px 2px 10px 2px;
}
.filterInput{
border: solid var(--gray) 1px;
border-radius: 21px;
padding-left: 10px !important;
}
.filterBtn{
background: var(--newgreen);
--background: var (--newgreen);
border-radius: 50%;
height: 60px;
width: 60px;
}
*{
box-sizing: border-box;
}
.square-container{
// padding: 8px;
width:100%;
}
.square{
// width:calc(100% / 2);
width:50%;
float:left;
position: relative;
// padding-bottom: calc(100% / 2);
}
.square .content{
width: calc(100% - 16px) !important;
height: calc(100% - 16px) !important;
margin: 8px;
padding: 16px;
// position: absolute;
color: white;
border-radius: 9px;
text-align: center;
min-height: 90px;
// background-color: #0095ff;
// box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
}
.empImge{
border-radius: 50%;
width:100%;
height: 100%;
border: #dedede solid 1px;
}
.empImgeRep {
border-radius: 50% !important;
width: 80px;
height: 80px;
border: #dedede solid 1px;
}

@ -28,6 +28,7 @@ export class ReplacementListComponent implements OnInit {
replacmentRequest: any = "";
isAbs: boolean = false;
isSave: boolean = false;
active: any;
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, public modalController: ModalController) { }
@ -104,27 +105,97 @@ export class ReplacementListComponent implements OnInit {
}
}
doInfinite(infiniteScroll) {
}
closePage() {
this.isSave = true;
let data: any = null;
if (this.isSave == true) {
if (this.selEmp) {
data = this.ReplacementList[this.selEmp];
// data = this.ReplacementList[this.selEmp];
data=this.selEmp;
} else {
data = null;
let msg: string = this.ts.trPK("replacementRoll", "msg");
this.cs.presentAlert(msg);
return;
}
if (typeof this.callback == 'function') {
this.callback(data);
// if (typeof this.callback == 'function') {
// this.callback(data);
// }
// this.modalController.dismiss({
// 'dismissed': true,
// empData: data
// });
this.modalController.dismiss(data);
// }else{
// let msg: string = this.ts.trPK("replacementRoll", "msg");
// this.cs.presentAlert(msg);
// return;
// }
}
}
closeModal() {
this.modalController.dismiss();
}
this.modalController.dismiss({
'dismissed': true,
empData: data
});
select(selectEmp,index){
console.log(selectEmp.EMPLOYEE_DISPLAY_NAME);
this.selEmp=selectEmp
console.log("this.selEmp" + this.selEmp);
this.active=index;
}
doInfinite(infiniteScroll) {
if (!this.IsReachEnd) {
const request = new ReplacementServiceRequest();
request.P_PAGE_NUM = this.P_PAGE_NUM;
request.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
// request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp;
this.vacationRuleService.getReplacementList(request).
subscribe((result: any) => {
if (this.cs.validResponse(result)) {
if (this.cs.hasData(result.ReplacementList)) {
this.P_PAGE_NUM++;
result.ReplacementList.forEach(vr => {
if (vr.ROW_NUM == vr.NO_OF_ROWS) {
this.IsReachEnd = true;
}
else {
this.IsReachEnd = false;
}
this.ReplacementList.push(vr);
// this.pro.GetVacationRulesList.push(vr);
});
} else {
this.IsReachEnd = true;
}
}
//this.P_PAGE_NUM++;
if (infiniteScroll)
infiniteScroll.target.complete();
// console.log(resFlag);
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
} else {
if (infiniteScroll)
infiniteScroll.target.complete();
}
}
}

@ -13,6 +13,7 @@ import { CreateVacationRuleComponent } from './create-vacation-rule/create-vacat
import { ReplacementListComponent } from './replacement-list/replacement-list.component';
// import { MaterialDesignFrameworkModule } from 'angular6-json-schema-form';
import { PipesModule } from '../pipes/pipes.module';
const routes: Routes = [
{
@ -48,6 +49,8 @@ const routes: Routes = [
CommonModule,
FormsModule,
IonicModule,
PipesModule,
HmgCommonModule,
// {
// ngModule: JsonSchemaFormModule,

@ -1,45 +1,44 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-toolbar class="header-toolbar-new">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/vacation-rule/home" ></ion-back-button>
</ion-buttons>
<ion-title color="light">{{ 'vacation-rule, vacation-type' | translate}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-content class="colorBG" padding>
<ion-grid no-padding>
<ul class="cusprogressbar">
<!-- <ul class="cusprogressbar">
<ion-row nowrap>
<ion-col size="4">
<!-- <ul class="cusprogressbar"> -->
<li class="active">{{'vacation-rule, itemType' | translate}}</li>
<!-- </ul> -->
</ion-col>
<ion-col size="4">
<!-- <ul class="cusprogressbar"> -->
<li>{{'vacation-rule, notification-type' | translate}}</li>
<!-- </ul> -->
</ion-col>
<ion-col size="4">
<!-- <ul class="cusprogressbar"> -->
<li>{{'vacation-rule, create-vacation-rule' | translate}}</li>
<!-- </ul> -->
</ion-col>
</ion-row>
</ul>
</ul> -->
<ion-row justify-content-center>
<!-- <ion-row justify-content-center>
<div [innerHTML]='"vacation-rule, vacation-type-text" | translate'></div>
</ion-row>
</ion-row> -->
<div *ngIf="!isUpdate" class="divStep ">
<ion-row no-wrap>
<div class="stepHeaderDiv">
<label class="stepHeaderLebal">Applay for vacation Rule </label><br>
<label class="stepHeaderLebal">Step 1</label>
</div>
<ion-item>
<ion-item class="selectItem">
<ion-label>{{'vacation-rule, itemType' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="index" required>
[(ngModel)]="index" (ionChange)="vacationRuleSel($event)" required>
<ion-select-option [selected]="x.ITEM_TYPE_DISPLAY_NAME" value="{{i}}"
*ngFor="let x of ruleTypeList; let i=index;">
{{x.ITEM_TYPE_DISPLAY_NAME}} </ion-select-option>
@ -54,12 +53,148 @@
</p>
</ion-row>
</div>
<div *ngIf="notificationTypeShow && !isUpdate" class="divStep">
<div class="stepHeaderDiv">
<label class="stepHeaderLebal">Step 2</label>
</div>
<ion-row >
<ion-list style="width: 100% !important;">
<ion-radio-group (ionChange)="notificationTypeSel($event)" [(ngModel)]="notifTypeSelP2" mode="md">
<ion-item>
<ion-label class="labelRadio">{{'vacation-rule, all-label' | translate}}</ion-label>
<ion-radio color="secondary" mode="md" checked value="*"></ion-radio>
</ion-item>
<ion-item>
<ion-label class="labelRadio">{{'vacation-rule, select-label' | translate}}</ion-label>
<ion-radio color="secondary" mode="md" value="sel_opt"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
</ion-row>
<ion-row>
<ion-item class="selectItem" *ngIf="notifTypeSelP2=='sel_opt'" >
<ion-label>{{'vacation-rule, notification' | translate}}</ion-label>
<ion-select okText='{{"general, ok" | translate }}' cancelText='{{"general, cancel" | translate }}'
[(ngModel)]="var_notification" (ionChange)="notificationSel($event)" >
<ion-select-option value="{{i}}" *ngFor="let x of notification_list; let i=index">
{{x.NOTIFICATION_DISPLAY_NAME}}
</ion-select-option>
</ion-select>
</ion-item>
</ion-row>
</div>
<div *ngIf="createVacationRuleShow" class="divStep" >
<div class="stepHeaderDiv">
<label class="stepHeaderLebal">Step 3</label>
</div>
<ion-row>
<ion-grid>
<ion-row style="margin-top: 20px;">
<ion-col style="border-right: solid #d3d3d3 1px" size="6">
<p class="labelTitle label">{{'vacation-rule, itemType' | translate}}</p><br/>
<p class="labelValue label floatlabel">{{P_ITEM_TYPE_TITLE}} </p>
</ion-col>
<ion-col size="6">
<p class="labelTitle label">{{'vacation-rule, notification' | translate}} </p><br/>
<p class="labelValue label floatlabel">{{Notification_Title}} </p>
</ion-col>
</ion-row>
</ion-grid>
<!-- <ion-item>
<ion-label class="label">{{'vacation-rule, itemType' | translate}}</ion-label>
<ion-label class="label floatlabel">{{P_ITEM_TYPE_TITLE}} </ion-label>
</ion-item>
<ion-item>
<ion-label class="label">{{'vacation-rule, notification' | translate}} </ion-label>
<ion-label class="label floatlabel">{{Notification_Title}} </ion-label>
</ion-item> -->
<ion-item class="requiredItem selectItem">
<ion-label class="label">{{'vacation-rule, start-date' | translate}}</ion-label>
<ion-datetime [(ngModel)]="Sdate" min="1900" max="2100" displayFormat="MM/DD/YYYY hh:mm:ss A"
placeholder="MM/DD/YYYY hh:mm:ss A" required></ion-datetime>
</ion-item>
<ion-item class="requiredItem selectItem">
<ion-label class="label">{{'vacation-rule, end-date' | translate}}</ion-label>
<ion-datetime [(ngModel)]="Edate" min="1900" max="2100" displayFormat="MM/DD/YYYY hh:mm:ss A"
placeholder="MM/DD/YYYY hh:mm:ss A" required></ion-datetime>
</ion-item>
<ion-item lines="none" class="requiredItem selectItem">
<ion-label>{{'vacation-rule, message-label' | translate}}</ion-label>
<ion-textarea required [(ngModel)]="msgVal"></ion-textarea>
</ion-item>
<ion-list style="width: 95%;">
<ion-radio-group [(ngModel)]="notifTypeSel">
<ion-item *ngFor="let assignMode of REASSIGN_val;let i=index">
<ion-label class="labelRadio">{{assignMode.RADIO_BUTTON_LABEL}}</ion-label>
<ion-radio color="secondary" mode="md" value="{{assignMode.RADIO_BUTTON_ACTION}}" [checked]="i==0"></ion-radio>
</ion-item>
<ion-item *ngIf="isDeliver">
<ion-label class="labelRadio">{{'vacation-rule, deliver' | translate}}</ion-label>
<ion-radio color="secondary" mode="md" value="DELIVER"></ion-radio>
</ion-item>
<ion-item *ngIf="showForType_Y">
<ion-label class="labelRadio">{{'vacation-rule, close' | translate}}</ion-label>
<ion-radio color="secondary" mode="md" value="CLOSE"></ion-radio>
</ion-item>
<!-- <button *ngIf="notifTypeSel!='RESPOND'" ion-button block (click)="SearchReplacment()">{{'createVacationRule.search' | translate}}</button> -->
<ion-item *ngIf="RespondAttributeList.length > 0 && showForType_Y == false">
<ion-label class="labelRadio">{{'vacation-rule, respond' | translate}}</ion-label>
<ion-radio color="secondary" mode="md" value="RESPOND"></ion-radio>
</ion-item>
</ion-radio-group>
</ion-list>
<div [ngClass]="RespondAttributeList.length > 0 ? 'dynamicFields' : '' " id="CVDynamicFields">
</div>
<!-- <json-schema-form *ngIf="schemaNotific && notifTypeSel =='RESPOND'" [form]="schemaNotific"
[(ngModel)]="exampleJsonObject">
</json-schema-form> -->
<ion-item class="selectItem" lines="none" (click)="openReplacementRoll()"
*ngIf="(hideForwordEmployee && notifTypeSel =='RESPOND') || (notifTypeSel == 'DELEGATE') || (notifTypeSel == 'TRANSFER') ">
<ion-input [(ngModel)]="employeeSel" placeholder="{{'vacation-rule, search-employee' | translate}}"></ion-input>
<ion-button style="width: 19%;" button-type="clear">
<ion-icon slot="icon-only" name="search"></ion-icon>
</ion-button>
</ion-item>
</ion-row>
</div>
</ion-grid>
</ion-content>
<ion-footer>
<ion-footer class="colorBG">
<div class="centerDiv">
<ion-button class="footer-button" color="customnavy" ion-button (click)="NextPage()">
<ion-button *ngIf="!createBtn" class="button-login footer-button" ion-button (click)="NextPage()">
{{'vacation-rule, next-label' | translate}}</ion-button>
</div>
<!-- <ion-button *ngIf="createBtn" class="footer-button" color="customnavy" ion-button (click)="createVacationRule()">
create </ion-button> -->
<div *ngIf="isUpdate==false && createBtn" class="centerDiv">
<ion-button class="button-login footer-button" ion-button (click)="openConfirmAlertDialogAction(true)">
{{'vacation-rule, apply' | translate}}</ion-button>
</div>
<div *ngIf="isUpdate " class="centerDiv">
<ion-button class="button-login footer-button" ion-button (click)="openConfirmAlertDialogAction(false)">
{{'vacation-rule, update' | translate}}</ion-button>
</div>
</div>
</ion-footer>

@ -12,7 +12,7 @@ li {
}
ion-item {
width: 100%;
width: 95%;
margin-left: 2%;
margin-right: 5%;
}
@ -30,6 +30,67 @@ p.smallTip {
min-width: 200px;
}
.noteInput{
border: solid var(--gray) 1px;
border-radius: 15px;
margin: 8px 17px 0px 17px;
padding: 10px 2px 10px 2px;
}
// new css //
.divStep{
border: solid var(--gray) 1px;
border-radius: 15px;
padding: 10px 2px 10px 2px;
background: white;
box-shadow: 0px 0px 6px 0px #d5d5d5ab;
margin-bottom: 17px;
}
.ionItemStep{
width: 100%;
margin-left: 5%;
margin-right: 5%;
margin-top: 10px;
border-radius: 30px;
border: 1px solid #dbdbdb;
}
.selectItem{
border: solid 1px #dbdbdb;
border-radius: 25px;
margin: 15px;
width: 100%;
}
.labelTitle{
margin-left: 15px;
}
.labelValue{
margin-top: -27px;
font-weight: 900;
margin-left: 15px;
}
.labelRadio{
white-space: pre-line !important;
color: black !important;
}
.dynamicFields{
width: 321px;
border: #dbdbdb solid 1px;
border-radius: 16px;
margin: 10px;
padding: 10px;
}
.stepHeaderDiv{
text-align: center;
margin: auto;
font-weight: bolder;
}
.stepHeaderLebal{
margin:0;
}
// .progcontainer {
// margin: auto;
// text-align: center;

@ -1,10 +1,23 @@
import { vacationTypeResponse } from './../model/vacationType.Respond';
import { notificationTypeResponse } from './../model/notification.Respond';
import { VacationTypeRequest } from './../model/VacationTypeRequest';
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ElementRef } from '@angular/core';
import { VacationRuleServiceService } from '../service/vacation-rule-service.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { notificationTypeRequest } from '../model/notification.Request';
import * as moment from 'moment';
import { vacationRuleResponse } from '../model/vacationRule.Respond';
import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request';
import { ReplacementServiceRequest } from '../model/replacement-Service.request';
import { NumberInput } from 'src/app/uI-elements/number.input';
import { DateInput } from 'src/app/uI-elements/date.input';
import { SelectInput } from 'src/app/uI-elements/select.input';
import { TextInput } from 'src/app/uI-elements/text.input';
import { ModalController } from '@ionic/angular';
import { ReplacementListComponent } from '../replacement-list/replacement-list.component';
import { createVacationRequest } from '../model/createVacation.Request';
import { WorkListReplacementRollComponent } from 'src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component';
@Component({
selector: 'app-vacation-type',
@ -12,14 +25,194 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service
styleUrls: ['./vacation-type.component.scss'],
})
export class VacationTypeComponent implements OnInit {
ruleTypeList: any;
index: any;
vactionRuleSelected:any =-1;
notificationTypeSelected: number;
notification_list: any; ////
notificationTypeShow:boolean=false;
notificationSelected: any;
createVacationRuleShow: boolean=false;
createBtn: boolean;
Sdate: any;
isUpdate: any;
SelAction: any;
updateData: any;
notificationType: { NOTIFICATION_NAME: any; NOTIFICATION_DISPLAY_NAME: any; NOTIFICATION_SUBJECT: any; FYI_FLAG: any; };
P_ITEM_TYPE_TITLE: any;
selEmployeeID: any;
selEmployeeName: any;
employeeSel: any;
msgVal: any;
notifTypeSel: any;
itemType: any;
Edate: string;
Notification_Title: any;
showForType_Y: boolean;
isDeliver: boolean;
REASSIGN_val: any =[];
var_notification: any;
exampleJsonObject: {};
RespondAttributeList: any=[];
GetRespondAttributeValueList: any;
wFLookUpList: any;
Resp2_val: any;
dateInput: DateInput;
numberInput: NumberInput;
selectInput: any;
textInput: TextInput;
hideForwordEmployee: any;
notifTypeSelP2: string;
P_RESPOND_ATTRIBUTES_TBL: any=[];
vacationRuleRequest: createVacationRequest;
confirmMsg: string;
constructor(public vacationRuleService: VacationRuleServiceService,
public ts: TranslatorService,
public cs: CommonService,
public modalController: ModalController,
private elementRef: ElementRef) {
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService) { }
}
ngOnInit() {
this.getVacationType();
this.isUpdate = this.cs.sharedService.getSharedData('isUpdate');
if (this.isUpdate) {
this.initCreateVaction();
}
else{
this.getVacationType();
}
}
initCreateVaction(){
this.Sdate = moment().format('YYYY-MM-DDTHH:mm:ssZ');
this.Edate="";
// this.isUpdate = this.cs.sharedService.getSharedData('isUpdate');
if (this.isUpdate) {
this.updateData = this.cs.sharedService.getSharedData(vacationRuleResponse.SHARED_DATA, false);
this.SelAction = this.updateData.ACTION;
if (this.updateData.ACTION == "RESPOND" && this.updateData.FYI_FLAG == "Y") {
this.SelAction = "Close"
}
this.notificationType = {
NOTIFICATION_NAME: this.updateData.NOTIFICATION_NAME,
NOTIFICATION_DISPLAY_NAME: this.updateData.NOTIFICATION_SUBJECT,
NOTIFICATION_SUBJECT: this.updateData.NOTIFICATION_SUBJECT,
FYI_FLAG: this.updateData.FYI_FLAG
}
/*************** */
this.P_ITEM_TYPE_TITLE = this.updateData.ITEM_TYPE_DISPLAY_NAME;
this.selEmployeeID = this.updateData.REPLACEMENT_USER_NAME;
if (this.selEmployeeID) {
this.selEmployeeName = this.updateData.RULE_NAME;
this.employeeSel = this.updateData.RULE_NAME;
}
/************ */
this.msgVal = this.updateData.MESSAGE;
this.notifTypeSel = this.updateData.ACTION;
this.itemType = this.updateData;
this.notificationType = this.updateData;
//this.Sdate = this.updateData.BEGIN_DATE;
//this.Edate = this.updateData.END_DATE;
let _Sdate = this.updateData.BEGIN_DATE ? this.updateData.BEGIN_DATE : "";
let _Edate = this.updateData.END_DATE ? this.updateData.END_DATE : "";
//let tzoffset = moment().utcOffset(); //offset in milliseconds
if (_Sdate) {
this.Sdate = moment(_Sdate).format('YYYY-MM-DDTHH:mm:ssZ');
//this.Sdate = (new Date(myStartTime - tzoffset)).toISOString().slice(0, -1);
//this.startTime = this.Sdate;
}
if (_Edate) {
this.Edate = moment(_Edate).format('YYYY-MM-DDTHH:mm:ssZ');
//this.Edate = (new Date(myEndTime - tzoffset)).toISOString().slice(0, -1);
// this.endTime = this.Edate;
}
//this.schemaNotific =this.updateData.RespondAttributeList;
//this.notifTypeSel=this.REASSIGN_val[0].RADIO_BUTTON_LABEL;
//console.log(this.notifTypeSel);
// this.getNotificationReassign();
} else {
this.msgVal="";
this.isUpdate = false;
this.SelAction = "";
this.employeeSel = "";
this.itemType = this.cs.sharedService.getSharedData(vacationTypeResponse.SHARED_DATA, false);
this.notificationType = this.cs.sharedService.getSharedData(notificationTypeResponse.SHARED_DATA, false);
}
this.Notification_Title = this.notificationType.NOTIFICATION_DISPLAY_NAME;
this.P_ITEM_TYPE_TITLE = this.itemType.ITEM_TYPE_DISPLAY_NAME;
console.log("showForType_Y");
if (this.notificationType.FYI_FLAG == 'Y') {
this.showForType_Y = true;
} else {
this.showForType_Y = false;
}
if (this.itemType.ITEM_TYPE == "*") {
this.isDeliver = false;
} else {
this.isDeliver = true;
}
this.getNotificationReassign();
this.respondAttributes();
}
vacationRuleSel(event){
this.vactionRuleSelected=event.detail.value;
if(this.notificationTypeShow){
//this.notificationTypeShow = false
this.notificationTypeShow = false
this.notifTypeSelP2 = "*";
//this.part3show = false
}
if (this.createVacationRuleShow){
this.createVacationRuleShow = false
this.createBtn=false;
}
console.log("event: "+ event.detail.value);
}
notificationSel(event){
this.notificationSelected=event.detail.value;
if(this.createVacationRuleShow){
//this.notificationTypeShow = false
this.createVacationRuleShow = false
this.createBtn=false;
//this.part3show = false
}
//
console.log("notificationSel event: "+ event.detail.value);
}
notificationTypeSel(event){
// notifTypeSelP2
this.notificationTypeSelected=event.detail.value;
if(this.createVacationRuleShow){
//this.notificationTypeShow = false
this.createVacationRuleShow = false
this.createBtn=false;
//this.part3show = false
}
}
getVacationType() {
@ -38,6 +231,11 @@ export class VacationTypeComponent implements OnInit {
}
NextPage() {
//notification_list
if(this.vactionRuleSelected >= 0 ){
//&& !this.notificationTypeShow && !this.notificationTypeShow){
if(!this.notificationTypeShow){
this.cs.sharedService.setSharedData(this.ruleTypeList[this.index], vacationTypeResponse.SHARED_DATA);
if (this.ruleTypeList[this.index].ITEM_TYPE == "*") {
@ -47,12 +245,657 @@ export class VacationTypeComponent implements OnInit {
notificatioAtt.NOTIFICATION_NAME = "*";
notificatioAtt.NOTIFICATION_SUBJECT = "";
this.cs.sharedService.setSharedData(notificatioAtt, notificationTypeResponse.SHARED_DATA);
this.cs.navigateForward('/vacation-rule/create-vacation-rule');
//part 3
this.createVacationRuleShow = true
this.createBtn=true;
// if (this.notifTypeSelP2 == "*") {
// let notificatioAtt: notificationTypeResponse = new notificationTypeResponse();
// notificatioAtt.FYI_FLAG = "";
// notificatioAtt.NOTIFICATION_DISPLAY_NAME = "All";
// notificatioAtt.NOTIFICATION_NAME = "*";
// notificatioAtt.NOTIFICATION_SUBJECT = "";
// this.cs.sharedService.setSharedData(notificatioAtt, notificationTypeResponse.SHARED_DATA);
// } else {
// this.cs.sharedService.setSharedData(this.notification_list[this.var_notification], notificationTypeResponse.SHARED_DATA);
// }
this.initCreateVaction();
//this.cs.navigateForward('/vacation-rule/create-vacation-rule');
} else {
//part 2
this.getNotificationType();
// this.cs.navigateForward('/vacation-rule/notification-type');
}
}//end part not show
else{
// check if notifictype sele and part 3 not show
//this.notificationSelected=event.detail.value;
///if(this.createVacationRuleShow
if((this.notificationSelected >= 0 || this.notifTypeSelP2 == '*') && !this.createVacationRuleShow){
//call part3
this.createVacationRuleShow = false
this.createBtn=false;
if (this.notifTypeSelP2 == "*") {
let notificatioAtt: notificationTypeResponse = new notificationTypeResponse();
notificatioAtt.FYI_FLAG = "";
notificatioAtt.NOTIFICATION_DISPLAY_NAME = "All";
notificatioAtt.NOTIFICATION_NAME = "*";
notificatioAtt.NOTIFICATION_SUBJECT = "";
this.cs.sharedService.setSharedData(notificatioAtt, notificationTypeResponse.SHARED_DATA);
} else {
this.cs.sharedService.setSharedData(this.notification_list[this.var_notification], notificationTypeResponse.SHARED_DATA);
}
this.initCreateVaction();
}
}
}
else{
alert("please select vaction rule");
}
}////////////////////////////////
getNotificationType() {
let request: notificationTypeRequest = new notificationTypeRequest();
request.P_ITEM_TYPE = this.ruleTypeList[this.index].ITEM_TYPE; //;this.itemTypeObj.ITEM_TYPE;
this.vacationRuleService.getNotificationType(request, () => {
this.getNotificationType();
}, this.ts.trPK('general', 'retry')).subscribe((result) => {
console.log(result);
if (this.cs.validResponse(result)) {
console.log(result.GetItemTypeNotificationsList);
this.notification_list = result.GetItemTypeNotificationsList;
//rest radio button of notifTypeSel (All , select)
this.notificationTypeShow=true;
} else {
this.cs.presentAlert(result.ErrorEndUserMessage);
}
});
}
getNotificationReassign() {
let request: LoginRequest = new LoginRequest();
this.vacationRuleService.notificationReassign(request, () => {
this.getNotificationReassign();
}, this.ts.trPK('general', 'retry')).subscribe((result) => {
console.log(result);
if (this.cs.validResponse(result)) {
console.log(result.GetNotificationReassignModeList);
this.REASSIGN_val = result.GetNotificationReassignModeList;//[0].RADIO_BUTTON_ACTION;
this.notifTypeSel = this.REASSIGN_val[0].RADIO_BUTTON_ACTION;
this.reverseAction();
this.createVacationRuleShow = true;
this.createBtn=true;
} else {
this.cs.presentAlert(result.ErrorEndUserMessage);
}
});
}
reverseAction() {
if (this.updateData) {
switch (this.SelAction) {
case 'FORWARD': {
this.notifTypeSel = "DELEGATE";
break;
}
case 'RESPOND': {
this.notifTypeSel = "RESPOND";
break;
}
case 'CLOSE': {
this.notifTypeSel = "CLOSE";
break;
}
case 'NOOP': {
this.notifTypeSel = "DELIVER";
break;
}
case 'TRANSFER': {
this.notifTypeSel = "TRANSFER";
break;
}
default: {
this.notifTypeSel = "";
break;
}
}
}
}
/////////////////////////////////////
respondAttributes() {
let request: notificationTypeRequest = new notificationTypeRequest();
request.P_NOTIFICATION_NAME = this.notificationType.NOTIFICATION_NAME;
request.P_ITEM_TYPE = this.itemType.ITEM_TYPE;
// this.vacationRuleService.respondAttributes(
// request).
// subscribe((result: Response) => {
// this.handlerespondAttributesResult(result);
// });
this.vacationRuleService.respondAttributes(request, () => {
this.respondAttributes();
}, this.ts.trPK('general', 'retry')).subscribe((result) => {
this.handlerespondAttributesResult(result);
});
}
handlerespondAttributesResult(result) {
if (this.cs.validResponse(result)) {
this.RespondAttributeList = result.RespondAttributesList;
if (result.RespondRolesList != "" && result.RespondRolesList[0].ATTRIBUTE_NAME != null && result.RespondRolesList[0].ATTRIBUTE_NAME != undefined) {
this.Resp2_val = result.RespondRolesList[0].ATTRIBUTE_NAME;
this.hideForwordEmployee = result.RespondRolesList[0];
}
if (result.RespondAttributesList) {
//this.schemaNotific = JSON.parse(result.P_Schema);
////////************************************** */
this.createVacationDynamicFields(result.RespondAttributesList);
}
this.reverseAction();
if (this.isUpdate) {
this.fillResposeAtrributes(result.RespondAttributesList);
}
// ATTRIBUTE_DISPLAY_NAME: "Note"
// ATTRIBUTE_FORMAT: "4000"
// ATTRIBUTE_NAME: "WF_NOTE"
// ATTRIBUTE_TYPE: "VARCHAR2"
}
}
createVacationDynamicFields(RespondAttributesList) {
console.log("createVacationDynamicFields");
const containerId = 'CVDynamicFields';
for (let i = 0; i < RespondAttributesList.length; i++) {
if (RespondAttributesList[i].ATTRIBUTE_TYPE == "VARCHAR2") {
console.log("1");
this.textInput = new TextInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", "", "");
} else if (RespondAttributesList[i].ATTRIBUTE_TYPE == "LOOKUP") {
console.log("2");
//call create WF_LOOKUP
//call there or when the got response from responsedAtt
this.selectInput = new SelectInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", "");
this.getWFLookUp(RespondAttributesList[i].ATTRIBUTE_FORMAT, RespondAttributesList[i].ATTRIBUTE_NAME);
} else if (RespondAttributesList[i].ATTRIBUTE_TYPE == "DATE") {
console.log("3");
this.dateInput = new DateInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", "");
} else if (RespondAttributesList[i].ATTRIBUTE_TYPE == "NUMBER") {
console.log("4");
this.numberInput = new NumberInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId, "", "", "");
}
}
}
fillResposeAtrributes(respList) {
let body = {
P_RULE_ID: this.updateData.RULE_ID,
GetRespondAttributeValueTBL: respList
}
this.vacationRuleService.getRespondAttributeValues(
body).
subscribe((result: Response) => {
this.handleFillResponseAttr(result);
});
}
handleFillResponseAttr(result) {
if (this.cs.validResponse(result)) {
if (result.GetRespondAttributeValueList && result.GetRespondAttributeValueList.length > 0) {
this.GetRespondAttributeValueList=result.GetRespondAttributeValueList;
let resp_val: any = result.GetRespondAttributeValueList[0].P_ATTRIBUTE_NAME;
let Emp_ID: any = result.GetRespondAttributeValueList[0].P_ATTRIBUTE_TEXT_VALUE;
let valueList = result.GetRespondAttributeValueList;
var obj = {};
if (resp_val == this.Resp2_val) {
let request: ReplacementServiceRequest = new ReplacementServiceRequest();
request.P_SEARCH_USER_NAME = Emp_ID;
request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = "";
request.P_SEARCH_EMAIL_ADDRESS = "";
request.P_PAGE_NUM = 1;
request.P_PAGE_LIMIT = 1000
this.vacationRuleService.getReplacementList(request).
subscribe((result: Response) => {
this.handleFillRole(result);
});
}
for (let i = 0; i < valueList.length; i++) {
obj[valueList[i].P_ATTRIBUTE_NAME] = valueList[i].P_ATTRIBUTE_TEXT_VALUE;
}
this.exampleJsonObject = obj;
//Call set value of responsed attribute
// this.createVacationDynamicFields(this.exampleJsonObject);//ashwaq
this.setRespondAttributeValue();
// this.exampleJsonObject = new Map(valueList.map(obj => [ obj., obj.P_ATTRIBUTE_TEXT_VALUE ]));
}
}
}
handleFillRole(result) {
if (this.cs.validResponse(result)) {
this.selEmployeeName = result.ReplacementList[0].EMPLOYEE_DISPLAY_NAME;
this.selEmployeeID = result.ReplacementList[0].USER_NAME;
}
}
setRespondAttributeValue(){
for (let i = 0; i < this.RespondAttributeList.length; i++) {
if(this.RespondAttributeList[i].ATTRIBUTE_NAME == this.GetRespondAttributeValueList[i].P_ATTRIBUTE_NAME){
if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "VARCHAR2") {
console.log("1");
let x = (document.getElementById(this.RespondAttributeList[i].ATTRIBUTE_NAME)) as HTMLInputElement;
x.value=this.GetRespondAttributeValueList[i].P_ATTRIBUTE_NUMBER_VALUE;
} else if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "LOOKUP") {
console.log("2");
//call create WF_LOOKUPP_ATTRIBUTE_NAME
//call there or when the got response from responsedAtt
let x = (document.getElementById(this.RespondAttributeList[i].ATTRIBUTE_NAME)) as HTMLSelectElement;
if(this.wFLookUpList){
let index= this.wFLookUpList.findIndex(x => x.LOOKUP_CODE == this.GetRespondAttributeValueList[i].P_ATTRIBUTE_TEXT_VALUE);
console.log("Hel: "+ index);
x.options[index+1].selected=true;
}
} else if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "DATE") {
console.log("3");
} else if (this.RespondAttributeList[i].ATTRIBUTE_TYPE == "NUMBER") {
console.log("4");
let x = (document.getElementById(this.RespondAttributeList[i].ATTRIBUTE_NAME)) as HTMLInputElement;
x.value=this.GetRespondAttributeValueList[i].P_ATTRIBUTE_NUMBER_VALUE;
}
}//end if
}
}
getWFLookUp(resAttrFormat: any, ATTRIBUTE_NAME) {
const request = {
P_LOOKUP_TYPE: resAttrFormat,
}
this.vacationRuleService.getLookup(request, () => { }, this.ts.trPK('general', 'retry')).subscribe(
(result: any) => {
if (this.cs.validResponse(result)) {
// console.log("Lookup result "+ result);
this.wFLookUpList=result.WFLookUpList
this.fillDropdownList(result.WFLookUpList, ATTRIBUTE_NAME);
} else {
this.cs.presentAlert(result.ErrorEndUserMessage);
}
});
}
fillDropdownList(optionList: any = [],attributeID) {
let elemID: any = attributeID;
let eitObj: any;
if (optionList.length > 0) {
let select = document.getElementById(elemID) as HTMLSelectElement;
document.getElementById(elemID).innerHTML = "";
var firstoption = document.createElement("option");
firstoption.text = this.ts.trPK("general", "choose");
firstoption.value = "";
select.add(firstoption);
for (let i = 0; i < optionList.length; i++) {
var option = document.createElement("option");
option.text = optionList[i].LOOKUP_MEANING;
option.value = optionList[i].LOOKUP_CODE;
select.add(option);
}
select.disabled = false;
}
}
async SearchReplacment() {
const modal = await this.modalController.create({
component: ReplacementListComponent
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss()
.then((data) => {
const user = data.data;
console.log(data)
console.log(user);
if (data) {
this.selEmployeeName = user.EMPLOYEE_DISPLAY_NAME;
this.selEmployeeID = user.USER_NAME;
this.employeeSel = this.selEmployeeName + "," + this.selEmployeeID
}
});
return await modal.present();
}
clearEmployee() {
this.selEmployeeName = "";
this.selEmployeeID = "";
}
/////////////////////////////////////////////
ApplyFunc() {
(this.elementRef.nativeElement.querySelectorAll('ion-item') as HTMLElement[]).forEach((x) => {
if (x.classList.contains('requiredItem')) {
x.classList.add('ng-touched');
x.classList.remove('ng-untouched');
}
});
let msg: string = "";
if (this.notifTypeSel == undefined) {
msg = this.ts.trPK('vacation-rule', 'fillAction');
this.cs.presentAlert(msg);
} else if (this.msgVal == undefined) {
msg = this.ts.trPK('vacation-rule', 'fillMsg');
this.cs.presentAlert(msg);
} else if (this.Sdate == undefined) {
msg = this.ts.trPK('vacation-rule', 'fillSDate');
this.cs.presentAlert(msg);
}
// else if (this.selEmployeeID == undefined) {
// msg = this.ts.trPK('vacation-rule', 'fillReplacement');
// this.cs.presentAlert(msg);
// }
else {
// var responseAttrDic = this.exampleJsonObject;//haroon
var responseAttrDic =this.RespondAttributeList; // Ashwaq
this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let key in responseAttrDic) {
let obj: any = {};
obj.ATTRIBUTE_NAME =responseAttrDic[key].ATTRIBUTE_NAME;//ashwaq to get ATTRIBUTE_NAME
if (typeof responseAttrDic[key] === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(responseAttrDic[key].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
else {
obj.ATTRIBUTE_TEXT_VALUE =(document.getElementById(responseAttrDic[key].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
let repUserName = this.selEmployeeID;
if(repUserName == null || repUserName ==""){
}
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);
}
let pAction = "";
pAction = this.getActionValue();
let jsonSDate = "";
let jsonEDate = "";
if (this.Sdate) {
let startDate = moment(this.Sdate).format('YYYY-MM-DDTHH:mm:ssZ');
jsonSDate = this.cs.convertISODateToJsonDate(startDate);
} else {
jsonSDate = null;
}
if (this.Edate) {
let endDate = moment(this.Edate).format('YYYY-MM-DDTHH:mm:ssZ');
jsonEDate = this.cs.convertISODateToJsonDate(endDate);
} else {
this.cs.navigateForward('/vacation-rule/notification-type');
jsonEDate = null;
}
let request: createVacationRequest = new createVacationRequest();
request.P_BEGIN_DATE = jsonSDate;
request.P_END_DATE = jsonEDate;
request.P_MESSAGE = this.msgVal;
request.P_REPLACEMENT_USER_NAME = repUserName;
request.P_ITEM_TYPE = this.itemType.ITEM_TYPE;
request.P_NOTIFICATION_NAME = this.notificationType.NOTIFICATION_NAME;
request.P_ACTION = pAction;
request.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL;
this.vacationRuleRequest = request;
this.vacationRuleService.createVacationRule(request, () => {
}, this.ts.trPK('general', 'retry')).subscribe((result) => {
if (this.cs.validResponse(result)) {
console.log(result);
this.handlecreateVacationResult(result);
} else {
this.cs.presentAlert(result.ErrorEndUserMessage);
}
});
}
}
handlecreateVacationResult(result) {
if (this.cs.validResponse(result)) {
this.cs.JustAlertDialog(this.ts.trPK('general', 'ok'), this.ts.trPK('vacation-rule', 'rule-success'))
this.goToStart();
}
}
goToStart() {
this.cs.navigateRoot('/home')
}
updateVacationRule() {
(this.elementRef.nativeElement.querySelectorAll('ion-item') as HTMLElement[]).forEach((x) => {
if (x.classList.contains('requiredItem')) {
x.classList.add('ng-touched');
x.classList.remove('ng-untouched');
}
});
let msg: string = "";
if (this.notifTypeSel == undefined) {
msg = this.ts.trPK('vacation-rule', 'fillAction');
} else if (this.msgVal == undefined) {
msg = this.ts.trPK('vacation-rule', 'fillMsg');
} else if (this.Sdate == undefined) {
msg = this.ts.trPK('vacation-rule', 'fillSDate');
} else {
var responseAttrDic = this.exampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let key in responseAttrDic) {
let obj: any = {};
obj.ATTRIBUTE_NAME = key;
if (typeof responseAttrDic[key] === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = responseAttrDic[key];
}
else {
obj.ATTRIBUTE_TEXT_VALUE = responseAttrDic[key];
}
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);
}
let pAction = "";
pAction = this.getActionValue();
let jsonSDate = "";
let jsonEDate = "";
if (this.Sdate) {
let startDate = moment(this.Sdate).format('YYYY-MM-DDTHH:mm:ssZ');
jsonSDate = this.cs.convertISODateToJsonDate(startDate);
} else {
jsonSDate = null;
}
if (this.Edate) {
let endDate = moment(this.Edate).format('YYYY-MM-DDTHH:mm:ssZ');
jsonEDate = this.cs.convertISODateToJsonDate(endDate);
} else {
jsonEDate = null;
}
let body: any = {
P_RULE_ID: this.updateData.RULE_ID,
P_BEGIN_DATE: jsonSDate,
P_END_DATE: jsonEDate,
P_MESSAGE: this.msgVal,
P_REPLACEMENT_USER_NAME: repUserName,
P_ACTION: pAction,
RespondAttributeList: this.P_RESPOND_ATTRIBUTES_TBL
}
this.vacationRuleService.updateVacationRule(
body).
subscribe((result: Response) => {
this.handleupdateVacationResult(result);
});
}
}
handleupdateVacationResult(result) {
if (this.cs.validResponse(result)) {
this.cs.JustAlertDialog(this.ts.trPK('general', 'ok'), this.ts.trPK('vacation-rule', 'rule-update-success'))
this.goToStart();
}
}
getActionValue(): string {
let pAction = "";
//this.pAction = this.notifTypeSel;
//console.log(this.pAction);
if (this.notifTypeSel) {
switch (this.notifTypeSel) {
case 'DELEGATE': {
pAction = "FORWARD";
break;
}
case 'RESPOND': {
pAction = "RESPOND";
break;
}
case 'CLOSE': {
pAction = "RESPOND";
break;
}
case 'DELIVER': {
pAction = "NOOP";
break;
}
case 'TRANSFER': {
pAction = "TRANSFER";
break;
}
default: {
pAction = "";
break;
}
}
return pAction;
}
}
async openReplacementRoll() {
const modal = await this.modalController.create({
component: ReplacementListComponent,
backdropDismiss: false,
});
modal.cssClass = 'replaceRoll-modal';
modal.onDidDismiss().then((data) => {
console.log(data.data);
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
this.selEmployeeName = data.data.EMPLOYEE_DISPLAY_NAME;
this.selEmployeeID = data.data.USER_NAME;
this.employeeSel = this.selEmployeeName + "," + this.selEmployeeID
}
});
return await modal.present();
}
//////
openConfirmAlertDialogAction(flag){
if(flag==true){
this.confirmMsg = this.ts.trPK('vacation-rule', 'confirm-msg-success')
}
else{
this.confirmMsg= this.ts.trPK('vacation-rule', 'update-msg-success')
}
this.cs.confirmAlertDialogAction(
() => {
if(flag==true){
this.ApplyFunc();
}
else{
this.updateVacationRule();
}
}, this.ts.trPK('general', 'ok'),
() => { }, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg
)
}
//////
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

@ -767,7 +767,7 @@
"ar": "أنت تحاول حذف صف تم حذفه بالفعل."
},
"noData": {
"en": "There are no requests",
"en": "No request found",
"ar": "لا توجد طلبات"
},
"noFileSelect": {
@ -1219,6 +1219,16 @@
"rule-update-success": {
"en": "Rule updated successfully",
"ar": "تم تحديث القاعدة بنجاح"
},
"confirm-msg-success": {
"en" :"Are you sure, you want to Apply for Vacation Rule?",
"ar" :"Are you sure, you want to Apply for Vacation Rule?"
},
"update-msg-success": {
"en" :"Are you sure, you want to Update this Vacation Rule?",
"ar" :"Are you sure, you want to Update this Vacation Rule?"
}
},
"absenceList": {
@ -1359,8 +1369,8 @@
"ar": "Attendance Statistics"
},
"myTeam-header": {
"en": "MY TEAM",
"ar": "MY TEAM"
"en": "My Team",
"ar": "فريقى"
},
"total": {
"en": "TOTAL",

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -868,9 +868,9 @@ div.no-dataDiv{
border-color:var(--cusgray);
}
h4 {
font-size: 2.2rem;
font-size: 140%;
text-align: center;
color: var(--dark);
color: #888888;
}
.empty-data {
@ -927,6 +927,8 @@ color: var(--dark);
// right: 5%;
// bottom: 5%;
background: rgba(0, 0, 0, 0.5) !important;
padding: 60% 10% !important;
padding: 30% 10% !important;
--height: 12cm !important;
// --width: 80% !important;
@ -1020,10 +1022,10 @@ color: var(--dark);
}
.checkOutOkBtn{
/* margin-left: 50px !important; */
/* margin-right: 55px !important; */
margin-left: 50px !important;
margin-right: 55px !important;
margin-top: 10px !important;
/* margin-bottom: 10px !important; */
margin-bottom: 10px !important;
border-radius: 5px !important;
height: 40px !important;
min-height: 40px !important;
@ -1040,10 +1042,10 @@ color: var(--dark);
}
.checkOutCancelBtn{
/* margin-left: 55px !important; */
/* margin-right: 55px !important; */
/* margin-top: 10px !important; */
/* margin-bottom: 10px !important; */
margin-left: 50px !important;
margin-right: 55px !important;
margin-top: 10px !important;
margin-bottom: 10px !important;
border-radius: 5px !important;
height: 40px !important;
min-height: 40px !important;
@ -1127,7 +1129,7 @@ border:0px
--border-radius: 33px !important;
border-radius: 33px !important;
--min-height: 1.6cm !important;
width: 315px;
width: 315px !important;
}
@ -1189,7 +1191,7 @@ border:0px
// }
.advanced-search-modal {
--height: 9cm !important;
--height: 12cm !important;
--width: 88% !important;
--border-radius: 0.6cm;
}
@ -1219,7 +1221,14 @@ border:0px
.alert-button-inner.sc-ion-alert-md {
justify-content: center !important;
}
.replaceRoll-modal {
padding: 30% 1% !important;
--height: 15cm !important;
--width: 100% !important;
--border-radius: 0.4cm;
}
.header-md:after {
height: 0px !important;
display: none !important;
@ -1229,6 +1238,7 @@ border:0px
background: #22c6b3;
}
.boldText{
color: var(--dark) !important;
font-weight: bold;
@ -1267,19 +1277,16 @@ border:0px
}
.advanced-search-modal {
--height: 12cm !important;
.advanced-search-modal-custom {
--height: 9cm !important;
--width: 80% !important;
--border-radius: 0.4cm;
}
.calendar-modal {
--height: 15cm !important;
--height: 13.5cm !important;
--width: 88% !important;
--border-radius: 0.4cm;
// height: 544px !important;
// width: 332px !important;
}
@ -1402,6 +1409,11 @@ table.monthview-datetable th small {
border-radius: 20px !important;
}
.disable-phone {
pointer-events: none;
opacity: .3;
}
// .replaceRoll-modal {
// padding: 30% 1% !important;

@ -1,5 +1,7 @@
.colorBG{
--background: #f0efef;
--background: #f0efef !important;
background: #f0efef !important;
}
.footerSearchBtn{
padding: 50px !important;

Loading…
Cancel
Save