fix notification & home

MOHEMM-Q3-DEV-LATEST
mohamed.mekawy 5 years ago
parent 492eb5d912
commit ad56814966

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.cloudsolutions.alhabibmohemm" version="1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.cloudsolutions.alhabibmohemm" version="1.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MOHEMM</name> <name>MOHEMM</name>
<description>an app created by cloud Solutions</description> <description>an app created by cloud Solutions</description>
<author email="eservices.hmg@drsulaimanalhabib.com" href="http://cloudsolution-sa.com">Cloud Solutions</author> <author email="eservices.hmg@drsulaimanalhabib.com" href="http://cloudsolution-sa.com">Cloud Solutions</author>

@ -1,34 +1,34 @@
{ {
"project_info": { "project_info": {
"project_number": "608631731238", "project_number": "679409052782",
"firebase_url": "https://mohemm-cs.firebaseio.com", "firebase_url": "https://mohemm-dce93.firebaseio.com",
"project_id": "mohemm-cs", "project_id": "mohemm-dce93",
"storage_bucket": "mohemm-cs.appspot.com" "storage_bucket": "mohemm-dce93.appspot.com"
}, },
"client": [ "client": [
{ {
"client_info": { "client_info": {
"mobilesdk_app_id": "1:608631731238:android:3a8384007f8700ec", "mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f",
"android_client_info": { "android_client_info": {
"package_name": "com.cloudsolutions.mohemm" "package_name": "hmg.cloudSolutions.mohem"
} }
}, },
"oauth_client": [ "oauth_client": [
{ {
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com", "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
], ],
"api_key": [ "api_key": [
{ {
"current_key": "AIzaSyB5zpz9vC2NOxsU1dPr0TK0dVaMY5D4Mjg" "current_key": "AIzaSyDgWjuSBIKGghWxYg_KGBRIZTi-O_UA8mU"
} }
], ],
"services": { "services": {
"appinvite_service": { "appinvite_service": {
"other_platform_oauth_client": [ "other_platform_oauth_client": [
{ {
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com", "client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com",
"client_type": 3 "client_type": 3
} }
] ]

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain>localhost</domain>
</domain-config>
</network-security-config>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 132 KiB

@ -48,8 +48,8 @@
</ion-item> </ion-item>
</ion-list> </ion-list>
<div class=""> <div class="" style="text-align:center">
<div> <img src="{{companyUrl}}" class="CompanyImg logoImg"></div> <img src="{{companyUrl}}" class="CompanyImg logoImg">
<p class="companyTxt">{{CompanyImageDescription}}</p> <p class="companyTxt">{{CompanyImageDescription}}</p>
</div> </div>
<div class="menuFooter"> <div class="menuFooter">

@ -171,8 +171,6 @@ button.menu-item.item.item-block.item-ios {
.logoImg{ .logoImg{
width: 120px; width: 120px;
position: relative; position: relative;
left: 100px;
top: 120px;
} }
.companyTxt { .companyTxt {

@ -1,49 +1,53 @@
<ion-content padding> <ion-content padding>
<ion-grid class="customGrid"> <ion-grid class="customGrid">
<ion-row> <ion-row>
<ion-col class="colPad"> <ion-col class="colPad">
<img class="centerDiv" src="../assets/imgs/HMG.png" /> <img class="centerDiv" src="../assets/imgs/HMG.png" />
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-col> <ion-col>
<P class="pageTitle text-caps">{{ts.trPK('login','login')}}</P> <P class="pageTitle text-caps">{{ts.trPK('login','login')}}</P>
</ion-col> </ion-col>
</ion-row> </ion-row>
</ion-grid> </ion-grid>
<ion-item> <ion-item>
<img class="item-icon" src="assets/imgs/username.png" item-start /> <img class="item-icon" src="assets/imgs/username.png" item-start />
<ion-label>{{ts.trPK('login','username')}}</ion-label> <ion-label>{{ts.trPK('login','username')}}</ion-label>
<ion-input required type="text" [(ngModel)]="username"> <ion-input required type="text" [(ngModel)]="username">
</ion-input> </ion-input>
</ion-item> </ion-item>
<ion-item> <ion-item>
<img class="item-icon" src="assets/imgs/password.png" item-start /> <img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-label>{{ts.trPK('login','password')}}</ion-label> <ion-label>{{ts.trPK('login','password')}}</ion-label>
<ion-input required type="password" [(ngModel)]="password"> <ion-input required type="password" [(ngModel)]="password">
</ion-input> </ion-input>
</ion-item> </ion-item>
<div class="centerDiv signupDiv" *ngIf="isAppleStore==false"> <ion-item>
<a (click)="signUp()">{{ts.trPK('login','signup')}}</a> <ion-label>{{ts.trPK('login','remeber-me')}}</ion-label>
</div> <ion-checkbox [(ngModel)]="remeberMe" (ionChange)="addValue($event)" ></ion-checkbox>
<div class="gridDiv" aria-disabled="true" > </ion-item>
<!-- <button disabled class="gridBtn" ion-button (click)="changeLanguage()" [ngClass]="{'active':this.currentLang ==1}">English</button>
<div class="centerDiv signupDiv" *ngIf="isAppleStore==false">
<a (click)="signUp()">{{ts.trPK('login','signup')}}</a>
</div>
<div class="gridDiv" aria-disabled="true">
<!-- <button disabled class="gridBtn" ion-button (click)="changeLanguage()" [ngClass]="{'active':this.currentLang ==1}">English</button>
<button disabled class="gridBtn arTxt" ion-button (click)="changeLanguage()" [ngClass]="{'active':this.currentLang ==2}">عربي</button> --> <button disabled class="gridBtn arTxt" ion-button (click)="changeLanguage()" [ngClass]="{'active':this.currentLang ==2}">عربي</button> -->
<button disabled class="gridBtn" ion-button (click)="changeLanguage()" style="background: #dcdcdc !important;color: #ccc6c6 !important;margin: 1px;width: 49%">English</button> <button disabled class="gridBtn" ion-button (click)="changeLanguage()" style="background: #dcdcdc !important;color: #ccc6c6 !important;margin: 1px;width: 49%">English</button>
<button disabled class="gridBtn arTxt" ion-button (click)="changeLanguage()" style="background: #dcdcdc !important;color: #ccc6c6 !important;margin: 1px;width: 49%">عربي</button> <button disabled class="gridBtn arTxt" ion-button (click)="changeLanguage()" style="background: #dcdcdc !important;color: #ccc6c6 !important;margin: 1px;width: 49%">عربي</button>
</div> </div>
</ion-content> </ion-content>
<ion-footer> <ion-footer>
<div class="centerDiv"> <div class="centerDiv">
<ion-button color="customnavy" (click)="onLogin()">{{ts.trPK('login','login')}}</ion-button> <ion-button color="customnavy" (click)="onLogin()">{{ts.trPK('login','login')}}</ion-button>
</div> </div>
<br/> <br />
<div class="centerDiv"> <div class="centerDiv">
<a (click)="forgetPasswordPage()">{{ts.trPK('login','forgot-password')}}</a> <a (click)="forgetPasswordPage()">{{ts.trPK('login','forgot-password')}}</a>
</div> </div>
</ion-footer> </ion-footer>

@ -2,7 +2,7 @@ import { Component, OnInit, NgZone, OnDestroy } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { Router } from "@angular/router"; 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 { 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 { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response";
import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service"; import { 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 { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { Password } from '../models/password'; import { Password } from '../models/password';
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request'; 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({ @Component({
selector: "login", selector: "login",
@ -29,6 +30,9 @@ export class LoginComponent implements OnInit, OnDestroy {
private password: string; private password: string;
private language: string; private language: string;
private username: string; private username: string;
private remeberMe: boolean;
private iosLink: string;
private androidLink: string;
private currentLang: any = 1; private currentLang: any = 1;
private patientOutSA: boolean; private patientOutSA: boolean;
private loginTokenID: string; private loginTokenID: string;
@ -47,10 +51,21 @@ export class LoginComponent implements OnInit, OnDestroy {
public ngZone: NgZone, public ngZone: NgZone,
public device: Device, public device: Device,
public splash: SplashScreen, 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 { ngOnDestroy(): void {
this.backClicked(); 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() { 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() { private checkUserAuthentication() {
@ -104,15 +163,15 @@ export class LoginComponent implements OnInit, OnDestroy {
this.loginData.P_USER_NAME = this.username; this.loginData.P_USER_NAME = this.username;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA); this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo();
this.cs.openSMSPage(); this.cs.openSMSPage();
} else{ } else {
console.log("result.IsPasswordExpired"); console.log("result.IsPasswordExpired");
console.log(result.IsPasswordExpired); console.log(result.IsPasswordExpired);
if(result.IsPasswordExpired) if (result.IsPasswordExpired) {
{ this.presentPasswordExpiredDialog();
this.presentPasswordExpiredDialog(); }
} }
}
}); });
} }

@ -147,6 +147,7 @@ export class SmsPageComponent implements OnInit {
.subscribe((result: SMSCheckResponse) => { .subscribe((result: SMSCheckResponse) => {
console.log(result); console.log(result);
if (this.common.validResponse(result)) { if (this.common.validResponse(result)) {
AuthenticationService.servicePrivilage=result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => { this.authService.setAuthenticatedUser(result).subscribe(() => {
this.common.openHome(); this.common.openHome();
}); });

@ -22,11 +22,13 @@ import { UserLocalNotificationService } from "../user-local-notification/user-lo
import { GetLoginInfoRequest } from "./models/get-login-info.request"; import { GetLoginInfoRequest } from "./models/get-login-info.request";
import { GetLoginInfoResponse } from "./models/get-login-info.response"; import { GetLoginInfoResponse } from "./models/get-login-info.response";
import { analyzeAndValidateNgModules } from "@angular/compiler"; 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 { InternationalMobileComponent } from "../../ui/mobile-number/international-mobile/international-mobile.component";
import { SMSCheckRequest } from "./models/smscheck.request"; import { SMSCheckRequest } from "./models/smscheck.request";
import { SMSCheckResponse } from "./models/smscheck.response"; import { SMSCheckResponse } from "./models/smscheck.response";
import { ForgetPassword } from 'src/app/authentication/models/forget.password'; import { ForgetPassword } from 'src/app/authentication/models/forget.password';
import { CheckAppVersionResponse } from './models/check-app-version.response';
import { PrivilageModel } from './models/privilage-model';
@Injectable({ @Injectable({
providedIn: "root" providedIn: "root"
@ -58,12 +60,14 @@ export class AuthenticationService {
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static user: AuthenticatedUser; public static user: AuthenticatedUser;
public static servicePrivilage : PrivilageModel[];
/*user checking methods */ /*user checking methods */
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation'; public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget'; public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget';
public static changePassword ='Services/ERP.svc/REST/ChangePassword_FromActiveSession'; public static changePassword ='Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired'; 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 LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event'; public static FAMILY_LOGIN_EVENT = 'family-login-event';
@ -78,7 +82,8 @@ export class AuthenticationService {
public ts: TranslatorService, public ts: TranslatorService,
public nativeStorage: NativeStorage, public nativeStorage: NativeStorage,
public localNotifications: UserLocalNotificationService, public localNotifications: UserLocalNotificationService,
private events: Events private events: Events,
private menu: MenuController,
) { } ) { }
public authenticateRequest(request: Request, automaticLogin = true): Request { public authenticateRequest(request: Request, automaticLogin = true): Request {
@ -110,8 +115,8 @@ export class AuthenticationService {
} }
public setPublicFields(request: Request): Request { public setPublicFields(request: Request): Request {
request.VersionID = 1; request.VersionID = 1.1;
request.Channel = 31; request.Channel = 33;
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
@ -179,6 +184,12 @@ export class AuthenticationService {
return request; return request;
} }
public checkApplicationVersion(onError: any): Observable<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
}
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> { public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request); this.setPublicFields(request);
@ -608,10 +619,11 @@ export class AuthenticationService {
} }
private sessionTimeOutDialog() { private sessionTimeOutDialog() {
this.cs.presentConfirmDialog( this.cs.presentAcceptDialog(
this.ts.trPK("general", "idle-relogin"), this.ts.trPK("general", "idle-relogin"),
() => { () => {
// this.cs.openUserLogin(); this.cs.sharedService.clearAll();
this.cs.openLogin();
} }
); );
} }

@ -0,0 +1,7 @@
import { Response } from '../../models/response';
export class CheckAppVersionResponse extends Response {
public IOSLink :string;
public AndroidLink :string;
}

@ -0,0 +1,6 @@
export class PrivilageModel extends Request{
ID: number;
Previlege: boolean;
ServiceName: string;
}

@ -1,8 +1,10 @@
import { Response } from '../../models/response'; import { Response } from '../../models/response';
import { AuthenticatedUser } from './authenticated-user'; import { AuthenticatedUser } from './authenticated-user';
import { PrivilageModel } from './privilage-model';
export class SMSCheckResponse extends Response { export class SMSCheckResponse extends Response {
AuthenticationTokenID: string; AuthenticationTokenID: string;
MemberInformationList:AuthenticatedUser[]; MemberInformationList:AuthenticatedUser[];
Privilege_List:PrivilageModel[];
public TokenID: string; public TokenID: string;
public SessionID: string; public SessionID: string;
public MobileType: string; public MobileType: string;

@ -4,7 +4,8 @@ import {
ToastController, ToastController,
LoadingController, LoadingController,
AlertController, AlertController,
Platform Platform,
MenuController
} from "@ionic/angular"; } from "@ionic/angular";
import { Router } from "@angular/router"; import { Router } from "@angular/router";
import { TranslatorService } from "../translator/translator.service"; import { TranslatorService } from "../translator/translator.service";
@ -95,7 +96,8 @@ export class CommonService {
public lifeCycle: LifeCycleService, public lifeCycle: LifeCycleService,
public diagnostic: Diagnostic, public diagnostic: Diagnostic,
public callNumber: CallNumber, public callNumber: CallNumber,
public iab: InAppBrowser public iab: InAppBrowser,
private menu: MenuController,
) {} ) {}
public back() { public back() {
@ -237,14 +239,15 @@ export class CommonService {
) { ) {
this.alertDialog( this.alertDialog(
onClick, onClick,
okLabel, this.ts.trPK("general", "ok"),
this.ts.trPK("general", "alert"), this.ts.trPK("general", "alert"),
message message
); );
} }
public userNeedToReLogin() { public userNeedToReLogin() {
this.presentConfirmDialog(this.ts.trPK("general", "relogin"), () => { this.presentAcceptDialog(this.ts.trPK("general", "relogin"), () => {
this.sharedService.clearAll();
this.openLogin(); this.openLogin();
}); });
} }
@ -254,7 +257,7 @@ export class CommonService {
onClick, onClick,
okLabel, okLabel,
this.ts.trPK("general", "alert"), this.ts.trPK("general", "alert"),
this.ts.trPK("error", "conn") this.ts.trPK("general", "connError")
); );
} }

@ -19,8 +19,8 @@ export class ConnectorService {
public static timeOut = 30 * 1000; public static timeOut = 30 * 1000;
// public static host = 'http://10.50.100.113:6060/'; // development service // public static host = 'http://10.50.100.113:6060/'; // development service
public static host = 'https://uat.hmgwebservices.com/'; //public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/'; public static host = 'https://hmgwebservices.com/';
// public static host = 'http://10.50.100.198:6060/'; // 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.113:6060/'; // development service
/* public static host = 'http://10.50.100.198:6060/'; /* public static host = 'http://10.50.100.198:6060/';
@ -122,7 +122,14 @@ export class ConnectorService {
// not authorized // not authorized
console.log(result.MessageStatus); console.log(result.MessageStatus);
console.log("erroe") 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"); //console.log("error expired");
} else { } else {
this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage); this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage);

@ -36,14 +36,14 @@
<p>{{ts.trPK('attendance','attendance')}}</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" id="vacationRule" (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>{{ts.trPK('vacation-rule','vacationRule')}}</p> <p>{{ts.trPK('vacation-rule','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" id="accrualBalance" (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>{{ts.trPK('absenceList','accrualBalances')}}</p> <p>{{ts.trPK('absenceList','accrualBalances')}}</p>
</button> </button>

@ -49,6 +49,7 @@ export class HomePage implements OnInit {
ngOnInit() { ngOnInit() {
this.getUserDetails(); this.getUserDetails();
this.getMenu(); this.getMenu();
this.setServicesPrivilage();
this.geolocation this.geolocation
.getCurrentPosition() .getCurrentPosition()
.then(resp => { .then(resp => {
@ -65,6 +66,13 @@ export class HomePage implements OnInit {
}); });
this.getCount(); this.getCount();
} }
setServicesPrivilage(){
for(let i=0;i<AuthenticationService.servicePrivilage.length;i++)
if(AuthenticationService.servicePrivilage[i].Previlege==false){
document.getElementById(AuthenticationService.servicePrivilage[i].ServiceName).setAttribute("disabled","disabled");
}
}
getCount() { getCount() {
const req: any = {}; const req: any = {};
this.menuService.getNotificationCount(req).subscribe((result: any) => { this.menuService.getNotificationCount(req).subscribe((result: any) => {

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('home','worklist')}}</ion-title> <ion-title color="light"> {{ts.trPK('home','worklist')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons></nav-buttons> <nav-buttons backLink="/home"></nav-buttons>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>

@ -15,6 +15,7 @@ import { IonInfiniteScroll } from '@ionic/angular';
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
// @ViewChild(Navbar) navBar: Navbar; // @ViewChild(Navbar) navBar: Navbar;
public static NOTIFICATION_DATA='notification_data'; public static NOTIFICATION_DATA='notification_data';
public static NOTIFICATION_ARR='notification_arr';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
private WorkListObj: WorkListRequest; private WorkListObj: WorkListRequest;
WorkListResObj: any; //WorKListResponse; WorkListResObj: any; //WorKListResponse;
@ -134,6 +135,7 @@ export class HomeComponent implements OnInit {
if (this.common.hasData(result.GetWorkList)) { if (this.common.hasData(result.GetWorkList)) {
this.WorkListObj.P_PAGE_NUM++; this.WorkListObj.P_PAGE_NUM++;
this.WorkListResObj = result.GetWorkList; this.WorkListResObj = result.GetWorkList;
this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR);
let lastItemIndex = this.WorkListResObj.length - 1; let lastItemIndex = this.WorkListResObj.length - 1;
if (result.GetWorkList[lastItemIndex]) { if (result.GetWorkList[lastItemIndex]) {
let lastitem = result.GetWorkList[lastItemIndex]; let lastitem = result.GetWorkList[lastItemIndex];

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar"> <ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title> <ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start"> <ion-buttons slot="start">
<nav-buttons></nav-buttons> <nav-buttons backLink="/notification/homepage"></nav-buttons>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
@ -109,7 +109,12 @@
</ion-card> </ion-card>
<div> <div>
<!-- ATTRIBUTE_DISPLAY_NAME: "Note"
ATTRIBUTE_FORMAT: "4000"
ATTRIBUTE_NAME: "WF_NOTE"
ATTRIBUTE_TYPE: "VARCHAR2" -->
<div id="notificationDynamicFields">
</div>
<!-- <json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject"> <!-- <json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject">
</json-schema-form> --> </json-schema-form> -->
</div> </div>
@ -125,4 +130,7 @@
<div class="centerDiv" > <div class="centerDiv" >
<ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</ion-button> <ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</ion-button>
</div> </div>
<div class="centerDiv" >
<ion-button color="customnavy" class="gridBtn" (click)="nextNotfification()">next</ion-button>
</div>
</ion-footer> </ion-footer>

@ -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 { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { WorklistMainService } from "../service/work-list.main.service"; import { WorklistMainService } from "../service/work-list.main.service";
import { HomeComponent } from "src/app/notification/home/home.component"; 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({ @Component({
selector: "app-worklist-main", selector: "app-worklist-main",
templateUrl: "./worklist-main.component.html", templateUrl: "./worklist-main.component.html",
@ -43,18 +45,32 @@ export class WorklistMainComponent implements OnInit {
P_RESPOND_ATTRIBUTES_TBL: any; P_RESPOND_ATTRIBUTES_TBL: any;
selEmployeeID: any; selEmployeeID: any;
actionType: string = ""; actionType: string = "";
notificationArray: any;
notificationDynamicAttributeArr:any;
private textInput: TextInput;
private textArea: TextAreaInput;
constructor( constructor(
public common: CommonService, public common: CommonService,
public ts: TranslatorService, public ts: TranslatorService,
public worklistMainService: WorklistMainService, public worklistMainService: WorklistMainService,
public elementRef: ElementRef, public elementRef: ElementRef,
) {} ) { }
ngOnInit() { ngOnInit() {
this.intializeNotificationDetail();
}
intializeNotificationDetail() {
document.getElementById("notificationDynamicFields").innerHTML="";
this.getPassNotificationDetails = this.common.sharedService.getSharedData( this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA, HomeComponent.NOTIFICATION_DATA,
false false
); );
console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR,
false
);
this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListBodyObj = new WorkListBodyRequest();
this.WorkListButtonsObj = new WorkListButtonRequest(); this.WorkListButtonsObj = new WorkListButtonRequest();
@ -145,26 +161,54 @@ export class WorklistMainComponent implements OnInit {
if (result.MessageStatus == 1) { if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage"); // this.navCtrl.push("HomePage");
//this.common.openHome(); //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 } // 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() { actionButton() {
console.log("test>>>>>>>>>>>>>>");
let ButtonAction: string = this.actionType; let ButtonAction: string = this.actionType;
var responseAttrDic = this.notExampleJsonObject; var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = []; this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let key in responseAttrDic) { for (let i=0;i<this.notificationDynamicAttributeArr.length;i++) {
let obj: any = {}; let obj: any = {};
obj.ATTRIBUTE_NAME = key; obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME;
if (typeof responseAttrDic[key] === "number") { if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = responseAttrDic[key]; obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
} }
// else if (isDate(responseAttrDic[key])) { // else if (isDate(responseAttrDic[key])) {
// obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key]; // obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
// } // }
else { else if(this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE=="VARCHAR2") {
obj.ATTRIBUTE_TEXT_VALUE = responseAttrDic[key]; obj.ATTRIBUTE_TEXT_VALUE =(document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
} }
this.P_RESPOND_ATTRIBUTES_TBL.push(obj); this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
} }
@ -207,7 +251,7 @@ export class WorklistMainComponent implements OnInit {
); );
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(
this.P_RESPOND_ATTRIBUTES_TBL, this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR WorklistMainComponent.PASS_RES_ATTR
); );
this.common.openWorklistRFCPage(); this.common.openWorklistRFCPage();
} else if (ButtonAction == "ANSWER_INFO") { } else if (ButtonAction == "ANSWER_INFO") {
@ -297,7 +341,7 @@ export class WorklistMainComponent implements OnInit {
} }
}); });
this.common.presentAlert( this.common.presentAlert(
this.ts.trPK("worklistMain","actionRequird") this.ts.trPK("worklistMain", "actionRequird")
); );
} }
} }
@ -345,11 +389,27 @@ export class WorklistMainComponent implements OnInit {
this.Resp2_val = result.NotificationRespondRolesList[0].ATTRIBUTE_NAME; this.Resp2_val = result.NotificationRespondRolesList[0].ATTRIBUTE_NAME;
this.hideForwordEmployee = result.NotificationRespondRolesList[0]; this.hideForwordEmployee = result.NotificationRespondRolesList[0];
} }
this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList;
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it } // valid it
} // End handleWorkListButtonsResult } // End handleWorkListButtonsResult
notificationDynamicFields(notificationAttr){
const containerId = 'notificationDynamicFields';
for(let i=0;i<notificationAttr.length;i++){
if(notificationAttr[i].ATTRIBUTE_TYPE=="VARCHAR2"){
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId,"","","");
}else if(notificationAttr[i].ATTRIBUTE_TYPE=="ROLE"){
}else if(notificationAttr[i].ATTRIBUTE_TYPE=="DATE"){
}else if(notificationAttr[i].ATTRIBUTE_TYPE=="NUMBER"){
}
}
}
openNotificationBody() { openNotificationBody() {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
this.common.sharedService.setSharedData( this.common.sharedService.setSharedData(

@ -71,7 +71,8 @@
</ion-item> </ion-item>
</ion-radio-group> </ion-radio-group>
</ion-list> </ion-list>
<div id="CVDynamicFields">
</div>
<!-- <json-schema-form *ngIf="schemaNotific && notifTypeSel =='RESPOND'" [form]="schemaNotific" <!-- <json-schema-form *ngIf="schemaNotific && notifTypeSel =='RESPOND'" [form]="schemaNotific"
[(ngModel)]="exampleJsonObject"> [(ngModel)]="exampleJsonObject">
</json-schema-form> --> </json-schema-form> -->

@ -13,6 +13,10 @@ import { NavController, ModalController } from '@ionic/angular';
import { notificationTypeResponse } from '../model/notification.Respond'; import { notificationTypeResponse } from '../model/notification.Respond';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { ReplacementListComponent } from '../replacement-list/replacement-list.component'; 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({ @Component({
selector: 'app-create-vacation-rule', selector: 'app-create-vacation-rule',
@ -50,6 +54,10 @@ export class CreateVacationRuleComponent implements OnInit {
SelAction: string = ""; SelAction: string = "";
hideForwordEmployee: any; hideForwordEmployee: any;
exampleJsonObject: 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, constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService,
private elementRef: ElementRef, public navCtrl: NavController, public router: Router, public modalController: ModalController, 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]; this.hideForwordEmployee = result.RespondRolesList[0];
} }
if (result.P_Schema) if (result.RespondAttributesList){
this.schemaNotific = JSON.parse(result.P_Schema); //this.schemaNotific = JSON.parse(result.P_Schema);
this.createVacationDynamicFields(result.RespondAttributesList);
}
this.reverseAction(); this.reverseAction();
if (this.isUpdate) { if (this.isUpdate) {
this.fillResposeAtrributes(result.RespondAttributesList); this.fillResposeAtrributes(result.RespondAttributesList);
@ -447,6 +457,21 @@ export class CreateVacationRuleComponent implements OnInit {
} }
} }
createVacationDynamicFields(RespondAttributesList){
const containerId = 'CVDynamicFields';
for(let i=0;i<RespondAttributesList.length;i++){
if(RespondAttributesList[i].ATTRIBUTE_TYPE=="VARCHAR2"){
this.textInput = new TextInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","","");
}else if(RespondAttributesList[i].ATTRIBUTE_TYPE=="LOOKUP"){
this.selectInput = new SelectInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","");
}else if(RespondAttributesList[i].ATTRIBUTE_TYPE=="DATE"){
this.dateInput = new DateInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","");
}else if(RespondAttributesList[i].ATTRIBUTE_TYPE=="NUMBER"){
this.numberInput = new NumberInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","");
}
}
}
fillResposeAtrributes(respList) { fillResposeAtrributes(respList) {
let body = { let body = {
P_RULE_ID: this.updateData.RULE_ID, P_RULE_ID: this.updateData.RULE_ID,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 66 KiB

@ -13,6 +13,10 @@
"en": "User Name", "en": "User Name",
"ar": "اسم المستخدم" "ar": "اسم المستخدم"
}, },
"remeber-me": {
"en": "Remember Me",
"ar": "تذكرنى"
},
"login-type": { "login-type": {
"en": "Login Type", "en": "Login Type",
"ar": "نوع الدخول" "ar": "نوع الدخول"
@ -709,10 +713,6 @@
"en":"Delete", "en":"Delete",
"ar":"حذف" "ar":"حذف"
}, },
"ok": {
"en":"Ok",
"ar":"موافق"
},
"cancel":{ "cancel":{
"en": "Cancel", "en": "Cancel",
"ar": "إلغاء" "ar": "إلغاء"

@ -0,0 +1,40 @@
{
"project_info": {
"project_number": "608631731238",
"firebase_url": "https://mohemm-cs.firebaseio.com",
"project_id": "mohemm-cs",
"storage_bucket": "mohemm-cs.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:608631731238:android:3a8384007f8700ec",
"android_client_info": {
"package_name": "com.cloudsolutions.mohemm"
}
},
"oauth_client": [
{
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB5zpz9vC2NOxsU1dPr0TK0dVaMY5D4Mjg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

@ -0,0 +1,6 @@
CS :
android:hmg.cloudSolutions.mohem
IOS :com.cloudsolutions.mohemm
HMG :
com.cloudsolutions.alhabibmohemm
Loading…
Cancel
Save