Merge branch 'master-newdesign' into work-list

MOHEMM-Q3-DEV-LATEST
Mohamed Mekawy 6 years ago
commit ab10db88f6

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"
]
}
}
}

@ -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>

@ -33,6 +33,7 @@ export class AppComponent implements OnInit, AfterViewInit {
DeviceType: string; DeviceToken: string; //this.deviceToken
};
user: boolean;
TeamFlag :string = "false";
constructor(
public ts: TranslatorService,
private cs: CommonService,
@ -55,11 +56,12 @@ 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(() => {
@ -106,6 +108,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();
@ -130,6 +137,12 @@ export class AppComponent implements OnInit, AfterViewInit {
this.menu.toggle();
this.cs.openLogin();
}
openMyTeamPage() {
this.menu.toggle();
this.cs.openMyTeamPage();
}
// profile() {
// this.cs.openProfile();

@ -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");

@ -237,12 +237,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();

@ -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" );
}
}

@ -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;

@ -221,7 +221,7 @@ export class PushService {
console.log("processStartReceivingWithFirebase");
this.firebasex.getToken().then(token => {
alert("token: "+ token);
// alert("token: "+ token);
this.registerInBackend(token);
}).catch(error => console.error('Error getting token', error));

@ -89,7 +89,7 @@ export class DateInfoModalComponent implements OnInit {
{
data: [this.percChart],
backgroundColor: [
'#22C6B3'
'#094875'
],
borderWidth: 2
}]

@ -13,9 +13,9 @@
<h2 class="name">{{name}}</h2>
<span class="title">{{title}}</span>
</span>
<span class="image-container">
<a class="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>

@ -11,6 +11,8 @@ export class EmployeeInformationComponent implements OnInit {
@Input() name: string;
@Input() title: string;
@Input() employeeImage: string;
@Input() employeePhoneNumber: string;
constructor() { }

@ -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);
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() {
@ -373,6 +375,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 +396,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 +444,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();
}
@ -708,7 +722,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 class="action-button-icon" href="tel:{{employee.EMPLOYEE_MOBILE_NUMBER}}">
<img src="../assets/imgs/call_icon.png">
</span>
</a>
<span>Call</span>
</div>
</ion-col>
@ -222,6 +222,7 @@
[name]="subordinate.EMPLOYEE_NAME"
[title]="subordinate.POSITION_NAME"
[employeeImage]="subordinate.EMPLOYEE_IMAGE ? 'data:image/png;base64,'+subordinate.EMPLOYEE_IMAGE : '../assets/imgs/profile.png'"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(click)="getDetails(i)">
</app-employee-information>
</ng-container>

@ -80,11 +80,6 @@ export class DetailsComponent implements OnInit {
public data = {};
public slideOptsOne = {
slidesPerView: 4,
spaceBetween: 10
};
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
@ -131,6 +126,10 @@ export class DetailsComponent implements OnInit {
}
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;
@ -266,10 +265,6 @@ export class DetailsComponent implements OnInit {
}
}
this.showData = true;
console.log(this.arrDaysOff);
console.log(this.arrDaysAttendance);
console.log(this.arrDaysAbsent);
console.log(this.normalDays);
}
public getTimeCardSummaryDetails(month?, year?) {
@ -520,6 +515,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,8 +68,7 @@
[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="-"
[employeePhoneNumber]="subordinate.EMPLOYEE_MOBILE_NUMBER"
(click)="getDetails(i)">
</app-employee-information>
</ng-container>

@ -1,148 +1,100 @@
<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
[eventsdateAttend]='arrDaysAttendance'
[eventsdateAbsent]='arrDaysAbsent'
[eventsdateDayOff]='arrDaysOff'
[currentDateParent]="currentDate"
[dayHoursTypeDetailsList]="dayHoursTypeDetailsList"
[normalDays]="normalDays"
(monthTitle)='changeMonthTitle($event)'
(currentYear)=changeYear($event)>
</app-circle-calendar>
</div>
</div>
</div>
</ion-content>

@ -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;
@ -73,25 +63,18 @@ export class TimeCardDetailsComponent implements OnInit {
public currentMonthName = this.getMonthName(new Date().getMonth() + 1);
public showData = false;
public currentYear = new Date().getFullYear();
public dayHoursTypeDetailsList = [];
public normalDays: any = [];
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) {
@ -112,22 +95,8 @@ export class TimeCardDetailsComponent implements OnInit {
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 +113,12 @@ 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;
}
this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList;
}
});
@ -185,44 +127,56 @@ 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({
// 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)
});
} else if (allDays[i].DAY_TYPE === 'SCHEDULED') {
// attendace
this.arrDaysAttendance.push({
// tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') {
allDays[i].present = false;
allDays[i].absent = true;
allDays[i].daysOff = false;
allDays[i].schedule = false;
this.arrDaysAbsent.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE),
isoTime: '09:00:00',
allDay: false
});
// tslint:disable-next-line: triple-equals
} else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') {
allDays[i].present = false;
allDays[i].absent = false;
allDays[i].daysOff = true;
allDays[i].schedule = false;
this.arrDaysOff.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
} else {
// 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].present = false;
allDays[i].absent = false;
allDays[i].daysOff = false;
allDays[i].schedule = true;
this.normalDays.push({
startTime: new Date(allDays[i].SCHEDULE_DATE),
endTime: new Date(allDays[i].SCHEDULE_DATE)
});
}
}
this.showData = true;
}
public getTimeCardSummaryDetails(month?, year?) {
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 +189,101 @@ 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() {
this.normalDays = [];
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
this.currentYear = this.currentYear + 1;
this.nextMonth = 1;
}
this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1);
this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear);
this.nextMonth = this.nextMonth + 1;
this.preMonth = this.nextMonth - 2;
}
}
}
previousSlide() {
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
this.preMonth = 12;
previousSlide() {
this.normalDays = [];
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
this.preMonth = 12;
}
this.currentDate = new Date(this.currentYear, (this.preMonth - 1), 1);
console.log(this.currentDate);
this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear);
this.preMonth = this.preMonth - 1;
this.nextMonth = this.preMonth + 2;
}
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: 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

@ -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",

@ -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;
}
@ -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;

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

Loading…
Cancel
Save