Merge branches 'master' and 'master' of https://hmg.git.cloudforge.com/mohemmionic5

# Conflicts:
#	Mohem/src/assets/localization/i18n.json
production
haroon amjad 7 years ago
commit 7609feb6ae

@ -26,7 +26,6 @@
"@ionic-native/app-rate": "^5.5.1", "@ionic-native/app-rate": "^5.5.1",
"@ionic-native/background-geolocation": "^5.4.0", "@ionic-native/background-geolocation": "^5.4.0",
"@ionic-native/badge": "^5.4.0", "@ionic-native/badge": "^5.4.0",
"@ionic-native/barcode-scanner": "^5.4.0",
"@ionic-native/ble": "^5.4.0", "@ionic-native/ble": "^5.4.0",
"@ionic-native/call-number": "^5.4.0", "@ionic-native/call-number": "^5.4.0",
"@ionic-native/camera": "^5.4.0", "@ionic-native/camera": "^5.4.0",
@ -35,13 +34,11 @@
"@ionic-native/diagnostic": "^5.4.0", "@ionic-native/diagnostic": "^5.4.0",
"@ionic-native/fingerprint-aio": "^5.4.0", "@ionic-native/fingerprint-aio": "^5.4.0",
"@ionic-native/globalization": "^5.4.0", "@ionic-native/globalization": "^5.4.0",
"@ionic-native/health": "^5.4.0",
"@ionic-native/in-app-browser": "^5.5.1", "@ionic-native/in-app-browser": "^5.5.1",
"@ionic-native/keyboard": "^5.4.0", "@ionic-native/keyboard": "^5.4.0",
"@ionic-native/launch-navigator": "^5.4.0", "@ionic-native/launch-navigator": "^5.4.0",
"@ionic-native/local-notifications": "^5.4.0", "@ionic-native/local-notifications": "^5.4.0",
"@ionic-native/native-storage": "^5.4.0", "@ionic-native/native-storage": "^5.4.0",
"@ionic-native/push": "^5.4.0",
"@ionic-native/sms": "^5.8.0", "@ionic-native/sms": "^5.8.0",
"@ionic-native/splash-screen": "^5.0.0", "@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.5.1", "@ionic-native/sqlite": "^5.5.1",
@ -54,7 +51,6 @@
"call-number": "^1.0.1", "call-number": "^1.0.1",
"chart.js": "^2.8.0", "chart.js": "^2.8.0",
"cordova-android": "7.1.4", "cordova-android": "7.1.4",
"cordova-android-support-gradle-release": "2.1.0",
"cordova-browser": "5.0.4", "cordova-browser": "5.0.4",
"cordova-ios": "4.5.5", "cordova-ios": "4.5.5",
"cordova-opentok-android-permissions": "1.0.1", "cordova-opentok-android-permissions": "1.0.1",
@ -71,12 +67,10 @@
"cordova-plugin-dialogs": "2.0.1", "cordova-plugin-dialogs": "2.0.1",
"cordova-plugin-fingerprint-aio": "^1.7.0", "cordova-plugin-fingerprint-aio": "^1.7.0",
"cordova-plugin-globalization": "^1.11.0", "cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-health": "1.1.3",
"cordova-plugin-inappbrowser": "3.0.0", "cordova-plugin-inappbrowser": "3.0.0",
"cordova-plugin-ionic-keyboard": "^2.1.3", "cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^3.1.2", "cordova-plugin-ionic-webview": "^3.1.2",
"cordova-plugin-local-notification": "^0.9.0-beta.2", "cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-mauron85-background-geolocation": "3.0.0-alpha.50",
"cordova-plugin-nativestorage": "^2.3.2", "cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-sms-receive": "^1.0.2", "cordova-plugin-sms-receive": "^1.0.2",
"cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-splashscreen": "^5.0.2",
@ -85,14 +79,11 @@
"cordova-plugin-whitelist": "^1.3.3", "cordova-plugin-whitelist": "^1.3.3",
"cordova-sms-plugin": "1.0.0", "cordova-sms-plugin": "1.0.0",
"cordova-sqlite-storage": "^3.2.0", "cordova-sqlite-storage": "^3.2.0",
"cordova-support-google-services": "^1.1.0",
"cordova.plugins.diagnostic": "^4.0.12", "cordova.plugins.diagnostic": "^4.0.12",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"date-fns": "^1.30.1", "date-fns": "^1.30.1",
"mx.ferreyra.callnumber": "0.0.2", "mx.ferreyra.callnumber": "0.0.2",
"phonegap-plugin-barcodescanner": "^8.0.1",
"phonegap-plugin-multidex": "^1.0.0", "phonegap-plugin-multidex": "^1.0.0",
"phonegap-plugin-push": "2.2.3",
"primeicons": "^1.0.0", "primeicons": "^1.0.0",
"primeng": "^7.1.2", "primeng": "^7.1.2",
"run": "1.4.0", "run": "1.4.0",
@ -136,18 +127,6 @@
"cordova-plugin-ionic-webview": { "cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
}, },
"cordova-plugin-mauron85-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "16.0.0",
"ANDROID_SUPPORT_LIBRARY_VERSION": "26+",
"ICON": "@mipmap/icon",
"SMALL_ICON": "@mipmap/icon",
"ACCOUNT_NAME": "@string/app_name",
"ACCOUNT_LABEL": "@string/app_name",
"ACCOUNT_TYPE": "$PACKAGE_NAME.account",
"CONTENT_AUTHORITY": "$PACKAGE_NAME",
"ALWAYS_USAGE_DESCRIPTION": "This app always requires location tracking",
"MOTION_USAGE_DESCRIPTION": "This app requires motion detection"
},
"cordova-sqlite-storage": {}, "cordova-sqlite-storage": {},
"cordova-plugin-nativestorage": {}, "cordova-plugin-nativestorage": {},
"cordova-plugin-ble-central": {}, "cordova-plugin-ble-central": {},
@ -165,28 +144,11 @@
"cordova.plugins.diagnostic": { "cordova.plugins.diagnostic": {
"ANDROID_SUPPORT_VERSION": "28.+" "ANDROID_SUPPORT_VERSION": "28.+"
}, },
"phonegap-plugin-barcodescanner": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-camera": {}, "cordova-plugin-camera": {},
"cordova-plugin-ionic-keyboard": {}, "cordova-plugin-ionic-keyboard": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"cordova-opentok-android-permissions": {}, "cordova-opentok-android-permissions": {},
"cordova-plugin-health": {
"HEALTH_READ_PERMISSION": "App needs read access to read heart rate",
"HEALTH_WRITE_PERMISSION": "App needs write access for heart rate",
"GMS_VERSION": "16.0.1"
},
"cordova-plugin-appavailability": {}, "cordova-plugin-appavailability": {},
"call-number": {}, "call-number": {},
"cordova-support-google-services": {},
"phonegap-plugin-push": {
"GOOGLE_PLAY_SERVICES_VERSION": "16.0.0",
"FCM_VERSION": "15.0.0",
"ANDROID_SUPPORT_V13_VERSION": "27.+"
},
"cordova-plugin-apprate": {}, "cordova-plugin-apprate": {},
"cordova-plugin-inappbrowser": {}, "cordova-plugin-inappbrowser": {},
"cordova-sms-plugin": {} "cordova-sms-plugin": {}

