diff --git a/Mohem/src/app/app.component.html b/Mohem/src/app/app.component.html index abbe1186..a8aaa491 100644 --- a/Mohem/src/app/app.component.html +++ b/Mohem/src/app/app.component.html @@ -56,6 +56,16 @@ {{notBadge}} + + + + + + + {{ts.trPK('general','digital-id')}} + {{notBadge}} + + @@ -128,6 +138,16 @@ --> + + + + + + {{ts.trPK('general','digital-id')}} + {{notBadge}} + + + + diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html index 95971d3d..64c9226f 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html @@ -66,4 +66,9 @@ + + diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.scss b/Mohem/src/app/authentication/confirm-login/confirm-login.component.scss index eb5390a3..ad2206df 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.scss +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.scss @@ -7,4 +7,31 @@ } +.button-digital-id{ + --background: white !important; + background: white !important; + white-space: normal; + color: white; + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 33px !important; + border-radius: 33px !important; + --min-height: 1.6cm !important; + width: 315px; + border: 1px solid black; +} + + +.digital-id-en{ + color: black; + position: absolute; + right: 20px; + width: 10%; + } + .digital-id-ar{ + color: black; + position: absolute; + left: 20px; + width: 10%; + } \ No newline at end of file diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index 065e2fb1..8c6d5924 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -12,12 +12,13 @@ import { GetLoginInfoResponse } from '../../hmg-common/services/authentication/m import { SMSCheckRequest } from 'src/app/hmg-common/services/authentication/models/smscheck.request'; import { SMSCheckResponse } from 'src/app/hmg-common/services/authentication/models/smscheck.response'; import { PushService } from 'src/app/hmg-common/services/push/push.service'; -import { Platform } from '@ionic/angular'; +import { ModalController, Platform } from '@ionic/angular'; import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response'; import { LoginModel } from '../models/LoginModel'; import * as moment from 'moment'; import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response'; import { NFC } from "@ionic-native/nfc/ngx"; +import { DigitalIdComponent } from '../digital-id/digital-id.component'; @Component({ selector: 'app-confirm-login', @@ -49,6 +50,8 @@ export class ConfirmLoginComponent implements OnInit { private iosLink: string; private androidLink: string; public isNFCAvailable = false; + direction:string; + userInfo: any; constructor( public ts: TranslatorService, @@ -58,6 +61,7 @@ export class ConfirmLoginComponent implements OnInit { private faio: FingerprintAIO, public pushService: PushService, public platform: Platform, + public modalController: ModalController, private nfc: NFC ) { this.loginData = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); @@ -75,6 +79,8 @@ export class ConfirmLoginComponent implements OnInit { } ngOnInit() { + this.direction = TranslatorService.getCurrentLanguageName(); + this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.checkNFCStatus(); // **checkIfAvailable FAIO **// this.checkIfAvailable(); @@ -474,4 +480,12 @@ checkAccess(el: any) { } } +async openDigitalId() { + const modal = await this.modalController.create({ + component: DigitalIdComponent, + cssClass: 'digital-id-modal-css' + }); + return await modal.present(); +} + }​ diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.html b/Mohem/src/app/authentication/digital-id/digital-id.component.html new file mode 100644 index 00000000..14a196c0 --- /dev/null +++ b/Mohem/src/app/authentication/digital-id/digital-id.component.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + +

{{userInfo.ASSIGNMENT_NUMBER}}

+
+
+ + +

{{userInfo.EMPLOYEE_DISPLAY_NAME}}

+

{{userInfo.JOB_NAME}}

