My Request Menu implemented

production
haroon amjad 6 years ago
parent ceb4968a69
commit 892082fb78

2
Mohem/.gitignore vendored

@ -11,6 +11,8 @@ log.txt
*.sublime-workspace *.sublime-workspace
.vscode/ .vscode/
npm-debug.log* npm-debug.log*
package-lock.json
package.json
.idea/ .idea/
.ionic/ .ionic/

@ -85,10 +85,6 @@
<plugin name="cordova-plugin-statusbar" spec="2.4.2" /> <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" /> <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" /> <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
<plugin name="cordova-plugin-cszbar" spec="1.3.4" />
<plugin name="cordova-plugin-geolocation" spec="4.0.1">
<variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To fetch location for marking attendance" />
</plugin>
<plugin name="cordova-plugin-device" spec="2.0.2" /> <plugin name="cordova-plugin-device" spec="2.0.2" />
<plugin name="cordova-android-support-gradle-release" spec="^3.0.1"> <plugin name="cordova-android-support-gradle-release" spec="^3.0.1">
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" /> <variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
@ -124,4 +120,8 @@
<engine name="browser" spec="5.0.4" /> <engine name="browser" spec="5.0.4" />
<engine name="ios" spec="4.5.5" /> <engine name="ios" spec="4.5.5" />
<engine name="android" spec="7.1.4" /> <engine name="android" spec="7.1.4" />
<plugin name="cordova-plugin-geolocation" spec="4.0.1">
<variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To fetch location for marking attendance" />
</plugin>
<plugin name="cordova-plugin-cszbar" spec="1.3.4" />
</widget> </widget>

1988
Mohem/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -25,7 +25,6 @@
"@ionic-native/app-availability": "^5.8.0", "@ionic-native/app-availability": "^5.8.0",
"@ionic-native/app-rate": "^5.8.0", "@ionic-native/app-rate": "^5.8.0",
"@ionic-native/background-geolocation": "^5.4.0", "@ionic-native/background-geolocation": "^5.4.0",
"@ionic-native/geolocation": "^5.8.0",
"@ionic-native/badge": "^5.8.0", "@ionic-native/badge": "^5.8.0",
"@ionic-native/barcode-scanner": "^5.8.0", "@ionic-native/barcode-scanner": "^5.8.0",
"@ionic-native/ble": "^5.8.0", "@ionic-native/ble": "^5.8.0",
@ -35,6 +34,7 @@
"@ionic-native/device": "^5.8.0", "@ionic-native/device": "^5.8.0",
"@ionic-native/diagnostic": "^5.8.0", "@ionic-native/diagnostic": "^5.8.0",
"@ionic-native/fingerprint-aio": "^5.8.0", "@ionic-native/fingerprint-aio": "^5.8.0",
"@ionic-native/geolocation": "^5.9.0",
"@ionic-native/globalization": "^5.8.0", "@ionic-native/globalization": "^5.8.0",
"@ionic-native/health": "^5.4.0", "@ionic-native/health": "^5.4.0",
"@ionic-native/in-app-browser": "^5.8.0", "@ionic-native/in-app-browser": "^5.8.0",
@ -42,14 +42,13 @@
"@ionic-native/launch-navigator": "^5.8.0", "@ionic-native/launch-navigator": "^5.8.0",
"@ionic-native/local-notifications": "^5.8.0", "@ionic-native/local-notifications": "^5.8.0",
"@ionic-native/native-storage": "^5.8.0", "@ionic-native/native-storage": "^5.8.0",
"@ionic-native/push": "^5.8.0", "@ionic-native/push": "^5.8.0",
"@ionic-native/sms": "^5.8.0", "@ionic-native/sms": "^5.8.0",
"@ionic-native/splash-screen": "^5.0.0", "@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.8.0", "@ionic-native/sqlite": "^5.8.0",
"@ionic-native/status-bar": "^5.0.0", "@ionic-native/status-bar": "^5.0.0",
"@ionic-native/themeable-browser": "^5.5.1", "@ionic-native/themeable-browser": "^5.5.1",
"@ionic-native/zbar": "^5.8.0", "@ionic-native/zbar": "^5.9.0",
"@ionic/angular": "^4.1.0", "@ionic/angular": "^4.1.0",
"@ng-bootstrap/ng-bootstrap": "^4.2.1", "@ng-bootstrap/ng-bootstrap": "^4.2.1",
"@swimlane/ngx-charts": "^10.1.0", "@swimlane/ngx-charts": "^10.1.0",
@ -169,7 +168,6 @@
}, },
"cordova-plugin-camera": {}, "cordova-plugin-camera": {},
"cordova-plugin-ionic-keyboard": {}, "cordova-plugin-ionic-keyboard": {},
"cordova-android-support-gradle-release": {},
"cordova-opentok-android-permissions": {}, "cordova-opentok-android-permissions": {},
"cordova-plugin-health": { "cordova-plugin-health": {
"HEALTH_READ_PERMISSION": "App needs read access to read heart rate", "HEALTH_READ_PERMISSION": "App needs read access to read heart rate",
@ -200,4 +198,4 @@
"android" "android"
] ]
} }
} }