@ -4,32 +4,50 @@
<ion-split-pane> <ion-split-pane>
<ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false" (ionWillOpen)="menuOpened(true)" <ion-menu [side]=" direction === 'rtl' ? 'end' : 'start'" [swipeGesture]="false" (ionWillOpen)="menuOpened(true)"
(ionWillClose)="menuOpened(false)"> (ionWillClose)="menuOpened(false)">
<ion-content class="sidebar-menu"> <ion-content class="sidebar-menu" >
<div class="header-div"> <div class="header-div">
<div class="centerDiv"> <div class="centerDiv">
<p class="TxtPlace">{{"home.hello" | translate}}, {{User_name_Emp}}</p> <p class="TxtPlace">{{ts.trPK('home','hello')}}, {{User_name_Emp}}</p>
<div> <img src="{{user_image}}" class="profileImg" ></div> <div> <img src="{{user_image}}" class="profileImg" ></div>
</div> </div>
</div> </div>
<!-- <ion-list> <ion-list>
<button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" > <ion-item>
<img width="30" src="../assets/imgs/bell.png" item-left > <ion-thumbnail slot="start" class="menu-thumb">
{{"home.worklist" | translate }} <img width="30" src="../assets/imgs/bell.png" item-left >
<ion-badge item-end>{{notBadge}}</ion-badge> </ion-thumbnail>
</button> <ion-label>
<button class="menu-item" ion-item menuClose ion-item (click)="goToProfile()" > {{ts.trPK('home','worklist')}}
<img width="30" src="../assets/imgs/username.png" item-left >
{{"userProfile.title" | translate }} <ion-badge item-end>{{notBadge}}</ion-badge>
</button> </ion-label>
<!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
<button class="menu-item" ion-item menuClose ion-item (click)="logout()" >
</button> -->
</ion-item>
<ion-item>
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/username.png" item-left >
</ion-thumbnail>
<ion-label>
{{ts.trPK('userProfile','title')}}
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/signout.png" item-left > <img width="30" src="../assets/imgs/signout.png" item-left >
{{"home.logout" | translate }} </ion-thumbnail>
</button> <ion-label>
{{ts.trPK('home','logout')}}
</ion-label>
</ion-list> --> </ion-item>
</ion-list>
<div class="menuFooter"> <div class="menuFooter">

@ -173,3 +173,7 @@ button.menu-item.item.item-block.item-ios {
color: var(--customnavy); color: var(--customnavy);
text-align: center; text-align: center;
} }
ion-thumbnail.menu-thumb{
width:30px;
height:30px;
}