+
+
+ + + + + +
+ +
+ + + +
+ +
+
\ No newline at end of file diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.scss b/Mohem/src/app/authentication/digital-id/digital-id.component.scss new file mode 100644 index 00000000..e43b4628 --- /dev/null +++ b/Mohem/src/app/authentication/digital-id/digital-id.component.scss @@ -0,0 +1,13 @@ +.button-login{ + --background: #c1272d !important; + background: #c1272d !important; + white-space: normal; + color: var(--light); + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 33px !important; + border-radius: 33px !important; + --min-height: 1.6cm !important; + width: 315px; +} + diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.spec.ts b/Mohem/src/app/authentication/digital-id/digital-id.component.spec.ts new file mode 100644 index 00000000..9884cc27 --- /dev/null +++ b/Mohem/src/app/authentication/digital-id/digital-id.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DigitalIdComponent } from './digital-id.component'; + +describe('DigitalIdComponent', () => { + let component: DigitalIdComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DigitalIdComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DigitalIdComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.ts b/Mohem/src/app/authentication/digital-id/digital-id.component.ts new file mode 100644 index 00000000..da088354 --- /dev/null +++ b/Mohem/src/app/authentication/digital-id/digital-id.component.ts @@ -0,0 +1,29 @@ +import { Component, OnInit, Input} from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-digital-id', + templateUrl: './digital-id.component.html', + styleUrls: ['./digital-id.component.scss'], +}) +export class DigitalIdComponent implements OnInit { + @Input() userInfo: any; + + constructor( + public modalCtrl: ModalController, + public ts: TranslatorService, + ) { } + + ngOnInit() { + console.log(this.userInfo); + } + + + dismiss() { + this.modalCtrl.dismiss({ + 'dismissed': true + }); + } + +} diff --git a/Mohem/src/app/authentication/login/login.component.html b/Mohem/src/app/authentication/login/login.component.html index 94cf254d..638b6265 100644 --- a/Mohem/src/app/authentication/login/login.component.html +++ b/Mohem/src/app/authentication/login/login.component.html @@ -26,9 +26,6 @@ -
@@ -40,6 +37,8 @@
+ + @@ -47,6 +46,17 @@
+ + + + +

+
diff --git a/Mohem/src/app/authentication/login/login.component.scss b/Mohem/src/app/authentication/login/login.component.scss index 080bb5d5..81d65d6c 100644 --- a/Mohem/src/app/authentication/login/login.component.scss +++ b/Mohem/src/app/authentication/login/login.component.scss @@ -141,6 +141,22 @@ img.centerDiv { --min-height: 1.6cm !important; width: 315px; } + +.button-digital-id{ + --background: white !important; + background: white !important; + white-space: normal; + color: white; + text-transform: capitalize; + min-height: 1.0cm; + --border-radius: 33px !important; + border-radius: 33px !important; + --min-height: 1.6cm !important; + width: 315px; + border: 1px solid black; +} + + .content { width: 500px; margin-left: auto; @@ -227,4 +243,19 @@ img.centerDiv { display:inline-block; margin-top:20px; margin-right: 15%; + } + + + .digital-id-en{ + color: black; + position: absolute; + right: 20px; + width: 10%; + } + + .digital-id-ar{ + color: black; + position: absolute; + left: 20px; + width: 10%; } \ No newline at end of file diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 88a625f5..447b9d2b 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -18,6 +18,8 @@ import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authenticat import { PushService } from 'src/app/hmg-common/services/push/push.service'; import { KeyboardService } from 'src/app/hmg-common/services/keyboard/keyboard.service'; import { KeyboardStatusModel } from 'src/app/hmg-common/services/keyboard/keyboard-status.model'; +import { ModalController } from '@ionic/angular'; +import { DigitalIdComponent } from '../digital-id/digital-id.component'; @Component({ selector: 'login', @@ -26,6 +28,7 @@ import { KeyboardStatusModel } from 'src/app/hmg-common/services/keyboard/keyboa }) export class LoginComponent implements OnInit, OnDestroy { deviceToken1: any; + userInfo: any; constructor( public cs: CommonService, @@ -42,21 +45,22 @@ export class LoginComponent implements OnInit, OnDestroy { public sharedData: SharedDataService, public plt: Platform, public pushService: PushService, - public keyboardService: KeyboardService + public keyboardService: KeyboardService, + public modalController: ModalController ) { this.events.subscribe('logoutFlage', logoutFlage => { console.log('login compont logoutFlage: ' + logoutFlage); // tslint:disable-next-line: triple-equals if (logoutFlage == true) { - console.log(' subscribe check logoutFlage: ' + logoutFlage); - this.logoutFlage = logoutFlage; - localStorage.setItem('logoutFlage', logoutFlage); + console.log(' subscribe check logoutFlage: ' + logoutFlage); + this.logoutFlage = logoutFlage; + localStorage.setItem('logoutFlage', logoutFlage); } }); this.getuser = this.cs.sharedService.getSharedData( AuthenticationService.IMEI_USER_DATA, false - ); + ); if (this.getuser) { this.user = true; @@ -91,7 +95,7 @@ export class LoginComponent implements OnInit, OnDestroy { user = false; DeviceType: string; requestGetLoginInfo: any; - logoutFlage: boolean ; + logoutFlage: boolean; getuser: any = ''; getlastlogin: any; public keyboardOpened = false; @@ -99,6 +103,7 @@ export class LoginComponent implements OnInit, OnDestroy { ngOnInit() { this.monitorKeyboardChange(); + this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.currentLang = TranslatorService.getCurrentLanguageCode(); if (TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) { @@ -113,19 +118,19 @@ export class LoginComponent implements OnInit, OnDestroy { this.deviceToken = this.cs.getDeviceToken(); if (this.deviceToken) { console.log('login enabled first time: ' + this.deviceToken); - } else { - console.log('no deviceToken' ); - this.pushService.startReceiving(); - } + } else { + console.log('no deviceToken'); + this.pushService.startReceiving(); + } // here will delete below part and depdding on user (response from getMobileInfo) this.username = localStorage.getItem('user'); this.password = localStorage.getItem('password'); // ****// const remember = localStorage.getItem('remember'); // ****// - this.empname = localStorage.getItem('emp-name'); + this.empname = localStorage.getItem('emp-name'); this.logintype = localStorage.getItem('login-type'); // tslint:disable-next-line: triple-equals - if (remember == 'true') { this.remeberMe = true ; } else { this.remeberMe = false; } + if (remember == 'true') { this.remeberMe = true; } else { this.remeberMe = false; } } ngOnDestroy(): void { @@ -133,9 +138,9 @@ export class LoginComponent implements OnInit, OnDestroy { } public changeLanguage(langNumber) { - console.log("current lang: "+this.currentLang) - console.log("click lang: "+langNumber) - if(this.currentLang == langNumber){ + console.log("current lang: " + this.currentLang) + console.log("click lang: " + langNumber) + if (this.currentLang == langNumber) { this.currentLang = langNumber; return; } else { @@ -167,9 +172,9 @@ export class LoginComponent implements OnInit, OnDestroy { this.remeberMyInfo(); } public remeberMyInfo() { - if (this.username) {localStorage.setItem('user', this.username); } - if (this.password) {localStorage.setItem('password', this.password); } - localStorage.setItem('remember', 'true'); + if (this.username) { localStorage.setItem('user', this.username); } + if (this.password) { localStorage.setItem('password', this.password); } + localStorage.setItem('remember', 'true'); } public onLogin() { @@ -183,21 +188,21 @@ export class LoginComponent implements OnInit, OnDestroy { this.checkAppUpdated(); console.log('login enabled second time: ' + this.deviceToken); }, 1000); - } + } } public checkAppUpdated() { - this.authService.checkApplicationVersion(() => {}).subscribe((result: CheckAppVersionResponse) => { - // tslint:disable-next-line: triple-equals - if (result.MessageStatus == 2 && result.ErrorType == 4) { - this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { - this.handleAppUpdate(result); - }); + this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => { + // tslint:disable-next-line: triple-equals + if (result.MessageStatus == 2 && result.ErrorType == 4) { + this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { + this.handleAppUpdate(result); + }); // tslint:disable-next-line: triple-equals - } else if (result.MessageStatus == 1) { - this.checkUserAuthentication(); - } - }); + } else if (result.MessageStatus == 1) { + this.checkUserAuthentication(); + } + }); } private handleAppUpdate(result) { @@ -332,7 +337,7 @@ export class LoginComponent implements OnInit, OnDestroy { login() { let anotherUser = this.sharedData.getSharedData('anotherUser'); - if(anotherUser){ + if (anotherUser) { this.username = ''; this.password = ''; } @@ -340,42 +345,51 @@ export class LoginComponent implements OnInit, OnDestroy { console.log('login'); // this.loginDiv=true; this.user = false; - } + } - loginWithUser() { + loginWithUser() { console.log('loginWithUser'); this.cs.openConfirmLoginPage(); - } + } - getLastLoginInfo() { + getLastLoginInfo() { this.requestGetLoginInfo = { DeviceType: this.cs.getDeviceType(), // "Android",//this.cs.getDeviceType(), DeviceToken: this.cs.getDeviceToken()// "5ca8a69cf1804db55264c349edffb99b9d63acd9fa9b6b18956bcb2ad3f2ba36"//this.deviceToken }; - this.authService.getLoginInfo(this.requestGetLoginInfo, () => {}, this.ts.trPK('general', 'ok')).subscribe(res => { - if (this.cs.validResponse(res)) { + this.authService.getLoginInfo(this.requestGetLoginInfo, () => { }, this.ts.trPK('general', 'ok')).subscribe(res => { + if (this.cs.validResponse(res)) { - if (res.Mohemm_GetMobileLoginInfoList.length > 0) { + if (res.Mohemm_GetMobileLoginInfoList.length > 0) { - this.cs.sharedService.setSharedData( - // res.Patient_SELECTDeviceIMEIbyIMEIList[0], - res.Mohemm_GetMobileLoginInfoList[0], - AuthenticationService.IMEI_USER_DATA - ); - this.user = true; + this.cs.sharedService.setSharedData( + // res.Patient_SELECTDeviceIMEIbyIMEIList[0], + res.Mohemm_GetMobileLoginInfoList[0], + AuthenticationService.IMEI_USER_DATA + ); + this.user = true; - } else { - this.user = false; - } - } + } else { + this.user = false; + } + } }); - } + } + + private monitorKeyboardChange() { + this.events.subscribe(KeyboardService.KEYBOARD_STATUS, (status: KeyboardStatusModel) => { + this.keyboardOpened = status.opened; + }); + } + - private monitorKeyboardChange() { - this.events.subscribe ( KeyboardService.KEYBOARD_STATUS , ( status: KeyboardStatusModel) => { - this.keyboardOpened = status.opened; + async openDigitalId() { + const modal = await this.modalController.create({ + component: DigitalIdComponent, + cssClass: 'digital-id-modal-css' }); - } + return await modal.present(); + } } diff --git a/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts b/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts index 2bdcc8cf..d0127578 100644 --- a/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts +++ b/Mohem/src/app/hmg-common/services/attend-services/attend-scan.service.ts @@ -25,12 +25,13 @@ import { ModalController } from '@ionic/angular'; export class AttendScanService { location: boolean; camera: boolean; - lat: any; - longt: any; + lat = 0; + longt = 0; deviceID: string; scannedResult: any; userData: any = {}; public isFakeLocationUsed = false; + public isGpsRequired = false; constructor(private device: Device, private zbar: ZBar, @@ -51,6 +52,7 @@ export class AttendScanService { } getDeviceLocation() { + this.isGpsRequired = true; this.isFakeLocationUsed = false; const isVirtual = this.device.isVirtual; if (isVirtual === true) { @@ -69,7 +71,7 @@ export class AttendScanService { } this.lat = resp.latitude; this.longt = resp.longitude; - this.attendance(); + this.attendance(true); } else { this.common.presentAlert(this.ts.trPK('home', 'position-error')); @@ -82,7 +84,7 @@ export class AttendScanService { if(resp && resp.coords.latitude && resp.coords.longitude) { this.lat = resp.coords.latitude; this.longt = resp.coords.longitude; - this.attendance(); + this.attendance(true); } else { this.common.presentAlert(this.ts.trPK('home', 'position-error')); @@ -97,7 +99,12 @@ export class AttendScanService { }); } - public attendance() { + public attendance(isGPSValue: boolean) { + this.isGpsRequired = isGPSValue; + if (!this.isGpsRequired) { + this.lat = 0; + this.longt = 0; + } this.permissions.requestCameraAutherization().then(granted => { this.camera = granted as boolean; if (this.camera) { @@ -130,6 +137,8 @@ export class AttendScanService { request.Latitude = this.lat; request.Longitude = this.longt; request.QRValue = this.scannedResult.text; + request.NFCValue = ''; + request.WIFIValue = ''; request.UID = this.deviceID; request.EmployeeID = this.userData.EMPLOYEE_NUMBER; this.attendance_service.fakeAttendanceSwipeScanner(request, () => {console.log('Error inside in swipe attendance');}) @@ -150,6 +159,7 @@ export class AttendScanService { request.NFCValue = ''; request.UID = this.deviceID; request.UserName = this.userData.EMPLOYEE_NUMBER; + request.IsGpsRequired = this.isGpsRequired; console.log('request'); console.log(JSON.stringify(request)); this.attendance_service diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index c1d7c20c..db2c1fc6 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -133,8 +133,8 @@ export class AuthenticationService { }else{ mobileType = 'android'; } - request.VersionID = 2.7; - request.Channel = 33; + request.VersionID = 2.8; + request.Channel = 31; request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.MobileType = mobileType; @@ -209,7 +209,7 @@ export class AuthenticationService { public login(request: LoginRequest, onError: any, errorLabel: string): Observable { this.setPublicFields(request); - request.P_APP_VERSION="HMG"; + request.P_APP_VERSION="CS"; return this.con.post(AuthenticationService.login, request, onError, errorLabel); } @@ -464,7 +464,7 @@ export class AuthenticationService { public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string) : Observable { this.setPublicFields(request); - request.P_APP_VERSION="HMG"; + request.P_APP_VERSION="CS"; return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel); } diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index acd8ff0e..5b221dfc 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -22,22 +22,9 @@ export class ConnectorService { }; public static retryTimes = 0; public static timeOut = 120 * 1000; - // public static host = 'http://10.50.100.113:6060/'; // development service // public static host = 'https://uat.hmgwebservices.com/'; public static host = 'https://hmgwebservices.com/'; - // public static host = 'http://10.50.100.198:6060/'; - // public static host = 'http://10.50.100.113:6060/'; // development service - /* public static host = 'http://10.50.100.198:6060/'; - public static host = 'http://10.50.100.198:6060/'; // development service - public static host = 'http://10.50.100.198:4040/'; // UAT service - public static host = 'http://10.50.100.198:4444/'; // production service - public static host = 'http://10.50.100.113:4040/'; // UAT service - public static host = 'http://10.50.100.113:4444/'; // production service - */ - /* - end of connection configuration - */ constructor(public httpClient: HttpClient, public cs: CommonService) {} diff --git a/Mohem/src/app/hmg-common/services/push/push.service.ts b/Mohem/src/app/hmg-common/services/push/push.service.ts index b75b052b..4ed1f3ae 100644 --- a/Mohem/src/app/hmg-common/services/push/push.service.ts +++ b/Mohem/src/app/hmg-common/services/push/push.service.ts @@ -35,8 +35,18 @@ export class PushService { public startReceiving() { console.log("startReceiving"); - this.processStartReceivingWithFirebase(); - } + this.firebasex.hasPermission().then(hasPermission => { + if (!hasPermission) { + this.firebasex.grantPermission().then(hasPermission => { + console.log("Permission was " + (hasPermission ? "granted" : "denied")); + this.processStartReceivingWithFirebase(); + }); + } else { + this.processStartReceivingWithFirebase(); + } + }); + }​​ + private processNotification(data: any) { const notification = new NotificationModel(); diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts index ac292fa6..110e1ba6 100644 --- a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.ts @@ -11,7 +11,7 @@ export class AccordinTabCustomComponent implements OnInit { private accordion: AccordinCustomComponent; private id: number; - public show = false; + @Input() public show = false; public direction = 'ltr'; @Input() header: string; @Input() subHeader: string; @@ -30,7 +30,6 @@ export class AccordinTabCustomComponent implements OnInit { } public setVisibility(show: boolean) { - this.show = show; } public setAccordion(accordion: AccordinCustomComponent) { @@ -38,6 +37,7 @@ export class AccordinTabCustomComponent implements OnInit { } public onClick() { + this.show = !this.show; this.setVisibility(!this.show); if (this.show) { if (this.accordion) { diff --git a/Mohem/src/app/home/attendance-options/attendance-options.component.html b/Mohem/src/app/home/attendance-options/attendance-options.component.html index 7622aa12..145721f3 100644 --- a/Mohem/src/app/home/attendance-options/attendance-options.component.html +++ b/Mohem/src/app/home/attendance-options/attendance-options.component.html @@ -21,7 +21,7 @@ -
+

{{ "general, nfc-text" | translate }}

@@ -42,7 +42,7 @@ -
+

{{ "general, wifi-text" | translate }}

diff --git a/Mohem/src/app/home/attendance-options/attendance-options.component.ts b/Mohem/src/app/home/attendance-options/attendance-options.component.ts index f655dcb9..6cc32f42 100644 --- a/Mohem/src/app/home/attendance-options/attendance-options.component.ts +++ b/Mohem/src/app/home/attendance-options/attendance-options.component.ts @@ -16,7 +16,8 @@ import { Response } from "src/app/hmg-common/services/models/response"; import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx"; import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; import { DevicePermissionsService } from 'src/app/hmg-common/services/device-permissions/device-permissions.service'; - +import { Geolocation } from '@ionic-native/geolocation/ngx'; +import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; @Component({ @@ -32,8 +33,15 @@ export class AttendanceOptionsComponent implements OnInit { public serviceEnableNFC = false; public serviceEnableQR = false; public serviceEnableWifi = false; + public enableLocationQR = false; + public enableLocationNFC = false; + public enableLocationWIFI = false; public deviceNFC = false; public nfcIOSSuccess = false; + public lat = 0; + public longt = 0; + public isFakeLocationUsed = false; + public deviceID: string; constructor( private nfc: NFC, @@ -47,7 +55,9 @@ export class AttendanceOptionsComponent implements OnInit { public ngZone: NgZone, private wifiWizard2: WifiWizard2, private openNativeSettings: OpenNativeSettings, - private devicePermissionsService:DevicePermissionsService + private devicePermissionsService:DevicePermissionsService, + private geolocation: Geolocation, + public backgroundGeolocation: BackgroundGeolocation ) {} ngOnInit() { @@ -59,7 +69,6 @@ export class AttendanceOptionsComponent implements OnInit { this.priviligeList = AuthenticationService.servicePrivilage; this.setServicesPrivilage(); this.checkNFCStatus("one"); - } async checkNFCStatus(checkValue: string) { @@ -110,6 +119,24 @@ export class AttendanceOptionsComponent implements OnInit { ) { this.serviceEnableWifi = true; } + if ( + servicePrivilage.Previlege && + servicePrivilage.ServiceName === "enableLocationQR" + ) { + this.enableLocationQR = true; + } + if ( + servicePrivilage.Previlege && + servicePrivilage.ServiceName === "enableLocationNFC" + ) { + this.enableLocationNFC = true; + } + if ( + servicePrivilage.Previlege && + servicePrivilage.ServiceName === "enableLocationWIFI" + ) { + this.enableLocationWIFI = true; + } } } @@ -130,6 +157,7 @@ export class AttendanceOptionsComponent implements OnInit { component: NfcModalComponent, showBackdrop: true, backdropDismiss: true, + componentProps:{ enableLocationNFC: this.enableLocationNFC, lat: this.lat, longt: this.longt}, }); modal.cssClass = "nfc-modal"; await modal.present(); @@ -138,12 +166,13 @@ export class AttendanceOptionsComponent implements OnInit { public swipeAttendanceNFC(nfcSerialCode: any) { const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); request.PointType = 2; - request.Latitude = 0; - request.Longitude = 0; + request.Latitude = this.lat; + request.Longitude = this.longt; request.QRValue = ""; request.NFCValue = nfcSerialCode; request.UID = this.device.uuid; request.UserName = this.userData.EMPLOYEE_NUMBER; + request.IsGpsRequired = this.enableLocationNFC; this.attendance_service .attendanceSwipeScanner(request, () => { console.log("Error inside in swipe attendance"); @@ -171,9 +200,28 @@ export class AttendanceOptionsComponent implements OnInit { } public startQRCode() { - this.attendScanService.getDeviceLocation(); + if (this.enableLocationQR) { + this.attendScanService.getDeviceLocation(); + } else { + this.attendScanService.attendance(false); + } } + public startNFCCode() { + if (this.enableLocationNFC) { + this.getDeviceLocation('NFC'); + } else { + this.checkNFCStatus('two'); + } + } + + public startWIFICode() { + if (this.enableLocationWIFI) { + this.getDeviceLocation('WIFI'); + } else { + this.startWifi(); + } + } // Wifi Attendance public async startWifi() { @@ -181,15 +229,14 @@ export class AttendanceOptionsComponent implements OnInit { const isIOS = this.platform.is("ios"); const isWifiEnabled = await this.wifiWizard2.isWifiEnabled(); - if(isIOS){ + if (isIOS) { if(!isWifiEnabled){ this.showWifiNotEnabled(); return; } - - }else if(isAndroid){ + } else if(isAndroid) { let locationPermission = await this.devicePermissionsService.requestLocationAutherization(); - if(!locationPermission){ + if (!locationPermission) { return; } @@ -198,30 +245,95 @@ export class AttendanceOptionsComponent implements OnInit { this.startWifi(); }).catch((err) => { console.debug(err); - this.showWifiNotEnabled(); }); return; - } } - + // opening wifi dailog if all above conditions are passed (isWifiEnabled == true) let modal = await this.modalController.create({ component: WifiModalComponent, showBackdrop: true, backdropDismiss: false, + componentProps:{ enableLocationWIFI: this.enableLocationWIFI, lat: this.lat, longt: this.longt}, }); modal.cssClass = "wifi-modal"; await modal.present(); } +} showWifiNotEnabled(){ this.common.showErrorMessageDialog(()=>{ - // this.openNativeSettings.open('wifi').then(()=>{}); }, this.ts.trPK("general", "ok"), this.ts.trPK("general","wifi-not-enable-text")); } - + + getDeviceLocation(source: string) { + this.isFakeLocationUsed = false; + this.devicePermissionsService.requestLocationAutherization().then(granted => { + this.location = granted as boolean; + if (this.location) { + if (this.platform.is('android')) { + this.backgroundGeolocation.getCurrentLocation({ timeout: 10000, enableHighAccuracy: true, maximumAge: 3000 }).then((resp) => { + if (resp && (resp.latitude && resp.longitude)) { + if (resp.isFromMockProvider || resp.mockLocationsEnabled) { + this.isFakeLocationUsed = true; + this.fakeSwipeAttendance(source); + } else { + this.lat = resp.latitude; + this.longt = resp.longitude; + if (source === 'WIFI') { + this.startWifi(); + } else if (source === 'NFC') { + this.checkNFCStatus('two'); + } + } + } else { + this.common.presentAlert(this.ts.trPK('home', 'position-error')); + } + }, (error) => { + this.common.presentAlert(this.ts.trPK('home', 'position-error')); + }); + } else { + this.geolocation.getCurrentPosition({maximumAge: 3000, timeout: 10000, enableHighAccuracy: true}).then(resp => { + if(resp && resp.coords.latitude && resp.coords.longitude) { + this.lat = resp.coords.latitude; + this.longt = resp.coords.longitude; + if (source === 'WIFI') { + this.startWifi(); + } else if (source === 'NFC') { + this.checkNFCStatus('two'); + } + } else { + this.common.presentAlert(this.ts.trPK('home', 'position-error')); + } + }).catch(error => { + this.common.presentAlert(this.ts.trPK('home', 'position-error')); + }); + } + } else { + return false; + } + }); + } + + fakeSwipeAttendance(sourceName: string) { + const request: any = {}; + request.Latitude = this.lat; + request.Longitude = this.longt; + request.QRValue = ''; + request.NFCValue = sourceName === 'NFC' ? sourceName : ''; + request.WifiValue = sourceName === 'WIFI' ? sourceName : ''; + request.UID = this.deviceID; + request.EmployeeID = this.userData.EMPLOYEE_NUMBER; + this.attendance_service.fakeAttendanceSwipeScanner(request, () => {console.log('Error inside in swipe attendance');}) + .subscribe((result: Response) => { + if (this.common.validResponse(result)) { + this.common.presentAlert(this.ts.trPK('home', 'fake-location')); + } + }); + } + } diff --git a/Mohem/src/app/home/models/attendanceSwipe.Request.ts b/Mohem/src/app/home/models/attendanceSwipe.Request.ts index c6a1e8bd..063d2b3a 100644 --- a/Mohem/src/app/home/models/attendanceSwipe.Request.ts +++ b/Mohem/src/app/home/models/attendanceSwipe.Request.ts @@ -18,6 +18,7 @@ export class attendanceSwipeScannerRequest extends Request{ public PointType: number; public NFCValue: string; public WifiValue: string; + public IsGpsRequired: boolean; } diff --git a/Mohem/src/app/home/nfc-modal/nfc-modal.component.ts b/Mohem/src/app/home/nfc-modal/nfc-modal.component.ts index 605b3e87..202e996f 100644 --- a/Mohem/src/app/home/nfc-modal/nfc-modal.component.ts +++ b/Mohem/src/app/home/nfc-modal/nfc-modal.component.ts @@ -19,6 +19,9 @@ export class NfcModalComponent implements OnInit { public userData: any = {}; public gifStatus = false; public nfcReader: any; + public enableLocationNFC: boolean; + public lat: number; + public longt: number; constructor( private nfc: NFC, @@ -34,6 +37,7 @@ export class NfcModalComponent implements OnInit { ngOnInit() { this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false); this.startAndroidNfc(); + console.log(this.enableLocationNFC); } ionViewDidLeave() { @@ -56,12 +60,13 @@ export class NfcModalComponent implements OnInit { this.nfcReader.unsubscribe(); const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); request.PointType = 2; - request.Latitude = 0; - request.Longitude = 0; + request.Latitude = this.lat; + request.Longitude = this.longt; request.QRValue = ""; request.NFCValue = nfcSerialCode; request.UID = this.device.uuid; request.UserName = this.userData.EMPLOYEE_NUMBER; + request.IsGpsRequired = this.enableLocationNFC; this.attendance_service.attendanceSwipeScanner(request, () => { console.log('Error inside in swipe attendance'); this.modalController.dismiss(); diff --git a/Mohem/src/app/home/wifi-model/wifi-modal.component.ts b/Mohem/src/app/home/wifi-model/wifi-modal.component.ts index 208682cf..6d8073d4 100644 --- a/Mohem/src/app/home/wifi-model/wifi-modal.component.ts +++ b/Mohem/src/app/home/wifi-model/wifi-modal.component.ts @@ -22,6 +22,9 @@ export class WifiModalComponent implements OnInit { private ssid = CommonService.MOHEMM_WIFI_SSID; private password = CommonService.MOHEMM_WIFI_PASSWORD; private algo = 'WPA'; + public enableLocationWIFI: boolean; + public lat: number; + public longt: number; constructor( public common: CommonService, @@ -77,7 +80,7 @@ export class WifiModalComponent implements OnInit { console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_); setTimeout(() => { this.swipeAttendanceWifi(ssid_); - },2000); + },6000); }else{ this.showErrorInvalidWorkspace(); } @@ -134,13 +137,14 @@ export class WifiModalComponent implements OnInit { async swipeAttendanceWifi(code:any) { const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); request.PointType = 3; - request.Latitude = 0; - request.Longitude = 0; + request.Latitude = this.lat; + request.Longitude = this.longt; request.QRValue = ""; request.NFCValue = ""; request.WifiValue = "100"; request.UID = this.device.uuid; request.UserName = this.userData.EMPLOYEE_NUMBER; + request.IsGpsRequired = this.enableLocationWIFI; this.attendance_service .attendanceSwipeScanner(request, () => { diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html index 6fec7db6..a174e010 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -1,582 +1,592 @@ - - -
-
{{getPassNotificationDetails.SUBJECT}}
+ +
+
{{getPassNotificationDetails.SUBJECT}}
- - + + - - {{'worklistMain , itemReq'| translate}} - + + {{'worklistMain , itemReq'| translate}} + - - - {{'worklistMain, action' | translate}} - + + + {{'worklistMain, action' | translate}} + - - + + {{'worklistMain, attach-file' | translate}} - + - - {{'worklistMain , info'| translate}} - - + + {{'worklistMain , info'| translate}} + + + + + + + - - -
{{pInformation}}
+
+ - - - - - - - -
- - -
+ + - - -
- - -
-
- - - -
+
- - - - - -
+ - - -
- - - - - - -
- - - -
- - -
- - - -
-
- + + + +
+ + {{notificationList.ITEM_CODE}} +
+ + + + + +
+ + {{notificationList.UOM}} +
+
+ + + + + +
+ + {{notificationList.QUANTITY}} - - - -
+
+ + +
+ + {{notificationList.DATE_REQUIRED}} +
+
- - -
-
+ - -
+ - - + + +
+ + {{notificationList.LINE_STATUS}} +
- - -
+ + +
+ + {{notificationList.STATUS_DATE}} +
- -
-
+ -
-
+ + + +
+ + {{notificationList.TRANSACTION_TYPE_NAME}} +
- -
- - -
{{totalH}}
-
{{valueH}}
+ + +
+ + {{notificationList.OPERATING_UNIT}} +
-
- -
{{taxH}}
-
{{taxvalueH}}
-
-
+ -
-
+ + + +
+ + {{notificationList.ORGANIZATION_CODE}} +
+ + +
+ + {{notificationList.ORGANIZATION_NAME}} +
+
+ + + + + +
+ + {{notificationList.FROM_SUBINVENTORY}} +
+ + + +
+ + {{notificationList.FROM_LOCATOR}} +
- - + - + + +
+ + {{notificationList.TO_SUBINVENTORY}} +
+ + +
+ + {{notificationList.TO_LOCATOR}} +
- - - - - - - - +
+ -
- - - - + + +
+ + {{notificationList.SHIP_TO_LOCATION}} +
+ -
+ - - - - - - -
- - {{notificationList.ITEM_CODE}} -
- - - - - -
- - {{notificationList.UOM}} -
-
- - - - - -
- - {{notificationList.QUANTITY}} - -
- - -
- - {{notificationList.DATE_REQUIRED}} -
-
- - - - - - - - -
- - {{notificationList.LINE_STATUS}} -
- - - -
- - {{notificationList.STATUS_DATE}} -
- -
- - - - - - -
- - {{notificationList.TRANSACTION_TYPE_NAME}} -
- - - -
- - {{notificationList.OPERATING_UNIT}} -
- - -
- - - - -
- - {{notificationList.ORGANIZATION_CODE}} -
- - - -
- - {{notificationList.ORGANIZATION_NAME}} -
-
- - - - - -
- - {{notificationList.FROM_SUBINVENTORY}} -
+ - - -
- - {{notificationList.FROM_LOCATOR}} -
+
+ +
- - -
- - {{notificationList.TO_SUBINVENTORY}} -
- - -
- - {{notificationList.TO_LOCATOR}} -
+
+
-
- +
+
+
+ +
+
+ + + - - -
- - {{notificationList.SHIP_TO_LOCATION}} -
+ + -
+ + + + - +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ - +
-
+ + +
+ + +
+
+ + {{actionHistory.NAME}} + - -
- -
- +
+ +
+
+ + {{actionHistory.ACTION}} + + {{actionHistory.NOTIFICATION_DATE| dateString }} +
+ +
+
- - - - -
- - - - - - - - - - - - - -
-

{{ 'general, empty' | translate}}

-
-
- -
- -
+ + + + + + + + + + + + +
+

{{ 'general, notAttch' | translate}}

+
+
- + + {{i+1 }}. {{attachList.FILE_NAME}} - - + - -
--> + -
- - -
-
- - {{actionHistory.NAME}} - - -
-
-
- Note: {{actionHistory.NOTE}} -
-
+
+ + + + -
+ + + + + +
{{pInformation}}
+
+
+ + + + + + + + + +
+ + +
-
- Note: {{actionHistory.NOTE}} + + +
+ + +
+ + + + + +
+ + + +
+ + + +
+ + + +
+
+ + + + + + +
+ + + +
+ + +
+ + + +
+
+ + + + + +
+ + + +
+
+ + + +
+ + + + + + +
+ + +
+
- +
-
-
- + +
+ + +
{{totalH}}
+
{{valueH}}
- {{actionHistory.ACTION}} +
+ +
{{taxH}}
+
{{taxvalueH}}
+
+
- - {{actionHistory.NOTIFICATION_DATE| dateString }} - - -
- -
+
+ - - -
-
- -
- - - - -
-

{{ 'general, notAttch' | translate}}

-
-
- - - - - - {{i+1 }}. {{attachList.FILE_NAME}} - - - - - - - - -
-
-
-
- - - - - - - - - -
-
-
-
-
-
- - - + + + + + + + + + + + + + + + + + + + + +
+
-
{{'worklistMain, Tran_Succ' | translate}}
-
+
+ + +
+
+ + + + + +
{{'worklistMain, Tran_Succ' | translate}}
+
+
@@ -641,38 +651,38 @@ - {{approve_label}} - + {{approve_label}} + - {{close_label}} - + {{close_label}} + - {{reject_label}} + {{reject_label}} - {{reqInfo_label}} + {{reqInfo_label}} - {{'worklistMain, skip' | translate}} + {{'worklistMain, skip' | translate}} - {{'worklistMain, more' | translate}} + {{'worklistMain, more' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss index dc67036f..df2dc68f 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss @@ -105,4 +105,10 @@ // font-weight: bold; // } - \ No newline at end of file +.no-padding-label { + padding: 0px !important; +} + +.margin-left { + margin-left: 30px; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index a00287ea..cc535bac 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ElementRef } from '@angular/core'; +import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { WorkListBodyRequest } from '../models/NotificationBodyReq'; @@ -35,6 +35,7 @@ import { MOItemHistoryRes } from '../models/MOItemHistoryRes'; import { MOItemHistoryReq } from '../models/MOItemHistoryReq'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { IonSlides } from '@ionic/angular'; @Component({ selector: 'app-worklist-main-mr', @@ -43,6 +44,7 @@ import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbore }) export class WorklistMainMRComponent implements OnInit { + @ViewChild('slides') slides: IonSlides; private WorkListBodyObj: WorkListBodyRequest; private WorkListButtonsObj: WorkListButtonRequest; private WorkListActionObj: WorkListActionRequest; @@ -141,12 +143,57 @@ export class WorklistMainMRComponent implements OnInit { this.WorkListAttachObj = new WorkListButtonRequest(); this.intializeNotificationDetail(); + } + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + if(this.activeSegment === 'item-req') + { + this.slides.slideTo(0); + } + else if(this.activeSegment === 'action-history') + { + this.slides.slideTo(1); + } + else if(this.activeSegment === 'attach') + { + this.slides.slideTo(2); + } + else if(this.activeSegment === 'info') + { + this.slides.slideTo(3); + } + console.log(" event.detail.value: " + event.detail.value); + } - + public slideChanged(event: any) { + this.slides.getActiveIndex().then(index => { + console.log(index); + console.log(event); + if(index === 0) + { + this.activeSegment = 'item-req'; + } + else if(index === 1) + { + this.activeSegment = 'action-history'; + } + else if(index === 2) + { + this.activeSegment = 'attach'; + } + else if(index === 3) + { + this.activeSegment = 'info'; + } + console.log(this.activeSegment); + }); } - public segmentChanged(event: any) { + + + + public segmentChanged1(event: any) { this.activeSegment = event.detail.value; console.log(' event.detail.value: ' + event.detail.value); } diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html index 1d129790..1ca7ee25 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -1,815 +1,574 @@ - + - -
+ +
{{getPassNotificationDetails.SUBJECT}}
- - + + - {{'worklistMain,itemReq'| translate}} - - + {{'worklistMain,itemReq'| translate}} + + - {{'worklistMain, action' | translate}} - + [ngClass]="activeSegment == 'action-history' ? 'active-Segment' : 'normal-Segment'"> + {{'worklistMain, action' | translate}} + - - {{'worklistMain, attach-file' | translate}} - + + {{'worklistMain, attach-file' | translate}} + - - {{'worklistMain, info'| translate}} - + + {{'worklistMain, info'| translate}} + - - - - - - - - -
{{pInformation}}
- - - - - - - - -
- - -
- - - -
- - -
-
- - - - -
- - -
- - - -
- - - -
-
- - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - -
- - -
- - - - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - - -
- - -
- - - -
- - -
-
- - - -
- - -
- - - -
- - -
-
- - - - -
- - -
- -
- - -
-
- - - - -
- - -
{{totalH}}
-
{{valueH}}
- -
- -
{{taxH}}
-
{{taxvalueH}}
- -
-
- -
-
- - - -
- - - - -
- - - -
- -
- - - - -
-

{{ 'general, empty' | translate}}

-
- - - - - - - - - + + + +
+

{{ 'general, empty' | translate}}

+
+ +
- - - - - - - - -
- - {{Lines.ITEM_CODE}} -
- - -
- - {{Lines.MFG}} * -
- - -
- - - -
- - {{Lines.LINE_TYPE}} -
- - - -
- - {{Lines.UOM}} -
- - - - -
- - - - -
- - {{Lines.UNIT_PRICE}} - -
- - -
- - {{Lines.LINE_AMOUNT}} -
- - - - -
- - - - -
- - {{Lines.QUANTITY}} - -
- - -
- - {{Lines.LINE_DISC_PERCENTAGE}} -
- - - - - -
- - - - -
- - {{Lines.NEED_BY_DATE}} - -
- - -
- - {{Lines.PROMISED_DATE}} -
- - - - - -
- - - - -
- - {{Lines.DELIVER_TO_LOCATION}} - -
- - -
- - {{Lines.PR_NUM}} -
- - - - - -
- - - - - -
- - {{Lines.REQUESTOR}} - -
- - - - + + + + +
+ {{Lines.ITEM_CODE}} +
+ + +
+ {{Lines.MFG}} * +
+
+ + + +
+ {{Lines.LINE_TYPE}} +
+ + +
+ {{Lines.UOM}} +
+
+ + + +
+ {{Lines.UNIT_PRICE}} +
+ + +
+ {{Lines.LINE_AMOUNT}} +
+
+ + + +
+ {{Lines.QUANTITY}} +
+ + +
+ {{Lines.LINE_DISC_PERCENTAGE}} + +
+
+ + + +
+ {{Lines.NEED_BY_DATE}} +
+ + +
+ {{Lines.PROMISED_DATE}} +
+
+ + + +
+ {{Lines.DELIVER_TO_LOCATION}} + +
+ + +
+ {{Lines.PR_NUM}} +
+
+ + + +
+ {{Lines.REQUESTOR}} +
+
+ + +
+ +
+
+ +
+ +
+
+
+
+
+
+
+
+
+ + - + + - +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+ +
+ + +
+
+ + + {{actionHistory.NAME}} + - +
+
+
+
+ Note: {{actionHistory.NOTE}} +
+
-
- -
- +
+ Note: {{actionHistory.NOTE}} - - -
+
+ - -
+
+
-
+
+ {{actionHistory.ACTION}} - -
- -
-
- - - - - - - -
- - - - - -
-

{{ 'general, empty' | translate}}

-
-
- -
- + {{actionHistory.NOTIFICATION_DATE| + dateString }} + + + +
+
+
+ + +
+ +
+
+ + + + + + +
+

{{ 'general, notAttch' | translate}}

+
+
-
+ + + + {{i+1}}. {{attachList.FILE_NAME}} - -
- -
-
- - {{actionHistory.NAME}} - - -
-
-
-
- Note: {{actionHistory.NOTE}} -
-
- - -
- -
- Note: {{actionHistory.NOTE}} - - -
- - -
-
- -
- - - {{actionHistory.ACTION}} - - - {{actionHistory.NOTIFICATION_DATE| dateString }} -
-
- -
- - - - - - - - - -
-

{{ 'general, notAttch' | translate}}

-
-
- - - - - - {{i+1}}. {{attachList.FILE_NAME}} - - - - - - - - -
-
-
-
- - - - +
+ +
+ + +
{{totalH}} +
+
{{valueH}}
+
+ +
{{taxH}} +
+
{{taxvalueH}}
+
+
+
+
+ + + + + +
+ + + + + + -
-
-
-
-
-
- - - - -
{{'worklistMain, Tran_Succ' | translate}}
+
- - - - - - - - - - - - - - - - + + + + + + {{approve_label}} - + - - + - + {{close_label}} + - {{approve_label}} - + + + {{reject_label}} - - - - {{close_label}} + + + {{reqInfo_label}} + + + + {{'worklistMain, skip' | translate}} + + + + {{'worklistMain, more' | translate}} - - - - - {{reject_label}} - - - - - {{reqInfo_label}} - - - - - - {{'worklistMain, skip' | translate}} - - - - - {{'worklistMain, more' | translate}} - - - + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss index a321bdf4..684ed13a 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss @@ -107,4 +107,11 @@ // padding-top: 10px; // font-weight: bold; // } - \ No newline at end of file + +.no-padding-label { + padding: 0px !important; +} + +.margin-left { + margin-left: 30px; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index c459c4b0..cdc5f505 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ElementRef } from "@angular/core"; +import { Component, OnInit, ElementRef, ViewChild } from "@angular/core"; import { CommonService } from "src/app/hmg-common/services/common/common.service"; import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; import { WorkListBodyRequest } from "../models/NotificationBodyReq"; @@ -37,6 +37,7 @@ import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/ import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; +import { IonSlides } from '@ionic/angular'; @Component({ selector: 'app-worklist-main-po', @@ -44,6 +45,7 @@ import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbo styleUrls: ['./worklist-main-po.component.scss'], }) export class WorklistMainPoComponent implements OnInit { + @ViewChild('slides') slides: IonSlides; private WorkListBodyObj: WorkListBodyRequest; private WorkListButtonsObj: WorkListButtonRequest; private WorkListActionObj: WorkListActionRequest; @@ -148,14 +150,59 @@ export class WorklistMainPoComponent implements OnInit { } ngOnInit() { - this.WorkListAttachObj = new WorkListButtonRequest(); - this.intializeNotificationDetail(); + }//ngOn + + + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + if(this.activeSegment === 'line_details') + { + this.slides.slideTo(0); + } + else if(this.activeSegment === 'action-history') + { + this.slides.slideTo(1); + } + else if(this.activeSegment === 'attach') + { + this.slides.slideTo(2); + } + else if(this.activeSegment === 'info') + { + this.slides.slideTo(3); + } + console.log(" event.detail.value: " + event.detail.value); + } + + public slideChanged(event: any) { + this.slides.getActiveIndex().then(index => { + console.log(index); + console.log(event); + if(index === 0) + { + this.activeSegment = 'line_details'; + } + else if(index === 1) + { + this.activeSegment = 'action-history'; + } + else if(index === 2) + { + this.activeSegment = 'attach'; + } + else if(index === 3) + { + this.activeSegment = 'info'; + } + console.log(this.activeSegment); + }); + } + - }//ngOn intializeNotificationDetail() { this.approveDis = false; this.rejectDis = false; @@ -211,7 +258,7 @@ export class WorklistMainPoComponent implements OnInit { } } - public segmentChanged(event: any) { + public segmentChanged1(event: any) { this.activeSegment = event.detail.value; console.log(" event.detail.value: " + event.detail.value); } diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html index da469ac2..45631bc9 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -1,424 +1,297 @@ - + - -
-
{{getPassNotificationDetails.SUBJECT}}
- - - - - - {{'worklistMain, itemReq'| translate}} - - - {{'worklistMain, action' | translate}} - - - - {{'worklistMain, attach-file' | translate}} + +
+
{{getPassNotificationDetails.SUBJECT}}
+ + + + + + {{'worklistMain, itemReq'| translate}} + + + {{'worklistMain, action' | translate}} + + + + {{'worklistMain, attach-file' | translate}} - - - - {{'worklistMain, info'| translate}} - - - - - - -
{{pInformation}}
- - - - - - - - - -
- - -
- - - -
- - - -
-
- - - - -
- - - -
- - - -
- - - -
-
- - - -
- - - -
- - - - -
- - - -
-
- - - - - -
- - - - - - -
- - -
-
- -
-
- - - - -
- - -
{{totalH}}
-
{{valueH}}
- -
- -
{{taxH}}
-
{{taxvalueH}}
- -
-
- -
-
- - - -
- - -
- - - -
- - -
- - - - - -
-

{{ 'general, empty' | translate}}

-
- - - + + + {{'worklistMain, info'| translate}} + + - - - - - -
- - - - - -
- - {{Lines.COST_CENTER}} -
- - - - -
- - {{Lines.ITEM_CODE}} -
-
- - - -
- - {{Lines.UOM}} -
- - - - -
- - {{Lines.UNIT_PRICE}} - -
-
- - - -
- - {{Lines.LINE_AMOUNT}} -
- - - - - -
- - {{Lines.QUANTITY}} -
- -
- - - - -
- - {{Lines.ITEM_AMU}} -
-
-
-
-
- -
- - - - -
-

{{ 'general, empty' | translate}}

-
-
- -
- - -
- - - -
- - - -
-
- - - {{actionHistory.NAME}} - - -
-
-
-
- Note: {{actionHistory.NOTE}} + + +
+ {{Lines.ITEM_CODE}} +
+ + + + +
+ {{Lines.UOM}} +
+ + +
+ {{Lines.UNIT_PRICE}} +
+
+ + + +
+ {{Lines.LINE_AMOUNT}} +
+ + +
+ {{Lines.QUANTITY}} +
+
+ + + +
+ {{Lines.ITEM_AMU}} +
+
+
+ + + + + + + + + +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ +
+
+ +
- - -
- -
- Note: {{actionHistory.NOTE}} - - + + + {{actionHistory.NAME}} + +
+
+
+
+ Note: {{actionHistory.NOTE}} +
+
+
+
+ Note: {{actionHistory.NOTE}} +
+ +
+
- - -
-
- - - - - + {{actionHistory.ACTION}} + + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + +
- - - {{actionHistory.ACTION}} - - - - {{actionHistory.NOTIFICATION_DATE| dateString }} - - -
- -
- - - - - - - - + +
+ + + + + + + + + -
-

{{ 'general, notAttch' | translate}}

-
- -
- - - - - - {{i+1}}. {{attachList.FILE_NAME}} + + + + - + + + + + + +
{{pInformation}}
+
+
+ + + + + + + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+
+ + + +
+ +
+
+
+
+ +
+ + +
{{totalH}}
+
{{valueH}}
+
+ +
{{taxH}}
+
{{taxvalueH}}
+
+
+
+
+
+ +
+
+
+
+
+
+
+ -
-
-
-
-
-
- - -
-
+ + +
+
+
+
+
+
+ + + + +
{{'worklistMain, Tran_Succ' | translate}}
- -
-
- - - - -
{{'worklistMain, Tran_Succ' | translate}}
-
+
@@ -487,41 +360,41 @@ - {{approve_label}} - + {{approve_label}} + - {{close_label}} + {{close_label}} - {{reject_label}} + {{reject_label}} - {{reqInfo_label}} + {{reqInfo_label}} - {{'worklistMain, skip' | translate}} + {{'worklistMain, skip' | translate}} - - + + - {{'worklistMain, more' | translate}} + {{'worklistMain, more' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss index 74a23cee..be89a485 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss @@ -103,4 +103,12 @@ // text-align: center; // padding-top: 10px; // font-weight: bold; -// } \ No newline at end of file +// } + +.no-padding-label { + padding: 0px !important; +} + +.margin-left { + margin-left: 30px; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index 3cbbbcd4..fca6e90b 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ElementRef } from '@angular/core'; +import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { WorkListBodyRequest } from '../models/NotificationBodyReq'; @@ -33,6 +33,7 @@ import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/ import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; +import { IonSlides } from '@ionic/angular'; @Component({ selector: 'app-worklist-main-pr', @@ -40,6 +41,7 @@ import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbo styleUrls: ['./worklist-main-pr.component.scss'], }) export class WorklistMainPRComponent implements OnInit { + @ViewChild('slides') slides: IonSlides; public isPostNoLoad = true; public worklistNotifications: any; public totalRequestCount = 0; @@ -138,13 +140,53 @@ export class WorklistMainPRComponent implements OnInit { this.WorkListAttachObj = new WorkListButtonRequest(); this.intializeNotificationDetail(); + } - - + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + if(this.activeSegment === 'item-req') + { + this.slides.slideTo(0); + } + else if(this.activeSegment === 'action-history') + { + this.slides.slideTo(1); + } + else if(this.activeSegment === 'attach') + { + this.slides.slideTo(2); + } + else if(this.activeSegment === 'info') + { + this.slides.slideTo(3); + } + console.log(" event.detail.value: " + event.detail.value); } - + public slideChanged(event: any) { + this.slides.getActiveIndex().then(index => { + console.log(index); + console.log(event); + if(index === 0) + { + this.activeSegment = 'item-req'; + } + else if(index === 1) + { + this.activeSegment = 'action-history'; + } + else if(index === 2) + { + this.activeSegment = 'attach'; + } + else if(index === 3) + { + this.activeSegment = 'info'; + } + console.log(this.activeSegment); + }); + } intializeNotificationDetail() { @@ -209,7 +251,7 @@ export class WorklistMainPRComponent implements OnInit { this.getPRNotificationDetails(this.WorkListBodyObj); } } - public segmentChanged(event: any) { + public segmentChanged1(event: any) { this.activeSegment = event.detail.value; console.log(' event.detail.value: ' + event.detail.value); } diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index c4ac77fc..f465522b 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -308,72 +308,74 @@ -
{{pInformation}}
- -
- - -
- - - -
- -
-
-
-
- -
-
- - -
- {{ts.trPK('worklistMain','employee-on-leave')}}
- - - + + + +
{{pInformation}}
+
+
- -
- - -
- - - - -
-
-
- - - - -
-
- - - -
- -
- - -
- -
-
-
-
+ + +
+ + +
+ + + +
+ +
+
+
+
+
+
+
+ {{ts.trPK('worklistMain','employee-on-leave')}} +
+ + +
+ + +
+ + + +
+
+
+ + + +
+
+ + +
+ +
+ +
+ +
+
+
+
+
+
+ +
diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.html b/Mohem/src/app/profile/edit-profile/edit-profile.component.html index 5f2cdb05..32b4dd9d 100644 --- a/Mohem/src/app/profile/edit-profile/edit-profile.component.html +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.html @@ -27,24 +27,63 @@
- -
+ +
+ + + + + - -
+ + + + + + + + + + + + +
+ +
- -
+ + + + + + + + + + + + +
+ +
- -
+ + + + + + + + + +
- -
diff --git a/Mohem/src/app/profile/edit-profile/edit-profile.component.scss b/Mohem/src/app/profile/edit-profile/edit-profile.component.scss index ccb2a610..4d784a03 100644 --- a/Mohem/src/app/profile/edit-profile/edit-profile.component.scss +++ b/Mohem/src/app/profile/edit-profile/edit-profile.component.scss @@ -1,11 +1,19 @@ .list-ios { + // margin-left: 0; + // margin-right: 0; + // margin-top: 32px; + // margin-bottom: 32px; + // background: var(--ion-item-background,var(--ion-background-color,#fff)); margin-left: 0; margin-right: 0; - margin-top: 32px; + margin-top: -15px; margin-bottom: 32px; - background: var(--ion-item-background,var(--ion-background-color,#fff)); + border: 1px solid #d8d8d8; + background: var(--ion-item-background, var(--ion-background-color, #fff)); + border-radius: 10px; + padding-top: 60px; } .header-toolbar-new{ @@ -76,33 +84,38 @@ } - .gridService{ - - // background-color: #269DB8; + .gridService-en{ margin-top: 87px; border-radius: 10px; margin-bottom: -49px; - margin-left: 14px; - margin-right: 14px; - + margin-left: 30px; + margin-right: 30px; + } + .gridService-ar{ + margin-top: 87px; + border-radius: 10px; + margin-bottom: -49px; + margin-left: 17px; + margin-right: 17px; } + .columns{ - margin: 10px; - background: #269DB8; - border-radius: 27px; - padding-left: 30px; - padding-right: 6px; - padding-top: 19px; - padding-bottom: 26px; + // margin: 10px; + // background: #0B4775; + // border-radius: 27px; + // padding-left: 30px; + // padding-right: 6px; + // padding-top: 19px; + // padding-bottom: 26px; } .columns-ar{ - margin: 10px; - background: #269DB8; - border-radius: 27px; - padding-left: 7px; - padding-right: 3px; - padding-top: 19px; - padding-bottom: 26px; + // margin: 10px; + // background: #0B4775; + // border-radius: 27px; + // padding-left: 7px; + // padding-right: 3px; + // padding-top: 19px; + // padding-bottom: 26px; } .service{ @@ -125,7 +138,7 @@ margin-right: 26px; } .services-ar{ - font-size: 14px; + font-size: 20px; color: white; margin-right: 25px; } @@ -134,8 +147,8 @@ margin-left: 14px; margin-right: 14px; border-radius: 10px; - background: white; - border: solid #bebbbb !important; + // background: white; + border:#bebbbb !important; padding: 2px; } .p{ @@ -183,4 +196,21 @@ color: grey; -webkit-transform: rotate(180deg); transform: rotate(180deg); - } \ No newline at end of file + } + + .verticalLine { + width:1%; + height:50px; + background:white; + margin-top: 100%; + // margin-left: 10%; +} + +.service-row-en{ + width: 79%; + margin: -12px 0px 0px 35px; +} +.service-row-ar{ + width: 95%; + margin: -12px 0px 35px 0px; +} \ No newline at end of file diff --git a/Mohem/src/app/profile/home/home.component.scss b/Mohem/src/app/profile/home/home.component.scss index 23f91321..e8143682 100644 --- a/Mohem/src/app/profile/home/home.component.scss +++ b/Mohem/src/app/profile/home/home.component.scss @@ -33,6 +33,7 @@ ion-col.colBold, ion-col.colBold > label{ border-radius: 50% !important; position: relative; color: #7f8c8d; + height: 35px; } @@ -45,7 +46,7 @@ ion-col.colBold, ion-col.colBold > label{ .changeImgBtn-ar{ position: absolute; top: 80%; - left: 74%; + left: 66%; } .profileImg{ width: 160px; diff --git a/Mohem/src/assets/imgs/IDTOP.png b/Mohem/src/assets/imgs/IDTOP.png new file mode 100644 index 00000000..edcdad43 Binary files /dev/null and b/Mohem/src/assets/imgs/IDTOP.png differ diff --git a/Mohem/src/assets/imgs/IDTOP_HMG.png.png b/Mohem/src/assets/imgs/IDTOP_HMG.png.png new file mode 100644 index 00000000..75ac031d Binary files /dev/null and b/Mohem/src/assets/imgs/IDTOP_HMG.png.png differ diff --git a/Mohem/src/assets/imgs/ID_ico.png b/Mohem/src/assets/imgs/ID_ico.png new file mode 100644 index 00000000..0fefb6bc Binary files /dev/null and b/Mohem/src/assets/imgs/ID_ico.png differ diff --git a/Mohem/src/assets/imgs/ID_ico_menu.png b/Mohem/src/assets/imgs/ID_ico_menu.png new file mode 100644 index 00000000..68fb7339 Binary files /dev/null and b/Mohem/src/assets/imgs/ID_ico_menu.png differ diff --git a/Mohem/src/assets/imgs/profilePic.png b/Mohem/src/assets/imgs/profilePic.png new file mode 100644 index 00000000..b6b1a4a4 Binary files /dev/null and b/Mohem/src/assets/imgs/profilePic.png differ diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index ac593c6b..4ec28a25 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -932,12 +932,20 @@ "ar": "إلغاء" }, "wifi-connect-message": { - "en": "Please wait", - "ar": "أرجو الإنتظار" + "en": "Connecting", + "ar": "توصيل" }, "success-attendance": { "en": "Your attendance is marked successfully.", "ar": "تم تسجيل حضورك بنجاح" + }, + "digital-id":{ + "en":"Employee Digital ID", + "ar":"هوية الموظف الرقمية" + }, + "appreciate-service":{ + "en":"We appreciate you for completing the service of", + "ar":"نحن نقدر لك استكمال خدمة" } }, "home": { @@ -1060,8 +1068,8 @@ "ar": "بحث متقدم" }, "No-data-available": { - "en": "No Data Available", - "ar": "لا يوجد بيانات" + "en": "No History Available", + "ar": "لا يوجد محفوظات متاحة" } }, "userProfile": { diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index 35c54fcc..ff3befe8 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -1545,3 +1545,11 @@ table.monthview-datetable th small { .disable-button-opacity { opacity: .2; } + + .digital-id-modal-css .modal-wrapper { + height: 90%; + width: 90%; + top: 3%; + position: absolute; + display: block; + } \ No newline at end of file diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss index a97d89c7..6d003cfc 100644 --- a/Mohem/src/theme/worklist.scss +++ b/Mohem/src/theme/worklist.scss @@ -16,6 +16,7 @@ .itemReqList{ background: #f0efef; margin-top: 20px; + width: 100%; // width: 95%; // margin-left:9px