@ -12,7 +12,8 @@ const routes: Routes = [
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' }, { path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' }, { path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' }, { path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' } { path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' }
]; ];

@ -102,6 +102,7 @@ export class LoginComponent implements OnInit, OnDestroy {
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER; this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
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.openSMSPage(); this.cs.openSMSPage();
} }
// console.log("result.IsPasswordExpired"); // console.log("result.IsPasswordExpired");
@ -179,6 +180,7 @@ export class LoginComponent implements OnInit, OnDestroy {
console.log(result); console.log(result);
this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.P_USER_NAME = this.username; this.loginData.P_USER_NAME = this.username;
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.sharedData.setSharedData(true,Password.IS_FORGET_PSW); this.sharedData.setSharedData(true,Password.IS_FORGET_PSW);
this.cs.stopLoading(); this.cs.stopLoading();

@ -0,0 +1,38 @@
import { HmgCommonModule } from 'src/app/hmg-common/hmg-common.module';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { EITPage } from './eit.page';
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{
path: '',
component: EITPage,
children: [
{
path: 'homepage',
component: HomeComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [
EITPage,
HomeComponent
]
})
export class EITPageModule { }

@ -0,0 +1,3 @@
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EITPage } from './eit.page';
describe('EITPage', () => {
let component: EITPage;
let fixture: ComponentFixture<EITPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EITPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EITPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-eit',
templateUrl: './eit.page.html',
styleUrls: ['./eit.page.scss'],
})
export class EITPage implements OnInit {
constructor() { }
ngOnInit() {
}
}

@ -0,0 +1,37 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<nav-buttons></nav-buttons>
<ion-title color="light">{{headerTitle}}</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item lines="none" class="custCollabs ion-item-styling" *ngFor="let menuItem of menu; let i=index"
(click)="openPage(menuItem, i);">
<ion-row>
<!-- Parent Pages -->
<ion-col col-12 class="menu-name">
<div [ngClass]="{'selectedDiv': selectedMenu == i,'notSelected': selectedMenu != i }">
<ion-text>
<b>{{menuItem.PROMPT}}</b>
<ion-icon [name]="selectedMenu == i? 'ios-arrow-down' : 'ios-arrow-forward'"
*ngIf="menuItem.children && menuItem.MENU_ENTRY_TYPE=='MENU'" slot="end"></ion-icon>
</ion-text>
</div>
<!-- Child Pages -->
<ion-list [hidden]="selectedMenu != i">
<ion-item class="childItem" *ngFor="let subPage of menuItem.children;let i2=index" text-wrap
(click)="openPage(subPage)">
<ion-row>
<ion-col col-11 class="menu-name"><span ion-text color="color2">&nbsp;{{subPage.PROMPT}}</span>
</ion-col>
</ion-row>
</ion-item>
</ion-list>
</ion-col>
</ion-row>
</ion-item>
</ion-list>
</ion-content>

@ -0,0 +1,62 @@
ion-item.custCollabs.item.item-block.item-md,
ion-item.custCollabs.item.item-block.item-ios {
padding: 0px;
}
.ion-item-styling {
-webkit-box-shadow: 0px 2px 7px 0px #7f8c8d;
-moz-box-shadow: 0px 2px 7px 0px #7f8c8d;
box-shadow: 0px 2px 7px 0px #7f8c8d;
color: #209a83 !important;
border: 0px;
border-radius: 5px;
line-height: 2;
margin: 8px 2px;
min-height: 40px;
}
ion-item.item.item-block {
.item-inner {
border: 0px !important;
padding: 0px !important;
}
ion-item.childItem.item.item-block {
padding: 0px 5px;
width: 100%;
ion-label.label.label-md,
ion-label.label.label-ios {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-bottom: 1px solid #e4e5e7;
border-radius: 0px;
color: #000000;
}
}
ion-col.menu-name.col {
padding: 0px;
}
div.selectedDiv {
background: #209a83;
color: #ffffff;
padding: 0px 10px;
min-height: 40px;
}
div.notSelected {
padding: 0px 10px;
}
// ion-label.label.label-md,
// ion-label.label.label-ios {
}
ion-icon::before {
line-height: 2;
}
// .list-md > .item-block:last-child .item-inner,
// .list-ios > .item-block:last-child .item-inner{
// border-bottom: 1px solid #dedede;
// }

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,59 @@
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Component, OnInit } from '@angular/core';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
menu: any;
pages: any;
headerTitle: string;
selMenu: MenuResponse = new MenuResponse();
// Selected Side Menu
selectedMenu: any;
constructor(private cs: CommonService, private ts: TranslatorService) {
this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
let title: string = this.ts.trPK('eit', 'my-requests');
this.headerTitle = this.selMenu.List_Menu.MENU_NAME ? this.selMenu.List_Menu.MENU_NAME : title;
}
ngOnInit() { }
openPage(page, index) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
if (page.children.length == 0) {
this.goToRequest(page);
} else {
if (this.selectedMenu == 0) {
this.selectedMenu = -1;
} else if (this.selectedMenu != -1) {
this.selectedMenu = -1;
} else {
this.selectedMenu = index;
}
}
}
goToRequest(menuEntry) {
let selMenu: MenuResponse = new MenuResponse();
selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
selMenu.GetMenuEntriesList = menuEntry;
this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
if (menuEntry.REQUEST_TYPE == 'ABSENCE') {
// this.navCtrl.push('AbsenceListPage');
// this.cs.open
} else if (menuEntry.REQUEST_TYPE == 'EIT') {
// this.navCtrl.push('EitListPage');
}
}
}

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