@ -27,7 +27,7 @@ export class AppComponent implements OnInit, AfterViewInit {
companyDesc: string = "Powered By Cloud Solutions"; companyDesc: string = "Powered By Cloud Solutions";
public direction = "ltr"; public direction = "ltr";
constructor( constructor(
public translatorService: TranslatorService, public ts: TranslatorService,
private cs: CommonService, private cs: CommonService,
private lazyLoadingService: LazyLoadingService, private lazyLoadingService: LazyLoadingService,
private platform: Platform, private platform: Platform,
@ -43,7 +43,7 @@ export class AppComponent implements OnInit, AfterViewInit {
this.start = false; this.start = false;
this.lazyLoadingService.monitorLazyLoading(15, true); this.lazyLoadingService.monitorLazyLoading(15, true);
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.translatorService.loadResources(() => { this.ts.loadResources(() => {
this.initializeDirection(); this.initializeDirection();
// this.statusBar.styleDefault(); // this.statusBar.styleDefault();
this.start = true; this.start = true;

@ -1,397 +1,400 @@
import { Component, OnInit, ViewChild, ChangeDetectorRef, NgZone, OnDestroy } from '@angular/core'; import {
import { CommonService } from 'src/app/hmg-common/services/common/common.service'; Component,
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; OnInit,
import { Router } from '@angular/router'; ViewChild,
import { AlertController } from '@ionic/angular'; ChangeDetectorRef,
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; NgZone,
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request'; OnDestroy
import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response'; } from "@angular/core";
import { CheckActivationCodeResponse } from 'src/app/hmg-common/services/authentication/models/check-activation-code.response'; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { SmsReaderService } from 'src/app/hmg-common/services/sms/sms-reader.service'; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; import { Router } from "@angular/router";
import { PATIENT_TYPE } from 'src/app/hmg-common/services/models/patient.type'; import { AlertController } from "@ionic/angular";
import { FingerprintAIO } from '@ionic-native/fingerprint-aio/ngx'; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { GetLoginInfoRequest } from 'src/app/hmg-common/services/authentication/models/get-login-info.request'; import { CheckUserAuthenticationRequest } from "src/app/hmg-common/services/authentication/models/check-user-auth.request";
import { GetLoginInfoResponse } from 'src/app/hmg-common/services/authentication/models/get-login-info.response'; import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response";
import { Device } from '@ionic-native/device/ngx'; import { CheckActivationCodeResponse } from "src/app/hmg-common/services/authentication/models/check-activation-code.response";
import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service";
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
import { LoginModel } from '../models/LoginModel'; import { PATIENT_TYPE } from "src/app/hmg-common/services/models/patient.type";
import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request'; import { FingerprintAIO } from "@ionic-native/fingerprint-aio/ngx";
import { GetLoginInfoRequest } from "src/app/hmg-common/services/authentication/models/get-login-info.request";
import { GetLoginInfoResponse } from "src/app/hmg-common/services/authentication/models/get-login-info.response";
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";
@Component({ @Component({
selector: 'login', selector: "login",
templateUrl: './login.component.html', templateUrl: "./login.component.html",
styleUrls: ['./login.component.scss'] styleUrls: ["./login.component.scss"]
}) })
export class LoginComponent implements OnInit, OnDestroy { export class LoginComponent implements OnInit, OnDestroy {
appLang:number=1; appLang: number = 1;
isExpired:boolean =false; isExpired: boolean = false;
isSupportAr:boolean=false; isSupportAr: boolean = false;
isAppleStore:boolean=false; isAppleStore: boolean = false;
memberLogin: any = {}; memberLogin: any = {};
private password: string; private password: string;
private language: string; private language: string;
private username : string; private username: string;
private currentLang : any =1; private currentLang: any = 1;
private patientOutSA: boolean; private patientOutSA: boolean;
private loginTokenID: string; private loginTokenID: string;
private isMobileFingerPrint: boolean; private isMobileFingerPrint: boolean;
private FingerPrintPatientIdentificationID: string; private FingerPrintPatientIdentificationID: string;
private loginData = new LoginModel(); private loginData = new LoginModel();
constructor( constructor(
public cs: CommonService, public cs: CommonService,
public authService: AuthenticationService, public authService: AuthenticationService,
public router: Router, public router: Router,
public alertController: AlertController, public alertController: AlertController,
public ts: TranslatorService, public ts: TranslatorService,
public smsService: SmsReaderService, public smsService: SmsReaderService,
private faio: FingerprintAIO, private faio: FingerprintAIO,
public ngZone: NgZone, public ngZone: NgZone,
public device: Device, public device: Device,
public splash: SplashScreen, public splash: SplashScreen,
public sharedData: SharedDataService public sharedData: SharedDataService
) { ) {}
}
ngOnInit() {}
ngOnInit() {
ngOnDestroy(): void {
this.backClicked();
}
public changeLanguage() {
this.ts.switchLanguage();
if (TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) {
this.language = "US";
} else {
this.language = "AR";
} }
this.currentLang = TranslatorService.getCurrentLanguageCode();
ngOnDestroy(): void { }
this.backClicked(); // private checkIfLoggedInBefore() {
} // this.cs.startLoading();
public changeLanguage(){ // // check if user logged in before
this.ts.switchLanguage(); // this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if(TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) // if (user) {
{ // this.startBiometricLogin(user);
this.language = "US"; // } else {
} // this.hideSplashScreen(true);
else{ // }
this.language = "AR"; // });
} // }
this.currentLang = TranslatorService.getCurrentLanguageCode(); private forgetPasswordPage() {
this.cs.openUserForgot();
} }
// private checkIfLoggedInBefore() { private hideSplashScreen(stopLoading = false) {
// this.cs.startLoading(); // this.splash.hide();
// // check if user logged in before if (stopLoading) {
// this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { this.cs.stopLoading();
// if (user) {
// this.startBiometricLogin(user);
// } else {
// this.hideSplashScreen(true);
// }
// });
// }
private forgetPasswordPage(){
this.cs.openUserForgot();
} }
private hideSplashScreen(stopLoading = false) { }
// this.splash.hide(); // private startBiometricLogin(user: AuthenticatedUser) {
if (stopLoading) { // this.faio.isAvailable().then((options) => {
this.cs.stopLoading(); // this.hideSplashScreen(true);
} // if (user.biometricEnabled) {
} // // ask if login with face or finger
// private startBiometricLogin(user: AuthenticatedUser) { // this.cs.presentConfirmDialog(
// this.faio.isAvailable().then((options) => { // this.ts.trPK('login', options),
// this.hideSplashScreen(true); // () => this.presentBiometricDialog(user),
// if (user.biometricEnabled) { // () => { }
// // ask if login with face or finger // );
// this.cs.presentConfirmDialog( // } else {
// this.ts.trPK('login', options), // // ask to enable biometric
// () => this.presentBiometricDialog(user), // this.getPermissionToActivateBiometric(user);
// () => { } // }
// ); // }, () => {
// } else { // this.hideSplashScreen(true);
// // ask to enable biometric // });
// this.getPermissionToActivateBiometric(user); // }
// }
// }, () => { private getPermissionToActivateBiometric(user: AuthenticatedUser) {
// this.hideSplashScreen(true); this.cs.presentConfirmDialog(
// }); this.ts.trPK("login", "enable-biometric"),
// } () => {
user["biometricEnabled"] = true;
private getPermissionToActivateBiometric(user: AuthenticatedUser) { this.authService
this.cs.presentConfirmDialog( .updateLoggedInUser(user)
this.ts.trPK('login', 'enable-biometric'), .subscribe((success: boolean) => {
() => { this.presentBiometricDialog(user);
user['biometricEnabled'] = true; });
this.authService.updateLoggedInUser(user).subscribe((success: boolean) => { },
this.presentBiometricDialog(user); () => {}
}); );
}, }
() => { } /*
);
}
/*
activate biometric login for this user activate biometric login for this user
*/ */
private getMobileInfo(user: AuthenticatedUser) { private getMobileInfo(user: AuthenticatedUser) {
this.authService.getLoginInfo(new GetLoginInfoRequest(user), () => { this.authService
.getLoginInfo(
}, this.ts.trPK('general', 'ok')).subscribe((result: GetLoginInfoResponse) => { new GetLoginInfoRequest(user),
if (this.cs.validResponse(result)) { () => {},
if (!result.SMSLoginRequired) { this.ts.trPK("general", "ok")
this.loginTokenID = result.LogInTokenID; )
this.patientOutSA = result.PatientOutSA; .subscribe((result: GetLoginInfoResponse) => {
this.initializeForAuthentictedUser(user); if (this.cs.validResponse(result)) {
// sms for register the biometric if (!result.SMSLoginRequired) {
if (result.isSMSSent) { this.loginTokenID = result.LogInTokenID;
this.startListeneingForSMS(this.ts.trPK('general', 'enter-sms-enable-biometric')); this.patientOutSA = result.PatientOutSA;
} else { this.initializeForAuthentictedUser(user);
this.checkActivationCode(); // sms for register the biometric
} if (result.isSMSSent) {
} this.startListeneingForSMS(
this.ts.trPK("general", "enter-sms-enable-biometric")
);
} else {
this.checkActivationCode();
} }
}); }
} }
});
private initializeForAuthentictedUser(user: AuthenticatedUser) { }
this.ngZone.run(() => {
//this.isMobileFingerPrint = true; private initializeForAuthentictedUser(user: AuthenticatedUser) {
//this.FingerPrintPatientIdentificationID = user.IdentificationNo; this.ngZone.run(() => {
//this.mobileNumber = user.MobileNumber; //this.isMobileFingerPrint = true;
//this.zipCode = CountryCode.localCode(user.ZipCode); //this.FingerPrintPatientIdentificationID = user.IdentificationNo;
//this.mobileNumber = user.MobileNumber;
}); //this.zipCode = CountryCode.localCode(user.ZipCode);
} });
}
private presentBiometricDialog(user) {
this.faio.show({ private presentBiometricDialog(user) {
clientId: 'Fingerprint Authetnciation', this.faio
clientSecret: 'Ate343_9347lajF', // Only necessary for Android .show({
disableBackup: true, // Only for Android(optional) clientId: "Fingerprint Authetnciation",
localizedFallbackTitle: this.ts.trPK('login', 'use-pin'), // Only for iOS clientSecret: "Ate343_9347lajF", // Only necessary for Android
localizedReason: this.ts.trPK('login', 'auth-please') // Only for iOS disableBackup: true, // Only for Android(optional)
}).then((result: any) => { localizedFallbackTitle: this.ts.trPK("login", "use-pin"), // Only for iOS
// this.checkActivationCode(); localizedReason: this.ts.trPK("login", "auth-please") // Only for iOS
this.getMobileInfo(user); })
.then((result: any) => {
}).catch((error: any) => console.log(error)); // this.checkActivationCode();
} this.getMobileInfo(user);
})
public onLogin() { .catch((error: any) => console.log(error));
this.checkUserAuthentication(); }
}
public onLogin() {
this.checkUserAuthentication();
}
// public loginWithMyAccount() {
// // this.loginWithTamer();
// public loginWithMyAccount() { // this.loginWithTamer();
// // this.loginWithTamer(); // }
// this.loginWithTamer();
// } /*
/*
TODO to be removed later TODO to be removed later
*/ */
// public loginWithEnas() { // public loginWithEnas() {
// alert('you are doing slient login width enas account '); // alert('you are doing slient login width enas account ');
// const user = new AuthenticatedUser(); // const user = new AuthenticatedUser();
// user.PatientID = 862616; // user.PatientID = 862616;
// user.PatientTypeID = PATIENT_TYPE.PERMANENT; // user.PatientTypeID = PATIENT_TYPE.PERMANENT;
// user.PatientOutSA = false; // user.PatientOutSA = false;
// user.TokenID = '@dm!n'; // user.TokenID = '@dm!n';
// user.ProjectID = 0; // user.ProjectID = 0;
// user.NationalityID = '2300948375'; // user.NationalityID = '2300948375';
// user.MobileNo = user.MobileNumber = '554355126'; // user.MobileNo = user.MobileNumber = '554355126';
// user.ZipCode = '+966'; // user.ZipCode = '+966';
// user.Address = 'riyadh'; // user.Address = 'riyadh';
// user.FirstName = 'MOHAMED'; // user.FirstName = 'MOHAMED';
// user.MiddleName = 'yaghi'; // user.MiddleName = 'yaghi';
// user.LastName = 'mohammed'; // user.LastName = 'mohammed';
// user.Age = 30; // user.Age = 30;
// user.agreed = true; // user.agreed = true;
// const birthDate = new Date(); // const birthDate = new Date();
// birthDate.setFullYear(birthDate.getFullYear() - 29); // birthDate.setFullYear(birthDate.getFullYear() - 29);
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate)); // user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
// user.Email = 'Mohamed.Afifi@cloudsolution-sa.com'; // user.Email = 'Mohamed.Afifi@cloudsolution-sa.com';
// user.PatientName = 'enas yaghi'; // user.PatientName = 'enas yaghi';
// this.authService.updateLoggedInUser(user).subscribe(done => { // this.authService.updateLoggedInUser(user).subscribe(done => {
// this.authService.startIdleMonitoring(); // this.authService.startIdleMonitoring();
// this.cs.openHome(); // this.cs.openHome();
// }); // });
// } // }
// public loginWithVaccineUser() { // public loginWithVaccineUser() {
// alert('you are doing slient login width vaccine account '); // alert('you are doing slient login width vaccine account ');
// const user = new AuthenticatedUser(); // const user = new AuthenticatedUser();
// user.PatientID = 862616; // user with vaccines in dev // user.PatientID = 862616; // user with vaccines in dev
// user.PatientTypeID = PATIENT_TYPE.PERMANENT; // user.PatientTypeID = PATIENT_TYPE.PERMANENT;
// user.PatientOutSA = false; // user.PatientOutSA = false;
// user.TokenID = '@dm!n'; // user.TokenID = '@dm!n';
// user.NationalityID = '2300948375'; // user.NationalityID = '2300948375';
// user.MobileNo = user.MobileNumber = '554355126'; // user.MobileNo = user.MobileNumber = '554355126';
// user.ProjectID = 0; // user.ProjectID = 0;
// user.ZipCode = '+966'; // user.ZipCode = '+966';
// user.Address = 'riyadh'; // user.Address = 'riyadh';
// user.FirstName = 'MOHAMED'; // user.FirstName = 'MOHAMED';
// user.MiddleName = 'yaghi'; // user.MiddleName = 'yaghi';
// user.LastName = 'mohammed'; // user.LastName = 'mohammed';
// user.Age = 30; // user.Age = 30;
// user.agreed = true; // user.agreed = true;
// const birthDate = new Date(); // const birthDate = new Date();
// birthDate.setFullYear(birthDate.getFullYear() - 29); // birthDate.setFullYear(birthDate.getFullYear() - 29);
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate)); // user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
// user.Email = 'minna.barry@cloudsolution-sa.com'; // user.Email = 'minna.barry@cloudsolution-sa.com';
// user.PatientName = 'enas yaghi'; // user.PatientName = 'enas yaghi';
// this.authService.updateLoggedInUser(user).subscribe(done => { // this.authService.updateLoggedInUser(user).subscribe(done => {
// this.authService.startIdleMonitoring(); // this.authService.startIdleMonitoring();
// this.cs.openHome(); // this.cs.openHome();
// }); // });
// } // }
// public loginWithEyeMeasureUser() {
// public loginWithEyeMeasureUser() { // alert('you are doing slient login width eye measurements user account ');
// alert('you are doing slient login width eye measurements user account '); // const user = new AuthenticatedUser();
// const user = new AuthenticatedUser(); // user.PatientID = 873010;
// user.PatientID = 873010;
// user.PatientTypeID = PATIENT_TYPE.PERMANENT;
// user.PatientTypeID = PATIENT_TYPE.PERMANENT; // user.PatientOutSA = false;
// user.PatientOutSA = false; // user.TokenID = '@dm!n';
// user.TokenID = '@dm!n'; // user.NationalityID = '2302581828';
// user.NationalityID = '2302581828'; // user.ProjectID = 0;
// user.ProjectID = 0; // user.MobileNo = user.MobileNumber = '555333541';
// user.MobileNo = user.MobileNumber = '555333541'; // user.ZipCode = '+966';
// user.ZipCode = '+966'; // user.Address = 'riyadh';
// user.Address = 'riyadh'; // user.FirstName = 'eye';
// user.FirstName = 'eye'; // user.MiddleName = 'user';
// user.MiddleName = 'user'; // user.LastName = 'measurment';
// user.LastName = 'measurment'; // user.Age = 30;
// user.Age = 30; // user.agreed = true;
// user.agreed = true; // const birthDate = new Date();
// const birthDate = new Date(); // birthDate.setFullYear(birthDate.getFullYear() - 29);
// birthDate.setFullYear(birthDate.getFullYear() - 29); // user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate)); // user.Email = 'sultan.khan@hmg.local';
// user.Email = 'sultan.khan@hmg.local'; // user.PatientName = 'eye user';
// user.PatientName = 'eye user'; // this.authService.updateLoggedInUser(user).subscribe(done => {
// this.authService.updateLoggedInUser(user).subscribe(done => { // this.authService.startIdleMonitoring();
// this.authService.startIdleMonitoring(); // this.cs.openHome();
// this.cs.openHome(); // });
// }); // }
// }
/*
/*
TODO login with mr rwaid TODO login with mr rwaid
*/ */
// public loginWithRwaid() { // public loginWithRwaid() {
// alert('you are doing slient login width mr: rwaid account'); // alert('you are doing slient login width mr: rwaid account');
// const user = new AuthenticatedUser(); // const user = new AuthenticatedUser();
// // tamer with eye measurments 1231755 // // tamer with eye measurments 1231755
// user.PatientID = 1018977; // user.PatientID = 1018977;
// user.PatientTypeID = PATIENT_TYPE.PERMANENT; // user.PatientTypeID = PATIENT_TYPE.PERMANENT;
// user.ProjectID = 0; // user.ProjectID = 0;
// user.PatientOutSA = false; // user.PatientOutSA = false;
// user.TokenID = '@dm!n'; // user.TokenID = '@dm!n';
// user.NationalityID = '1001242559'; // user.NationalityID = '1001242559';
// user.MobileNo = user.MobileNumber = '545156035'; // user.MobileNo = user.MobileNumber = '545156035';
// user.ZipCode = '+966'; // user.ZipCode = '+966';
// user.Address = 'riyadh'; // user.Address = 'riyadh';
// user.FirstName = 'rwaid'; // user.FirstName = 'rwaid';
// user.MiddleName = 'el mallah'; // user.MiddleName = 'el mallah';
// user.LastName = 'mohammed'; // user.LastName = 'mohammed';
// user.Age = 30; // user.Age = 30;
// user.agreed = true; // user.agreed = true;
// const birthDate = new Date(); // const birthDate = new Date();
// birthDate.setFullYear(birthDate.getFullYear() - 29); // birthDate.setFullYear(birthDate.getFullYear() - 29);
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate)); // user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
// user.Email = 'mohamed.afifi@cloudsolution-sa.com'; // user.Email = 'mohamed.afifi@cloudsolution-sa.com';
// user.PatientName = 'rwaid al mallah'; // user.PatientName = 'rwaid al mallah';
// this.authService.updateLoggedInUser(user).subscribe(done => { // this.authService.updateLoggedInUser(user).subscribe(done => {
// this.authService.startIdleMonitoring(); // this.authService.startIdleMonitoring();
// this.cs.openHome(); // this.cs.openHome();
// }); // });
// } // }
// public loginWithTamer() { // public loginWithTamer() {
// alert('you are doing slient login width tamer account'); // alert('you are doing slient login width tamer account');
// const user = new AuthenticatedUser(); // const user = new AuthenticatedUser();
// user.PatientID = 1231755; // user.PatientID = 1231755;
// user.PatientTypeID = PATIENT_TYPE.PERMANENT; // user.PatientTypeID = PATIENT_TYPE.PERMANENT;
// user.ProjectID = 0; // user.ProjectID = 0;
// user.PatientOutSA = false; // user.PatientOutSA = false;
// user.TokenID = '@dm!n'; // user.TokenID = '@dm!n';
// user.NationalityID = '1001242559'; // user.NationalityID = '1001242559';
// user.MobileNo = user.MobileNumber = '537503378'; // user.MobileNo = user.MobileNumber = '537503378';
// user.ZipCode = '+966'; // user.ZipCode = '+966';
// user.Address = 'riyadh'; // user.Address = 'riyadh';
// user.FirstName = 'tamer'; // user.FirstName = 'tamer';
// user.MiddleName = 'faneshah'; // user.MiddleName = 'faneshah';
// user.LastName = 'faneshah'; // user.LastName = 'faneshah';
// user.Age = 30; // user.Age = 30;
// user.agreed = true; // user.agreed = true;
// const birthDate = new Date(); // const birthDate = new Date();
// birthDate.setFullYear(birthDate.getFullYear() - 29); // birthDate.setFullYear(birthDate.getFullYear() - 29);
// user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate)); // user.DateofBirth = this.cs.convertISODateToJsonDate(this.cs.getDateISO(birthDate));
// user.Email = 'mohamed.afifi@cloudsolution-sa.com'; // user.Email = 'mohamed.afifi@cloudsolution-sa.com';
// user.PatientName = 'tamer fneshah'; // user.PatientName = 'tamer fneshah';
// this.authService.updateLoggedInUser(user).subscribe(done => { // this.authService.updateLoggedInUser(user).subscribe(done => {
// this.authService.startIdleMonitoring(); // this.authService.startIdleMonitoring();
// this.cs.openHome(); // this.cs.openHome();
// });
// }
private startListeneingForSMS(title?: string) {
this.startReceivingSMS();
//this.presentSMSPasswordDialog(title);
}
private checkUserAuthentication() {
const request = new LoginRequest();
request.P_USER_NAME = this.username;
request.P_LANGUAGE = this.language;
request.P_PASSWORD = this.password;
console.log(request);
this.authService
.login(request, () => {}, this.ts.trPK("general", "ok"))
.subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
this.sharedData.setSharedData(this.loginData, "logindata");
this.cs.openSMSPage();
}
});
}
public backClicked() {
this.smsService.stopSMSMonitoring();
}
private startReceivingSMS() {
// this.smsModal.presentModal();
// this.smsService.startSMSMonitoring((code) => {
// this.smsModal.dismiss;
// this.global_code = code;
// SMSService.code = this.global_code;
// this.checkActivationCode(code);
// this.cs.dismissSMSDialog().subscribe(cleared => {
// this.checkActivationCode(code);
// }); // });
// });
// } }
public presentSMSPasswordDialog(title?: string) {
this.cs.presentSMSPasswordDialog(
(code: string) => {
private startListeneingForSMS(title?: string) { this.checkActivationCode(code);
this.startReceivingSMS(); },
//this.presentSMSPasswordDialog(title); null,
} title
);
private checkUserAuthentication() { }
const request = new LoginRequest();
request.P_USER_NAME = this.username; private checkActivationCode(readedCode?) {
request.P_LANGUAGE = this.language; /*const request = new CheckActivationCodeRequest();
request.P_PASSWORD = this.password;
console.log(request);
this.authService.login(
request,
() => {
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) {
this.loginData.LogInTokenID = result.LogInTokenID;
this.sharedData.setSharedData(this.loginData, "logindata");
this.cs.openSMSPage();
}
});
}
public backClicked() {
this.smsService.stopSMSMonitoring();
}
private startReceivingSMS() {
// this.smsModal.presentModal();
// this.smsService.startSMSMonitoring((code) => {
// this.smsModal.dismiss;
// this.global_code = code;
// SMSService.code = this.global_code;
// this.checkActivationCode(code);
// this.cs.dismissSMSDialog().subscribe(cleared => {
// this.checkActivationCode(code);
// });
// });
}
public presentSMSPasswordDialog(title?: string) {
this.cs.presentSMSPasswordDialog(
(code: string) => {
this.checkActivationCode(code);
}, null, title);
}
private checkActivationCode(readedCode?) {
/*const request = new CheckActivationCodeRequest();
request.IsMobileFingerPrint = this.isMobileFingerPrint; request.IsMobileFingerPrint = this.isMobileFingerPrint;
request.FingerPrintPatientIdentificationID = this.FingerPrintPatientIdentificationID; request.FingerPrintPatientIdentificationID = this.FingerPrintPatientIdentificationID;
request.LogInTokenID = this.loginTokenID; request.LogInTokenID = this.loginTokenID;
@ -401,73 +404,62 @@ export class LoginComponent implements OnInit, OnDestroy {
request.PatientMobileNumber = this.mobileNumber; request.PatientMobileNumber = this.mobileNumber;
request.ZipCode = this.zipCode; request.ZipCode = this.zipCode;
request.isRegister = false;*/ request.isRegister = false;*/
// request.SearchType = this.loginType;
// request.SearchType = this.loginType; // if (this.loginType === LoginComponent.IDENTIFCIATION_LOGIN_TYPE) {
// if (this.loginType === LoginComponent.IDENTIFCIATION_LOGIN_TYPE) { // request.PatientIdentificationID = this.id;
// request.PatientIdentificationID = this.id; // request.PatientID = 0;
// request.PatientID = 0; // } else {
// } else { // request.PatientID = Number(this.id);
// request.PatientID = Number(this.id); // request.PatientIdentificationID = '';
// request.PatientIdentificationID = ''; // }
// } // this.authService.checkActivationCode(
// this.authService.checkActivationCode( // request,
// request, // () => {
// () => { // //this.presentSMSPasswordDialog();
// //this.presentSMSPasswordDialog(); // this.smsModal.presentModal();
// this.smsModal.presentModal(); // }, this.ts.trPK('general', 'retry')).subscribe((result: CheckActivationCodeResponse) => {
// }, this.ts.trPK('general', 'retry')).subscribe((result: CheckActivationCodeResponse) => { // if (this.cs.validResponse(result)) {
// if (this.cs.validResponse(result)) { // if (this.cs.hasData(result.List)) {
// if (this.cs.hasData(result.List)) { // this.smsService.stopSMSMonitoring();
// this.smsService.stopSMSMonitoring(); // this.checkIfUserAgreedBefore(result);
// this.checkIfUserAgreedBefore(result); // }
// } // }
// } // });
// }); }
} private checkIfUserAgreedBefore(result: CheckActivationCodeResponse) {
this.authService.setAuthenticatedUser(result).subscribe(() => {
// if (this.authService.isAgreedBefore()) {
private checkIfUserAgreedBefore(result: CheckActivationCodeResponse) { // this.cs.openHome();
// } else {
this.authService.setAuthenticatedUser(result).subscribe(() => { // // this.cs.openAgreement();
// if (this.authService.isAgreedBefore()) { // }
// this.cs.openHome(); });
// } else { }
// // this.cs.openAgreement();
// } private checkUserAgreement() {}
});
} public signOut() {
// this.cs.presentConfirmDialog(this.ts.trPK('login', 'sign-out'),
private checkUserAgreement() { // () => {
// this.authService.clearUser().subscribe(success => {
} // this.id = null;
// if (this.countryCode) {
public signOut() { // this.internationlMobile.setMobileNumber(this.countryCode.code, null);
// this.cs.presentConfirmDialog(this.ts.trPK('login', 'sign-out'), // }
// () => { // });
// this.authService.clearUser().subscribe(success => { // });
// this.id = null; }
// if (this.countryCode) {
// this.internationlMobile.setMobileNumber(this.countryCode.code, null); public openForgotID() {
// } this.cs.openUserForgot();
}
// });
// }); public onDismiss() {
// this.global_code = SMSService.code;
//this.checkActivationCode(this.global_code);
} }
public onCancelled() {
public openForgotID() { console.log("Modal pop up cancelled");
this.cs.openUserForgot(); }
}
public onDismiss()
{
// this.global_code = SMSService.code;
//this.checkActivationCode(this.global_code);
}
public onCancelled()
{
console.log("Modal pop up cancelled");
}
} }

@ -1,14 +1,14 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from "@angular/core";
import { ElementRef } from '@angular/core'; import { ElementRef } from "@angular/core";
import { NavController } from '@ionic/angular'; import { NavController } from "@ionic/angular";
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; import { SharedDataService } from "src/app/hmg-common/services/shared-data-service/shared-data.service";
import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request'; import { SMSCheckRequest } from "src/app/hmg-common/services/authentication/models/smscheck.request";
import { LoginModel } from '../models/LoginModel'; import { LoginModel } from "../models/LoginModel";
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response'; import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
import { Password } from '../models/password'; import { Password } from "../models/password";
@Component({ @Component({
selector: "app-sms-page", selector: "app-sms-page",
@ -16,7 +16,7 @@ import { Password } from '../models/password';
styleUrls: ["./sms-page.page.scss"] styleUrls: ["./sms-page.page.scss"]
}) })
export class SmsPagePage implements OnInit { export class SmsPagePage implements OnInit {
public static LOGIN_DATA = 'LOGIN_DATA'; public static LOGIN_DATA = "LOGIN_DATA";
Channel: number = 0; Channel: number = 0;
activationCode: string; activationCode: string;
P_SESSION_ID: number; P_SESSION_ID: number;
@ -46,8 +46,8 @@ export class SmsPagePage implements OnInit {
this.count = 0; this.count = 0;
this.initTimer(); this.initTimer();
this.startTimer(); this.startTimer();
this.isForgetPwd = this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false; this.isForgetPwd =
this.sharedData.getSharedData(Password.IS_FORGET_PSW) || false;
} }
initTimer() { initTimer() {
@ -124,7 +124,7 @@ export class SmsPagePage implements OnInit {
//this.navCtrl.pop(); goBack //this.navCtrl.pop(); goBack
this.common.JustAlertDialog(this.translate.trPK("general", "ok"), msg); this.common.JustAlertDialog(this.translate.trPK("general", "ok"), msg);
} }
}; }
public checkSMS() { public checkSMS() {
const data = this.sharedData.getSharedData("logindata", false); const data = this.sharedData.getSharedData("logindata", false);
@ -132,9 +132,7 @@ export class SmsPagePage implements OnInit {
(request.LogInTokenID = data.LogInTokenID), (request.LogInTokenID = data.LogInTokenID),
(request.activationCode = this.activationCode); (request.activationCode = this.activationCode);
//request.P_USER_NAME=this.userName, request.MobileNumber = data.MobileNumber;
//request.MobileNumber=this.member.MemberLoginList.P_MOBILE_NUMBER
this.authService this.authService
.checkSMS(request, () => {}, this.translate.trPK("general", "ok")) .checkSMS(request, () => {}, this.translate.trPK("general", "ok"))
.subscribe((result: SMSCheckResponse) => { .subscribe((result: SMSCheckResponse) => {
@ -142,36 +140,33 @@ export class SmsPagePage implements OnInit {
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
//this.sharedData.setSharedData(this.loginData, SmsPagePage.LOGIN_DATA); //this.sharedData.setSharedData(this.loginData, SmsPagePage.LOGIN_DATA);
this.authService.setAuthenticatedUser(result).subscribe(() => { this.authService.setAuthenticatedUser(result).subscribe(() => {
this.common.openHome(); this.common.openHome();
}) });
} }
}); });
} }
public checkForgetPwdSMS() public checkForgetPwdSMS() {
{
const data = this.sharedData.getSharedData("logindata", false); const data = this.sharedData.getSharedData("logindata", false);
const request = new SMSCheckRequest(); const request = new SMSCheckRequest();
request.LogInTokenID= data.LogInTokenID, (request.LogInTokenID = data.LogInTokenID),
request.activationCode =this.activationCode; (request.activationCode = this.activationCode);
//request.P_USER_NAME=this.userName, //request.P_USER_NAME=this.userName,
//request.MobileNumber=this.member.MemberLoginList.P_MOBILE_NUMBER //request.MobileNumber=this.member.MemberLoginList.P_MOBILE_NUMBER
console.log(data.LogInTokenID); console.log(data.LogInTokenID);
this.authService.checkForgetSMS( this.authService
request, .checkForgetSMS(request, () => {}, this.translate.trPK("general", "ok"))
() => { .subscribe((result: SMSCheckResponse) => {
}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
console.log(result); console.log(result);
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
console.log(result); console.log(result);
//this.loginData.LogInTokenID = result.LogInTokenID; //this.loginData.LogInTokenID = result.LogInTokenID;
//this.sharedData.setSharedData(this.loginData, "logindata"); //this.sharedData.setSharedData(this.loginData, "logindata");
this.common.openForgotPassword(); this.common.openForgotPassword();
} }
}); });
} }
} }

