diff --git a/Mohem/src/app/authentication/login/login.component.html b/Mohem/src/app/authentication/login/login.component.html
index 2dd41792..f1f487a9 100644
--- a/Mohem/src/app/authentication/login/login.component.html
+++ b/Mohem/src/app/authentication/login/login.component.html
@@ -59,7 +59,7 @@
diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts
index aa8ad0a2..bdc8e9de 100644
--- a/Mohem/src/app/authentication/login/login.component.ts
+++ b/Mohem/src/app/authentication/login/login.component.ts
@@ -1,56 +1,28 @@
-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, 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";
-import { FingerprintAIO } from "@ionic-native/fingerprint-aio/ngx";
-import { Device } from "@ionic-native/device/ngx";
-import { SplashScreen } from "@ionic-native/splash-screen/ngx";
-import { SharedDataService } from "src/app/hmg-common/services/shared-data-service/shared-data.service";
-import { LoginModel } from "../models/LoginModel";
-import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
+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, 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';
+import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx';
+import { Device } from '@ionic-native/device/ngx';
+import { SplashScreen } from '@ionic-native/splash-screen/ngx';
+import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
+import { LoginModel } from '../models/LoginModel';
+import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request';
import { Password } from '../models/password';
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response';
import { PushService } from 'src/app/hmg-common/services/push/push.service';
@Component({
- selector: "login",
- templateUrl: "./login.component.html",
- styleUrls: ["./login.component.scss"]
+ selector: 'login',
+ templateUrl: './login.component.html',
+ styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit, OnDestroy {
- appLang: number = 1;
- isExpired: boolean = false;
- isSupportAr: boolean = false;
- isAppleStore: boolean = false;
- memberLogin: any = {};
- private password: string;
- private language: string;
- private username: string;
- private remeberMe: boolean;
- private iosLink: string;
- private androidLink: string;
- private currentLang: any = 1;
- private patientOutSA: boolean;
- private loginTokenID: string;
- private isMobileFingerPrint: boolean;
- private FingerPrintPatientIdentificationID: string;
- private loginData = new LoginModel();
- private empname:any;
- private logintype:any;
- public loginDiv:boolean =true;
- public welcomeBack:boolean =false;
- public logo = "assets/icon/login/password.png";
- deviceToken: any="";
- user: boolean =false;
- DeviceType: string;
- requestGetLoginInfo:any;
- logoutFlage: boolean ;
- getuser:any="";
constructor(
public cs: CommonService,
@@ -60,20 +32,21 @@ export class LoginComponent implements OnInit, OnDestroy {
public ts: TranslatorService,
public smsService: SmsReaderService,
private faio: FingerprintAIO,
- public events:Events,
+ 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.events.subscribe('logoutFlage', logoutFlage => {
+ console.log('login compont logoutFlage: ' + logoutFlage);
+ // tslint:disable-next-line: triple-equals
+ if (logoutFlage == true) {
+ console.log(' subscribe check logoutFlage: ' + logoutFlage);
this.logoutFlage = logoutFlage;
- localStorage.setItem('logoutFlage',logoutFlage);
+ localStorage.setItem('logoutFlage', logoutFlage);
}
});
@@ -82,20 +55,49 @@ export class LoginComponent implements OnInit, OnDestroy {
false
);
// alert(" this.getuser "+this.getuser);
- if(this.getuser){
+ if (this.getuser) {
this.user = true;
- }
- else{
+ } else {
this.user = false;
-
+
}
}
+ appLang = 1;
+ isExpired = false;
+ isSupportAr = false;
+ isAppleStore = false;
+ memberLogin: any = {};
+ public password: string;
+ private language: string;
+ public username: string;
+ public remeberMe: boolean;
+ private iosLink: string;
+ private androidLink: string;
+ public currentLang: any = 1;
+ private patientOutSA: boolean;
+ private loginTokenID: string;
+ private isMobileFingerPrint: boolean;
+ private FingerPrintPatientIdentificationID: string;
+ private loginData = new LoginModel();
+ private empname: any;
+ private logintype: any;
+ public loginDiv = true;
+ public welcomeBack = false;
+ public logo = 'assets/icon/login/password.png';
+ deviceToken: any = '';
+ user = false;
+ DeviceType: string;
+ requestGetLoginInfo: any;
+ logoutFlage: boolean ;
+ getuser: any = '';
+
+ private checkUserResult: CheckUserAuthenticationResponse;
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,
@@ -108,61 +110,62 @@ export class LoginComponent implements OnInit, OnDestroy {
// }
- this.events.subscribe("user", user => {
- console.log("login compont: "+user);
+ this.events.subscribe('user', user => {
+ console.log('login compont: ' + user);
this.user = user;
-
+
});
-
-
-
- this.deviceToken= localStorage.getItem('devicyeToken');
- console.log("let deviceToken" + this.deviceToken);
- if (this.deviceToken) {
+
+
+ this.deviceToken = localStorage.getItem('devicyeToken');
+ console.log('let deviceToken' + this.deviceToken);
+
+ if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {
- console.log("no deviceToken" );
+ console.log('no deviceToken' );
- this.pushService.startReceiving();
- setTimeout(() => {
+ this.pushService.startReceiving();
+ setTimeout(() => {
// alert('login enabled second time: ' + this.deviceToken);
}, 1000);
}
-
+
// setTimeout(() => {
// alert("this.logoutFlage in setTime" +localStorage.getItem('logoutFlage'));
// alert("this.this.user in setTime" + this.user);
// if(localStorage.getItem('logoutFlage')== "true"){
// this.getLastLoginInfo();
-
+
// }
// },1000);
-
-
- //here will delete below part and depdding on user (response from getMobileInfo)
- this.username = localStorage.getItem("user");
- this.password = localStorage.getItem("password"); //****//
- let remember = localStorage.getItem("remember");//****//
- this.empname= localStorage.getItem("emp-name");
- this.logintype= localStorage.getItem("login-type");
- if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false }
- //here will be check on user if exite then s part and depdding on user (response from getMobileInfo)
- if(this.user){
+ // here will delete below part and depdding on user (response from getMobileInfo)
+ this.username = localStorage.getItem('user');
+ this.password = localStorage.getItem('password'); // ****//
+ const remember = localStorage.getItem('remember'); // ****//
+ this.empname = localStorage.getItem('emp-name');
+ this.logintype = localStorage.getItem('login-type');
+ // tslint:disable-next-line: triple-equals
+ if (remember == 'true') { this.remeberMe = true; } else { this.remeberMe = false; }
+
+ // here will be check on user if exite then s part and depdding on user (response from getMobileInfo)
+
+ if (this.user) {
// this.loginDiv=false;
// this.welcomeBack=true;
- }else{
+ } else {
// this.user=true;
// this.welcomeBack=false;
}
@@ -180,14 +183,15 @@ export class LoginComponent implements OnInit, OnDestroy {
}
public changeLanguage() {
this.ts.switchLanguage();
+ // tslint:disable-next-line: triple-equals
if (TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) {
- this.language = "US";
+ this.language = 'US';
} else {
- this.language = "AR";
+ this.language = 'AR';
}
this.currentLang = TranslatorService.getCurrentLanguageCode();
}
- private forgetPasswordPage() {
+ public forgetPasswordPage() {
this.cs.openUserForgot();
}
private hideSplashScreen(stopLoading = false) {
@@ -198,15 +202,15 @@ export class LoginComponent implements OnInit, OnDestroy {
}
public addValue(e): void {
- // console.log(e.currentTarget.checked);
- this.remeberMe = true;//e.currentTarget.checked;
+ // console.log(e.currentTarget.checked);
+ this.remeberMe = true; // e.currentTarget.checked;
this.remeberMyInfo();
}
public remeberMyInfo() {
// if (this.remeberMe) {
- if(this.username){localStorage.setItem("user", this.username);}
- if(this.password){localStorage.setItem("password", this.password);}
- localStorage.setItem("remember", "true");
+ if (this.username) {localStorage.setItem('user', this.username); }
+ if (this.password) {localStorage.setItem('password', this.password); }
+ localStorage.setItem('remember', 'true');
// } else {
// localStorage.setItem("user", "");
// localStorage.setItem("password", "");
@@ -215,21 +219,21 @@ export class LoginComponent implements OnInit, OnDestroy {
}
public onLogin() {
- console.log("onLogin");
+ console.log('onLogin');
// this.checkAppUpdated();
// this.checkUserAuthentication();
- this.deviceToken = localStorage.getItem('deviceToken');
- console.log("let deviceToken" + this.deviceToken);
+ this.deviceToken = localStorage.getItem('deviceToken');
+ console.log('let deviceToken' + this.deviceToken);
- if (this.deviceToken) {
+ if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
this.checkAppUpdated();
} else {
- console.log("no deviceToken" );
+ console.log('no deviceToken' );
- this.pushService.startReceiving();
- setTimeout(() => {
+ this.pushService.startReceiving();
+ setTimeout(() => {
this.deviceToken = localStorage.getItem('deviceToken');
this.checkAppUpdated();
console.log('login enabled second time: ' + this.deviceToken);
@@ -242,31 +246,34 @@ export class LoginComponent implements OnInit, OnDestroy {
() => {
/* Write code for error */
}).subscribe((result: CheckAppVersionResponse) => {
+ // tslint:disable-next-line: triple-equals
if (result.MessageStatus == 2 && result.ErrorType == 4) {
- this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{
- this.handleAppUpdate(result)
+ this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => {
+ this.handleAppUpdate(result);
});
+ // tslint:disable-next-line: triple-equals
} else if (result.MessageStatus == 1) {
this.checkUserAuthentication();
}
});
}
- private handleAppUpdate(result){
+ private handleAppUpdate(result) {
this.iosLink = result.IOSLink;
this.androidLink = result.AndroidLink;
if (this.plt.is('android')) {
- if (this.androidLink)
+ if (this.androidLink) {
window.open(this.androidLink, '_system');
- }
- else if (this.plt.is('ios')) {
- if (this.iosLink)
+ }
+ } else if (this.plt.is('ios')) {
+ if (this.iosLink) {
window.open(this.iosLink, '_system');
+ }
}
}
private checkUserAuthentication() {
- console.log("debug Here!!");
+ console.log('debug Here!!');
console.log(this.username);
console.log(this.language);
console.log(this.password);
@@ -279,13 +286,13 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log(request);
this.authService
.login(request, () => {
- console.log("error here");
- //console.log(result.MessageStatus);
- //this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
- //this.userCheck();
- }, this.ts.trPK("general", "ok"))
+ console.log('error here');
+ // console.log(result.MessageStatus);
+ // this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
+ // this.userCheck();
+ }, this.ts.trPK('general', 'ok'))
.subscribe((result: CheckUserAuthenticationResponse) => {
- console.log("success");
+ console.log('success');
this.cs.stopLoading();
if (this.cs.validResponse(result)) {
// alert("result.MemberLoginList.EMPLOYEE_NAME :" + result.MemberLoginList[0].EMPLOYEE_NAME);
@@ -297,14 +304,14 @@ export class LoginComponent implements OnInit, OnDestroy {
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo();
- //this.cs.openSMSPage(); phase#1 one type of OTP
+ // this.cs.openSMSPage(); phase#1 one type of OTP
// if(!this.welcomeBack){
- this.cs.openConfirmLoginPage();//phase#2 add 4 types for OTP
+ this.cs.openConfirmLoginPage(); // phase#2 add 4 types for OTP
// }
} else {
- console.log("result.IsPasswordExpired");
+ console.log('result.IsPasswordExpired');
console.log(result.IsPasswordExpired);
if (result.IsPasswordExpired) {
this.presentPasswordExpiredDialog();
@@ -319,11 +326,11 @@ export class LoginComponent implements OnInit, OnDestroy {
async presentPasswordExpiredDialog() {
const alert = await this.alertController.create({
- header: this.ts.trPK("general", "confirm"),
- message: this.ts.trPK("login", "password-expired"),
+ header: this.ts.trPK('general', 'confirm'),
+ message: this.ts.trPK('login', 'password-expired'),
buttons: [
{
- text: this.ts.trPK("general", "ok"),
+ text: this.ts.trPK('general', 'ok'),
handler: () => {
console.log('Confirm Okay');
this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
@@ -356,23 +363,21 @@ export class LoginComponent implements OnInit, OnDestroy {
});
}
- private checkUserResult: CheckUserAuthenticationResponse;
-
private sendSMSForForgotPassword() {
this.cs.startLoading();
- let changePwdObj = new LoginRequest();
+ const changePwdObj = new LoginRequest();
changePwdObj.MobileNumber = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
changePwdObj.P_USER_NAME = this.username;
changePwdObj.P_MOBILE_NUMBER = this.checkUserResult.BasicMemberInformation.P_MOBILE_NUMBER;
this.authService.sendPublicSMS(
changePwdObj,
() => {
- //this.sendSMSForForgotPassword();
+ // this.sendSMSForForgotPassword();
/* Write code for error */
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.checkUserResult = result;
- console.log("2");
+ console.log('2');
console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.username;
@@ -388,31 +393,31 @@ export class LoginComponent implements OnInit, OnDestroy {
}
login() {
- console.log("login emit");
- console.log("login");
- // this.checkUserAuthentication();
- //this.loginDiv=true;
- this.user=false;
+ console.log('login emit');
+ console.log('login');
+ // this.checkUserAuthentication();
+ // this.loginDiv=true;
+ this.user = false;
}
-
-
+
+
loginWithUser() {
- console.log("loginWithUser")
+ console.log('loginWithUser');
this.cs.openConfirmLoginPage();
}
///
- getLastLoginInfo(){
- this.requestGetLoginInfo= {
- 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 => {
+ getLastLoginInfo() {
+ this.requestGetLoginInfo = {
+ 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){
+ if (res.Mohemm_GetMobileLoginInfoList.length > 0) {
this.cs.sharedService.setSharedData(
// res.Patient_SELECTDeviceIMEIbyIMEIList[0],
@@ -421,15 +426,14 @@ export class LoginComponent implements OnInit, OnDestroy {
);
this.user = true;
- }
- else{
- this.user=false
+ } else {
+ this.user = false;
}
}
});
}
-
-
+
+
}
diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts
index b3879314..f8a6c040 100644
--- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts
+++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts
@@ -24,7 +24,7 @@ export class ConfirmAddEitComponent implements OnInit {
private P_TransactionID: number;
private eitRequest: EitRequest;
- approversList: ApproversList;
+ approversList = [];
addrespList: any;//EitRespModel;
eitComments: string = "";
menuType: string = "";
@@ -36,7 +36,7 @@ export class ConfirmAddEitComponent implements OnInit {
headerTitle: string = "";
isTrue: any = 0;
attachItems: any;
- private isResubmitEIT: boolean = false;
+ public isResubmitEIT: boolean = false;
private itemKey: string = "";
private pActionMode: string = "SUBMIT";
attachReqObj: WorkListButtonRequest = new WorkListButtonRequest();
diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.ts b/Mohem/src/app/eit/eit-list/eit-list.component.ts
index 92e41259..6cd84bcb 100644
--- a/Mohem/src/app/eit/eit-list/eit-list.component.ts
+++ b/Mohem/src/app/eit/eit-list/eit-list.component.ts
@@ -19,27 +19,26 @@ export class EitListComponent implements OnInit {
P_PAGE_NUM: number;
P_PAGE_LIMIT: number;
- IsReachEnd: boolean = false;
+ IsReachEnd = false;
userName: any;
- isDelete: boolean = false;
+ isDelete = false;
getResEITTransactionList: any = [];
eitAddedList: any = [];
getPassMnuEntryObj: any;
selMenu: MenuResponse = new MenuResponse();
- //getMenuResponse :MenuResponse=new MenuResponse
EITTransactionsListObj: EITTransactionsRequest = new EITTransactionsRequest();
selEmp: string;
respID: number;
- transactionNo: number = 0;
- menuType: string = "";
- private functionName: string = "";
+ transactionNo = 0;
+ menuType = '';
+ public functionName = '';
private eitRequest: EitRequest;
private eitTransactionTbl: any = [];
private validEitTransactionTbl: any = [];
- private desxFlexCode: string = "";
+ private desxFlexCode = '';
private selectedIndex: number;
- private pAction: number = 0;
- public headerTitle: string = "";
+ private pAction = 0;
+ public headerTitle = '';
data: any;
accrualNetInfants: any;
accrualUNetChild: any;
@@ -49,15 +48,16 @@ export class EitListComponent implements OnInit {
cutoutPercentage: 80,
tooltips: { enabled: false },
legend: { display: false }};
- gaugeType = "full";
+ gaugeType = 'full';
accrualBalancesList: any;
common: any;
direction: string;
// gaugeValue = 11.200;
// gaugeLabel = "";
- constructor(private cs: CommonService, private EITService: EitService, private ts: TranslatorService, private modalCtrl: ModalController) {
- this.direction = TranslatorService.getCurrentLanguageName()
+ // tslint:disable-next-line: max-line-length
+ constructor(private cs: CommonService, private EITService: EitService, public ts: TranslatorService, private modalCtrl: ModalController) {
+ this.direction = TranslatorService.getCurrentLanguageName();
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
this.selEmp = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false);
this.respID = this.cs.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false);
@@ -65,32 +65,31 @@ export class EitListComponent implements OnInit {
this.menuType = this.selMenu.List_Menu.MENU_TYPE;
this.transactionNo = 0;
this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME;
- console.log("fN>>>>>>>>>>>>>>>>>"+this.functionName);
this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT;
this.validEitTransactionTbl = [];
this.P_PAGE_NUM = 1;
this.P_PAGE_LIMIT = 50;
}
- ngOnInit() {
+ ngOnInit() {
this.getEITTransactions();
this.accrualBalancesList = this.cs.sharedService.getSharedData('tickitsbalance', false);
// accrualNetInfants
// accrualUNetChild
// accrualNetAdult
- this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT;
- this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT;
- this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT;
-
+ this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT;
+ this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT;
+ this. accrualNetInfants = this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT;
+
this.data = {
// labels: ['earingTotal', 'deductionTotal'],
datasets: [
{ data: [this.accrualNetInfants, this.accrualUNetChild, this.accrualNetAdult],
backgroundColor: [
'#1FA269',
- '#22C6B3',
- '#3CB9D5',],
+ '#22C6B3',
+ '#3CB9D5', ],
borderWidth: 2
}
]
@@ -98,7 +97,7 @@ export class EitListComponent implements OnInit {
}
getEITTransactions() {
- console.log("jkfdjkdfsffjhfsdahffg");
+ console.log('jkfdjkdfsffjhfsdahffg');
this.IsReachEnd = false;
this.EITTransactionsListObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
@@ -118,9 +117,10 @@ export class EitListComponent implements OnInit {
this.getResEITTransactionList = result.GetEITTransactionList;
this.P_PAGE_NUM++;
this.EITTransactionsListObj.P_PAGE_NUM = this.P_PAGE_NUM;
- let lastItemIndex = this.getResEITTransactionList.length - 1;
+ const lastItemIndex = this.getResEITTransactionList.length - 1;
if (result.GetEITTransactionList[lastItemIndex] && result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0]) {
- let lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0];
+ const lastitem = result.GetEITTransactionList[lastItemIndex].Collection_Transaction[0];
+ // tslint:disable-next-line: triple-equals
if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) {
this.IsReachEnd = true;
} else {
@@ -152,31 +152,33 @@ export class EitListComponent implements OnInit {
this.IsReachEnd = true;
}
}
- //this.P_PAGE_NUM++;
- if (infiniteScroll)
+ // this.P_PAGE_NUM++;
+ if (infiniteScroll) {
infiniteScroll.target.complete();
+ }
}, (Error) => console.log(Error), () => infiniteScroll.target.complete());
} else {
- if (infiniteScroll)
+ if (infiniteScroll) {
infiniteScroll.target.complete();
+ }
}
}
- addEITRrq(i) {
+ addEITRrq(i?) {
this.pAction = EIT_ACTION.ADD;
// this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
// this.navCtrl.push("AddEitPage");
- //this.openEit(i);
+ // this.openEit(i);
this.openEitNew(i);
}
updateEITRrq(i) {
this.pAction = EIT_ACTION.UPDATE;
this.cs.sharedService.setSharedData(this.getResEITTransactionList[i].Collection_Transaction, EITTransactionsRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(this.pAction, EITTransactionsRequest.SUBMIT_EIT_ACTION);
- //this.fillEitTransactionTable(i);
- //this.navCtrl.push("AddEitPage");
- //this.openEit(i);
+ // this.fillEitTransactionTable(i);
+ // this.navCtrl.push("AddEitPage");
+ // this.openEit(i);
this.openEitNew(i);
}
deleteEIT(i) {
@@ -190,21 +192,22 @@ export class EitListComponent implements OnInit {
}
deleteEITRrq(i) {
- let list: any = this.getResEITTransactionList[i];
+ const list: any = this.getResEITTransactionList[i];
+ // tslint:disable-next-line: triple-equals
if (list.statusID != 2) {
this.selectedIndex = i;
// if(this.transactionNo==0)
this.transactionNo++;
this.pAction = EIT_ACTION.DELETE;
- //this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
+ // this.sharedData.setSharedData(this.getResEITTransactionList[i].Collection_Transaction,EITTransactionsRequest.SHARED_DATA);
// this.sharedData.setSharedData(EIT_ACTION.DELETE,EITTransactionsRequest.SUBMIT_EIT_ACTION);
this.fillEitTransactionTable(i);
this.validateEITTransaction();
// this.submitEit();
- //this.navCtrl.push("AddEitPage");
+ // this.navCtrl.push("AddEitPage");
} else {
- let msg: string = "";
- msg = this.ts.trPK("general", "attemptDel");
+ let msg = '';
+ msg = this.ts.trPK('general', 'attemptDel');
this.cs.presentAlert(msg);
// alert("You are attempting to delete a row that has already been deleted.");
@@ -212,19 +215,24 @@ export class EitListComponent implements OnInit {
}
openEitNew(index) {
let item: any = [];
- if (this.pAction == EIT_ACTION.UPDATE)
+ if (this.pAction == EIT_ACTION.UPDATE) {
item = this.getResEITTransactionList[index].Collection_Transaction;
+ }
this.transactionNo++;
- this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData')
+ // tslint:disable-next-line: max-line-length
+ this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData');
this.cs.openAddEitPage();
// this.navCtrl.push('AddEitPage', { dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo });
}
async openEit(index) {
let item: any = [];
- if (this.pAction == EIT_ACTION.UPDATE)
+ // tslint:disable-next-line: triple-equals
+ if (this.pAction == EIT_ACTION.UPDATE) {
item = this.getResEITTransactionList[index].Collection_Transaction;
+ }
this.transactionNo++;
- this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData')
+ // tslint:disable-next-line: max-line-length
+ this.cs.sharedService.setSharedData({ dirfromNotificationPage: false, submitEITObjList: item, transNo: this.transactionNo }, 'AddEITData');
const modalPage = await this.modalCtrl.create({
component: AddEitComponent
});
@@ -234,26 +242,29 @@ export class EitListComponent implements OnInit {
.then((data: any) => {
if (data) {
// this.transactionNo++;
- //this.updatedData=this.updatedData?this.updatedData.concat(data.updated):data.updated;
+ // this.updatedData=this.updatedData?this.updatedData.concat(data.updated):data.updated;
// this.notificationBodyRes[index].Collection_Transaction=data.updated;
this.selectedIndex = index;
this.desxFlexCode = data.eitRequest.P_DESC_FLEX_CONTEXT_CODE;
+ // tslint:disable-next-line: triple-equals
if (this.pAction == EIT_ACTION.ADD) {
index = this.eitAddedList.length + 1;
- let status = this.ts.trPK("eit", ".added");
- let statusID = EIT_ACTION.ADD;
- let obj = { status: status, statusID: statusID, Collection_Transaction: data.updated };
+ const status = this.ts.trPK('eit', '.added');
+ const statusID = EIT_ACTION.ADD;
+ const obj = { status, statusID, Collection_Transaction: data.updated };
this.eitAddedList.push(obj);
} else {
- let status = this.ts.trPK("eit", ".updated");
- let statusID = EIT_ACTION.UPDATE;
+ const status = this.ts.trPK('eit', '.updated');
+ const statusID = EIT_ACTION.UPDATE;
this.getResEITTransactionList[this.selectedIndex].status = status;
this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
}
this.updateTransactionList(data.eitRequest.EITTransactionTBL, false);
} else {
- if (this.transactionNo != 0)
+ // tslint:disable-next-line: triple-equals
+ if (this.transactionNo != 0) {
this.transactionNo--;
+ }
}
});
@@ -288,14 +299,18 @@ export class EitListComponent implements OnInit {
}
fillEitTransactionTable(index) {
- var obj = { peiObjVer: null, peiExtraInfoID: null };
- let list: any = this.getResEITTransactionList[index].Collection_Transaction;
+ let obj = { peiObjVer: null, peiExtraInfoID: null };
+ const list: any = this.getResEITTransactionList[index].Collection_Transaction;
let valuseArr: any = [];
+ // tslint:disable-next-line: prefer-for-of
for (let i = 0; i < list.length; i++) {
- let item = list[i];
- if (item.APPLICATION_COLUMN_NAME != "PEI_ACTION" && item.APPLICATION_COLUMN_NAME != "PEI_EXTRA_INFO_ID" && item.APPLICATION_COLUMN_NAME != "PEI_OBJECT_VERSION_NUMBER") {
+ const item = list[i];
+ // tslint:disable-next-line: triple-equals
+ // tslint:disable-next-line: max-line-length
+ if (item.APPLICATION_COLUMN_NAME != 'PEI_ACTION' && item.APPLICATION_COLUMN_NAME != 'PEI_EXTRA_INFO_ID' && item.APPLICATION_COLUMN_NAME != 'PEI_OBJECT_VERSION_NUMBER') {
this.desxFlexCode = item.DESC_FLEX_CONTEXT_CODE;
- if (item.DATE_VALUE == "") {
+ // tslint:disable-next-line: triple-equals
+ if (item.DATE_VALUE == '') {
item.DATE_VALUE = null;
}
valuseArr.push(
@@ -306,17 +321,19 @@ export class EitListComponent implements OnInit {
NUMBER_VALUE: item.NUMBER_VALUE,
DATE_VALUE: item.DATE_VALUE,
}
- )
+ );
} else {
- if (item.APPLICATION_COLUMN_NAME == "PEI_OBJECT_VERSION_NUMBER")
+ if (item.APPLICATION_COLUMN_NAME == 'PEI_OBJECT_VERSION_NUMBER') {
obj.peiObjVer = item.NUMBER_VALUE;
- else if (item.APPLICATION_COLUMN_NAME == "PEI_EXTRA_INFO_ID")
+ }
+ else if (item.APPLICATION_COLUMN_NAME == 'PEI_EXTRA_INFO_ID') {
obj.peiExtraInfoID = item.NUMBER_VALUE;
+ }
}
- }// end for
- //}
- valuseArr = this.fillExtraInformation(valuseArr, "DELETE_ROW", obj.peiExtraInfoID, obj.peiObjVer, this.transactionNo);
+ }// end for
+ // }
+ valuseArr = this.fillExtraInformation(valuseArr, 'DELETE_ROW', obj.peiExtraInfoID, obj.peiObjVer, this.transactionNo);
this.eitTransactionTbl = valuseArr;
}
@@ -324,7 +341,7 @@ export class EitListComponent implements OnInit {
values.push(
{
TRANSACTION_NUMBER: transNo,
- NAME: "PEI_ACTION",
+ NAME: 'PEI_ACTION',
VARCHAR2_VALUE: peiAction,
NUMBER_VALUE: null,
DATE_VALUE: null
@@ -332,7 +349,7 @@ export class EitListComponent implements OnInit {
values.push(
{
TRANSACTION_NUMBER: transNo,
- NAME: "PEI_EXTRA_INFO_ID",
+ NAME: 'PEI_EXTRA_INFO_ID',
VARCHAR2_VALUE: null,
NUMBER_VALUE: peiExtraInfoID,
DATE_VALUE: null
@@ -340,7 +357,7 @@ export class EitListComponent implements OnInit {
values.push(
{
TRANSACTION_NUMBER: transNo,
- NAME: "PEI_OBJECT_VERSION_NUMBER",
+ NAME: 'PEI_OBJECT_VERSION_NUMBER',
VARCHAR2_VALUE: null,
NUMBER_VALUE: peiObjVer,
DATE_VALUE: null
@@ -351,11 +368,11 @@ export class EitListComponent implements OnInit {
submitEit() {
this.eitRequest = new EitRequest();
- let list: any = this.fixTransactionNo();
+ const list: any = this.fixTransactionNo();
this.eitRequest.EITTransactionTBL = list;
this.eitRequest.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
this.eitRequest.P_MENU_TYPE = this.menuType;
- this.eitRequest.P_SELECTED_RESP_ID = this.respID;//this.selMenu.List_Menu.RESP_ID,//-999,
+ this.eitRequest.P_SELECTED_RESP_ID = this.respID; // this.selMenu.List_Menu.RESP_ID,//-999,
this.eitRequest.P_FUNCTION_NAME = this.functionName;
this.eitRequest.P_DESC_FLEX_CONTEXT_CODE = this.desxFlexCode;
@@ -367,14 +384,14 @@ export class EitListComponent implements OnInit {
if (this.cs.validResponse(result)) {
this.cs.sharedService.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
this.cs.sharedService.setSharedData(result, AddEitResponse.SHARED_DATA);
- //this.addrespList=result.SubmitEITTransactionList;
+ // this.addrespList=result.SubmitEITTransactionList;
// this.itemKey=this.addrespList.P_ITEM_KEY;
// this.P_TransactionID=result.SubmitEITTransactionList.P_TRANSACTION_ID;
// this.sharedData.setSharedData(result,AddEitResponse.SHARED_DATA);
// //this.cs.sharedService.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit");
// // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA);
- this.cs.sharedService.setSharedData({ isResubmit: false, isDelete: this.isDelete }, 'confirmAddEITData')
+ this.cs.sharedService.setSharedData({ isResubmit: false, isDelete: this.isDelete }, 'confirmAddEITData');
this.cs.openConfirmEitPage();
// this.navCtrl.push("ConfirmAddEitPage", { isResubmit: false, isDelete: this.isDelete });
}
@@ -388,7 +405,7 @@ export class EitListComponent implements OnInit {
P_FUNCTION_NAME: this.functionName,
P_DESC_FLEX_CONTEXT_CODE: this.desxFlexCode,
EITTransactionTBL: this.eitTransactionTbl
- }
+ };
this.EITService.validateEITTransaction(this.eitRequest).subscribe((result: any) => {
this.handleEITValidateTr(result);
@@ -397,22 +414,23 @@ export class EitListComponent implements OnInit {
private handleEITValidateTr(result) {
if (this.cs.validResponse(result)) {
// public static SHARED_DATA = 'login-request';
- //this.sharedData.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
- let status = this.ts.trPK("eit", ".deleted");
- let statusID = EIT_ACTION.DELETE;
+ // this.sharedData.setSharedData(this.eitRequest, EitRequest.SHARED_DATA);
+ const status = this.ts.trPK('eit', '.deleted');
+ const statusID = EIT_ACTION.DELETE;
this.isDelete = true;
this.getResEITTransactionList[this.selectedIndex].status = status;
this.getResEITTransactionList[this.selectedIndex].statusID = statusID;
this.updateTransactionList(this.eitTransactionTbl, false);
this.submitEit();
} else {
- if (this.transactionNo != 0)
+ if (this.transactionNo != 0) {
this.transactionNo--;
+ }
}
}
updateTransactionList(list, isRemove) {
- //let newlist = this.validEitTransactionTbl.map(a => a.NAME='PEI_EXTRA_INFO_ID');
- let isAnewRow: boolean = false;
+ // let newlist = this.validEitTransactionTbl.map(a => a.NAME='PEI_EXTRA_INFO_ID');
+ let isAnewRow = false;
let updateDelTransNo: number;
if (this.cs.hasData(this.validEitTransactionTbl)) {
this.validEitTransactionTbl.forEach(element => {
@@ -426,42 +444,45 @@ export class EitListComponent implements OnInit {
}
list.forEach(element => {
// NAME=PEI_EXTRA_INFO_ID
- //const index = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
+ // const index = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
// let newlist = this.validEitTransactionTbl.map(a => a.NAME==='PEI_EXTRA_INFO_ID');
if (isAnewRow == true) {
- let index: number = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
- //if(index!=-1)
- //this.validEitTransactionTbl.splice(index, 1);
+ const index: number = this.validEitTransactionTbl.findIndex(x => x.TRANSACTION_NUMBER === element.TRANSACTION_NUMBER);
+ // if(index!=-1)
+ // this.validEitTransactionTbl.splice(index, 1);
} else {
- let index: number = this.validEitTransactionTbl.findIndex(x => x.NAME === 'PEI_EXTRA_INFO_ID' && x.NUMBER_VALUE === element.NUMBER_VALUE);
+ const index: number = this.validEitTransactionTbl.findIndex(x => x.NAME === 'PEI_EXTRA_INFO_ID' && x.NUMBER_VALUE === element.NUMBER_VALUE);
if (index != -1) {
- //this.validEitTransactionTbl.splice(index, 1);
- if (!updateDelTransNo)
+ // this.validEitTransactionTbl.splice(index, 1);
+ if (!updateDelTransNo) {
updateDelTransNo = this.validEitTransactionTbl[index].TRANSACTION_NUMBER;
+ }
}
}
});
- if (updateDelTransNo)
+ if (updateDelTransNo) {
this.removeItems(updateDelTransNo);
- if (isRemove == false)
+ }
+ if (isRemove == false) {
this.validEitTransactionTbl = this.validEitTransactionTbl ? this.validEitTransactionTbl.concat(list) : list;
+ }
}
fixTransactionNo(): any[] {
- let list: any = [];
- let newIndex: number = 1;
- let length: number = this.validEitTransactionTbl.length;
+ const list: any = [];
+ let newIndex = 1;
+ const length: number = this.validEitTransactionTbl.length;
for (let i = 0; i < length; i++) {
// let item :any={};
const item = Object.assign({}, this.validEitTransactionTbl[i]);
- let transNo: number = item.TRANSACTION_NUMBER;
- let obj: any = item;
+ const transNo: number = item.TRANSACTION_NUMBER;
+ const obj: any = item;
if (i == 0) {
obj.TRANSACTION_NUMBER = newIndex;
list.push(obj);
} else {
- let prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER;
+ const prevEl: any = this.validEitTransactionTbl[i - 1].TRANSACTION_NUMBER;
if (transNo == prevEl) {
obj.TRANSACTION_NUMBER = newIndex;
list.push(obj);
@@ -475,19 +496,21 @@ export class EitListComponent implements OnInit {
return list;
}
removeItems(transNo) {
- let list = [];
+ const list = [];
for (let i = 0; i < this.validEitTransactionTbl.length; i++) {
- if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo)
+ if (this.validEitTransactionTbl[i].TRANSACTION_NUMBER != transNo) {
list.push(this.validEitTransactionTbl[i]);
+ }
}
this.validEitTransactionTbl = list;
}
removeAddedItem(index) {
- let list = [];
+ const list = [];
let item: any = [];
for (let i = 0; i < this.eitAddedList.length; i++) {
- if (i != index)
+ if (i != index) {
list.push(this.eitAddedList[i]);
+ }
}
item = this.eitAddedList[index];
this.eitAddedList = list;
diff --git a/Mohem/src/app/eit/home/home.component.html b/Mohem/src/app/eit/home/home.component.html
index 7591dd7e..5aa222c7 100644
--- a/Mohem/src/app/eit/home/home.component.html
+++ b/Mohem/src/app/eit/home/home.component.html
@@ -15,7 +15,7 @@
-
+
@@ -33,7 +33,7 @@
+ (click)="openPage(subPage, i2)">
{{subPage.PROMPT}}
@@ -54,7 +54,7 @@
-
+
@@ -72,7 +72,7 @@
+ (click)="openPage(subPage, i2)">
{{subPage.PROMPT}}
diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts
index a4ae5018..7bd5660a 100644
--- a/Mohem/src/app/eit/home/home.component.ts
+++ b/Mohem/src/app/eit/home/home.component.ts
@@ -17,10 +17,10 @@ export class HomeComponent implements OnInit {
// Selected Side Menu
selectedMenu: any;
direction: string;
- pageType :string;
+ pageType: string;
constructor(private cs: CommonService, private ts: TranslatorService) {
- this.direction = TranslatorService.getCurrentLanguageName()
+ this.direction = TranslatorService.getCurrentLanguageName();
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);
@@ -44,7 +44,7 @@ export class HomeComponent implements OnInit {
this.selectedMenu = index;
}
}
- console.log("selected>>>>>>>"+this.selectedMenu);
+ console.log('selected>>>>>>>' + this.selectedMenu);
}
goToRequest(menuEntry) {
@@ -57,7 +57,7 @@ export class HomeComponent implements OnInit {
} else if (menuEntry.REQUEST_TYPE === 'EIT') {
this.cs.openEitListPage();
}
- if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){
+ if (menuEntry.REQUEST_TYPE === 'PAYSLIP') {
this.cs.openPayslipPage();
}
if (menuEntry.REQUEST_TYPE === 'TIME_CARD') {
diff --git a/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts
index 81ff9ffc..41e6c26a 100644
--- a/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts
+++ b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts
@@ -11,7 +11,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
export class SubmitEitModalComponent implements OnInit {
submitAttachmentList :any =[];
eitComments: string;
- constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){
+ constructor( public ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){
this.submitAttachmentList = this.cs.sharedService.getSharedData('submitAttachmentList', false);
this.eitComments = this.cs.sharedService.getSharedData('eitComments', false);
}
diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts
index ca469fcd..78c49b25 100644
--- a/Mohem/src/app/hmg-common/hmg-common.module.ts
+++ b/Mohem/src/app/hmg-common/hmg-common.module.ts
@@ -55,7 +55,7 @@ import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component';
import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component';
// import { GeofencingService } from './services/geofencing/geofencing.service';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
-import { ButtonComponent } from './ui/button/button.component';
+import { ButtonComponent, Modal } from './ui/button/button.component';
import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component';
import { ListboxModule } from 'primeng/listbox';
import { GenderSelectComponent } from './ui/gender-select/gender-select.component';
@@ -91,7 +91,8 @@ import { RateService } from './services/rate/rate.service';
// import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
-import { FileSelectDirective } from 'ng2-file-upload';
+import { FileUploadModule } from 'ng2-file-upload';
+// import { FileSelectDirective } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
@@ -129,7 +130,8 @@ import { ChartModule } from 'primeng/chart';
NgCircleProgressModule.forRoot(),
NgCalendarModule,
ChartModule,
- NgxGaugeModule
+ NgxGaugeModule,
+ FileUploadModule
],
declarations: [
FabButtonComponent,
@@ -183,7 +185,7 @@ import { ChartModule } from 'primeng/chart';
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
- FileSelectDirective,
+ // FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@@ -195,8 +197,8 @@ import { ChartModule } from 'primeng/chart';
EmployeeInformationComponent,
ConfirmLoginComponent,
CircleCalendarComponent,
- DateInfoModalComponent
-
+ DateInfoModalComponent,
+ Modal
],
exports: [
FabButtonComponent,
@@ -247,7 +249,7 @@ import { ChartModule } from 'primeng/chart';
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
- FileSelectDirective,
+ // FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@@ -264,8 +266,9 @@ import { ChartModule } from 'primeng/chart';
CircleCalendarComponent,
DateInfoModalComponent,
NgCalendarModule,
- ChartModule
-
+ ChartModule,
+ FileUploadModule,
+ Modal
],
providers: [
AttendScanService,
diff --git a/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts b/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts
index dc780d83..2dbbe194 100644
--- a/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts
+++ b/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts
@@ -5,15 +5,15 @@ import { SharedDataService } from '../shared-data-service/shared-data.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { AttendanceService } from 'src/app/home/services/attendance.services';
import { ZBar } from '@ionic-native/zbar/ngx';
-import { Geolocation } from "@ionic-native/geolocation/ngx";
+import { Geolocation } from '@ionic-native/geolocation/ngx';
import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request';
import { AuthenticatedUser } from '../authentication/models/authenticated-user';
import { CommonService } from '../common/common.service';
import { TranslatorService } from '../translator/translator.service';
-import { Response } from "src/app/hmg-common/services/models/response";
-import { Camera, CameraOptions,PictureSourceType} from "@ionic-native/Camera/ngx";
-import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service'
-import { Device } from "@ionic-native/device/ngx";
+import { Response } from 'src/app/hmg-common/services/models/response';
+import { Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
+import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service';
+import { Device } from '@ionic-native/device/ngx';
@Injectable({
@@ -28,50 +28,49 @@ export class AttendScanService {
scannedResult: any;
userData: any = {};
constructor(private device: Device,
- private zbar: ZBar,
- private geolocation: Geolocation,
- private attendance_service: AttendanceService,
- private barcodeScanner: BarcodeScanner,
- private cameraController: Camera,
- public sharedData: SharedDataService,
- private sanitizer: DomSanitizer,
- private permissions: DevicePermissionsService,
- public common:CommonService,
- public ts: TranslatorService,) {
- this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false);
+ private zbar: ZBar,
+ private geolocation: Geolocation,
+ private attendance_service: AttendanceService,
+ private barcodeScanner: BarcodeScanner,
+ private cameraController: Camera,
+ public sharedData: SharedDataService,
+ private sanitizer: DomSanitizer,
+ private permissions: DevicePermissionsService,
+ public common: CommonService,
+ public ts: TranslatorService, ) {
+ this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
}
public getDeviceLocation() {
- let isVirtual = this.device.isVirtual;
- if(isVirtual==true){
- alert("emulater>>>>>>>"+isVirtual);
- alert("You are using virtual device");
+ const isVirtual = this.device.isVirtual;
+ // tslint:disable-next-line: triple-equals
+ if (isVirtual == true) {
+ alert('emulater>>>>>>>' + isVirtual);
+ alert('You are using virtual device');
return false;
}
-
+
this.permissions.requestLocationAutherization().then(granted => {
this.location = granted as boolean;
if (this.location) {
this.geolocation
.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true })
.then(resp => {
- // console.log(resp.coords.latitude);
- // console.log(resp.coords.longitude);
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
})
.catch(error => {
- console.log("Error getting location", error);
+ console.log('Error getting location', error);
});
-
+
} else {
return false;
}
});
-
+
}
-
+
public attendance() {
this.permissions.requestCameraAutherization().then(granted => {
this.camera = granted as boolean;
@@ -81,43 +80,43 @@ export class AttendScanService {
}
);
}
-
-
+
+
public scanCode() {
this.barcodeScanner.scan().then(barcodeData => {
- console.log('Barcode data', barcodeData);
- // let strResult = JSON.parse(barcodeData);
- // console.log(strResult.QRValue);
- this.scannedResult = barcodeData;
- this.deviceID = this.device.uuid;
- this.swipeAttendance();
+ if (!barcodeData.cancelled) {
+ this.scannedResult = barcodeData;
+ this.deviceID = this.device.uuid;
+ this.swipeAttendance();
+ }
}).catch(err => {
console.log('Error', err);
});
}
-
-
+
+
public swipeAttendance() {
- let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
+ const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat;
request.Longitude = this.longt;
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
- console.log("request");
+ console.log('request');
console.log(JSON.stringify(request));
this.attendance_service
.attendanceSwipeScanner(request, () => {
- console.log("Error inside in swipe attendance");
+ console.log('Error inside in swipe attendance');
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
- console.log("response");
+ console.log('response');
console.log(result);
- this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess"));
- } else {
- this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
+ this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess'));
}
+ // else {
+ // this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
+ // }
});
}
}
diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts
index 872b1331..31f9a7cd 100644
--- a/Mohem/src/app/hmg-common/services/common/common.service.ts
+++ b/Mohem/src/app/hmg-common/services/common/common.service.ts
@@ -1408,10 +1408,10 @@ public getMonthNameAr(value: number): string {
return FormatedDate;
}
- public setUpdateImage (image){
+ public setUpdateImage (image,status?){
console.log('setUpdateImage');
this.setUpdateImg=image;
- this.updateImage=true;
+ this.updateImage=status;
}
public getUpdateImage(){
console.log('getUpdateImage');
diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts
index a494567f..1f34b0ad 100644
--- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts
+++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts
@@ -174,7 +174,9 @@ public static host = 'https://uat.hmgwebservices.com/';
return false;
} else if (result.ErrorType === 2 || result.ErrorType === 4) {
// console.log("error expired");
+ this.cs.stopLoading();
} else {
+ this.cs.stopLoading();
this.cs.showErrorMessageDialog(
onError,
errorLabel,
diff --git a/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts b/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts
index b34ae6a3..01f7a2b9 100644
--- a/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts
+++ b/Mohem/src/app/hmg-common/services/device-permissions/device-permissions.service.ts
@@ -13,22 +13,25 @@ import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
providedIn: 'root'
})
export class DevicePermissionsService {
+
+ constructor(
+ public diagnostic: Diagnostic,
+ public cs: CommonService,
+ public nativeStorage: NativeStorage,
+ public ts: TranslatorService,
+ public nativeSettings: OpenNativeSettings) { }
public static GRANTED = 'GRANTED';
public static DENIED_ALWAYS = 'DENIED_ALWAYS';
public static CAMERA_MIC = 'camera_mic_permission';
public static LOCATION = 'location_permission';
+
+ public static APP_SETTINGS = 'application_details';
+
public onSucess;
public onerror;
- constructor(
- public diagnostic: Diagnostic,
- public cs: CommonService,
- public nativeStorage: NativeStorage,
- public ts: TranslatorService,
- public nativeSettings: OpenNativeSettings) { }
-
public requestCameraPermission(): Observable {
return Observable.create(observer => {
@@ -37,16 +40,17 @@ export class DevicePermissionsService {
}
private requestCamera(observer: any) {
- //console.log("Camera permission????????")
this.hasCameraPermission().then((isAvailable) => {
if (isAvailable) {
// this.requestMicophonePermission(observer);
this.observerDone(observer, true);
} else {
this.diagnostic.requestCameraAuthorization(true).then((value) => {
+ // tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) {
- //this.requestMicophonePermission(observer);
+ // this.requestMicophonePermission(observer);
this.observerDone(observer, true);
+ // tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
// this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false);
@@ -77,8 +81,10 @@ export class DevicePermissionsService {
this.observerDone(observer, true);
} else {
this.diagnostic.requestMicrophoneAuthorization().then((value) => {
+ // tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) {
this.observerDone(observer, true);
+ // tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false);
@@ -112,8 +118,8 @@ export class DevicePermissionsService {
}
public async hasCameraAndMicPermissions(): Promise {
- let camera = await this.hasCameraPermission();
- //let mic = await this.diagnostic.isMicrophoneAuthorized();
+ const camera = await this.hasCameraPermission();
+ // let mic = await this.diagnostic.isMicrophoneAuthorized();
if (camera) {
// await this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, false);
return true;
@@ -128,7 +134,7 @@ export class DevicePermissionsService {
resolve(true);
}, this.ts.trPK('general', 'accept'),
() => {
- resolve(false)
+ resolve(false);
}, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message
);
});
@@ -140,15 +146,12 @@ export class DevicePermissionsService {
resolve(true);
}, this.ts.trPK('general', 'settings'),
() => {
- resolve(false)
+ resolve(false);
}, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message
);
});
}
-
- public static APP_SETTINGS = 'application_details';
-
public async openApplicationSettings() {
// return new Promise((resolver, reject) => {
// this.nativeSettings.open(DevicePermissionsService.APP_SETTINGS).then(result => {
@@ -208,13 +211,13 @@ export class DevicePermissionsService {
if (await this.hasCameraAndMicPermissions()) {
return true;
} else {
- let message = this.ts.trPK('permissions', 'camera');
+ const message = this.ts.trPK('permissions', 'camera');
// if (await this.isPermissionAlwaysDenied(DevicePermissionsService.CAMERA_MIC)) {
// if (await this.permissionSettingsDialog(message)) {
// return this.openCameraAndMicSettings();
// }
// } else {
- if (await this.permissionRequestDialog(message)) {
+ if (await this.permissionRequestDialog(message)) {
return this.requestCameraPermission().toPromise();
}
// }
@@ -227,17 +230,16 @@ export class DevicePermissionsService {
public async requestLocationAutherization() {
if ( await this.isLocationEnabled()) {
-
if (await this.hasLocationPermissions()) {
return true;
} else {
- let message = this.ts.trPK('permissions', 'location');
+ const message = this.ts.trPK('permissions', 'location');
// if (await this.isPermissionAlwaysDenied(DevicePermissionsService.LOCATION)) {
// if (await this.permissionSettingsDialog(message)) {
// return this.openLocationSettings();
// }
// } else {
- if (await this.permissionRequestDialog(message)) {
+ if (await this.permissionRequestDialog(message)) {
return this.requestLocationPermission();
}
// }
@@ -249,7 +251,7 @@ export class DevicePermissionsService {
}
private async isLocationEnabled() {
- let isAvailable = await this.diagnostic.isLocationEnabled();
+ const isAvailable = await this.diagnostic.isLocationEnabled();
if (!isAvailable) {
this.cs.presentAlert(this.ts.trPK('permissions', 'enable-location'), () => {
});
@@ -258,7 +260,7 @@ export class DevicePermissionsService {
}
public async hasLocationPermissions(): Promise {
- let location = await this.diagnostic.isLocationAvailable();
+ const location = await this.diagnostic.isLocationAvailable();
if (location) {
await this.setAlwaysDenied(DevicePermissionsService.LOCATION, false);
return true;
@@ -280,12 +282,14 @@ export class DevicePermissionsService {
private async requestLocationPermission() {
- let hasPermissions = await this.hasLocationPermissions();
+ const hasPermissions = await this.hasLocationPermissions();
if (!hasPermissions) {
- let value = await this.diagnostic.requestLocationAuthorization();
+ const value = await this.diagnostic.requestLocationAuthorization();
+ // tslint:disable-next-line: triple-equals
if (value == DevicePermissionsService.GRANTED) {
return true;
+ // tslint:disable-next-line: triple-equals
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.LOCATION, true);
}
diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html
index 48c55d3e..ab15461a 100644
--- a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html
+++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html
@@ -1,5 +1,5 @@
-
-
+
-
-
@@ -71,9 +58,6 @@
>
-
-
@@ -103,7 +87,7 @@
diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts
index 314dd5a9..60dfc34f 100644
--- a/Mohem/src/app/home/home.page.ts
+++ b/Mohem/src/app/home/home.page.ts
@@ -249,7 +249,7 @@ export class HomePage implements OnInit {
this.attendance();
})
.catch(error => {
- console.log('Error getting location', error);
+ this.common.presentAlert(this.ts.trPK('home', 'position-error'));
});
} else {
return false;
@@ -283,18 +283,6 @@ export class HomePage implements OnInit {
// });
// }
- ionViewDidEnter() {
- this.geolocation
- .getCurrentPosition()
- .then(resp => {
- this.lat = resp.coords.latitude;
- this.longt = resp.coords.longitude;
- })
- .catch(error => {
- console.log('Error getting location', error);
- });
- }
-
private openMenu() {
this.menu.toggle();
}
@@ -331,7 +319,6 @@ export class HomePage implements OnInit {
this.showOpenMissingSwipes();
this.showAttendanceTracking();
this.getAccrualBalance();
- // this.common.stopLoading();
}
public Vacation_Rule() {
@@ -372,6 +359,7 @@ export class HomePage implements OnInit {
for (let i = 0; i < this.menuList.length; i++) {
if (this.menuList[i].MENU_TYPE === 'M') {
this.events.publish('myTeamFlag', 'true');
+ // this.common.sharedService.setSharedData('true', "myTeamFlag");
}
}
@@ -487,9 +475,11 @@ export class HomePage implements OnInit {
this.barcodeScanner
.scan()
.then(barcodeData => {
- this.scannedResult = barcodeData;
- this.deviceID = this.device.uuid;
- this.swipeAttendance();
+ if (!barcodeData.cancelled) {
+ this.scannedResult = barcodeData;
+ this.deviceID = this.device.uuid;
+ this.swipeAttendance();
+ }
})
.catch(err => {
console.log('Error', err);
diff --git a/Mohem/src/app/my-specialist/home/home.component.ts b/Mohem/src/app/my-specialist/home/home.component.ts
index d820bbaf..ea4bf9f2 100644
--- a/Mohem/src/app/my-specialist/home/home.component.ts
+++ b/Mohem/src/app/my-specialist/home/home.component.ts
@@ -133,7 +133,7 @@ export class HomeComponent implements OnInit {
}
}
- private getSpecialistInfo(i) {
+ public getSpecialistInfo(i) {
// this.navCtrl.push("MyTeamPage", { employee: this.specialistEmpList[i], isSpecialist: true });
this.cs.sharedService.setSharedData(this.specialistEmpList[i], MyTeamService.EMPLOYEE_SHARED_DATA);
this.cs.sharedService.setSharedData(true, 'isSpecialist');
diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html
index af154d2f..0fb04cdb 100644
--- a/Mohem/src/app/my-team/details/details.component.html
+++ b/Mohem/src/app/my-team/details/details.component.html
@@ -159,7 +159,7 @@
{{ts.trPK('attendance-tracking','non-analyzed')}}
-
{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}
+ {{timeCardSummaryData.NOT_ANALYZED_DAYS}}
diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts
index a5e58229..087df5da 100644
--- a/Mohem/src/app/my-team/details/details.component.ts
+++ b/Mohem/src/app/my-team/details/details.component.ts
@@ -75,7 +75,7 @@ export class DetailsComponent implements OnInit {
};
public data = {};
-
+ public isPostNoLoad = true;
public previousActiveIndex = 0;
public currentActiveIndex = 0;
public searchNameOrUserName = '';
@@ -96,11 +96,13 @@ export class DetailsComponent implements OnInit {
) { }
ngOnInit() {
+ this.common.startLoading();
this.intializeMemberDetail();
this.showAttendanceTracking();
}
showAttendanceTracking() {
+ this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
@@ -116,6 +118,7 @@ export class DetailsComponent implements OnInit {
public segmentChanged(event: any) {
this.activeSegment = event.detail.value;
if (this.activeSegment === 'Attendance') {
+ this.common.startLoading();
this.initAttendance();
}
}
@@ -139,7 +142,6 @@ export class DetailsComponent implements OnInit {
}
public getDayHoursTypeDetails(month?, year?) {
- console.log('getDayHoursTypeDetails');
const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest();
this.monthName = month;
this.yearDate = year;
@@ -156,17 +158,17 @@ export class DetailsComponent implements OnInit {
dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber;
dayAndHoursReqObj.P_PAGE_LIMIT = 100;
- this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => {
+ this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
console.log(result.GetDayHoursTypeDetailsList);
this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs');
this.countAllAttendDays(result.GetDayHoursTypeDetailsList);
}
});
-
}
nextSlide() {
+ this.common.startLoading();
if (this.currentMonthName !== this.month) {
this.showData = false;
if (this.nextMonth > 12) {
@@ -181,6 +183,7 @@ export class DetailsComponent implements OnInit {
}
previousSlide() {
+ this.common.startLoading();
this.showData = false;
if (this.preMonth === 0) {
this.currentYear = this.currentYear - 1;
@@ -255,17 +258,11 @@ export class DetailsComponent implements OnInit {
timeCardSummaryReqObj.SearchMonth = this.monthName;
timeCardSummaryReqObj.SearchYear = this.yearDate;
- this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => {
+ this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj, '', '', this.isPostNoLoad).subscribe((result) => {
if (this.common.validResponse(result)) {
-
this.timeCardSummaryData = result.GetTimeCardSummaryList[0];
this.absentDays = this.timeCardSummaryData.ABSENT_DAYS;
this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS;
-
- // this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS;
- // if (this.absentDays === 0 && this.attendedDays === 0) {
- // this.futrueDays = this.totalAttendancePrecentage;
- // }
this.totalAttendancePrecentage = this.absentDays + this.attendedDays;
if (this.totalAttendancePrecentage > 0) {
this.data = {
diff --git a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts
index 7750f3d9..43ea2773 100644
--- a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts
+++ b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts
@@ -25,7 +25,7 @@ export class ApplyActionModalComponent implements OnInit {
messageSuccess: boolean;
- constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService,
+ constructor( public ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService,
) {
this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false);
diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html
index f7ddcbba..e2a26be5 100644
--- a/Mohem/src/app/notification/home/home.component.html
+++ b/Mohem/src/app/notification/home/home.component.html
@@ -25,7 +25,7 @@