@ -0,0 +1,23 @@
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
@Injectable({
providedIn: 'root'
})
export class EitService {
/* EIT Services URLs */
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
public getMenuEntries(menuEntries: any, onError?: any, errorLabel?: string): Observable<any> {
const request = menuEntries;
this.authService.authenticateRequest(request);
console.log(request);
return this.con.post(EitService.getMenuEntries, request, onError, errorLabel);
}
}

@ -92,6 +92,7 @@ export class AuthenticationService {
request.TokenID = user.TokenID; request.TokenID = user.TokenID;
request.P_USER_NAME = user.EMPLOYEE_NUMBER; request.P_USER_NAME = user.EMPLOYEE_NUMBER;
request.UserName = user.EMPLOYEE_NUMBER; request.UserName = user.EMPLOYEE_NUMBER;
if (AuthenticationService.requireRelogin) { if (AuthenticationService.requireRelogin) {
this.sessionTimeOutDialog(); this.sessionTimeOutDialog();
} }

@ -6,12 +6,14 @@ export class LoginRequest extends Request {
PatientMobileNumber: string; // "537753536" PatientMobileNumber: string; // "537753536"
SearchType: number; // 1 for iqama 2 for file number SearchType: number; // 1 for iqama 2 for file number
TokenID: string; // "" TokenID: string; // ""
ZipCode: string; // "966" ZipCode: string; // "966"
MobileNumber: string; MobileNumber: string;
P_USER_NAME : string; P_USER_NAME: string;
P_MOBILE_NUMBER : string; P_MOBILE_NUMBER: string;
P_PASSWORD : string; P_PASSWORD: string;
P_LANGUAGE : string; P_LANGUAGE: string;
public static SHARED_DATA = 'login-request';
public static NATIONALITY_CODE = "Nationality_Code";
// isDentalAllowedBackend: false // isDentalAllowedBackend: false
isRegister: boolean; // false isRegister: boolean; // false
} }