@ -46,7 +46,7 @@ import { UserLocalNotificationService } from './services/user-local-notification
import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { EmailComponent } from './ui/email/email.component'; import { EmailComponent } from './ui/email/email.component';
import { Badge } from '@ionic-native/badge/ngx'; import { Badge } from '@ionic-native/badge/ngx';
import { Push } from '@ionic-native/push/ngx'; // import { Push } from '@ionic-native/push/ngx';
import { PushService } from './services/push/push.service'; import { PushService } from './services/push/push.service';
import { LifeCycleService } from './services/life-cycle/life-cycle.service'; import { LifeCycleService } from './services/life-cycle/life-cycle.service';
import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service'; import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service';
@ -69,7 +69,6 @@ import { Keyboard } from '@ionic-native/keyboard/ngx';
import { KeyboardService } from './services/keyboard/keyboard.service'; import { KeyboardService } from './services/keyboard/keyboard.service';
import { DevicePermissionsService } from './services/device-permissions/device-permissions.service'; import { DevicePermissionsService } from './services/device-permissions/device-permissions.service';
import { SegmentsComponent } from './ui/segments/segments.component'; import { SegmentsComponent } from './ui/segments/segments.component';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { AccordionComponent } from './ui/accordion/accordion.component'; import { AccordionComponent } from './ui/accordion/accordion.component';
import { AccordionTabComponent } from './ui/accordion/accordion-tab/accordion-tab.component'; import { AccordionTabComponent } from './ui/accordion/accordion-tab/accordion-tab.component';
import { TwoOptionSelectComponent } from './ui/two-option-select/two-option-select.component'; import { TwoOptionSelectComponent } from './ui/two-option-select/two-option-select.component';
@ -218,7 +217,6 @@ import { MenuService } from './services/menu/menuservice.service';
UserLocalNotificationService, UserLocalNotificationService,
LocalNotifications, LocalNotifications,
Badge, Badge,
Push,
LifeCycleService, LifeCycleService,
HmgBrowserService, HmgBrowserService,
GuidService, GuidService,
@ -228,7 +226,6 @@ import { MenuService } from './services/menu/menuservice.service';
KeyboardService, KeyboardService,
Diagnostic, Diagnostic,
DevicePermissionsService, DevicePermissionsService,
BarcodeScanner,
LazyLoadingService, LazyLoadingService,
HMGPreloadingStrategy, HMGPreloadingStrategy,
HMGPreloadingStrategyLoading, HMGPreloadingStrategyLoading,

