update home

production
Sultan Khan 7 years ago
parent fe7e62bbe6
commit b967536b26

@ -12,7 +12,7 @@
</div>
</div>
<ion-list>
<!-- <ion-list>
<button class="menu-item" ion-item menuClose ion-item (click)="goToWorkListPage()" >
<img width="30" src="../assets/imgs/bell.png" item-left >
{{"home.worklist" | translate }}
@ -29,7 +29,7 @@
{{"home.logout" | translate }}
</button>
</ion-list>
</ion-list> -->
<div class="menuFooter">

@ -3,110 +3,173 @@ header
*/
.menu-header {
height: 2.5cm;
}
}
.content-ios:not([no-bounce]) > .scroll-content::before {
.content-ios:not([no-bounce])>.scroll-content::before {
bottom: 0;
}
}
.menu-header .logo {
.menu-header .logo {
position: absolute;
left: 0.6cm;
top: 0.9cm;
width: 1.6cm;
}
}
.menu-header .background {
.menu-header .background {
height: 1.5cm;
width: 100%;
}
}
/* title */
.title-v-spacer {
/* title */
.title-v-spacer {
height: 0.7cm;
}
}
.suliman-title {
.suliman-title {
margin-left: 0.3cm;
margin-right: 0.3cm;
font-weight: bold;
font-size: 0.5cm;
}
}
.group-title {
.group-title {
margin-left: 0.4cm;
margin-right: 0.4cm;
font-size: 0.4cm;
}
}
/*
/*
items
*/
.items-buttons-spacer {
.items-buttons-spacer {
height: 10%;
}
/*
}
/*
user information
*/
.user-v-spacer {
.user-v-spacer {
height: 0.5cm;
}
}
.user-name-title {
.user-name-title {
margin-left: 0.3cm;
margin-right: 0.3cm;
font-weight: bold;
}
}
.file-id-title {
.file-id-title {
margin-left: 0.4cm;
margin-right: 0.4cm;
}
}
.social-media-container {
.social-media-container {
position: absolute !important;
width: 100%;
bottom: 0.2cm;
background-color: white;
}
}
.icon-spacer {
.icon-spacer {
margin-right: 0.3cm;
margin-left: 0.3cm;
}
}
/*mobile Landscape */
@media only screen and (min-device-height: 0px) and (max-device-height: 515px) and (orientation: landscape) {
/*mobile Landscape */
@media only screen and (min-device-height: 0px) and (max-device-height: 515px) and (orientation: landscape) {
.social-media-container {
display: none;
}
}
.info-container {
}
.info-container {
overflow-y: scroll;
width: 100%;
position: absolute;
top: 2.6cm;
bottom: 0.2cm;
padding-bottom: 4.5cm;
}
}
@media only screen and (orientation: landscape) {
@media only screen and (orientation: landscape) {
.info-container {
padding-bottom: 0.2cm;
}
}
}
.member {
.member {
border-bottom-color: var(--ion-color-medium) !important;
border-bottom-width: 0.02cm;
border-bottom-style: solid;
/* margin-left: 0.4cm; */
}
}
.selected-member {
.selected-member {
border-bottom-color: var(--ion-color-secondary) !important;
border-bottom-width: 0.02cm;
border-bottom-style: solid;
margin-left: 0.2cm;
}
}
.sidebar-menu .header-div {
background: var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%, var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%, var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%, var(--secondary) 59%, var(--customnavy) 100%);
color: var(--light);
text-transform: capitalize;
height: 120px;
position: relative;
display: block;
margin-bottom: 40px;
}
.list-md .item-block .item-inner,
.list-ios .item-block .item-inner {
border-color: var(--primary);
border-bottom: 0px;
}
.list-md>.item-block:last-child .item-inner,
.list-ios>.item-block:last-child .item-inner {
border-bottom: 0px;
}
button.menu-item.item.item-block.item-md,
button.menu-item.item.item-block.item-ios {
border-bottom: 1px solid var(--cusgray);
color: var(--customnavy);
}
.TxtPlace {
margin: 0;
padding: 40px 0 10px 0;
text-align: center;
}
.menuFooter {
position: fixed;
bottom: 0px;
text-align: center;
margin: auto;
width: 100%;
}
.menuFooter div {
width: 80px;
// height: 80px;
margin: auto;
}
.menuFooter .CompanyImg {
width: 100%;
height: 100%;
}
.companyTxt {
font-size: 12px;
color: var(--customnavy);
text-align: center;
}