@ -120,7 +120,7 @@ export class CommonService {
} }
} }
getSecondsAsDigitalClock(inputSeconds: number) { getSecondsAsDigitalClock(inputSeconds: number) {
var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param var sec_num = parseInt(inputSeconds.toString(), 10); // don't forget the second param
var hours = Math.floor(sec_num / 3600); var hours = Math.floor(sec_num / 3600);
@ -271,8 +271,7 @@ export class CommonService {
} }
async JustAlertDialog(acceptLabel: string, async JustAlertDialog(acceptLabel: string,
message: string) message: string) {
{
this.clearAllAlerts(); this.clearAllAlerts();
const alert = await this.alertControllerIonic.create({ const alert = await this.alertControllerIonic.create({
header: this.ts.trPK("general", "info"), header: this.ts.trPK("general", "info"),
@ -397,7 +396,7 @@ export class CommonService {
{ {
text: acceptLabel, text: acceptLabel,
handler: () => { handler: () => {
// this.openUserLogin(); // this.openUserLogin();
this.alertControllerIonic.dismiss(); this.alertControllerIonic.dismiss();
} }
} }
@ -509,17 +508,17 @@ export class CommonService {
browser.on('loadstart').subscribe(event => { browser.on('loadstart').subscribe(event => {
if ( successURLS ) { if (successURLS) {
successURLS.forEach((successURL, index) => { successURLS.forEach((successURL, index) => {
if (event.url && (event.url.indexOf(successURL) >= 0)) { if (event.url && (event.url.indexOf(successURL) >= 0)) {
// alert('load start found success url'); // alert('load start found success url');
browser.close(); browser.close();
if (onSuccess) { if (onSuccess) {
onSuccess(); onSuccess();
}
} }
} });
}); }
}
}); });
}); });
@ -901,11 +900,13 @@ export class CommonService {
public openAccuralPage() { public openAccuralPage() {
this.nav.navigateForward(["/accrual-balances/home"]); this.nav.navigateForward(["/accrual-balances/home"]);
} }
public openEITPage() {
public openMyTeamPage(){ this.nav.navigateForward(["/eit/homepage"]);
}
public openMyTeamPage() {
this.nav.navigateForward(["/my-team/home"]); this.nav.navigateForward(["/my-team/home"]);
} }
public openMyTeamDetails(){ public openMyTeamDetails() {
this.nav.navigateForward(["/my-team/details"]); this.nav.navigateForward(["/my-team/details"]);
} }
public reload(url: string, from: string) { public reload(url: string, from: string) {
@ -929,7 +930,7 @@ export class CommonService {
public navigateBack(url: string) { public navigateBack(url: string) {
this.nav.navigateBack([url]); this.nav.navigateBack([url]);
} }
private alternateNavigate(paths: string[], key: string, root = false) { private alternateNavigate(paths: string[], key: string, root = false) {
let url: string; let url: string;
if (localStorage.getItem(key) === "yes") { if (localStorage.getItem(key) === "yes") {
@ -949,7 +950,7 @@ export class CommonService {
public openLogin() { public openLogin() {
this.nav.navigateRoot(["/authentication/login"]); this.nav.navigateRoot(["/authentication/login"]);
} }
public openUserForgot() { public openUserForgot() {
this.nav.navigateForward(["/authentication/checkuser"]); this.nav.navigateForward(["/authentication/checkuser"]);
} }
@ -1012,4 +1013,22 @@ export class CommonService {
}); });
} }
list_to_tree(list) {
let map = {}, node, roots = [], i;
for (i = 0; i < list.length; i += 1) {
map[list[i].MENU_NAME] = i; // initialize the map
list[i].children = []; // initialize the children
}
for (i = 0; i < list.length; i += 1) {
node = list[i];
if (node.PARENT_MENU_NAME !== "") {
// if you have dangling branches check that map[node.parentId] exists
list[map[node.PARENT_MENU_NAME]].children.push(node);
} else {
roots.push(node);
}
}
return roots;
}
} }

@ -1,3 +1,4 @@
import { EitService } from './../eit/services/eit.service';
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from "@angular/core";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuController, Events } from "@ionic/angular"; import { MenuController, Events } from "@ionic/angular";
@ -12,6 +13,7 @@ import { Device } from '@ionic-native/device/ngx';
import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request'; import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request';
import { Response } from "src/app/hmg-common/services/models/response"; import { Response } from "src/app/hmg-common/services/models/response";
import { AttendanceService } from './services/attendance.services'; import { AttendanceService } from './services/attendance.services';
import { LoginRequest } from '../hmg-common/services/authentication/models/login.request';
@Component({ @Component({
selector: "app-home", selector: "app-home",
@ -22,10 +24,10 @@ export class HomePage implements OnInit {
userData: any = {}; userData: any = {};
user_image: any = "../assets/imgs/profile.png"; user_image: any = "../assets/imgs/profile.png";
menuList: any = []; menuList: any = [];
zbarOptions:any; zbarOptions: any;
scannedResult:any; scannedResult: any;
lat : any; lat: any;
longt : any; longt: any;
deviceID: string; deviceID: string;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
@ -36,9 +38,10 @@ export class HomePage implements OnInit {
public events: Events, public events: Events,
private device: Device, private device: Device,
private zbar: ZBar, private zbar: ZBar,
private geolocation: Geolocation, private geolocation: Geolocation,
private attendance_service:AttendanceService private attendance_service: AttendanceService,
) {} private eitService: EitService
) { }
ngOnInit() { ngOnInit() {
this.getUserDetails(); this.getUserDetails();
@ -48,21 +51,20 @@ export class HomePage implements OnInit {
// resp.coords.longitude // resp.coords.longitude
console.log(resp.coords.latitude); console.log(resp.coords.latitude);
console.log(resp.coords.longitude); console.log(resp.coords.longitude);
}).catch((error) => { }).catch((error) => {
console.log('Error getting location', error); console.log('Error getting location', error);
}); });
} }
ionViewDidLoad() ionViewDidLoad() {
{
this.geolocation.getCurrentPosition().then((resp) => { this.geolocation.getCurrentPosition().then((resp) => {
// resp.coords.latitude // resp.coords.latitude
// resp.coords.longitude // resp.coords.longitude
console.log(resp.coords.latitude); console.log(resp.coords.latitude);
console.log(resp.coords.longitude); console.log(resp.coords.longitude);
}).catch((error) => { }).catch((error) => {
console.log('Error getting location', error); console.log('Error getting location', error);
}); });
} }
private openMenu() { private openMenu() {
this.menu.toggle(); this.menu.toggle();
@ -113,48 +115,89 @@ export class HomePage implements OnInit {
} else if (item.MENU_TYPE == "S") { } else if (item.MENU_TYPE == "S") {
//this.navCtrl.push('MySpecialistPage',{"mySpecList":item}); //this.navCtrl.push('MySpecialistPage',{"mySpecList":item});
} else { } else {
//this.getMenuEntries(item); this.getMenuEntries(item);
}
}
getMenuEntries(item) {
let request: any = {};
let selEmpNo: string = null;
let nationality: string = null;
request.P_SELECTED_RESP_ID = -999;
if (item.MENU_TYPE == 'S') {
request.P_SELECTED_RESP_ID = item.RESP_ID;
} else {
selEmpNo = this.common.sharedService.getSharedData(LoginRequest.SHARED_DATA, false);
}
nationality = this.common.sharedService.getSharedData(LoginRequest.NATIONALITY_CODE, false);
request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo;
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
//set emp and resp id
this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP);
this.common.sharedService.setSharedData(request.P_SELECTED_RESP_ID, MenuResponse.SHARED_SEL_RESP_ID);
this.eitService.getMenuEntries(
request).
subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
}
sortMenuEntires(list) {
let tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, 'menuEntries');
// this.common.navigateForward("/eit/homepage");
this.common.openEITPage();
}
private handleMenuEntiresResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetMenuEntriesList)) {
this.sortMenuEntires(result.GetMenuEntriesList);
}
} }
} }
private Change_password(){
private Change_password() {
this.common.openChangePassword(); this.common.openChangePassword();
} }
private attendance(){ private attendance() {
this.zbarOptions = { this.zbarOptions = {
flash: 'off', flash: 'off',
drawSight: false drawSight: false
} }
console.log("your currnt location is"); console.log("your currnt location is");
this.scanCode(); this.scanCode();
} }
scanCode(){ scanCode() {
this.zbar.scan(this.zbarOptions) this.zbar.scan(this.zbarOptions)
.then(result => { .then(result => {
console.log(result); // Scanned code console.log(result); // Scanned code
let strResult = JSON.parse(result); let strResult = JSON.parse(result);
console.log(strResult.QRValue); console.log(strResult.QRValue);
this.scannedResult = result; this.scannedResult = result;
this.deviceID = this.device.uuid; this.deviceID = this.device.uuid;
this.swipeAttendance(); this.swipeAttendance();
}) })
.catch(error => { .catch(error => {
alert(error); // Error message alert(error); // Error message
}); });
} }
swipeAttendance(){ swipeAttendance() {
let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat; request.Latitude = this.lat;
request.Longitude = this.longt; request.Longitude = this.longt;
request.QRValue = this.scannedResult; request.QRValue = this.scannedResult;
request.UID = this.deviceID; request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER; request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request"); console.log("request");
console.log(JSON.stringify(request)); console.log(JSON.stringify(request));
this.attendance_service.attendanceSwipeScanner( this.attendance_service.attendanceSwipeScanner(
request,()=>{ request, () => {
console.log("Error inside in swipe attendance"); console.log("Error inside in swipe attendance");
}). }).
subscribe((result: Response) => { subscribe((result: Response) => {

@ -765,7 +765,7 @@
}, },
"confirmPassword": { "confirmPassword": {
"en": "Confirm Password", "en": "Confirm Password",
"ar": "تأكيد كلمة المرور" "ar": "تأكيد كلمة المرور"
}, },
"newPassword": { "newPassword": {
"en": "New Password", "en": "New Password",
@ -1019,54 +1019,59 @@
} }
}, },
"accrualBalances": { "accrualBalances": {
"accrualBalances":{ "accrualBalances": {
"en":"Accrual Balances", "en": "Accrual Balances",
"ar":"رصيد حساب المستحقات" "ar": "رصيد حساب المستحقات"
}, },
"selectDate":{ "selectDate": {
"en": "Select Date", "en": "Select Date",
"ar": "اختر التاريخ" "ar": "اختر التاريخ"
}, },
"tip":{ "tip": {
"en":"<p>Enter the <span class=\"boldTxtNav\">date</span> for which you wish to view your accrual balances.</p>", "en": "<p>Enter the <span class=\"boldTxtNav\">date</span> for which you wish to view your accrual balances.</p>",
"ar":"<p>أدخل <span class=\"boldTxtNav\">التاريخ</span> الذي تريد عرض الإستحقاقات له</p>" "ar": "<p>أدخل <span class=\"boldTxtNav\">التاريخ</span> الذي تريد عرض الإستحقاقات له</p>"
} }
}, },
"myTeam":{ "myTeam": {
"requestFor": {
"requestFor":{ "en": "Request for",
"en":"Request for", "ar": "اطلب ل"
"ar":"اطلب ل"
} }
}, },
"searchForReplacment": { "searchForReplacment": {
"searchForReplacment": { "searchForReplacment": {
"en":"Search for an Employee", "en": "Search for an Employee",
"ar":"ابحث عن موظف" "ar": "ابحث عن موظف"
}, },
"searchBy": { "searchBy": {
"en": " Search by", "en": " Search by",
"ar": " البحث بـ" "ar": " البحث بـ"
}, },
"name":{ "name": {
"en":"Name", "en": "Name",
"ar":"الاسم" "ar": "الاسم"
}, },
"userName": { "userName": {
"en":"User Name", "en": "User Name",
"ar":"اسم المستخدم" "ar": "اسم المستخدم"
}, },
"email": { "email": {
"en":"Email", "en": "Email",
"ar":"البريد الإلكتروني" "ar": "البريد الإلكتروني"
}, },
"search": { "search": {
"en":"Search", "en": "Search",
"ar":"بحث" "ar": "بحث"
}, },
"tip":{ "tip": {
"en": "You can search for an employee by <span class=\"boldTxtNav\">Name </span>, <span class=\"boldTxtNav\">User Name </span> and <span class=\"boldTxtNav\">Email </span>", "en": "You can search for an employee by <span class=\"boldTxtNav\">Name </span>, <span class=\"boldTxtNav\">User Name </span> and <span class=\"boldTxtNav\">Email </span>",
"ar":"يمكنك البحث عن موظف ب <span class=\"boldTxtNav\">الاسم </span>, <span class=\"boldTxtNav\">اسم المستخدم </span> ,أو <span class=\"boldTxtNav\">البريد الإلكتروني </span>" "ar": "يمكنك البحث عن موظف ب <span class=\"boldTxtNav\">الاسم </span>, <span class=\"boldTxtNav\">اسم المستخدم </span> ,أو <span class=\"boldTxtNav\">البريد الإلكتروني </span>"
}
},
"eit": {
"my-requests": {
"en": "My Requests",
"ar": "طلباتي"
} }
} }
} }

@ -35,6 +35,7 @@ body{
ion-label{ ion-label{
color:var(--labelColor) !important; color:var(--labelColor) !important;
} }
.tipsPadding{ .tipsPadding{
padding: 0px 10px; padding: 0px 10px;
} }

Loading…
Cancel
Save