@ -113,7 +113,7 @@ export class AuthenticationService {
request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.LanguageID = TranslatorService.getCurrentLanguageCode();
//request.IPAdress = '10.10.10.10'; //request.IPAdress = '10.10.10.10';
//request.SessionID = "any thing"; // ??? required for not authorized login funny //request.SessionID = "any thing"; // ??? required for not authorized login funny
request.MobileType = "android"; request.MobileType = "";
//request.isDentalAllowedBackend = false; //request.isDentalAllowedBackend = false;
return request; return request;
} }

@ -1,5 +1,5 @@
import { Injectable, NgZone } from '@angular/core'; import { Injectable, NgZone } from '@angular/core';
import { Push, PushObject, PushOptions } from '@ionic-native/push/ngx'; // import { Push, PushObject, PushOptions } from '@ionic-native/push/ngx';
import { CommonService } from '../common/common.service'; import { CommonService } from '../common/common.service';
import { TranslatorService } from '../translator/translator.service'; import { TranslatorService } from '../translator/translator.service';
import { NotificationModel } from './models/notification.model'; import { NotificationModel } from './models/notification.model';
@ -26,7 +26,7 @@ export class PushService {
public static CHANNEL_ID = '815750722565'; public static CHANNEL_ID = '815750722565';
constructor( constructor(
public push: Push, // public push: Push,
public cs: CommonService, public cs: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public sharedService: SharedDataService, public sharedService: SharedDataService,
@ -43,58 +43,58 @@ export class PushService {
this.processStartReceiving(); this.processStartReceiving();
} }
private processStartReceiving() { private processStartReceiving() {
if (this.cs.isCordova()) { // if (this.cs.isCordova()) {
this.stopNotifications(() => { // this.stopNotifications(() => {
this.push.hasPermission() // this.push.hasPermission()
.then((res: any) => { // .then((res: any) => {
if (res.isEnabled) { // if (res.isEnabled) {
this.createChannel(); // this.createChannel();
} else { // } else {
this.cs.presentAlert(this.ts.trPK('push', 'no-permiss')); // this.cs.presentAlert(this.ts.trPK('push', 'no-permiss'));
} // }
}); // });
}); // });
} // }
} }
private createChannel() { private createChannel() {
// Create a channel (Android O and above). You'll need to provide the id, description and importance properties. // Create a channel (Android O and above). You'll need to provide the id, description and importance properties.
this.push.createChannel({ // this.push.createChannel({
id: PushService.CHANNEL_ID, // id: PushService.CHANNEL_ID,
description: 'HMG push notifications', // description: 'HMG push notifications',
importance: 3 // importance: 3
}).then(() => { // }).then(() => {
this.initialize(); // this.initialize();
}); // });
} }
private initialize() { private initialize() {
const options: PushOptions = { // const options: PushOptions = {
android: { // android: {
senderID: PushService.CHANNEL_ID, // senderID: PushService.CHANNEL_ID,
sound: true, // sound: true,
forceShow: true // forceShow: true
}, // },
ios: { // ios: {
alert: true, // alert: true,
badge: true, // badge: true,
sound: true // sound: true
}, // },
windows: {}, // windows: {},
browser: { // browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push' // pushServiceURL: 'http://push.api.phonegap.com/v1/push'
} // }
}; // };
const pushObject: PushObject = this.push.init(options); // const pushObject: PushObject = this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => { // pushObject.on('notification').subscribe((notification: any) => {
this.processNotification(notification); // this.processNotification(notification);
}); // });
pushObject.on('registration').subscribe((data: any) => { // pushObject.on('registration').subscribe((data: any) => {
this.registerInBackend(data); // this.registerInBackend(data);
}); // });
pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error)); // pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
} }
@ -149,11 +149,11 @@ export class PushService {
} }
public stopNotifications(done: any) { public stopNotifications(done: any) {
// Delete a channel (Android O and above) // Delete a channel (Android O and above)
if (this.cs.isCordova()) { // if (this.cs.isCordova()) {
this.push.deleteChannel(PushService.CHANNEL_ID).then(() => { // this.push.deleteChannel(PushService.CHANNEL_ID).then(() => {
done(); // done();
}); // });
} // }
} }
private registerInBackend(data: any) { private registerInBackend(data: any) {

@ -12,14 +12,14 @@
<ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge> <ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge>
</button> </button>
<div class="centerDiv" (click)="openPersonalInfo()"> <div class="centerDiv" (click)="openPersonalInfo()">
<p class="TxtPlace">{{"userData.hello" | translate}}, {{User_name_Emp}}</p> <p class="TxtPlace">{{ts.trPK('home','hello')}}, {{User_name_Emp}}, {{User_name_Emp}}</p>
<div class="profileDiv"><ion-img class="profileImg" src="{{user_image}}"></ion-img></div> <div class="profileDiv"><ion-img class="profileImg" src="{{user_image}}"></ion-img></div>
</div> </div>
</div> </div>
<div> <div>
<div> <div>
<p class="dash-header text-caps">{{"userData.dashboard" | translate}}</p> <p class="dash-header text-caps">{{ts.trPK('home','dashboard')}}, {{User_name_Emp}}</p>
</div> </div>
<div> <div>
<ion-grid class="cus-grid"> <ion-grid class="cus-grid">
@ -33,26 +33,26 @@
<ion-col size="6" class="col-grid"> <ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="attendance()"> <button ion-button block class="serviceItem" (click)="attendance()">
<ion-img class="serviceItemImg" src="../assets/imgs/attend.png"></ion-img> <ion-img class="serviceItemImg" src="../assets/imgs/attend.png"></ion-img>
<p>{{"attendance.attendance" | translate}}</p> <p>{{ts.trPK('attendance','attendance')}}</p>
</button> </button>
</ion-col> </ion-col>
<ion-col size="6" class="col-grid"> <ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="Vacation_Rule()"> <button ion-button block class="serviceItem" (click)="Vacation_Rule()">
<ion-img class="serviceItemImg" src="../assets/imgs/vacationrule.png"></ion-img> <ion-img class="serviceItemImg" src="../assets/imgs/vacationrule.png"></ion-img>
<p>{{"vacationRule.vacationRule" | translate}}</p> <p>{{ts.trPK('vacationRule','vacationRule')}}</p>
</button> </button>
</ion-col> </ion-col>
<ion-col size="6" class="col-grid"> <ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="accrualBalance()"> <button ion-button block class="serviceItem" (click)="accrualBalance()">
<ion-img class="serviceItemImg" src="../assets/imgs/accu.png"></ion-img> <ion-img class="serviceItemImg" src="../assets/imgs/accu.png"></ion-img>
<p>{{"absenceList.accrualBalances" | translate}}</p> <p>{{ts.trPK('absenceList','accrualBalances')}}</p>
</button> </button>
</ion-col> </ion-col>
<ion-col size="6" class="col-grid"> <ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="Change_password()"> <button ion-button block class="serviceItem" (click)="Change_password()">
<ion-img class="serviceItemImg" src="../assets/imgs/changepass.png"></ion-img> <ion-img class="serviceItemImg" src="../assets/imgs/changepass.png"></ion-img>
<p>{{"changePassword.changePassword" | translate}}</p> <p>{{ts.trPK('changePassword','changePassword')}}</p>
</button> </button>
</ion-col> </ion-col>
</ion-row> </ion-row>

@ -63,7 +63,7 @@
font-size: 14px; font-size: 14px;
min-height: 20px; min-height: 20px;
// white-space: normal; // white-space: normal;
display: -webkit-box; text-align: center;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save