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>
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/bell.png" item-left > <img width="30" src="../assets/imgs/bell.png" item-left >
{{"home.worklist" | translate }} </ion-thumbnail>
<ion-label>
{{ts.trPK('home','worklist')}}
<ion-badge item-end>{{notBadge}}</ion-badge> <ion-badge item-end>{{notBadge}}</ion-badge>
</button> </ion-label>
<button class="menu-item" ion-item menuClose ion-item (click)="goToProfile()" > <!-- <button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
</button> -->
</ion-item>
<ion-item>
<ion-thumbnail slot="start" class="menu-thumb">
<img width="30" src="../assets/imgs/username.png" item-left > <img width="30" src="../assets/imgs/username.png" item-left >
{{"userProfile.title" | translate }} </ion-thumbnail>
</button> <ion-label>
{{ts.trPK('userProfile','title')}}
</ion-label>
</ion-item>
<ion-item>
<button class="menu-item" ion-item menuClose ion-item (click)="logout()" > <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,40 +1,46 @@
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;
@ -52,27 +58,21 @@ export class LoginComponent implements OnInit, OnDestroy {
public device: Device, public device: Device,
public splash: SplashScreen, public splash: SplashScreen,
public sharedData: SharedDataService public sharedData: SharedDataService
) { ) {}
}
ngOnInit() { ngOnInit() {}
}
ngOnDestroy(): void { ngOnDestroy(): void {
this.backClicked(); this.backClicked();
} }
public changeLanguage(){ public changeLanguage() {
this.ts.switchLanguage(); this.ts.switchLanguage();
if(TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) if (TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) {
{
this.language = "US"; this.language = "US";
} } else {
else{
this.language = "AR"; this.language = "AR";
} }
this.currentLang = TranslatorService.getCurrentLanguageCode(); this.currentLang = TranslatorService.getCurrentLanguageCode();
} }
// private checkIfLoggedInBefore() { // private checkIfLoggedInBefore() {
// this.cs.startLoading(); // this.cs.startLoading();
@ -85,7 +85,7 @@ export class LoginComponent implements OnInit, OnDestroy {
// } // }
// }); // });
// } // }
private forgetPasswordPage(){ private forgetPasswordPage() {
this.cs.openUserForgot(); this.cs.openUserForgot();
} }
private hideSplashScreen(stopLoading = false) { private hideSplashScreen(stopLoading = false) {
@ -115,23 +115,29 @@ export class LoginComponent implements OnInit, OnDestroy {
private getPermissionToActivateBiometric(user: AuthenticatedUser) { private getPermissionToActivateBiometric(user: AuthenticatedUser) {
this.cs.presentConfirmDialog( this.cs.presentConfirmDialog(
this.ts.trPK('login', 'enable-biometric'), this.ts.trPK("login", "enable-biometric"),
() => { () => {
user['biometricEnabled'] = true; user["biometricEnabled"] = true;
this.authService.updateLoggedInUser(user).subscribe((success: boolean) => { this.authService
.updateLoggedInUser(user)
.subscribe((success: boolean) => {
this.presentBiometricDialog(user); 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),
() => {},
this.ts.trPK("general", "ok")
)
.subscribe((result: GetLoginInfoResponse) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
if (!result.SMSLoginRequired) { if (!result.SMSLoginRequired) {
this.loginTokenID = result.LogInTokenID; this.loginTokenID = result.LogInTokenID;
@ -139,7 +145,9 @@ export class LoginComponent implements OnInit, OnDestroy {
this.initializeForAuthentictedUser(user); this.initializeForAuthentictedUser(user);
// sms for register the biometric // sms for register the biometric
if (result.isSMSSent) { if (result.isSMSSent) {
this.startListeneingForSMS(this.ts.trPK('general', 'enter-sms-enable-biometric')); this.startListeneingForSMS(
this.ts.trPK("general", "enter-sms-enable-biometric")
);
} else { } else {
this.checkActivationCode(); this.checkActivationCode();
} }
@ -154,33 +162,29 @@ export class LoginComponent implements OnInit, OnDestroy {
//this.FingerPrintPatientIdentificationID = user.IdentificationNo; //this.FingerPrintPatientIdentificationID = user.IdentificationNo;
//this.mobileNumber = user.MobileNumber; //this.mobileNumber = user.MobileNumber;
//this.zipCode = CountryCode.localCode(user.ZipCode); //this.zipCode = CountryCode.localCode(user.ZipCode);
}); });
} }
private presentBiometricDialog(user) { private presentBiometricDialog(user) {
this.faio.show({ this.faio
clientId: 'Fingerprint Authetnciation', .show({
clientSecret: 'Ate343_9347lajF', // Only necessary for Android clientId: "Fingerprint Authetnciation",
clientSecret: "Ate343_9347lajF", // Only necessary for Android
disableBackup: true, // Only for Android(optional) disableBackup: true, // Only for Android(optional)
localizedFallbackTitle: this.ts.trPK('login', 'use-pin'), // Only for iOS localizedFallbackTitle: this.ts.trPK("login", "use-pin"), // Only for iOS
localizedReason: this.ts.trPK('login', 'auth-please') // Only for iOS localizedReason: this.ts.trPK("login", "auth-please") // Only for iOS
}).then((result: any) => { })
.then((result: any) => {
// this.checkActivationCode(); // this.checkActivationCode();
this.getMobileInfo(user); this.getMobileInfo(user);
})
}).catch((error: any) => console.log(error)); .catch((error: any) => console.log(error));
} }
public onLogin() { public onLogin() {
this.checkUserAuthentication(); this.checkUserAuthentication();
} }
// public loginWithMyAccount() { // public loginWithMyAccount() {
// // this.loginWithTamer(); // // this.loginWithTamer();
// this.loginWithTamer(); // this.loginWithTamer();
@ -247,7 +251,6 @@ export class LoginComponent implements OnInit, OnDestroy {
// }); // });
// } // }
// 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();
@ -341,8 +344,6 @@ export class LoginComponent implements OnInit, OnDestroy {
// } // }
private startListeneingForSMS(title?: string) { private startListeneingForSMS(title?: string) {
this.startReceivingSMS(); this.startReceivingSMS();
//this.presentSMSPasswordDialog(title); //this.presentSMSPasswordDialog(title);
@ -354,12 +355,12 @@ export class LoginComponent implements OnInit, OnDestroy {
request.P_LANGUAGE = this.language; request.P_LANGUAGE = this.language;
request.P_PASSWORD = this.password; request.P_PASSWORD = this.password;
console.log(request); console.log(request);
this.authService.login( this.authService
request, .login(request, () => {}, this.ts.trPK("general", "ok"))
() => { .subscribe((result: CheckUserAuthenticationResponse) => {
}, this.ts.trPK('general', 'ok')).subscribe((result: CheckUserAuthenticationResponse) => {
if (this.cs.validResponse(result)) { if (this.cs.validResponse(result)) {
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
this.sharedData.setSharedData(this.loginData, "logindata"); this.sharedData.setSharedData(this.loginData, "logindata");
this.cs.openSMSPage(); this.cs.openSMSPage();
} }
@ -371,7 +372,6 @@ export class LoginComponent implements OnInit, OnDestroy {
} }
private startReceivingSMS() { private startReceivingSMS() {
// this.smsModal.presentModal(); // this.smsModal.presentModal();
// this.smsService.startSMSMonitoring((code) => { // this.smsService.startSMSMonitoring((code) => {
// this.smsModal.dismiss; // this.smsModal.dismiss;
@ -387,7 +387,10 @@ export class LoginComponent implements OnInit, OnDestroy {
this.cs.presentSMSPasswordDialog( this.cs.presentSMSPasswordDialog(
(code: string) => { (code: string) => {
this.checkActivationCode(code); this.checkActivationCode(code);
}, null, title); },
null,
title
);
} }
private checkActivationCode(readedCode?) { private checkActivationCode(readedCode?) {
@ -401,7 +404,6 @@ 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;
@ -423,12 +425,9 @@ export class LoginComponent implements OnInit, OnDestroy {
// } // }
// } // }
// }); // });
} }
private checkIfUserAgreedBefore(result: CheckActivationCodeResponse) { private checkIfUserAgreedBefore(result: CheckActivationCodeResponse) {
this.authService.setAuthenticatedUser(result).subscribe(() => { this.authService.setAuthenticatedUser(result).subscribe(() => {
// if (this.authService.isAgreedBefore()) { // if (this.authService.isAgreedBefore()) {
// this.cs.openHome(); // this.cs.openHome();
@ -438,9 +437,7 @@ export class LoginComponent implements OnInit, OnDestroy {
}); });
} }
private checkUserAgreement() { private checkUserAgreement() {}
}
public signOut() { public signOut() {
// this.cs.presentConfirmDialog(this.ts.trPK('login', 'sign-out'), // this.cs.presentConfirmDialog(this.ts.trPK('login', 'sign-out'),
@ -450,24 +447,19 @@ export class LoginComponent implements OnInit, OnDestroy {
// if (this.countryCode) { // if (this.countryCode) {
// this.internationlMobile.setMobileNumber(this.countryCode.code, null); // this.internationlMobile.setMobileNumber(this.countryCode.code, null);
// } // }
// }); // });
// }); // });
} }
public openForgotID() { public openForgotID() {
this.cs.openUserForgot(); this.cs.openUserForgot();
} }
public onDismiss() public onDismiss() {
{
// this.global_code = SMSService.code; // this.global_code = SMSService.code;
//this.checkActivationCode(this.global_code); //this.checkActivationCode(this.global_code);
} }
public onCancelled() public onCancelled() {
{
console.log("Modal pop up cancelled"); 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) => {
@ -143,26 +141,24 @@ export class SmsPagePage implements OnInit {
//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);
@ -173,5 +169,4 @@ export class SmsPagePage implements OnInit {
} }
}); });
} }
} }

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