@ -20,7 +20,7 @@ export class AppComponent implements OnInit, AfterViewInit {
start: any = false;
menuList: any = [];
User_name_Emp: string = "";
user_image: string = "";
user_image: string = "../assets/imgs/profile.png"
menuSide: string = "left";
notBadge: number;
companyUrl: string = "../assets/imgs/CS.png";

@ -94,7 +94,7 @@ export class ForgotComponent implements OnInit,OnDestroy {
private checkActivationCode(readedCode?) {
const request = new CheckActivationCodeRequest();
request.LogInTokenID = this.checkUserResult.LogInTokenID;
request.PatientOutSA = this.checkUserResult.PatientOutSA ? 1 : 0;
//request.PatientOutSA = this.checkUserResult.PatientOutSA ? 1 : 0;
request.PatientMobileNumber = this.countryCode.number;
request.ZipCode = CountryCode.localCode(this.countryCode.code);
request.activationCode = readedCode;

@ -30,11 +30,10 @@ export class LoginComponent implements OnInit, OnDestroy {
isSupportAr:boolean=false;
isAppleStore:boolean=false;
memberLogin: any = {};
private password: string;
private language: string;
private username : string;
private currentLang : any = 2;
private currentLang : any =1;
private patientOutSA: boolean;
private loginTokenID: string;
private isMobileFingerPrint: boolean;
@ -56,12 +55,6 @@ export class LoginComponent implements OnInit, OnDestroy {
}
ngOnInit() {
console.log(this.currentLang);
//this.setIdPattern();
// setTimeout(() => {
// this.checkIfLoggedInBefore();
// // this.splash.hide();
// }, 100);
}

@ -90,6 +90,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service';
import { PaymentComponent } from './ui/payment/payment.component';
import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
@NgModule({
imports: [
CommonModule,
@ -237,8 +238,8 @@ import { PaymentService } from './ui/payment/service/payment.service';
RatingService,
InAppBrowser,
RateService,
PaymentService
PaymentService,
MenuService
]
})
export class HmgCommonModule { }

@ -1,66 +1,74 @@
import { Injectable } from '@angular/core';
import { Request } from '../models/request';
import { TranslatorService } from '../translator/translator.service';
import { ConnectorService } from '../connector/connector.service';
import { Observable, throwError } from 'rxjs';
import { CheckPatientRegisterationRequest } from './models/check-patient-registeration.request';
import { LoginRequest } from './models/login.request';
import { Response } from '../models/response';
import { AuthenticatedUser } from './models/authenticated-user';
import { CommonService } from '../common/common.service';
import { CheckUserAuthenticationRequest } from './models/check-user-auth.request';
import { CheckActivationCodeRequest } from './models/check-activation-code.request';
import { CheckUserAuthenticationResponse } from './models/check-user-auth.response';
import { CheckActivationCodeResponse } from './models/check-activation-code.response';
import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { CheckRegisterationCodeRequest } from './models/check-registeration-code.request';
import { RegisterInformationRequest } from './models/register-information.request';
import { ForgotFileIDResponse } from './models/forgot-File-ID.response';
import { EmailRequest } from '../models/email-request';
import { EmailInput } from '../../ui/email/models/email-input';
import { UserLocalNotificationService } from '../user-local-notification/user-local-notification.service';
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 { InternationalMobileComponent } from '../../ui/mobile-number/international-mobile/international-mobile.component';
import { SMSCheckRequest } from './models/smscheck.request';
import { SMSCheckResponse } from './models/smscheck.response';
import { Injectable } from "@angular/core";
import { Request } from "../models/request";
import { TranslatorService } from "../translator/translator.service";
import { ConnectorService } from "../connector/connector.service";
import { Observable, throwError } from "rxjs";
import { CheckPatientRegisterationRequest } from "./models/check-patient-registeration.request";
import { LoginRequest } from "./models/login.request";
import { Response } from "../models/response";
import { AuthenticatedUser } from "./models/authenticated-user";
import { CommonService } from "../common/common.service";
import { CheckUserAuthenticationRequest } from "./models/check-user-auth.request";
import { CheckActivationCodeRequest } from "./models/check-activation-code.request";
import { CheckUserAuthenticationResponse } from "./models/check-user-auth.response";
import { CheckActivationCodeResponse } from "./models/check-activation-code.response";
import { NativeStorage } from "@ionic-native/native-storage/ngx";
import { CheckRegisterationCodeRequest } from "./models/check-registeration-code.request";
import { RegisterInformationRequest } from "./models/register-information.request";
import { ForgotFileIDResponse } from "./models/forgot-File-ID.response";
import { EmailRequest } from "../models/email-request";
import { EmailInput } from "../../ui/email/models/email-input";
import { UserLocalNotificationService } from "../user-local-notification/user-local-notification.service";
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 { InternationalMobileComponent } from "../../ui/mobile-number/international-mobile/international-mobile.component";
import { SMSCheckRequest } from "./models/smscheck.request";
import { SMSCheckResponse } from "./models/smscheck.response";
@Injectable({
providedIn: 'root'
providedIn: "root"
})
export class AuthenticationService {
public static MOBILE_USER = 102;
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static loginURL =
"Services/Authentication.svc/REST/CheckPatientAuthentication";
public static checkUserAuthURL =
"Services/Authentication.svc/REST/CheckPatientAuthentication";
public static login = 'Services/ERP.svc/REST/MemberLogin';
public static login = "Services/ERP.svc/REST/MemberLogin";
public static activationCodeURL = 'Services/Authentication.svc/REST/CheckActivationCode';
public static getLoginInfoURL = 'Services/Authentication.svc/REST/GetMobileLoginInfo';
public static activationCodeURL =
"Services/Authentication.svc/REST/CheckActivationCode";
public static getLoginInfoURL =
"Services/Authentication.svc/REST/GetMobileLoginInfo";
public static smsCheck='Services/ERP.svc/REST/CheckActivationCode';
public static smsCheckForget='Services/ERP.svc/REST/CheckPublicActivationCode';
public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode';
public static smsCheck = "Services/ERP.svc/REST/CheckActivationCode";
public static smsCheckForget =
"Services/ERP.svc/REST/CheckPublicActivationCode";
public static smsSendCode = "Services/ERP.svc/REST/SendPublicActivationCode";
/* register methods */
public static checkPatientForRegisterationURL = 'Services/Authentication.svc/REST/CheckPatientForRegisteration';
public static sendSmsForRegisterURL = 'Services/Authentication.svc/REST/SendSMSForPatientRegisteration';
public static registerTempUserURL = 'Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS';
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static checkPatientForRegisterationURL =
"Services/Authentication.svc/REST/CheckPatientForRegisteration";
public static sendSmsForRegisterURL =
"Services/Authentication.svc/REST/SendSMSForPatientRegisteration";
public static registerTempUserURL =
"Services/Authentication.svc/REST/RegisterTempPatientWithoutSMS";
public static sendSMSForgotFileNoURL =
"Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber";
public static forgotFileIDURL =
"Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo";
public static user: AuthenticatedUser;
public static LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event';
public static AUTHENTICATED_USER_KEY = 'save-authenticated-user';
public static LOGIN_EVENT = "user-login-event";
public static FAMILY_LOGIN_EVENT = "family-login-event";
public static AUTHENTICATED_USER_KEY = "save-authenticated-user";
// private static user: AuthenticatedUser;
constructor(
@ -70,18 +78,19 @@ export class AuthenticationService {
public nativeStorage: NativeStorage,
public localNotifications: UserLocalNotificationService,
private events: Events
) { }
) {}
public authenticateRequest(request: Request, automaticLogin = true): Request {
this.setPublicFields(request);
const user = this.getAuthenticatedUser();
if (user) {
/*user with eye prescriptions*/
// request.PatientID = user.PatientID;
// request.TokenID = user.TokenID;
// request.PatientOutSA = user.PatientOutSA ? 1 : 0;
// request.PatientTypeID = user.PatientTypeID;
request.P_SESSION_ID = user.P_SESSION_ID;
request.MobileNumber = user.EMPLOYEE_MOBILE_NUMBER;
request.LogInTokenID = user.LogInTokenID;
request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER;
if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog();
}
@ -103,13 +112,16 @@ export class AuthenticationService {
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
//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.isDentalAllowedBackend = false;
return request;
}
public authenticateAndSetPersonalInformation(request: EmailRequest, examinationInfo?: any): EmailRequest {
public authenticateAndSetPersonalInformation(
request: EmailRequest,
examinationInfo?: any
): EmailRequest {
// if not authenticated will be redirected to login
this.authenticateRequest(request);
const user = this.getAuthenticatedUser();
@ -123,53 +135,67 @@ export class AuthenticationService {
// request.PatientTypeID = user.PatientTypeID;
if (examinationInfo) {
if (examinationInfo.SetupID) { request.SetupID = examinationInfo.SetupID; }
if (examinationInfo.ProjectName) { request.ProjectName = examinationInfo.ProjectName; }
if (examinationInfo.ClinicName) { request.ClinicName = examinationInfo.ClinicDescription; }
if (examinationInfo.DoctorName) { request.DoctorName = examinationInfo.DoctorName; }
if (examinationInfo.ProjectID) { request.ProjectID = examinationInfo.ProjectID; }
if (examinationInfo.InvoiceNo) { request.InvoiceNo = examinationInfo.InvoiceNo; }
if (examinationInfo.SetupID) {
request.SetupID = examinationInfo.SetupID;
}
if (examinationInfo.ProjectName) {
request.ProjectName = examinationInfo.ProjectName;
}
if (examinationInfo.ClinicName) {
request.ClinicName = examinationInfo.ClinicDescription;
}
if (examinationInfo.DoctorName) {
request.DoctorName = examinationInfo.DoctorName;
}
if (examinationInfo.ProjectID) {
request.ProjectID = examinationInfo.ProjectID;
}
if (examinationInfo.InvoiceNo) {
request.InvoiceNo = examinationInfo.InvoiceNo;
}
if (examinationInfo.OrderDate) {
request.OrderDate = this.cs.getDateISO(this.cs.evaluteDateAsObject(examinationInfo.OrderDate));
request.OrderDate = this.cs.getDateISO(
this.cs.evaluteDateAsObject(examinationInfo.OrderDate)
);
}
}
}
return request;
}
public getAuthenticatedRequest(login = true): Request {
const request = new Request();
this.authenticateRequest(request, login);
return request;
}
public getPublicRequest(): Request {
const request = new Request();
this.setPublicFields(request);
return request;
}
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
public login(
request: LoginRequest,
onError: any,
errorLabel: string
): Observable<Response> {
request.PatientID = 0;
request.TokenID = '';
request.TokenID = "";
request.isDentalAllowedBackend = false;
request.isRegister = false;
return this.con.post(AuthenticationService.loginURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.loginURL,
request,
onError,
errorLabel
);
}
public isAuthenticated(): boolean {
return AuthenticationService.user != null;
}
/**
* this fucntion load from user information if he logged in before
* and save user into memory and local storage
@ -180,49 +206,47 @@ export class AuthenticationService {
* 1- user stored in local storage without token
* @param result check activation code result
*/
public setAuthenticatedUser(result: CheckActivationCodeResponse): Observable<boolean> {
public setAuthenticatedUser(
result: CheckActivationCodeResponse
): Observable<boolean> {
return Observable.create(observer => {
this.loadAuthenticatedUser().subscribe((loadedUser: AuthenticatedUser) => {
this.loadAuthenticatedUser().subscribe(
(loadedUser: AuthenticatedUser) => {
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, loadedUser);
/* we store in hd without token but with token in memory*/
this.saveUserInStorage(user).subscribe((success: boolean) => {
AuthenticationService.user = user;
this.publishUserChangeEvent();
observer.next(true);
observer.complete();
});
}
);
});
});
}
public resetAuthenticatedUser(user: AuthenticatedUser ) {
public resetAuthenticatedUser(user: AuthenticatedUser) {
AuthenticationService.user = user;
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
this.publishUserChangeEvent();
}
public setAuthenticatedMemberFamilyUser(result: CheckActivationCodeResponse) {
const authUser = new AuthenticatedUser();
AuthenticationService.requireRelogin = false;
this.startIdleMonitoring();
const user = this.updateAuthenticatedUser(result, authUser);
// user["hello"]= "ok";
/* we store in hd without token but with token in memory*/
AuthenticationService.user = user;
this.publishFamilyMemeberUserChangeEvent();
}
public updateLoggedInUser(newUser: AuthenticatedUser): Observable<boolean> {
return Observable.create(observer => {
/* we store in hd without token but with token in memory*/
@ -233,9 +257,7 @@ export class AuthenticationService {
observer.next(success);
observer.complete();
});
});
}
public setDeviceToken(token: string) {
@ -248,26 +270,49 @@ export class AuthenticationService {
}
}
public registerTempUser(request: RegisterInformationRequest, onError: any, errorLabel: string)
: Observable<CheckActivationCodeResponse> {
public registerTempUser(
request: RegisterInformationRequest,
onError: any,
errorLabel: string
): Observable<CheckActivationCodeResponse> {
this.setPublicFields(request);
request.TokenID = '';
return this.con.post(AuthenticationService.registerTempUserURL, request, onError, errorLabel);
request.TokenID = "";
return this.con.post(
AuthenticationService.registerTempUserURL,
request,
onError,
errorLabel
);
}
public getLoginInfo(request: GetLoginInfoRequest, onError: any, errorLabel: string)
: Observable<GetLoginInfoResponse> {
public getLoginInfo(
request: GetLoginInfoRequest,
onError: any,
errorLabel: string
): Observable<GetLoginInfoResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.getLoginInfoURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.getLoginInfoURL,
request,
onError,
errorLabel
);
}
/**
*update new authenticated user from previously stored and loaded user
*/
private updateAuthenticatedUser(result: CheckActivationCodeResponse, loadedUser: AuthenticatedUser): AuthenticatedUser {
private updateAuthenticatedUser(
result: CheckActivationCodeResponse,
loadedUser: AuthenticatedUser
): AuthenticatedUser {
const user = result.MemberInformationList[0];
user.P_SESSION_ID = result.P_SESSION_ID;
user.MobileNumber = result.EMPLOYEE_MOBILE_NUMBER;
user.TokenID = result.TokenID;
user.LogInTokenID = this.cs.sharedService.getSharedData(
"logindata"
).LogInTokenID;
return user;
}
@ -284,12 +329,12 @@ export class AuthenticationService {
* we store in localstorage without token but we keep it in the static member
*/
private saveUserInStorage(user: AuthenticatedUser): Observable<boolean> {
return Observable.create(observer => {
if (user) {
// const TokenID = user.TokenID;
// user.TokenID = null;
this.nativeStorage.setItem(AuthenticationService.AUTHENTICATED_USER_KEY, user)
this.nativeStorage
.setItem(AuthenticationService.AUTHENTICATED_USER_KEY, user)
.then(
() => {
//user.TokenID = TokenID;
@ -307,9 +352,7 @@ export class AuthenticationService {
observer.next(false);
observer.complete();
}
});
}
/**
@ -320,7 +363,9 @@ export class AuthenticationService {
this.clearUserSession();
return Observable.create(observer => {
this.publishUserChangeEvent();
this.nativeStorage.remove(AuthenticationService.AUTHENTICATED_USER_KEY).then(
this.nativeStorage
.remove(AuthenticationService.AUTHENTICATED_USER_KEY)
.then(
() => {
observer.next(true);
observer.complete();
@ -328,16 +373,25 @@ export class AuthenticationService {
() => {
observer.next(false);
observer.complete();
});
}
);
});
}
private publishUserChangeEvent() {
this.events.publish(AuthenticationService.LOGIN_EVENT, this.getAuthenticatedUser(), Date.now());
this.events.publish(
AuthenticationService.LOGIN_EVENT,
this.getAuthenticatedUser(),
Date.now()
);
}
private publishFamilyMemeberUserChangeEvent() {
this.events.publish(AuthenticationService.FAMILY_LOGIN_EVENT, this.getAuthenticatedUser(), Date.now());
this.events.publish(
AuthenticationService.FAMILY_LOGIN_EVENT,
this.getAuthenticatedUser(),
Date.now()
);
}
public clearUserSession() {
@ -346,10 +400,10 @@ export class AuthenticationService {
public loadAuthenticatedUser(): Observable<AuthenticatedUser> {
return Observable.create(observer => {
this.nativeStorage.getItem(AuthenticationService.AUTHENTICATED_USER_KEY)
this.nativeStorage
.getItem(AuthenticationService.AUTHENTICATED_USER_KEY)
.then(
(user) => {
user => {
observer.next(user);
observer.complete();
},
@ -376,80 +430,125 @@ export class AuthenticationService {
return AuthenticationService.user;
}
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
public checkUserAuthentication(
request: CheckUserAuthenticationRequest,
onError: any,
errorLabel: string
): Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
return this.con.post(
AuthenticationService.login,
request,
onError,
errorLabel
);
}
public checkActivationCode(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<CheckActivationCodeResponse> {
public checkActivationCode(
request: CheckActivationCodeRequest,
onError: any,
errorLabel: string
): Observable<CheckActivationCodeResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.activationCodeURL,
request,
onError,
errorLabel
);
}
public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
: Observable<SMSCheckResponse> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel);
public checkSMS(
request: SMSCheckRequest,
onError: any,
errorLabel: string
): Observable<SMSCheckResponse> {
//this.setPublicFields(request);
return this.con.post(
AuthenticationService.smsCheck,
request,
onError,
errorLabel
);
}
/*
client side:
id no , mobile no , zip code
*/
public checkPatientForRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
: Observable<Response> {
this.setPublicFields(request);
request.TokenID = '';
request.PatientID = 0;
request.isRegister = false;
return this.con.post(AuthenticationService.checkPatientForRegisterationURL, request, onError, errorLabel);
}
/*
client side:
id no , mobile no , zip code
*/
public sendSmsForPatientRegisteration(request: CheckPatientRegisterationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
public sendSmsForPatientRegisteration(
request: CheckPatientRegisterationRequest,
onError: any,
errorLabel: string
): Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.PatientID = 0;
request.TokenID = "";
request.isRegister = false;
return this.con.post(AuthenticationService.sendSmsForRegisterURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.sendSmsForRegisterURL,
request,
onError,
errorLabel
);
}
public checkRegisterationActivationCode(request: CheckRegisterationCodeRequest, onError: any, errorLabel: string)
: Observable<Response> {
public checkRegisterationActivationCode(
request: CheckRegisterationCodeRequest,
onError: any,
errorLabel: string
): Observable<Response> {
this.setPublicFields(request);
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.activationCodeURL,
request,
onError,
errorLabel
);
}
public sendSMSForForgotFileNumber(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
public sendSMSForForgotFileNumber(
request: CheckUserAuthenticationRequest,
onError: any,
errorLabel: string
): Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.PatientIdentificationID = '';
request.PatientID = 0;
request.TokenID = "";
// request.PatientIdentificationID = '';
// request.PatientID = 0;
//request.SearchType = 2;
//request.isRegister = false;
return this.con.post(AuthenticationService.sendSMSForgotFileNoURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.sendSMSForgotFileNoURL,
request,
onError,
errorLabel
);
}
public forgotFileIdActivation(request: CheckActivationCodeRequest, onError: any, errorLabel: string)
: Observable<ForgotFileIDResponse> {
public forgotFileIdActivation(
request: CheckActivationCodeRequest,
onError: any,
errorLabel: string
): Observable<ForgotFileIDResponse> {
this.setPublicFields(request);
request.TokenID = '';
request.PatientIdentificationID = '';
request.PatientID = 0;
request.TokenID = "";
request.PatientIdentificationID = "";
// request.PatientID = 0;
request.SearchType = 2;
request.isRegister = false;
return this.con.post(AuthenticationService.forgotFileIDURL, request, onError, errorLabel);
return this.con.post(
AuthenticationService.forgotFileIDURL,
request,
onError,
errorLabel
);
}
public isSAUDIIDValid(id: string): boolean {
if (!id) {
return false;
@ -470,48 +569,44 @@ export class AuthenticationService {
}
for (let i = 0; i < 10; i++) {
if ((i % 2) === 0) {
if (i % 2 === 0) {
const a = id.charAt(i);
const x = Number(a) * 2;
let b = x.toString();
if (b.length === 1) {
b = '0' + b;
b = "0" + b;
}
sum += Number(b.charAt(0)) + Number(b.charAt(1));
} else {
sum += Number(id.charAt(i));
}
}
return ((sum % 10) === 0);
}
} catch (err) {
return sum % 10 === 0;
}
} catch (err) {}
return false;
}
public checkUserHasEmailDialog(): Observable<void> {
return Observable.create(observer => {
if (this.isAuthenticatedUserHasRealEmail()) {
const message = this.ts.trPK('general', 'send-email')
.replace('[0]', this.getAuthenticatedUser().EmailAddress);
this.cs.presentConfirmDialog(message,
() => {
const message = this.ts
.trPK("general", "send-email")
.replace("[0]", this.getAuthenticatedUser().EmailAddress);
this.cs.presentConfirmDialog(message, () => {
observer.next();
observer.complete();
});
} else {
this.cs.presentConfirmDialog(this.ts.trPK('login', 'enter-email'),
this.cs.presentConfirmDialog(
this.ts.trPK("login", "enter-email"),
() => {
//this.cs.openPatientProfile();
observer.complete();
});
}
);
}
});
}
/*
@ -529,9 +624,12 @@ export class AuthenticationService {
}
private sessionTimeOutDialog() {
this.cs.presentConfirmDialog(this.ts.trPK('general', 'idle-relogin'), () => {
this.cs.presentConfirmDialog(
this.ts.trPK("general", "idle-relogin"),
() => {
// this.cs.openUserLogin();
});
}
);
}
/*
@ -561,20 +659,19 @@ export class AuthenticationService {
if (!AuthenticationService.eventsRegistered) {
AuthenticationService.eventsRegistered = true;
// every time we have and event
this.registerDocumentEvents(['mousedown', 'touchstart', 'click', 'keyup'], () => {
this.registerDocumentEvents(
["mousedown", "touchstart", "click", "keyup"],
() => {
// if user still logged in and session not expired
if (AuthenticationService.user && !AuthenticationService.requireRelogin) {
if (
AuthenticationService.user &&
!AuthenticationService.requireRelogin
) {
// reset and start idling timer
this.detectIdle();
}
});
}
);
}
}
}

@ -2,73 +2,77 @@ import { PatientUserModel } from './PatientUserModel';
import { TestBed } from '@angular/core/testing';
export class AuthenticatedUser extends PatientUserModel {
ACTUAL_TERMINATION_DATE: string
ASSIGNMENT_END_DATE: string
ASSIGNMENT_ID: number
ASSIGNMENT_NUMBER: string
ASSIGNMENT_START_DATE: string
ASSIGNMENT_STATUS_TYPE_ID: number
ASSIGNMENT_TYPE: string
BUSINESS_GROUP_ID: number
BUSINESS_GROUP_NAME: string
CURRENT_EMPLOYEE_FLAG: string
EMPLOYEE_DISPLAY_NAME: string
EMPLOYEE_EMAIL_ADDRESS:string
EMPLOYEE_IMAGE:string
EMPLOYEE_MOBILE_NUMBER: string
EMPLOYEE_NAME:string
EMPLOYEE_NUMBER: string
EMPLOYEE_WORK_NUMBER:string
EMPLOYMENT_CATEGORY: string
EMPLOYMENT_CATEGORY_MEANING: string
FREQUENCY: string
FREQUENCY_MEANING: string
FROM_ROW_NUM: number
GRADE_ID: number
GRADE_NAME: string
HIRE_DATE: string
JOB_ID: number
JOB_NAME: string
LEDGER_ID: number
LOCATION_ID: number
LOCATION_NAME: string
MANUAL_TIMECARD_FLAG: string
MANUAL_TIMECARD_MEANING: string
NATIONALITY_CODE: string
NATIONALITY_MEANING: string
NATIONAL_IDENTIFIER:string
NORMAL_HOURS: string
NO_OF_ROWS: number
ORGANIZATION_ID: number
ORGANIZATION_NAME: string
PAYROLL_CODE: string
PAYROLL_ID: number
PAYROLL_NAME: string
PERSON_ID: number
PERSON_TYPE:string
PERSON_TYPE_ID: number
PER_INFORMATION_CATEGORY: string
POSITION_ID: number
POSITION_NAME: string
PRIMARY_FLAG: string
ROW_NUM:number
SUPERVISOR_ASSIGNMENT_ID: string
SUPERVISOR_DISPLAY_NAME: string
SUPERVISOR_EMAIL_ADDRESS: string
SUPERVISOR_ID: number
SUPERVISOR_MOBILE_NUMBER: string
SUPERVISOR_NAME: string
SUPERVISOR_NUMBER: string
SUPERVISOR_WORK_NUMBER: string
SWIPES_EXEMPTED_FLAG: string
SWIPES_EXEMPTED_MEANING: string
SYSTEM_PERSON_TYPE: string
TK_EMAIL_ADDRESS: string
TK_EMPLOYEE_DISPLAY_NAME: string
TK_EMPLOYEE_NAME: string
TK_EMPLOYEE_NUMBER: string
TK_PERSON_ID: number
TO_ROW_NUM: number
UNIT_NUMBER: string
USER_STATUS: string
TokenID:string;
ACTUAL_TERMINATION_DATE: string;
ASSIGNMENT_END_DATE: string;
ASSIGNMENT_ID: number;
ASSIGNMENT_NUMBER: string;
ASSIGNMENT_START_DATE: string;
ASSIGNMENT_STATUS_TYPE_ID: number;
ASSIGNMENT_TYPE: string;
BUSINESS_GROUP_ID: number;
BUSINESS_GROUP_NAME: string;
CURRENT_EMPLOYEE_FLAG: string;
EMPLOYEE_DISPLAY_NAME: string;
EMPLOYEE_EMAIL_ADDRESS:string;
EMPLOYEE_IMAGE:string;
EMPLOYEE_MOBILE_NUMBER: string;
EMPLOYEE_NAME:string;
EMPLOYEE_NUMBER: string;
EMPLOYEE_WORK_NUMBER:string;
EMPLOYMENT_CATEGORY: string;
EMPLOYMENT_CATEGORY_MEANING: string;
FREQUENCY: string;
FREQUENCY_MEANING: string;
FROM_ROW_NUM: number;
GRADE_ID: number;
GRADE_NAME: string;
HIRE_DATE: string;
JOB_ID: number;
JOB_NAME: string;
LEDGER_ID: number;
LOCATION_ID: number;
LOCATION_NAME: string;
MANUAL_TIMECARD_FLAG: string;
MANUAL_TIMECARD_MEANING: string;
NATIONALITY_CODE: string;
NATIONALITY_MEANING: string;
NATIONAL_IDENTIFIER:string;
NORMAL_HOURS: string;
NO_OF_ROWS: number;
ORGANIZATION_ID: number;
ORGANIZATION_NAME: string;
PAYROLL_CODE: string;
PAYROLL_ID: number;
PAYROLL_NAME: string;
PERSON_ID: number;
PERSON_TYPE:string;
PERSON_TYPE_ID: number;
PER_INFORMATION_CATEGORY: string;
POSITION_ID: number;
POSITION_NAME: string;
PRIMARY_FLAG: string;
ROW_NUM:number;
SUPERVISOR_ASSIGNMENT_ID: string;
SUPERVISOR_DISPLAY_NAME: string;
SUPERVISOR_EMAIL_ADDRESS: string;
SUPERVISOR_ID: number;
SUPERVISOR_MOBILE_NUMBER: string;
SUPERVISOR_NAME: string;
SUPERVISOR_NUMBER: string;
SUPERVISOR_WORK_NUMBER: string;
SWIPES_EXEMPTED_FLAG: string;
SWIPES_EXEMPTED_MEANING: string;
SYSTEM_PERSON_TYPE: string;
TK_EMAIL_ADDRESS: string;
TK_EMPLOYEE_DISPLAY_NAME: string;
TK_EMPLOYEE_NAME: string;
TK_EMPLOYEE_NUMBER: string;
TK_PERSON_ID: number;
TO_ROW_NUM: number;
UNIT_NUMBER: string;
USER_STATUS: string;
P_SESSION_ID:number;
MobileNumber:string;
LogInTokenID:string;
}

@ -4,5 +4,10 @@ import { AuthenticatedUser } from './authenticated-user';
export class CheckActivationCodeResponse extends Response {
AuthenticationTokenID: string;
P_SESSION_ID:number;
MobileNumber:string;
LogInTokenID:string;
EMPLOYEE_MOBILE_NUMBER:string;
TokenID:string;
MemberInformationList:AuthenticatedUser[];
}

@ -1,6 +1,6 @@
import { Request } from '../../models/request';
export class SMSCheckRequest extends Request {
LogInTokenID?: string ;
LogInTokenID: string ;
activationCode?: string;
}

@ -3,5 +3,12 @@ import { AuthenticatedUser } from './authenticated-user';
export class SMSCheckResponse extends Response {
AuthenticationTokenID: string;
MemberInformationList:AuthenticatedUser[];
public TokenID: string;
public SessionID: string;
public MobileType: string;
public BookedBy?: number;
public P_SESSION_ID: number;
public MobileNumber : string;
public LogInTokenID : string;
public EMPLOYEE_MOBILE_NUMBER:string;
}

@ -54,8 +54,8 @@ export class GeofencingService {
const req = new InsertLocationRequest();
req.PointsID = id;
req.GeoType = type;
req.PatientID = userData.PatientID;
req.PatientOutSA = userData.PatientOutSA;
//req.PatientID = userData.PatientID;
//req.PatientOutSA = userData.PatientOutSA;
this.auth.setPublicFields(req);
this.con.postNoLoad(GeofencingService.loggingUrl, req, () => {
zone.pendingRequest = type; // failed to log, setup pending request

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { MenuserviceService } from './menuservice.service';
describe('MenuserviceService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: MenuserviceService = TestBed.get(MenuserviceService);
expect(service).toBeTruthy();
});
});

@ -0,0 +1,50 @@
import {Injectable} from '@angular/core';
import {Http, Response, Headers, } from "@angular/http";
import {AuthenticationService} from "../authentication/authentication.service";
import { Observable } from 'rxjs';
import {MenuEntries} from './models/menu-entries.request';
import {Request} from '../models/request';
import {MenuResponse} from './models/menu-response'
import { ConnectorService } from '../connector/connector.service';
@Injectable()
export class MenuService {
public static getMenu ='Services/ERP.svc/REST/GET_MENU';
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
public static getMyTeam = 'Services/ERP.svc/REST/GET_EMPLOYEE_SUBORDINATES';
public static getNotCount='Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS_NUM';
public static disableSession="Services/ERP.svc/REST/DisableSession";
public static detectLanguage='Services/ERP.svc/REST/Get_LanguageAvailable';
constructor(
public authService: AuthenticationService,
public con:ConnectorService
) { }
public getMenu(onError?: any, errorLabel?: string): Observable<MenuResponse> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getMenu, request, onError, errorLabel);
}
public getMenuEntires(menuEntries:any, onError?: any, errorLabel?: string): Observable<MenuResponse> {
const request = menuEntries;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getMenuEntries, request, onError, errorLabel);
}
public getNotificationCount(req:any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.getNotCount, request, onError, errorLabel);
}
public disableSession(req:any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.disableSession, request, onError, errorLabel);
}
public getAppLanguages(req:any, onError?: any, errorLabel?: string): Observable<any> {
const request = req;
this.authService.authenticateRequest(request);
return this.con.post(MenuService.detectLanguage, request, onError, errorLabel);
}
}

@ -0,0 +1,7 @@
export class ListMenu {
public MENU_ID:number;
public MENU_NAME:string;
public MENU_TYPE:string;
public RESP_ID:number;
public SUB_MENU_NAME:string;
}

@ -0,0 +1,6 @@
import { Request } from '../models/request';
export class MenuEntries extends Request {
public P_MENU_TYPE:string;
public P_SELECTED_EMPLOYEE_NUMBER:string;
public P_SELECTED_RESP_ID:number
}

@ -0,0 +1,9 @@
import { ListMenu } from './list.menu';
import { MenuEntry } from './menu.entry';
export class MenuResponse {
public static SHARED_DATA = 'menu_response';
public static SHARED_SEL_EMP= 'sel_empolyee';
public static SHARED_SEL_RESP_ID= 'sel_resp_id';
public List_Menu:ListMenu;
public GetMenuEntriesList:MenuEntry;
}

@ -0,0 +1,13 @@
export class MenuEntry {
public MENU_NAME:string;
public ADD_BUTTON:string;
public DELETE_BUTTON:string;
public UPDATE_BUTTON:string;
public ENTRY_SEQUENCE:number;
public FUNCTION_NAME:string;
public LVL:number;
public MENU_ENTRY_TYPE:string;
public PARENT_MENU_NAME:string;
public PROMPT:string;
public REQUEST_TYPE:string;
}

@ -0,0 +1,18 @@
export class Request {
public P_USER_NAME: string;
public LanguageID: number;
//public IPAdress: string;
public P_SESSION_ID: number;
public VersionID: number;
public Channel: number;
public P_PASSWORD: string;
public P_MOBILE_NUMBER: string;
public P_EMAIL_ADDRESS: string;
public TokenID:string;
public P_NOTIFICATION_ID:number;
public MobileNumber: string;
public UserName:string;
public LogInTokenID:string;
public MobileType:string;
}

@ -1,19 +1,16 @@
export class Request {
public ClinicID: number;
public PatientOutSA: number;
public PatientID: number;
public ProjectID: number;
public LanguageID: number;
public IPAdress: string;
public VersionID: number;
public Channel: number;
public PatientTypeID: number;
public isDentalAllowedBackend: boolean;
public IsIrisPrescription: boolean;
public TokenID: string;
public SessionID: string;
public MobileType: string;
public PatientIdentificationID: string;
public PatientMobileNumber: string;
public BookedBy?: number;
public P_SESSION_ID: number;
public MobileNumber : string;
public LogInTokenID : string;
public P_USER_NAME:string;
public UserName:string;
}

@ -174,7 +174,7 @@ export class TranslatorService {
}
private setCurrentLanguageToDefault() {
TranslatorService.CURRENT_LANGUAGE = TranslatorService.AR;
TranslatorService.CURRENT_LANGUAGE = TranslatorService.EN;
}
public setCurrentLanguage(language: string) {
TranslatorService.CURRENT_LANGUAGE = language;

@ -12,14 +12,14 @@
<ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge>
</button>
<div class="centerDiv" (click)="openPersonalInfo()">
<p class="TxtPlace">{{"home.hello" | translate}}, {{User_name_Emp}}</p>
<p class="TxtPlace">{{"userData.hello" | translate}}, {{User_name_Emp}}</p>
<div class="profileDiv"><ion-img class="profileImg" src="{{user_image}}"></ion-img></div>
</div>
</div>
<div>
<div>
<p class="dash-header text-caps">{{"home.dashboard" | translate}}</p>
<p class="dash-header text-caps">{{"userData.dashboard" | translate}}</p>
</div>
<div>
<ion-grid class="cus-grid">

@ -1,46 +1,59 @@
import { Component, OnInit } from '@angular/core';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { MenuController } from '@ionic/angular';
import { Component, OnInit } from "@angular/core";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuController } from "@ionic/angular";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/models/smscheck.response";
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
@Component({
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss'],
selector: "app-home",
templateUrl: "./home.page.html",
styleUrls: ["./home.page.scss"]
})
export class HomePage implements OnInit {
userData: any ={};
user_image : any = "../assets/imgs/profile.png";
constructor(public ts: TranslatorService, public menu: MenuController, public authService: AuthenticationService ) { }
userData: any = {};
user_image: any = "../assets/imgs/profile.png";
menuList: any = [];
constructor(
public ts: TranslatorService,
public menu: MenuController,
public authService: AuthenticationService,
public menuService: MenuService,
public common: CommonService
) {}
ngOnInit() {
this.getUserDetails();
this.getMenu();
}
private openMenu(){
private openMenu() {
this.menu.toggle();
}
private getUserDetails(){
const user = this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
private getUserDetails() {
const user = this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
this.userData=user;
this.userData = user;
console.log(user);
}else{
} else {
console.log(user);
}
})
});
}
private getMenu() {
this.menuService.getMenu().subscribe((result: MenuResponse) => {
this.handleMenuResult(result);
});
}
private handleMenuResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) {
this.menuList = result.List_Menu;
}
}
}
// private getMenu(){
// this.menuService.getMenu().
// subscribe((result: MenuResponse) => {
// this.handleMenuResult(result);
// });
// }
// private handleMenuResult(result){
// if (this.common.validResponse(result)) {
// if (this.common.hasData(result.List_Menu)) {
// this.menuList = result.List_Menu;
// }
// }
}

@ -139,10 +139,10 @@ ion-header ion-icon.icon.icon-ios.ion-ios-add{
color: (--darkgray);
}
.toolbar-background {
background: (--primary);
background: -moz-linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%);
background: -webkit-linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%);
background: linear-gradient(45deg, (--primary) 0%, (--secondary) 36%,(--secondary) 59%, (--customnavy) 100%);
background: var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='var(--primary)', endColorstr='--var(customnavy)',GradientType=1 );
}
/***************button bckground***************/

Loading…
Cancel
Save