diff --git a/Mohem/config.xml b/Mohem/config.xml index 14299fa7..8835a84b 100644 --- a/Mohem/config.xml +++ b/Mohem/config.xml @@ -1,5 +1,5 @@ - + MOHEMM an app created by cloud Solutions Cloud Solutions diff --git a/Mohem/google-services.json b/Mohem/google-services.json index 9fdb04b8..62fbaeae 100644 --- a/Mohem/google-services.json +++ b/Mohem/google-services.json @@ -1,34 +1,34 @@ { "project_info": { - "project_number": "608631731238", - "firebase_url": "https://mohemm-cs.firebaseio.com", - "project_id": "mohemm-cs", - "storage_bucket": "mohemm-cs.appspot.com" + "project_number": "679409052782", + "firebase_url": "https://mohemm-dce93.firebaseio.com", + "project_id": "mohemm-dce93", + "storage_bucket": "mohemm-dce93.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:608631731238:android:3a8384007f8700ec", + "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f", "android_client_info": { - "package_name": "com.cloudsolutions.mohemm" + "package_name": "hmg.cloudSolutions.mohem" } }, "oauth_client": [ { - "client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com", + "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyB5zpz9vC2NOxsU1dPr0TK0dVaMY5D4Mjg" + "current_key": "AIzaSyDgWjuSBIKGghWxYg_KGBRIZTi-O_UA8mU" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com", + "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com", "client_type": 3 } ] diff --git a/Mohem/key.jks b/Mohem/key.jks new file mode 100644 index 00000000..f63c61a7 Binary files /dev/null and b/Mohem/key.jks differ diff --git a/Mohem/resources/android - Copy/icon/drawable-hdpi-icon.png b/Mohem/resources/android - Copy/icon/drawable-hdpi-icon.png new file mode 100644 index 00000000..0d4559b9 Binary files /dev/null and b/Mohem/resources/android - Copy/icon/drawable-hdpi-icon.png differ diff --git a/Mohem/resources/android - Copy/icon/drawable-ldpi-icon.png b/Mohem/resources/android - Copy/icon/drawable-ldpi-icon.png new file mode 100644 index 00000000..e05b379e Binary files /dev/null and b/Mohem/resources/android - Copy/icon/drawable-ldpi-icon.png differ diff --git a/Mohem/resources/android - Copy/icon/drawable-mdpi-icon.png b/Mohem/resources/android - Copy/icon/drawable-mdpi-icon.png new file mode 100644 index 00000000..12217ffd Binary files /dev/null and b/Mohem/resources/android - Copy/icon/drawable-mdpi-icon.png differ diff --git a/Mohem/resources/android - Copy/icon/drawable-xhdpi-icon.png b/Mohem/resources/android - Copy/icon/drawable-xhdpi-icon.png new file mode 100644 index 00000000..b99acf02 Binary files /dev/null and b/Mohem/resources/android - Copy/icon/drawable-xhdpi-icon.png differ diff --git a/Mohem/resources/android - Copy/icon/drawable-xxhdpi-icon.png b/Mohem/resources/android - Copy/icon/drawable-xxhdpi-icon.png new file mode 100644 index 00000000..e408218b Binary files /dev/null and b/Mohem/resources/android - Copy/icon/drawable-xxhdpi-icon.png differ diff --git a/Mohem/resources/android - Copy/icon/drawable-xxxhdpi-icon.png b/Mohem/resources/android - Copy/icon/drawable-xxxhdpi-icon.png new file mode 100644 index 00000000..d3e40c78 Binary files /dev/null and b/Mohem/resources/android - Copy/icon/drawable-xxxhdpi-icon.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-land-hdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-land-hdpi-screen.png new file mode 100644 index 00000000..7d78415f Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-land-hdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-land-ldpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-land-ldpi-screen.png new file mode 100644 index 00000000..a2bc0538 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-land-ldpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-land-mdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-land-mdpi-screen.png new file mode 100644 index 00000000..9f218abd Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-land-mdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-land-xhdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-land-xhdpi-screen.png new file mode 100644 index 00000000..d200d129 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-land-xhdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-land-xxhdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-land-xxhdpi-screen.png new file mode 100644 index 00000000..b81de763 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-land-xxhdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-land-xxxhdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-land-xxxhdpi-screen.png new file mode 100644 index 00000000..bfc93bf6 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-land-xxxhdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-port-hdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-port-hdpi-screen.png new file mode 100644 index 00000000..9c844ff4 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-port-hdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-port-ldpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-port-ldpi-screen.png new file mode 100644 index 00000000..7b7e9d47 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-port-ldpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-port-mdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-port-mdpi-screen.png new file mode 100644 index 00000000..5114be78 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-port-mdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-port-xhdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-port-xhdpi-screen.png new file mode 100644 index 00000000..5c43ccdc Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-port-xhdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-port-xxhdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-port-xxhdpi-screen.png new file mode 100644 index 00000000..e12a1ca8 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-port-xxhdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/splash/drawable-port-xxxhdpi-screen.png b/Mohem/resources/android - Copy/splash/drawable-port-xxxhdpi-screen.png new file mode 100644 index 00000000..b8770919 Binary files /dev/null and b/Mohem/resources/android - Copy/splash/drawable-port-xxxhdpi-screen.png differ diff --git a/Mohem/resources/android - Copy/xml/network_security_config.xml b/Mohem/resources/android - Copy/xml/network_security_config.xml new file mode 100644 index 00000000..c15b28f7 --- /dev/null +++ b/Mohem/resources/android - Copy/xml/network_security_config.xml @@ -0,0 +1,6 @@ + + + + localhost + + diff --git a/Mohem/resources/android/icon/drawable-hdpi-icon.png b/Mohem/resources/android/icon/drawable-hdpi-icon.png index 2571b1ce..0d4559b9 100644 Binary files a/Mohem/resources/android/icon/drawable-hdpi-icon.png and b/Mohem/resources/android/icon/drawable-hdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-ldpi-icon.png b/Mohem/resources/android/icon/drawable-ldpi-icon.png index eda8f30a..e05b379e 100644 Binary files a/Mohem/resources/android/icon/drawable-ldpi-icon.png and b/Mohem/resources/android/icon/drawable-ldpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-mdpi-icon.png b/Mohem/resources/android/icon/drawable-mdpi-icon.png index ba66ec9a..12217ffd 100644 Binary files a/Mohem/resources/android/icon/drawable-mdpi-icon.png and b/Mohem/resources/android/icon/drawable-mdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-xhdpi-icon.png b/Mohem/resources/android/icon/drawable-xhdpi-icon.png index ea8d65eb..b99acf02 100644 Binary files a/Mohem/resources/android/icon/drawable-xhdpi-icon.png and b/Mohem/resources/android/icon/drawable-xhdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-xxhdpi-icon.png b/Mohem/resources/android/icon/drawable-xxhdpi-icon.png index 2f1933d4..e408218b 100644 Binary files a/Mohem/resources/android/icon/drawable-xxhdpi-icon.png and b/Mohem/resources/android/icon/drawable-xxhdpi-icon.png differ diff --git a/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png b/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png index 9ec1f30f..d3e40c78 100644 Binary files a/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png and b/Mohem/resources/android/icon/drawable-xxxhdpi-icon.png differ diff --git a/Mohem/resources/android/splash/drawable-land-hdpi-screen.png b/Mohem/resources/android/splash/drawable-land-hdpi-screen.png index fda71cdc..049727c9 100644 Binary files a/Mohem/resources/android/splash/drawable-land-hdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-hdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-ldpi-screen.png b/Mohem/resources/android/splash/drawable-land-ldpi-screen.png index 59a60721..ddf677d7 100644 Binary files a/Mohem/resources/android/splash/drawable-land-ldpi-screen.png and b/Mohem/resources/android/splash/drawable-land-ldpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-mdpi-screen.png b/Mohem/resources/android/splash/drawable-land-mdpi-screen.png index a9e8f341..e5edf975 100644 Binary files a/Mohem/resources/android/splash/drawable-land-mdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-mdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png b/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png index 90783d4d..6f264e22 100644 Binary files a/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-xhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png b/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png index ae81c7bf..6d3fda04 100644 Binary files a/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-xxhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png b/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png index 591f620d..3497cec0 100644 Binary files a/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-land-xxxhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-hdpi-screen.png b/Mohem/resources/android/splash/drawable-port-hdpi-screen.png index 079f4cbb..5f192c2a 100644 Binary files a/Mohem/resources/android/splash/drawable-port-hdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-hdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-ldpi-screen.png b/Mohem/resources/android/splash/drawable-port-ldpi-screen.png index 1739153a..5c239726 100644 Binary files a/Mohem/resources/android/splash/drawable-port-ldpi-screen.png and b/Mohem/resources/android/splash/drawable-port-ldpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-mdpi-screen.png b/Mohem/resources/android/splash/drawable-port-mdpi-screen.png index f2148121..2a6d9a25 100644 Binary files a/Mohem/resources/android/splash/drawable-port-mdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-mdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png b/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png index d48ffbc3..658e946b 100644 Binary files a/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-xhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png b/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png index e40401ba..42492889 100644 Binary files a/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-xxhdpi-screen.png differ diff --git a/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png b/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png index 33f8534d..6722931b 100644 Binary files a/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png and b/Mohem/resources/android/splash/drawable-port-xxxhdpi-screen.png differ diff --git a/Mohem/resources/icon.png b/Mohem/resources/icon.png index f44b5259..06dc8293 100755 Binary files a/Mohem/resources/icon.png and b/Mohem/resources/icon.png differ diff --git a/Mohem/resources/splash.png b/Mohem/resources/splash.png index 121950ff..b3611afe 100755 Binary files a/Mohem/resources/splash.png and b/Mohem/resources/splash.png differ diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index a066984d..2bb8459a 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -48,8 +48,8 @@ -
-
+
+

{{CompanyImageDescription}}

+ + + +
+ {{ts.trPK('login','login')}} +
+
+ +
\ No newline at end of file diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index a6c63227..7284b5d9 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, NgZone, OnDestroy } from "@angular/core"; import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { Router } from "@angular/router"; -import { AlertController } from "@ionic/angular"; +import { AlertController, Platform } from "@ionic/angular"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response"; import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service"; @@ -14,6 +14,7 @@ import { LoginModel } from "../models/LoginModel"; import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request"; import { Password } from '../models/password'; import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request'; +import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response'; @Component({ selector: "login", @@ -29,6 +30,9 @@ export class LoginComponent implements OnInit, OnDestroy { private password: string; private language: string; private username: string; + private remeberMe: boolean; + private iosLink: string; + private androidLink: string; private currentLang: any = 1; private patientOutSA: boolean; private loginTokenID: string; @@ -47,10 +51,21 @@ export class LoginComponent implements OnInit, OnDestroy { public ngZone: NgZone, public device: Device, public splash: SplashScreen, - public sharedData: SharedDataService + public sharedData: SharedDataService, + public plt: Platform ) { } - ngOnInit() { } + ngOnInit() { + + this.username = localStorage.getItem("user"); + this.password = localStorage.getItem("password"); + let remember = localStorage.getItem("remember"); + if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false } + // alert("user>>" + this.username); + // alert("pass>>>" + this.password); + // alert("remember>>>" + this.remeberMe); + + } ngOnDestroy(): void { this.backClicked(); @@ -74,10 +89,54 @@ export class LoginComponent implements OnInit, OnDestroy { } } - + public addValue(e): void { + // console.log(e.currentTarget.checked); + this.remeberMe = e.currentTarget.checked; + this.remeberMyInfo(); + } + public remeberMyInfo() { + if (this.remeberMe) { + if(this.username){localStorage.setItem("user", this.username);} + if(this.password){localStorage.setItem("password", this.password);} + localStorage.setItem("remember", "true"); + } else { + localStorage.setItem("user", ""); + localStorage.setItem("password", ""); + localStorage.setItem("remember", "false"); + } + } public onLogin() { - this.checkUserAuthentication(); + this.checkAppUpdated(); + // this.checkUserAuthentication(); + } + + public checkAppUpdated() { + this.authService.checkApplicationVersion( + () => { + /* Write code for error */ + }).subscribe((result: CheckAppVersionResponse) => { + if (result.MessageStatus == 2 && result.ErrorType == 4) { + this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{ + this.handleAppUpdate(result) + }); + } else if (result.MessageStatus == 1) { + this.checkUserAuthentication(); + } + }); + } + + private handleAppUpdate(result){ + this.iosLink = result.IOSLink; + this.androidLink = result.AndroidLink; + if (this.plt.is('android')) { + if (this.androidLink) + window.open(this.androidLink, '_system'); + } + else if (this.plt.is('ios')) { + if (this.iosLink) + window.open(this.iosLink, '_system'); + } } private checkUserAuthentication() { @@ -104,15 +163,15 @@ export class LoginComponent implements OnInit, OnDestroy { this.loginData.P_USER_NAME = this.username; this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); + this.remeberMyInfo(); this.cs.openSMSPage(); - } else{ - console.log("result.IsPasswordExpired"); - console.log(result.IsPasswordExpired); - if(result.IsPasswordExpired) - { - this.presentPasswordExpiredDialog(); + } else { + console.log("result.IsPasswordExpired"); + console.log(result.IsPasswordExpired); + if (result.IsPasswordExpired) { + this.presentPasswordExpiredDialog(); + } } - } }); } diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts index be747cbd..ec0d79eb 100644 --- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts +++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts @@ -147,6 +147,7 @@ export class SmsPageComponent implements OnInit { .subscribe((result: SMSCheckResponse) => { console.log(result); if (this.common.validResponse(result)) { + AuthenticationService.servicePrivilage=result.Privilege_List; this.authService.setAuthenticatedUser(result).subscribe(() => { this.common.openHome(); }); diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index 422ac828..e5f36181 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -22,11 +22,13 @@ import { UserLocalNotificationService } from "../user-local-notification/user-lo import { GetLoginInfoRequest } from "./models/get-login-info.request"; import { GetLoginInfoResponse } from "./models/get-login-info.response"; import { analyzeAndValidateNgModules } from "@angular/compiler"; -import { Events } from "@ionic/angular"; +import { Events, MenuController } from "@ionic/angular"; import { InternationalMobileComponent } from "../../ui/mobile-number/international-mobile/international-mobile.component"; import { SMSCheckRequest } from "./models/smscheck.request"; import { SMSCheckResponse } from "./models/smscheck.response"; import { ForgetPassword } from 'src/app/authentication/models/forget.password'; +import { CheckAppVersionResponse } from './models/check-app-version.response'; +import { PrivilageModel } from './models/privilage-model'; @Injectable({ providedIn: "root" @@ -58,12 +60,14 @@ export class AuthenticationService { public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; public static user: AuthenticatedUser; + public static servicePrivilage : PrivilageModel[]; /*user checking methods */ public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation'; public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget'; public static changePassword ='Services/ERP.svc/REST/ChangePassword_FromActiveSession'; public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired'; + public static checkAppVersion = 'Services/Utilities.svc/REST/CheckMobileAppVersion'; public static LOGIN_EVENT = 'user-login-event'; public static FAMILY_LOGIN_EVENT = 'family-login-event'; @@ -78,7 +82,8 @@ export class AuthenticationService { public ts: TranslatorService, public nativeStorage: NativeStorage, public localNotifications: UserLocalNotificationService, - private events: Events + private events: Events, + private menu: MenuController, ) { } public authenticateRequest(request: Request, automaticLogin = true): Request { @@ -110,8 +115,8 @@ export class AuthenticationService { } public setPublicFields(request: Request): Request { - request.VersionID = 1; - request.Channel = 31; + request.VersionID = 1.1; + request.Channel = 33; request.LanguageID = TranslatorService.getCurrentLanguageCode(); //request.IPAdress = '10.10.10.10'; //request.SessionID = "any thing"; // ??? required for not authorized login funny @@ -179,6 +184,12 @@ export class AuthenticationService { return request; } + public checkApplicationVersion(onError: any): Observable { + const request = new Request(); + this.setPublicFields(request); + return this.con.post(AuthenticationService.checkAppVersion, request, onError); + + } public login(request: LoginRequest, onError: any, errorLabel: string): Observable { this.setPublicFields(request); @@ -608,10 +619,11 @@ export class AuthenticationService { } private sessionTimeOutDialog() { - this.cs.presentConfirmDialog( + this.cs.presentAcceptDialog( this.ts.trPK("general", "idle-relogin"), () => { - // this.cs.openUserLogin(); + this.cs.sharedService.clearAll(); + this.cs.openLogin(); } ); } diff --git a/Mohem/src/app/hmg-common/services/authentication/models/check-app-version.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/check-app-version.response.ts new file mode 100644 index 00000000..6424c884 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/authentication/models/check-app-version.response.ts @@ -0,0 +1,7 @@ +import { Response } from '../../models/response'; + +export class CheckAppVersionResponse extends Response { + public IOSLink :string; + public AndroidLink :string; + +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/authentication/models/privilage-model.ts b/Mohem/src/app/hmg-common/services/authentication/models/privilage-model.ts new file mode 100644 index 00000000..e5a0c758 --- /dev/null +++ b/Mohem/src/app/hmg-common/services/authentication/models/privilage-model.ts @@ -0,0 +1,6 @@ + +export class PrivilageModel extends Request{ + ID: number; + Previlege: boolean; + ServiceName: string; +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts index 70fc4dba..5532d782 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts @@ -1,8 +1,10 @@ import { Response } from '../../models/response'; import { AuthenticatedUser } from './authenticated-user'; +import { PrivilageModel } from './privilage-model'; export class SMSCheckResponse extends Response { AuthenticationTokenID: string; MemberInformationList:AuthenticatedUser[]; + Privilege_List:PrivilageModel[]; public TokenID: string; public SessionID: string; public MobileType: string; diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 3e846bef..0833d2b2 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -4,7 +4,8 @@ import { ToastController, LoadingController, AlertController, - Platform + Platform, + MenuController } from "@ionic/angular"; import { Router } from "@angular/router"; import { TranslatorService } from "../translator/translator.service"; @@ -95,7 +96,8 @@ export class CommonService { public lifeCycle: LifeCycleService, public diagnostic: Diagnostic, public callNumber: CallNumber, - public iab: InAppBrowser + public iab: InAppBrowser, + private menu: MenuController, ) {} public back() { @@ -237,14 +239,15 @@ export class CommonService { ) { this.alertDialog( onClick, - okLabel, + this.ts.trPK("general", "ok"), this.ts.trPK("general", "alert"), message ); } public userNeedToReLogin() { - this.presentConfirmDialog(this.ts.trPK("general", "relogin"), () => { + this.presentAcceptDialog(this.ts.trPK("general", "relogin"), () => { + this.sharedService.clearAll(); this.openLogin(); }); } @@ -254,7 +257,7 @@ export class CommonService { onClick, okLabel, this.ts.trPK("general", "alert"), - this.ts.trPK("error", "conn") + this.ts.trPK("general", "connError") ); } diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index 71ff42bb..2d49b181 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -19,8 +19,8 @@ export class ConnectorService { public static timeOut = 30 * 1000; // public static host = 'http://10.50.100.113:6060/'; // development service - public static host = 'https://uat.hmgwebservices.com/'; - // public static host = 'https://hmgwebservices.com/'; + //public static host = 'https://uat.hmgwebservices.com/'; + public static host = 'https://hmgwebservices.com/'; // public static host = 'http://10.50.100.198:6060/'; // public static host = 'http://10.50.100.113:6060/'; // development service /* public static host = 'http://10.50.100.198:6060/'; @@ -122,7 +122,14 @@ export class ConnectorService { // not authorized console.log(result.MessageStatus); console.log("erroe") - if (result.ErrorType === 2) { + if(result.IsAuthenticated==false){ + this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{ + this.cs.sharedService.clearAll(); + this.cs.openLogin(); + }); + return false; + } + else if (result.ErrorType === 2||result.ErrorType === 4) { //console.log("error expired"); } else { this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage); diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html index 2ba7c5f0..168060b9 100644 --- a/Mohem/src/app/home/home.page.html +++ b/Mohem/src/app/home/home.page.html @@ -36,14 +36,14 @@

{{ts.trPK('attendance','attendance')}}

- - - diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index c881ff58..242f998d 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -49,6 +49,7 @@ export class HomePage implements OnInit { ngOnInit() { this.getUserDetails(); this.getMenu(); + this.setServicesPrivilage(); this.geolocation .getCurrentPosition() .then(resp => { @@ -65,6 +66,13 @@ export class HomePage implements OnInit { }); this.getCount(); } + + setServicesPrivilage(){ + for(let i=0;i { diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 1bad8976..9ee5f762 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -2,7 +2,7 @@ {{ts.trPK('home','worklist')}} - + diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index aa38f068..6b3b03d6 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -15,6 +15,7 @@ import { IonInfiniteScroll } from '@ionic/angular'; export class HomeComponent implements OnInit { // @ViewChild(Navbar) navBar: Navbar; public static NOTIFICATION_DATA='notification_data'; + public static NOTIFICATION_ARR='notification_arr'; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; private WorkListObj: WorkListRequest; WorkListResObj: any; //WorKListResponse; @@ -134,6 +135,7 @@ export class HomeComponent implements OnInit { if (this.common.hasData(result.GetWorkList)) { this.WorkListObj.P_PAGE_NUM++; this.WorkListResObj = result.GetWorkList; + this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR); let lastItemIndex = this.WorkListResObj.length - 1; if (result.GetWorkList[lastItemIndex]) { let lastitem = result.GetWorkList[lastItemIndex]; diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index 876c5e28..b0d50602 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -2,7 +2,7 @@ {{ts.trPK('worklistMain','title')}} - + @@ -109,7 +109,12 @@
- + +
+
@@ -125,4 +130,7 @@
{{ts.trPK('general','submit')}}
+
+ next +
\ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index a3aa86a6..62a0436d 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -12,6 +12,8 @@ import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-respo import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request"; import { WorklistMainService } from "../service/work-list.main.service"; import { HomeComponent } from "src/app/notification/home/home.component"; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; @Component({ selector: "app-worklist-main", templateUrl: "./worklist-main.component.html", @@ -43,18 +45,32 @@ export class WorklistMainComponent implements OnInit { P_RESPOND_ATTRIBUTES_TBL: any; selEmployeeID: any; actionType: string = ""; + notificationArray: any; + notificationDynamicAttributeArr:any; + private textInput: TextInput; + private textArea: TextAreaInput; constructor( public common: CommonService, public ts: TranslatorService, public worklistMainService: WorklistMainService, public elementRef: ElementRef, - ) {} + ) { } ngOnInit() { + this.intializeNotificationDetail(); + } + + intializeNotificationDetail() { + document.getElementById("notificationDynamicFields").innerHTML=""; this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, false ); + console.log(this.getPassNotificationDetails.ROW_NUM); + this.notificationArray = this.common.sharedService.getSharedData( + HomeComponent.NOTIFICATION_ARR, + false + ); this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListButtonsObj = new WorkListButtonRequest(); @@ -145,26 +161,54 @@ export class WorklistMainComponent implements OnInit { if (result.MessageStatus == 1) { // this.navCtrl.push("HomePage"); //this.common.openHome(); - this.common.openNotificationPage(); + //this.common.openNotificationPage(); + // for( var i = 0; i < this.notificationArray.length; i++){ + // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { + // this.notificationArray.splice(i, 1); + // } + // } + this.nextNotfification(); } } // valid it } + public nextNotfification() { + //let itemExist = false; + let itemNo = this.getPassNotificationDetails.ROW_NUM; + itemNo += 1; + if (itemNo > this.notificationArray.length) { + this.common.openNotificationPage(); + } else { + for (let i = 0; i <= this.notificationArray.length; i++) { + if (this.notificationArray[i].ROW_NUM == itemNo) { + this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA); + // itemExist = true; + this.intializeNotificationDetail(); + break; + } + } + // if(itemExist==false){ + // this.nextNotfification(); + // } + } + } + actionButton() { + console.log("test>>>>>>>>>>>>>>"); let ButtonAction: string = this.actionType; var responseAttrDic = this.notExampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; - for (let key in responseAttrDic) { + for (let i=0;i - +
+
diff --git a/Mohem/src/app/vacation-rule/create-vacation-rule/create-vacation-rule.component.ts b/Mohem/src/app/vacation-rule/create-vacation-rule/create-vacation-rule.component.ts index e315e623..1dc9db38 100644 --- a/Mohem/src/app/vacation-rule/create-vacation-rule/create-vacation-rule.component.ts +++ b/Mohem/src/app/vacation-rule/create-vacation-rule/create-vacation-rule.component.ts @@ -13,6 +13,10 @@ import { NavController, ModalController } from '@ionic/angular'; import { notificationTypeResponse } from '../model/notification.Respond'; import { Router, ActivatedRoute } from '@angular/router'; import { ReplacementListComponent } from '../replacement-list/replacement-list.component'; +import { TextInput } from 'src/app/uI-elements/text.input'; +import { NumberInput } from 'src/app/uI-elements/number.input'; +import { SelectInput } from 'src/app/uI-elements/select.input'; +import { DateInput } from 'src/app/uI-elements/date.input'; @Component({ selector: 'app-create-vacation-rule', @@ -50,6 +54,10 @@ export class CreateVacationRuleComponent implements OnInit { SelAction: string = ""; hideForwordEmployee: any; exampleJsonObject: any; + private numberInput: NumberInput; + private textInput: TextInput; + private selectInput: SelectInput; + private dateInput: DateInput; constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService, private elementRef: ElementRef, public navCtrl: NavController, public router: Router, public modalController: ModalController, @@ -434,8 +442,10 @@ export class CreateVacationRuleComponent implements OnInit { this.hideForwordEmployee = result.RespondRolesList[0]; } - if (result.P_Schema) - this.schemaNotific = JSON.parse(result.P_Schema); + if (result.RespondAttributesList){ + //this.schemaNotific = JSON.parse(result.P_Schema); + this.createVacationDynamicFields(result.RespondAttributesList); + } this.reverseAction(); if (this.isUpdate) { this.fillResposeAtrributes(result.RespondAttributesList); @@ -447,6 +457,21 @@ export class CreateVacationRuleComponent implements OnInit { } } + createVacationDynamicFields(RespondAttributesList){ + const containerId = 'CVDynamicFields'; + for(let i=0;i