-
{{curentDate}}
{{ts.trPK('attendance-tracking','today-time-left')}}
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 23bcf302..065e2fb1 100644
--- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts
+++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts
@@ -360,6 +360,11 @@ export class ConfirmLoginComponent implements OnInit {
this.authService.checkSMS(request, () => {}, this.ts.trPK('general', 'ok'))
.subscribe((result: SMSCheckResponse) => {
if (this.cs.validResponse(result)) {
+
+ // Wifi Credientials
+ CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
+ CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
+
AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts
index e85917ac..88a625f5 100644
--- a/Mohem/src/app/authentication/login/login.component.ts
+++ b/Mohem/src/app/authentication/login/login.component.ts
@@ -100,8 +100,7 @@ export class LoginComponent implements OnInit, OnDestroy {
ngOnInit() {
this.monitorKeyboardChange();
this.currentLang = TranslatorService.getCurrentLanguageCode();
- console.log(TranslatorService.CURRENT_LANGUAGE)
- console.log(TranslatorService.EN)
+
if (TranslatorService.CURRENT_LANGUAGE == TranslatorService.EN) {
this.language = "US";
this.changeLanguage('2')
@@ -109,11 +108,9 @@ export class LoginComponent implements OnInit, OnDestroy {
this.language = "AR";
this.changeLanguage('1')
}
- console.log("current lang: "+this.currentLang);
- this.events.subscribe('user', user => {
- this.user = user;
- });
- this.deviceToken =this.cs.getDeviceToken();
+
+ this.events.subscribe('user', user => { this.user = user; });
+ this.deviceToken = this.cs.getDeviceToken();
if (this.deviceToken) {
console.log('login enabled first time: ' + this.deviceToken);
} else {
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.ts b/Mohem/src/app/authentication/sms-page/sms-page.page.ts
index 2659c184..5bdfe570 100644
--- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts
+++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts
@@ -192,6 +192,11 @@ export class SmsPageComponent implements OnInit {
request.IsDeviceNFC = this.isNFCAvailable;
this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
if (this.common.validResponse(result)) {
+
+ // Wifi Credientials
+ CommonService.MOHEMM_WIFI_SSID = result.Mohemm_Wifi_SSID;
+ CommonService.MOHEMM_WIFI_PASSWORD = result.Mohemm_Wifi_Password;
+
AuthenticationService.servicePrivilage = result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {
localStorage.setItem('emp-name', result.MemberInformationList[0].EMPLOYEE_NAME);
diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts
index 2ba34058..7d6e752e 100644
--- a/Mohem/src/app/hmg-common/hmg-common.module.ts
+++ b/Mohem/src/app/hmg-common/hmg-common.module.ts
@@ -4,7 +4,7 @@ import { Globalization } from '@ionic-native/globalization/ngx';
import { NumberRangeComponent } from './ui/number-range/number-range.component';
import { IonicModule } from '@ionic/angular';
import { CommonModule } from '@angular/common';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { FormsModule } from '@angular/forms';
import { SSpacerComponent } from './ui/spacer/s-spacer/s-spacer.component';
import { MSpacerComponent } from './ui/spacer/m-spacer/m-spacer.component';
import { LSpacerComponent } from './ui/spacer/l-spacer/l-spacer.component';
@@ -33,7 +33,6 @@ import { KeysPipe } from './pipes/keys/keys.pipe';
import { SegmentContentComponent } from './ui/segment-content/segment-content.component';
import { GraphComponent } from './ui/graph/graph.component';
import { NgxChartsModule } from '@swimlane/ngx-charts';
-
import { ExpandableComponent } from './ui/expandable/expandable.component';
import { ProjectsService } from './services/projects/projects.service';
import { NationalityService } from './services/nationality/nationality.service';
@@ -43,8 +42,6 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service';
import { BarChartComponent } from './ui/bar-chart/bar-chart.component';
import { DonutChartComponent } from './ui/donut-chart/donut-chart.component';
-// import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service';
-// import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { EmailComponent } from './ui/email/email.component';
import { Badge } from '@ionic-native/badge/ngx';
import { PushService } from './services/push/push.service';
@@ -53,15 +50,12 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service';
import { GuidService } from './services/guid/guid.service';
import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component';
import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component';
-// import { GeofencingService } from './services/geofencing/geofencing.service';
-// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { ButtonComponent, Modal } from './ui/button/button.component';
import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component';
import { ListboxModule } from 'primeng/listbox';
import { GenderSelectComponent } from './ui/gender-select/gender-select.component';
import { DateSelectComponent } from './ui/date-select/date-select.component';
import { ToggleButtonComponent } from './ui/toggle-button/toggle-button.component';
-import { Footer } from 'primeng/components/common/shared';
import { FooterComponent } from './ui/footer/footer.component';
import { ScrollContentComponent } from './ui/scroll-content/scroll-content.component';
import { ScrollSegmentContentComponent } from './ui/scroll-segment-content/scroll-segment-content.component';
@@ -82,20 +76,16 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { DetailButtonComponent } from './ui/detail-button/detail-button.component';
import { RouterModule } from '@angular/router';
import { HeaderButtonComponent } from './ui/header-button/header-button.component';
-// import { CallNumber } from '@ionic-native/call-number/ngx';
import { AppRate } from '@ionic-native/app-rate/ngx';
import { RatingService } from './services/rating/rating.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service';
-// import { PaymentComponent } from './ui/payment/payment.component';
-// import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { FileUploadModule } from 'ng2-file-upload';
-// import { FileSelectDirective } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
-import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
+import {Camera} from '@ionic-native/Camera/ngx';
import {File} from '@ionic-native/file/ngx';
import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
@@ -120,6 +110,7 @@ import { ChartModule } from 'primeng/chart';
import { GenericHeaderComponent } from './ui/generic-header/generic-header.component';
import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { AttendanceOptionsComponent } from '../home/attendance-options/attendance-options.component';
+
@NgModule({
imports: [
CommonModule,
@@ -153,7 +144,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DatePipeTransform,
DateTimePipe,
SafeHtmlPipe,
- // TurncatePipe,
BackButtonComponent,
IfDatePipe,
DynamicTableComponent,
@@ -188,7 +178,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
- // FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@@ -219,7 +208,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DividerComponent,
NavButtonsComponent,
DatePipeTransform,
- // TurncatePipe,
TranslatePipe,
DateTimePipe,
SafeHtmlPipe,
@@ -254,7 +242,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
DetailButtonComponent,
HeaderButtonComponent,
ReplacementListComponent,
- // FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
@@ -293,14 +280,10 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
NativeStorage,
ProgressLoadingService,
PushService,
- // UserLocalNotificationService,
- // LocalNotifications,
Badge,
LifeCycleService,
HmgBrowserService,
GuidService,
- // BackgroundGeolocation,
- // GeofencingService,
Keyboard,
KeyboardService,
Diagnostic,
@@ -315,7 +298,6 @@ import { AttendanceOptionsComponent } from '../home/attendance-options/attendanc
RateService,
Camera,
File,
- // PaymentService,
MenuService,
OpenNativeSettings,
BarcodeScanner,
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 c1bdc43a..2bdcc8cf 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
@@ -70,6 +70,7 @@ export class AttendScanService {
this.lat = resp.latitude;
this.longt = resp.longitude;
this.attendance();
+
} else {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
@@ -82,6 +83,7 @@ export class AttendScanService {
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
+
} else {
this.common.presentAlert(this.ts.trPK('home', 'position-error'));
}
@@ -96,13 +98,12 @@ export class AttendScanService {
}
public attendance() {
- this.permissions.requestCameraAutherization().then(granted => {
- this.camera = granted as boolean;
- if (this.camera) {
- this.scanCode();
- }
+ this.permissions.requestCameraAutherization().then(granted => {
+ this.camera = granted as boolean;
+ if (this.camera) {
+ this.scanCode();
}
- );
+ });
}
scanCode() {
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 5573721f..c1d7c20c 100644
--- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
+++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
@@ -38,9 +38,6 @@ import { SendActivationByType } from 'src/app/authentication/models/sendActivati
})
export class AuthenticationService {
-
- public static MOBILE_USER = 102;
-
/* login methods */
public static loginURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
public static checkUserAuthURL = 'Services/Authentication.svc/REST/CheckPatientAuthentication';
@@ -133,8 +130,10 @@ export class AuthenticationService {
mobileType = 'android';
} else if (isIOS) {
mobileType = 'ios';
+ }else{
+ mobileType = 'android';
}
- request.VersionID = 2.6;
+ request.VersionID = 2.7;
request.Channel = 33;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
request.MobileType = mobileType;
diff --git a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts
index 660b8a28..7c703fb2 100644
--- a/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts
+++ b/Mohem/src/app/hmg-common/services/authentication/models/smscheck.response.ts
@@ -17,5 +17,7 @@ export class SMSCheckResponse extends Response {
public CompanyImageURL:string;
public EMPLOYEE_MOBILE_NUMBER:string;
public EMPLOYEE_NAME:string;
+ public Mohemm_Wifi_SSID:string;
+ public Mohemm_Wifi_Password:string;
}
diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts
index 610147d1..8e7fce00 100644
--- a/Mohem/src/app/hmg-common/services/common/common.service.ts
+++ b/Mohem/src/app/hmg-common/services/common/common.service.ts
@@ -26,13 +26,16 @@ import { SharedDataService } from '../shared-data-service/shared-data.service';
import { Badge } from '@ionic-native/badge/ngx';
import { LifeCycleService } from '../life-cycle/life-cycle.service';
import { Diagnostic } from '@ionic-native/diagnostic/ngx';
-//import { CallNumber } from "@ionic-native/call-number/ngx";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Injectable({
providedIn: 'root'
})
export class CommonService {
+
+ public static MOHEMM_WIFI_SSID = "";
+ public static MOHEMM_WIFI_PASSWORD = "";
+
public static months_en_long = [
'January',
'February',
@@ -100,7 +103,6 @@ export class CommonService {
public badge: Badge,
public lifeCycle: LifeCycleService,
public diagnostic: Diagnostic,
- //public callNumber: CallNumber,
public iab: InAppBrowser,
private menu: MenuController,
) {}
@@ -237,7 +239,6 @@ public getMonthNameAr(value: number): string {
public mobileNumber(number: string) {
return number.substr(1, number.length - 1);
}
- public testFunction() {}
public stopLoading() {
this.progressLoadingService.dismiss();
@@ -1321,20 +1322,6 @@ public getMonthNameAr(value: number): string {
});
}
- // public callPhoneNumber(phoneNumber: string) {
- // this.platform.ready().then(() => {
- // if (this.isCordova()) {
- // this.callNumber
- // .callNumber(phoneNumber, true)
- // .then(res => {})
- // .catch(err => {});
- // } else {
- // window.open("tel:" + phoneNumber);
- // // this.presentAlert(this.ts.trPK('error', 'call'));
- // }
- // });
- // }
-
list_to_tree(list) {
let map = {},
node,
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 0df0af0b..b75b052b 100644
--- a/Mohem/src/app/hmg-common/services/push/push.service.ts
+++ b/Mohem/src/app/hmg-common/services/push/push.service.ts
@@ -1,21 +1,15 @@
import { Injectable, NgZone } from '@angular/core';
-// import { Push, PushObject, PushOptions } from '@ionic-native/push/ngx';
import { CommonService } from '../common/common.service';
import { TranslatorService } from '../translator/translator.service';
import { NotificationModel } from './models/notification.model';
import { SharedDataService } from '../shared-data-service/shared-data.service';
import { ConnectorService } from '../connector/connector.service';
-//import { Response } from '../models/response';
import { Response } from 'src/app/hmg-common/services/models/response';
import { RegisterAuthenticatedUserRequest } from './models/register-authenticated-user.request';
import { Platform, Events } from '@ionic/angular';
import { RegisterNormalUserRequest } from './models/register-normal-user.request';
import { AuthenticationService } from '../authentication/authentication.service';
-// import { AppointmentModel } from 'src/app/eservices/appointments/service/models/appointment.model';
import { SessionModel } from './models/session.model';
-import { AuthenticatedUser } from '../authentication/models/authenticated-user';
-// import { NotificationsCenterService } from 'src/app/eservices/notifications-center/service/notifications-center.service';
-// import { NotificationsComponent } from 'src/app/eservices/notifications-center/notifications/notifications.component';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@Injectable({
@@ -28,7 +22,6 @@ export class PushService {
public static CHANNEL_ID = '679409052782';//'815750722565';
constructor(
- // public push: Push,
public cs: CommonService,
public ts: TranslatorService,
public sharedService: SharedDataService,
@@ -36,72 +29,14 @@ export class PushService {
private platform: Platform,
private authService: AuthenticationService,
public ngZone: NgZone,
- // public notifyService: NotificationsCenterService,
public events: Events,
- public firebasex: FirebaseX,
-
+ public firebasex: FirebaseX
) { }
public startReceiving() {
console.log("startReceiving");
- // this.processStartReceiving();
this.processStartReceivingWithFirebase();
}
- private processStartReceiving1() {
- // if (this.cs.isCordova()) {
- // this.stopNotifications(() => {
- // this.push.hasPermission()
- // .then((res: any) => {
- // if (res.isEnabled) {
- // this.createChannel();
- // } else {
- // this.cs.presentAlert(this.ts.trPK('push', 'no-permiss'));
- // }
- // });
- // });
- // }
- }
-
- private createChannel() {
- // Create a channel (Android O and above). You'll need to provide the id, description and importance properties.
- // this.push.createChannel({
- // id: PushService.CHANNEL_ID,
- // description: 'HMG push notifications',
- // importance: 3
- // }).then(() => {
- // this.initialize();
- // });
- }
-
- private initialize() {
- // const options: PushOptions = {
- // android: {
- // senderID: PushService.CHANNEL_ID,
- // sound: true,
- // forceShow: true
- // },
- // ios: {
- // alert: true,
- // badge: true,
- // sound: true
- // },
- // windows: {},
- // browser: {
- // pushServiceURL: 'http://push.api.phonegap.com/v1/push'
- // }
- // };
- // const pushObject: PushObject = this.push.init(options);
- // pushObject.on('notification').subscribe((notification: any) => {
- // this.processNotification(notification);
- // });
-
- // pushObject.on('registration').subscribe((data: any) => {
- // this.registerInBackend(data);
- // });
-
- // pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
-
- }
private processNotification(data: any) {
const notification = new NotificationModel();
@@ -120,12 +55,9 @@ export class PushService {
const type = Number(data.additionalData.NotificationType);
if (type === NotificationModel.TYPE_APPOINTMENT) {
this.sharedService.setSharedData(notification, NotificationModel.SHARED_DATA);
- // this.ngZone.run(() => this.cs.openAppointmentDetails());
} else if (type === NotificationModel.TYPE_CONFERENCE) {
const session = data.additionalData.sessionId;
- // console.log('session Id Recieved>>>>>'+ session);
this.sharedService.setSharedData( new SessionModel(session) , SessionModel.SHARED_DATA);
- // this.ngZone.run( () => this.cs.openConference() );
} else {
if (type === NotificationModel.TYPE_VIDEO) {
notification.MessageType = 'video';
@@ -137,28 +69,11 @@ export class PushService {
notification.MessageType = 'text';
}
this.sharedService.setSharedData(notification, NotificationModel.SHARED_DATA);
- //this.ngZone.run(async () => this.cs.openNotificationDetails());
}
}
private setAsReadNotification(notification: NotificationModel) {
notification.IsRead = true;
- // this.notifyService.setNotificationRead(notification, () => {
- // }).subscribe((result: Response) => {
- // if (this.cs.validResponse(result)) {
- // this.events.publish( NotificationsCenterService.NOTIFICATIONS_COUNT_EVENT, notification.count);
- // }
- // });
-
-
- }
- public stopNotifications(done: any) {
- // Delete a channel (Android O and above)
- // if (this.cs.isCordova()) {
- // this.push.deleteChannel(PushService.CHANNEL_ID).then(() => {
- // done();
- // });
- // }
}
private registerInBackend(data: any) {
@@ -166,14 +81,7 @@ export class PushService {
if (data) {
this.cs.sharedService.setSharedData(data, AuthenticationService.DEVICE_TOKEN);
localStorage.setItem('deviceToken', data);
-
}
- //
- // if (this.authService.isAuthenticated()) {
- // this.registerAuthenticatedUser(data);
- // } else {
- // this.registerNotAuthenticatedUser(data);
- // }
}
@@ -198,7 +106,6 @@ export class PushService {
});
}
-
private registerNotAuthenticatedUser(deviceToken: any) {
const request = new RegisterNormalUserRequest();
this.authService.setPublicFields(request);
@@ -220,26 +127,13 @@ export class PushService {
private processStartReceivingWithFirebase() {
console.log("processStartReceivingWithFirebase");
-
this.firebasex.getToken().then(token => {
// alert("token: "+ token);
this.cs.sharedService.setSharedData(token, "new-device-token");
localStorage.setItem('deviceToken', token);
this.cs.setDeviceToken(token); //last way to set the device Token to get it through getDeviceToken
-
this.registerInBackend(token);
-
}).catch(error => console.error('Error getting token', error));
-
-
- // this.firebase.getToken()
- // .then(token => console.log(`The token is ${token}`))
- // .catch(error => console.error('Error getting token', error));
-
- // this.firebasex.onTokenRefresh().subscribe(token => {
- // alert("token: "+ token);
- // this.registerInBackend(token);
- // });
}
public onPushReceived(payload: any) {
@@ -253,10 +147,4 @@ export class PushService {
console.log("onPushOpened openConference");
this.processNotification(payload);
}
-
-
-
-
-
-
}
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 49f1b330..7622aa12 100644
--- a/Mohem/src/app/home/attendance-options/attendance-options.component.html
+++ b/Mohem/src/app/home/attendance-options/attendance-options.component.html
@@ -38,6 +38,17 @@
+
+
+
+
+
+

+
{{ "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 33c06bab..f655dcb9 100644
--- a/Mohem/src/app/home/attendance-options/attendance-options.component.ts
+++ b/Mohem/src/app/home/attendance-options/attendance-options.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, NgZone } from "@angular/core";
+import { Component, OnInit, NgZone, VERSION } from "@angular/core";
import { NFC } from "@ionic-native/nfc/ngx";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { Platform } from "@ionic/angular";
@@ -6,12 +6,18 @@ import { AttendScanService } from "../../hmg-common/services/attend-services/att
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { ModalController } from "@ionic/angular";
import { NfcModalComponent } from "../nfc-modal/nfc-modal.component";
+import { WifiModalComponent } from "../wifi-model/wifi-modal.component";
import { AuthenticatedUser } from "../../hmg-common/services/authentication/models/authenticated-user";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { attendanceSwipeScannerRequest } from "src/app/home/models/attendanceSwipe.Request";
import { Device } from "@ionic-native/device/ngx";
import { AttendanceService } from "src/app/home/services/attendance.services";
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';
+
+
@Component({
selector: "app-attendance-options",
@@ -25,6 +31,7 @@ export class AttendanceOptionsComponent implements OnInit {
public priviligeList: any;
public serviceEnableNFC = false;
public serviceEnableQR = false;
+ public serviceEnableWifi = false;
public deviceNFC = false;
public nfcIOSSuccess = false;
@@ -37,7 +44,10 @@ export class AttendanceOptionsComponent implements OnInit {
public modalController: ModalController,
private device: Device,
private attendance_service: AttendanceService,
- public ngZone: NgZone
+ public ngZone: NgZone,
+ private wifiWizard2: WifiWizard2,
+ private openNativeSettings: OpenNativeSettings,
+ private devicePermissionsService:DevicePermissionsService
) {}
ngOnInit() {
@@ -49,6 +59,7 @@ export class AttendanceOptionsComponent implements OnInit {
this.priviligeList = AuthenticationService.servicePrivilage;
this.setServicesPrivilage();
this.checkNFCStatus("one");
+
}
async checkNFCStatus(checkValue: string) {
@@ -93,6 +104,12 @@ export class AttendanceOptionsComponent implements OnInit {
) {
this.serviceEnableQR = true;
}
+ if (
+ servicePrivilage.Previlege &&
+ servicePrivilage.ServiceName === "enableWIFI"
+ ) {
+ this.serviceEnableWifi = true;
+ }
}
}
@@ -156,4 +173,55 @@ export class AttendanceOptionsComponent implements OnInit {
public startQRCode() {
this.attendScanService.getDeviceLocation();
}
+
+
+ // Wifi Attendance
+ public async startWifi() {
+ const isAndroid = this.platform.is("android");
+ const isIOS = this.platform.is("ios");
+ const isWifiEnabled = await this.wifiWizard2.isWifiEnabled();
+
+ if(isIOS){
+ if(!isWifiEnabled){
+ this.showWifiNotEnabled();
+ return;
+ }
+
+ }else if(isAndroid){
+ let locationPermission = await this.devicePermissionsService.requestLocationAutherization();
+ if(!locationPermission){
+ return;
+ }
+
+ if(!isWifiEnabled){
+ this.wifiWizard2.setWifiEnabled(true).then(()=>{
+ 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,
+ });
+ 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"));
+ }
+
}
diff --git a/Mohem/src/app/home/home.module.ts b/Mohem/src/app/home/home.module.ts
index 32ba2bad..6232673c 100644
--- a/Mohem/src/app/home/home.module.ts
+++ b/Mohem/src/app/home/home.module.ts
@@ -9,6 +9,7 @@ import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { WorklistMainService } from '../notification/service/work-list.main.service';
import { AttendanceOptionsComponent } from './attendance-options/attendance-options.component';
import { NfcModalComponent } from './nfc-modal/nfc-modal.component';
+import { WifiModalComponent } from './wifi-model/wifi-modal.component';
const routes: Routes = [
{
path: '',
@@ -31,12 +32,16 @@ const routes: Routes = [
],
declarations: [
HomePage,
- NfcModalComponent
+ NfcModalComponent,
+ WifiModalComponent
],
providers: [
BarcodeScanner,
WorklistMainService
],
- entryComponents: [NfcModalComponent]
+ entryComponents: [
+ NfcModalComponent,
+ WifiModalComponent
+ ]
})
export class HomePageModule { }
diff --git a/Mohem/src/app/home/home.page.html b/Mohem/src/app/home/home.page.html
index 05491459..5cc9479e 100644
--- a/Mohem/src/app/home/home.page.html
+++ b/Mohem/src/app/home/home.page.html
@@ -26,14 +26,14 @@
{{menuItem.PROMPT}}
+
-
-
-
+
+
-
-
+
+
@@ -55,8 +55,8 @@
-
+
diff --git a/Mohem/src/app/home/models/attendanceSwipe.Request.ts b/Mohem/src/app/home/models/attendanceSwipe.Request.ts
index a75fe7ff..c6a1e8bd 100644
--- a/Mohem/src/app/home/models/attendanceSwipe.Request.ts
+++ b/Mohem/src/app/home/models/attendanceSwipe.Request.ts
@@ -17,6 +17,7 @@ export class attendanceSwipeScannerRequest extends Request{
public UserID: string;
public PointType: number;
public NFCValue: string;
+ public WifiValue: string;
}
diff --git a/Mohem/src/app/home/nfc-modal/nfc-modal.component.scss b/Mohem/src/app/home/nfc-modal/nfc-modal.component.scss
index 9e51eeaf..f36ce704 100644
--- a/Mohem/src/app/home/nfc-modal/nfc-modal.component.scss
+++ b/Mohem/src/app/home/nfc-modal/nfc-modal.component.scss
@@ -17,12 +17,12 @@
.ripple-div {
display: block;
text-align: center;
- margin-top: -20%;
+ margin-top: -5%;
p {
font-size: 16px;
color: #bbbbbb;
font-family: 'WorkSans-Bold';
- margin-top: -20%;
+ // margin-top: -20%;
padding-right: 10px;
}
ion-button {
@@ -33,6 +33,12 @@
}
}
+.wifi-div {
+ display: block;
+ text-align: center;
+ margin-top: -5%;
+}
+
.checked-img {
display: block;
text-align: center;
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 1117ea7c..605b3e87 100644
--- a/Mohem/src/app/home/nfc-modal/nfc-modal.component.ts
+++ b/Mohem/src/app/home/nfc-modal/nfc-modal.component.ts
@@ -72,7 +72,8 @@ export class NfcModalComponent implements OnInit {
});
setTimeout(() => {
this.modalController.dismiss();
- this.common.openHome();
+ // this.common.openHome();
+ this.common.openAttenTrackingpage();
}, 4000);
}
});
diff --git a/Mohem/src/app/home/wifi-model/wifi-modal.component.html b/Mohem/src/app/home/wifi-model/wifi-modal.component.html
new file mode 100644
index 00000000..5a87fce4
--- /dev/null
+++ b/Mohem/src/app/home/wifi-model/wifi-modal.component.html
@@ -0,0 +1,15 @@
+
+
+
+
+

+
{{ "general, wifi-connect-message" | translate }}
+
+
+
+

+
{{ "general, success-attendance" | translate }}
+
+
\ No newline at end of file
diff --git a/Mohem/src/app/home/wifi-model/wifi-modal.component.scss b/Mohem/src/app/home/wifi-model/wifi-modal.component.scss
new file mode 100644
index 00000000..f56315b0
--- /dev/null
+++ b/Mohem/src/app/home/wifi-model/wifi-modal.component.scss
@@ -0,0 +1,45 @@
+.centerDiv {
+ margin: auto;
+ text-align: center;
+ display: block;
+}
+
+.heading-div {
+ display: block;
+ text-align: center;
+}
+.heading-text {
+ font-size: 16px;
+ color: #bbbbbb;
+ font-family: 'WorkSans-Bold';
+ margin-top: 7%;
+}
+.ripple-div {
+ display: block;
+ text-align: center;
+ margin-top: -20%;
+ p {
+ font-size: 16px;
+ color: #bbbbbb;
+ font-family: 'WorkSans-Bold';
+ margin-top: -20%;
+ padding-right: 10px;
+ }
+ ion-button {
+ --background: #282f42;
+ color: var(--light);
+ border-radius: 33px;
+ width: 270px;
+ }
+}
+.wifi-div {
+ display: block;
+ text-align: center;
+ margin-top: 0%;
+}
+
+.checked-img {
+ display: block;
+ text-align: center;
+ margin-top: 10%;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/home/wifi-model/wifi-modal.component.spec.ts b/Mohem/src/app/home/wifi-model/wifi-modal.component.spec.ts
new file mode 100644
index 00000000..72adf22a
--- /dev/null
+++ b/Mohem/src/app/home/wifi-model/wifi-modal.component.spec.ts
@@ -0,0 +1,27 @@
+import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { WifiModalComponent } from './wifi-modal.component';
+
+describe('WifiModalComponent', () => {
+ let component: WifiModalComponent;
+ let fixture: ComponentFixture
;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ WifiModalComponent ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(WifiModalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/Mohem/src/app/home/wifi-model/wifi-modal.component.ts b/Mohem/src/app/home/wifi-model/wifi-modal.component.ts
new file mode 100644
index 00000000..208682cf
--- /dev/null
+++ b/Mohem/src/app/home/wifi-model/wifi-modal.component.ts
@@ -0,0 +1,184 @@
+import { Component, OnInit, NgZone } from '@angular/core';
+import { CommonService } from 'src/app/hmg-common/services/common/common.service';
+import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request';
+import { Device } from '@ionic-native/device/ngx';
+import { AuthenticatedUser } from '../../hmg-common/services/authentication/models/authenticated-user';
+import { AttendanceService } from 'src/app/home/services/attendance.services';
+import { Response } from 'src/app/hmg-common/services/models/response';
+import { ModalController } from '@ionic/angular';
+import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
+import { Platform } from "@ionic/angular";
+import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
+import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
+
+@Component({
+ selector: 'app-wifi-modal',
+ templateUrl: './wifi-modal.component.html',
+ styleUrls: ['./wifi-modal.component.scss'],
+})
+export class WifiModalComponent implements OnInit {
+ public userData: any = {};
+ public gifStatus = false;
+ private ssid = CommonService.MOHEMM_WIFI_SSID;
+ private password = CommonService.MOHEMM_WIFI_PASSWORD;
+ private algo = 'WPA';
+
+ constructor(
+ public common: CommonService,
+ private device: Device,
+ private attendance_service: AttendanceService,
+ public modalController: ModalController,
+ public ts: TranslatorService,
+ public ngZone: NgZone,
+ private wifiWizard2: WifiWizard2,
+ private openNativeSettings: OpenNativeSettings,
+ private platform: Platform,
+ ) { }
+
+ ngOnInit() {
+ this.userData = this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA, false);
+ setTimeout(() => {
+ this.startWifiConnection();
+ }, 1000);
+ }
+
+ async startWifiConnection() {
+ const isAndroid = this.platform.is("android");
+ const isIOS = this.platform.is("ios");
+
+ if (isAndroid) {
+ let isWifiAvailable = await this.isWifiAvailable(this.ssid);
+ console.debug("isWifiAvailable: " + isWifiAvailable);
+ if(isWifiAvailable){
+ console.debug("Wifi Credientials: " + this.ssid + " | " + this.password);
+ this.wifiWizard2.connect(this.ssid, true, this.password, this.algo).then(async (value) =>{
+ let ssid_ = await this.wifiWizard2.getConnectedSSID();
+ if(ssid_ == this.ssid){
+ console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_);
+ setTimeout(() => {
+ this.swipeAttendanceWifi(ssid_);
+ },2000);
+ }else{
+ this.showErrorInvalidWorkspace();
+ }
+ })
+ .catch((err) => {
+ console.debug(err);
+ this.showErrorForgetWifiConfiguration();
+ });
+ }else{
+ console.debug("Wifi is not available considered your device is not in range");
+ this.showErrorInvalidWorkspace();
+ }
+ } else if (isIOS) {
+ this.wifiWizard2.iOSConnectNetwork(this.ssid,this.password).then(async (value) => {
+ let ssid_ = await this.wifiWizard2.getConnectedSSID();
+ if(ssid_ == this.ssid){
+ console.debug("Wifi Connected: Verified Access | " + value + " | " + ssid_);
+ setTimeout(() => {
+ this.swipeAttendanceWifi(ssid_);
+ },2000);
+ }else{
+ this.showErrorInvalidWorkspace();
+ }
+ })
+ .catch((err) => {
+ console.debug(err);
+ this.showErrorInvalidWorkspace();
+ });
+ if(this.wifiWizard2.isWifiEnabled){
+ } else{
+ this.showWifiNotEnabled();
+ }
+ }
+ }
+
+ showWifiNotEnabled(){
+ this.common.showErrorMessageDialog(()=>{
+ this.openNativeSettings.open('wifi').then(()=>{});
+ },
+ this.ts.trPK("general", "ok"),
+ this.ts.trPK("general","wifi-not-enable-text"));
+ }
+
+ showErrorInvalidWorkspace() {
+ this.closeModal();
+ this.common.showErrorMessageDialog(()=>{
+ },
+ this.ts.trPK("general", "ok"),
+ this.ts.trPK("general","wifi-connection-failed-text"));
+ this.disconnectWifi();
+ }
+
+ showErrorForgetWifiConfiguration() {
+ this.closeModal();
+ this.common.confirmAlertDialog(() => {
+ this.openNativeSettings.open('wifi').then(()=>{});
+ }, this.ts.trPK('general', 'settings'), () => {
+ }, this.ts.trPK('general', 'cancel'), this.ts.trPK('vacation-rule', 'confirmation'), this.ts.trPK("general","forget-wifi-connection-text"));
+ this.disconnectWifi();
+ }
+
+ async disconnectWifi() {
+ const isAndroid = this.platform.is("android");
+ const isIOS = this.platform.is("ios");
+ if(isAndroid){
+ await this.wifiWizard2.disconnect(this.ssid).catch((error)=>{ console.error(error) });
+ await this.wifiWizard2.remove(this.ssid).catch((error)=>{ console.error(error) });
+ console.debug("Wifi Removed");
+ }else if(isIOS){
+ await this.wifiWizard2.iOSDisconnectNetwork(this.ssid);
+ }
+ }
+
+ async swipeAttendanceWifi(code:any) {
+ const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
+ request.PointType = 3;
+ request.Latitude = 0;
+ request.Longitude = 0;
+ request.QRValue = "";
+ request.NFCValue = "";
+ request.WifiValue = "100";
+ request.UID = this.device.uuid;
+ request.UserName = this.userData.EMPLOYEE_NUMBER;
+
+ this.attendance_service
+ .attendanceSwipeScanner(request, () => {
+ console.debug("Error inside in swipe attendance");
+ this.closeModal();
+ this.disconnectWifi();
+ })
+ .subscribe((result: Response) => {
+ this.disconnectWifi();
+ if (this.common.validResponse(result)) {
+ this.ngZone.run(() => {
+ this.gifStatus = true;
+ });
+ setTimeout(() => {
+ this.closeModal();
+ // this.common.openAttenTrackingpage();
+ }, 4000);
+ }else{
+ console.debug(result);
+ this.closeModal();
+ }
+ });
+ }
+
+ public closeModal() {
+ this.modalController.dismiss();
+ }
+
+ async isWifiAvailable(ssid:string){
+ let avaialble_wifi = await this.wifiWizard2.scan();
+ let find = avaialble_wifi.find(element => {
+ return element.SSID == ssid;
+ });
+
+ if (find === undefined) {
+ return false;
+ } else {
+ return find.SSID == ssid;
+ }
+ }
+}
diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html
index 124e0f0b..fe0b6141 100644
--- a/Mohem/src/app/notification/home/home.component.html
+++ b/Mohem/src/app/notification/home/home.component.html
@@ -19,7 +19,7 @@
{{ts.trPK('work-list','total')}}
{{ts.trPK('work-list','open-reqest')}}
-
+
@@ -90,13 +90,15 @@
-
-
{{ts.trPK('work-list','No-data-available')}}
+
+
+ {{ts.trPK('work-list','No-data-available')}}
+
+
+ {{ts.trPK('work-list','No-data-available')}}
+
-
- {{ts.trPK('work-list','No-data-available')}}
-
diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss
index 8ed6074c..c1faeb72 100644
--- a/Mohem/src/app/notification/home/home.component.scss
+++ b/Mohem/src/app/notification/home/home.component.scss
@@ -355,17 +355,18 @@ z-index: 99;
ion-col{
background: white;
border-radius: 12px;
- padding-right: 10px;
+ padding-right: 30px;
flex: none;
ion-icon{
margin-right: 3px;
- font-size: 14px;
+ font-size: 20px;
margin-left: 3px;
vertical-align: middle;
}
span{
- font-size: 12px;
+ font-size: 14px;
vertical-align: middle;
+ margin: 5px;
}
}
}
@@ -439,21 +440,23 @@ font-size: 15px;
font-size: 12px;
color: #888;
background-color: white;
-width: 93%;
-height: 30px;
+width: auto;
+height: 40px;
border: 1px solid;
-border-radius: 15px;
+border-radius: 30px;
+padding: 10px 30px;
}
.text-span-active{
font-size: 12px;
-color: #888;
+color:white;
background-color:#269DB8;
-width: 93%;
-height: 30px;
+width: auto;
+height: 40px;
border: 1px solid;
-border-radius: 15px;
+border-radius: 30px;
+padding: 10px 30px;
}
.slideCss{
-width: 200px !important;
+width: auto !important;
}
\ No newline at end of file
diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts
index 5fc32b0e..ec019152 100644
--- a/Mohem/src/app/notification/home/home.component.ts
+++ b/Mohem/src/app/notification/home/home.component.ts
@@ -29,6 +29,7 @@ export class HomeComponent implements OnInit {
private WorkListObj: WorkListRequest;
WorkListResObj: any;
notificationType = '1';
+ public isLoading: boolean;
pageNum = 1;
rowsNo: number;
noOfrows: number;
@@ -49,7 +50,6 @@ export class HomeComponent implements OnInit {
public noData = false;
public isITG = false;
public isSearch = false;
- // public direction = 'ltr';
public direction: string;
public ITGCount = 0;
public ITGSegment: { name: string, code: any, data: any, style: boolean, names?: any }[] = [];
@@ -176,6 +176,7 @@ export class HomeComponent implements OnInit {
ngOnInit() {
this.common.startLoading();
+ this.isLoading = true;
}
ionViewWillEnter() {
@@ -185,6 +186,7 @@ export class HomeComponent implements OnInit {
this.receivedITGCount = false;
this.showChart = false;
this.common.startLoading();
+ this.isLoading = true;
if (this.infiniteScroll) {
this.infiniteScroll.complete();
}
@@ -202,7 +204,6 @@ export class HomeComponent implements OnInit {
}
callWorkListServices() {
- // this.Details();
this.Count();
this.getAllPushNotificationFun();
}
@@ -221,6 +222,27 @@ export class HomeComponent implements OnInit {
assignDataToFilters() {
this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER;
+ this.filters[1].value = this.totalHR;
+ this.filters[2].value = this.totalPO;
+ this.filters[3].value = this.totalPR;
+ this.filters[4].value = this.totalMR;
+
+ if (this.totalHR === 0) {
+ this.data.datasets[0].data[0] = 0;
+ }
+
+ if (this.totalPO === 0) {
+ this.data.datasets[0].data[1] = 0;
+ }
+
+ if (this.totalPR === 0) {
+ this.data.datasets[0].data[2] = 0;
+ }
+
+ if (this.totalMR === 0) {
+ this.data.datasets[0].data[3] = 0;
+ }
+
const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList;
for (const notification of openNotificationsArray) {
@@ -240,7 +262,17 @@ export class HomeComponent implements OnInit {
}
// this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
- this.common.stopLoading();
+ // this.common.stopLoading();
+ this.isLoading = false;
+ }
+
+ checkLoadingStatus () {
+ if (this.showChart && this.receivedITGCount) {
+ this.common.stopLoading();
+ return true;
+ } else {
+ return false;
+ }
}
activeFilter(index: number) {
@@ -292,6 +324,7 @@ export class HomeComponent implements OnInit {
if (result.data) {
if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') {
this.common.startLoading();
+ this.isLoading = true;
this.showSearchButton = true;
this.itemType = result.data.itemType;
this.notificationType = result.data.notificationType;
@@ -459,7 +492,8 @@ export class HomeComponent implements OnInit {
this.newWorkListResponse = [];
this.data.datasets[0].data[4] = this.ITGCount;
this.showChart = true;
- this.common.stopLoading();
+ // this.common.stopLoading();
+ this.isLoading =false;
}
}
@@ -501,6 +535,7 @@ export class HomeComponent implements OnInit {
clearSearch() {
this.common.startLoading();
+ this.isLoading = true;
this.itemType = '';
this.selectedFilter = 'ALL';
this.isPostNoLoad = true;
@@ -563,11 +598,11 @@ export class HomeComponent implements OnInit {
Details() {
this.workListService.getITGDetails('', '', this.isPostNoLoad)
.subscribe((result: any) => {
- this.receivedITGCount = true;
this.ITGCount = result.TotalCount;
this.totalRequestCount = this.totalRequestCount + result.TotalCount;
this.data.datasets[0].data[4] = this.ITGCount;
this.filters[5].value = result.TotalCount;
+ this.receivedITGCount = true;
});
}
@@ -612,6 +647,7 @@ export class HomeComponent implements OnInit {
let count = 0;
let ITEM: any;
let NAME: any;
+ console.log(this.ITGSegment)
for (let i = 1; i < this.ITGSegment.length; i++) {
// tslint:disable-next-line: prefer-for-of
for (let j = 0; j < this.ITGSegment[i].data.length; j++) {
diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html
index 99ad265e..198a2606 100644
--- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html
+++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html
@@ -1,97 +1,192 @@
-
+
-
+
- {{segmentVal.name}}
+ {{segmentVal.name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{approvalInfo.Action}}
+
+
+
+
{{approvalInfo.Name}}
+
+
{{ 'submitAbsence, comments' | translate}}:
+
{{approvalInfo.Notes}}
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -107,7 +202,7 @@
-
+
-
-
+ -->
+
-
- Comment
-
-
-
-
- {{object.Label}}
-
-
- {{value}}
-
-
-
- {{value}}
-
-
+
+ Comment
+
+
+
+
+ {{object.Label}}
+
+
+ {{value}}
+
+
+
+ {{value}}
+
+
+
+
+
+
+
+
diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts
index 1bd380f1..90162fe0 100644
--- a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts
+++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, 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 { HomeComponent } from '../home/home.component';
@@ -7,7 +7,7 @@ import { itgRequest } from '../models/itgFormDetailsRequest';
import { ModalController } from '@ionic/angular';
import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component';
import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component';
-
+import { IonSlides } from '@ionic/angular';
@Component({
selector: 'app-work-list-main-itg',
@@ -15,6 +15,7 @@ import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/wo
styleUrls: ['./work-list-main-itg.component.scss'],
})
export class WorkListMainItgComponent implements OnInit {
+ @ViewChild('slides') slides: IonSlides;
public static APPROVAL = "Services/COCWS.svc/REST/ITGApproveRequest"
public static REJECT = 'Services/COCWS.svc/REST/ITGRejectRequest'
@@ -56,6 +57,7 @@ export class WorkListMainItgComponent implements OnInit {
index2: number;
direction: string;
defaultSegment = '';
+ public slideIndex = 0;
constructor(
public common: CommonService,
public ts: TranslatorService,
@@ -84,6 +86,8 @@ export class WorkListMainItgComponent implements OnInit {
this.request.Comments = this.request_info.Comments;
this.request.NewUserEMPId = this.request_info.NewUserEMPId;
this.workListService.getITGFormDetails(this.request).subscribe((result: any) => {
+ console.log(this.request);
+ console.log(result);
this.request_details = result.ITGRequest;
this.grantInfo = result.ITGRequest.GrantFields;
let count =0;
@@ -160,10 +164,22 @@ export class WorkListMainItgComponent implements OnInit {
}
public segmentChangedClick(event: any) {
- this.activeSegment = event.detail.value;
+ for(let i=0; i< this.segmentsArray.length; i++){
+ if(this.segmentsArray[i].name === event.detail.value){
+ this.slides.slideTo(i);
+ this.activeSegment = event.detail.value;
+ }
+ }
+ }
+
+ slideChanged(event: any) {
+ this.slides.getActiveIndex().then(index => {
+ this.activeSegment = this.segmentsArray[index].name;
+ });
}
skip() {
+ //check if the user clicked on all type of request
if (this.is_all_items_sents) {
for (let i = 1; i < this.all_request_names.length; i++) {
for (let j = 0; j < this.all_request_names[i].data.length; j++) {
@@ -187,24 +203,37 @@ export class WorkListMainItgComponent implements OnInit {
}
}
}
- } else {
+ }
+ //if user clicked on spicific type of ITG request
+ else {
+ console.log(this.all_request);
for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request
+ console.log("IF statment check the IDs:");
+ console.log(this.request_info.ID);
+ console.log(this.all_request[i].ID);
if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found.
this.index = i + 1;
+ console.log("value of i: "+i);
+ console.log("value of index: "+this.index);
if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request.
this.clearDataArray();
+ console.log(this.all_request[this.index]);
+ console.log(this.request_name)
this.changeITGForm(this.all_request[this.index], this.request_name);
- break;
+ return;
} else {
+ console.log("no 1");
this.common.sharedService.setSharedData(true, 'loadWorkList');
this.common.openNotificationPage();
- break;
+ return;
}
- } else {
- this.common.sharedService.setSharedData(true, 'loadWorkList');
- this.common.openNotificationPage();
- break;
- }
+ }
+ // else {
+ // console.log("no 2");
+ // this.common.sharedService.setSharedData(true, 'loadWorkList');
+ // this.common.openNotificationPage();
+ // return;
+ // }
}
}
}
@@ -468,5 +497,4 @@ export class WorkListMainItgComponent implements OnInit {
}
}
-
}
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 2adc87d2..c4ac77fc 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html
@@ -1,471 +1,400 @@
-
+
-
-
-
-
{{getPassNotificationDetails.SUBJECT}}
-
+
+
+
+
{{getPassNotificationDetails.SUBJECT}}
+
-
- {{'worklistMain, details-emp'| translate}}
+
+ {{'worklistMain, details-emp'| translate}}
-
-
- {{'worklistMain, action' | translate}}
-
+
+
+ {{'worklistMain, action' | translate}}
+
-
- {{'worklistMain, attach-file' | translate}}
+
+ {{'worklistMain, attach-file' | translate}}
-
-
- {{'worklistMain, info'| translate}}
-
-
+
+
+ {{'worklistMain, info'| translate}}
+
+
-
-
- {{pInformation}}
-
- 0 ">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0">
- {{ts.trPK('worklistMain','employee-on-leave')}}
-
-
-
-
-
-
-
-
-
-
![]()
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0 ">
-
-
-
-
-
-
- {{'userProfile, emp-detail' | translate}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+ 0 ">
-
+
+
+ {{'userProfile, emp-detail' | translate}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
-
-
-
-
-
-
- 0">
-
{{ 'general, empty' | translate}}
-
- 0 ">
-
-
-
-
-
-
-
![]()
-
-
-
-
- {{actionHistory.NAME}}
-
-
-
-
-
- Note: {{actionHistory.NOTE}}
-
-
-
+
+
+
+
-
- Note: {{actionHistory.NOTE}}
+
+
+ 0">
+
{{ 'general, empty' | translate}}
+
+ 0 ">
+
+
+
+
+
+
![]()
+
-
+
+
+ {{actionHistory.NAME}}
+
-
-
- {{actionHistory.ACTION}}
+
+
+
+ Note: {{actionHistory.NOTE}}
+
+
-
- {{actionHistory.NOTIFICATION_DATE| dateString }}
-
-
-
-
-
-
+
-
+
+ Note: {{actionHistory.NOTE}}
-
-
-
-
-
-
+
+
-
0">
-
{{ 'general, notAttch' | translate}}
-
+
+
+
{{actionHistory.ACTION}}
-
-
0 ">
+
+ {{actionHistory.NOTIFICATION_DATE| dateString }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0">
+
{{ 'general, notAttch' | translate}}
+
+
+
+
+ 0 ">
+
+
+
+
+ {{i+1 }}. {{attachList.FILE_NAME}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{pInformation}}
+
+ 0 ">
+
+ 0">
+
+
+
+
+
+
+
+
+
+
-
-
-
-
- {{i+1 }}. {{attachList.FILE_NAME}}
-
-
+ 0">
+ {{ts.trPK('worklistMain','employee-on-leave')}}
+
-
-
-
-
-
+
+
+
![]()
+

+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
{{'worklistMain, Tran_Succ' | translate}}
-
+
+ {{'worklistMain, Tran_Succ' | translate}}
+
+
@@ -511,41 +440,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/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss
index 785d9226..ecf60347 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss
@@ -292,3 +292,14 @@ ion-card{
.tabBar{
height:70px
}
+
+.cardAlignTextEn{
+ text-align: left;
+}
+.cardAlignTextAr{
+ text-align: right;
+}
+
+.padding-zero {
+ padding: 0px !important;
+}
\ No newline at end of file
diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
index 6b31e493..4297bb79 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.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";
@@ -7,9 +7,7 @@ import { AbsenceNotificatonBodyResponse } from "../models/AbsenceNotificationBod
import { NotificatonButtonResponse } from "../models/NotificationButtonRes";
import { WorkListActionRequest } from "../models/NotificationActionReq";
import { WorkListButtonRequest } from "../models/NotificationButtonReq";
-// import { isDate } from 'angular6-json-schema-form';
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
-import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { WorklistMainService } from "../service/work-list.main.service";
import { HomeComponent } from "src/app/notification/home/home.component";
import { TextInput } from 'src/app/uI-elements/text.input';
@@ -36,8 +34,7 @@ import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/
import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component';
import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component';
import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbored/models/GetOpenNotificationsResponse';
-
-
+import { IonSlides } from '@ionic/angular';
@Component({
selector: "app-worklist-main",
@@ -45,6 +42,7 @@ import { GetOpenNotificationsResponse } from 'src/app/hmg-common/services/dashbo
styleUrls: ["./worklist-main.component.scss"]
})
export class WorklistMainComponent implements OnInit {
+ @ViewChild('slides') slides: IonSlides;
private WorkListBodyObj: WorkListBodyRequest;
private WorkListButtonsObj: WorkListButtonRequest;
private WorkListActionObj: WorkListActionRequest;
@@ -78,7 +76,7 @@ export class WorklistMainComponent implements OnInit {
P_PAGE_NUM: number = 1;
P_PAGE_LIMIT: number = 100;
notificationCount: any;
- activeSegment: any = "item-req";
+ activeSegment: any = 'item-req';
lines_note_limit: any = 24;
attachmentRes: any = [];
private WorkListActionHistoryObj: WorkListActionHistoryRequest;
@@ -119,18 +117,15 @@ export class WorklistMainComponent implements OnInit {
private modalCtrl: ModalController,
public dashboredService: DashboredService,
public authService: AuthenticationService
-
-
- ) {
+ ) {
this.direction = TranslatorService.getCurrentLanguageName()
+ console.log("ENAD TEST LANG: "+this.direction);
this.WorkListActionHistoryObj = new WorkListActionHistoryRequest();
this.WorkListActionHistoryObj.P_PAGE_NUM = 1;
this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT;
-
}
ngOnInit() {
-
this.selEmp = this.common.sharedService.getSharedData(
MenuResponse.SHARED_SEL_EMP,
false
@@ -139,38 +134,64 @@ export class WorklistMainComponent implements OnInit {
this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => {
if (user) {
this.selEmp = user.ASSIGNMENT_NUMBER;
-
}
});
}
- //name=document.getElementById('notificationDynamicFields').value;
- //removeElement('parentDiv', name);"
-
-
- //var navbar = document.getElementById("notificationDynamicFields").value;
- // document.querySelector('svg .gauge.chart > text').remove();
- // var inputValue = (document.getElementById("notificationDynamicFields")).value;
-
- console.log(" this.selEmp" + this.selEmp);
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);
}
- intializeNotificationDetail() {
+ 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 intializeNotificationDetail() {
this.approveDis = false;
this.rejectDis = false;
this.requestDis = false;
this.moreDisabled = true;
this.closeDis = false;
- // this.approve_label="";
- // this.reject_label="";
- // this.reqInfo_label="";
if (this.messageSuccess) {
document.getElementById("notificationDynamicFields").innerHTML = "";
@@ -181,7 +202,6 @@ export class WorklistMainComponent implements OnInit {
false
);
- console.log("for next()" + this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = []
this.subordinatesleaveList = [];
this.notificationArray = this.common.sharedService.getSharedData(
@@ -255,7 +275,6 @@ export class WorklistMainComponent implements OnInit {
this.worklistMainService
.getMONotificationBody(notificationBodyObj)
.subscribe((result: MONotificatonBodyResponse) => {
- //this.handleWorkListBodyResult(result, "MO");
});
}
@@ -263,8 +282,6 @@ export class WorklistMainComponent implements OnInit {
this.worklistMainService
.getPONotificationBody(notificationBodyObj)
.subscribe((result: PONotificatonBodyResponse) => {
- // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER);
- // this.handleWorkListBodyResult(result, "PO");
});
}
@@ -307,13 +324,10 @@ export class WorklistMainComponent implements OnInit {
console.log(this.notificationBodyRes[0].Collection_Notification);
}
- // getDimensions(this.notificationBodyRes) {
let obj = (this.notificationBodyRes[0].Collection_Notification).filter(function (list) {
return list.SEGMENT_NAME === "END_DATE" || list.SEGMENT_NAME === "START_DATE";
});
- // return obj;
- // }
this.getSubordinatesleave(obj)
}
} else if (Type == "PR") {
@@ -325,8 +339,6 @@ export class WorklistMainComponent implements OnInit {
}
} //End handleWorkListBodyResult
-
-
getNotificationButtons(notificationButtonsObj) {
this.notificationButtonRes = [];
this.worklistMainService
@@ -365,7 +377,7 @@ export class WorklistMainComponent implements OnInit {
this.moreDisabled = false;
}
- } // valid it
+ }
}
}
} // End handleWorkListButtonsResult
@@ -398,8 +410,6 @@ export class WorklistMainComponent implements OnInit {
// this.openNotificationsDashboard();
this.nextNotfification();
}, 5000);
-
-
}
} // valid it
}
@@ -430,11 +440,8 @@ export class WorklistMainComponent implements OnInit {
public nextNotfification() {
- //let itemExist = false;
if (document.getElementById("notificationDynamicFields") != null) {
-
document.getElementById("notificationDynamicFields").innerHTML = "";
-
}
let itemNo = this.getPassNotificationDetails.ROW_NUM;
console.log(itemNo);
@@ -455,10 +462,8 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationArray[index].REQUEST_TYPE == "MO") {
this.common.openWorklistMainMRPage()
} else {
-
this.intializeNotificationDetail();
}
-
}
else {
this.common.openNotificationPage();
@@ -483,9 +488,6 @@ export class WorklistMainComponent implements OnInit {
if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
- // else if (isDate(responseAttrDic[key])) {
- // obj.ATTRIBUTE_DATE_VALUE = responseAttrDic[key];
- // }
else if (this.notificationDynamicAttributeArr[i].ATTRIBUTE_TYPE == "VARCHAR2") {
obj.ATTRIBUTE_TEXT_VALUE = (document.getElementById(this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME) as HTMLInputElement).value;
}
@@ -502,8 +504,6 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
- console.log("b" + this.P_RESPOND_ATTRIBUTES_TBL);
-
if (
ButtonAction == "APPROVED" ||
ButtonAction == "REJECTED" ||
@@ -528,7 +528,6 @@ export class WorklistMainComponent implements OnInit {
this.P_RESPOND_ATTRIBUTES_TBL,
WorklistMainComponent.PASS_RES_ATTR
);
- // this.applyAction(this.WorkListActionObj);
if (ButtonAction === "APPROVED") {
this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg')
@@ -543,7 +542,6 @@ export class WorklistMainComponent implements OnInit {
}
else if (ButtonAction === "CLOSE") {
this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg')
-
}
this.common.confirmAlertDialogAction(
@@ -553,15 +551,8 @@ export class WorklistMainComponent implements OnInit {
() => { }, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'),
this.confirmMsg)
-
- // this.openApplyModal(this.WorkListActionObj);
-
-
}
-
-
-
if (ButtonAction == "RFC") {
// alert("Return For Correction");
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
@@ -581,12 +572,6 @@ export class WorklistMainComponent implements OnInit {
//this.common.openWorklistRFCPage();
this.openRFCModal();
} else if (ButtonAction == "ANSWER_INFO") {
- // this.navCtrl.push("WorkListReplacmentRollPage", {
- // pQuestion: this.pQuestion,
- // passNotificationInfo: this.getPassNotificationDetails,
- // passActionMode: ButtonAction,
- // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
- // });
this.common.sharedService.setSharedData(this.pQuestion, "pQuestion");
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
@@ -610,11 +595,6 @@ export class WorklistMainComponent implements OnInit {
) {
// alert("multi option: "+ ButtonAction);
this.WorkListActionObj.P_ACTION_MODE = ButtonAction;
- // this.navCtrl.push("WorkListReplacmentRollPage", {
- // passNotificationInfo: this.getPassNotificationDetails,
- // passActionMode: ButtonAction,
- // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL
- // });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
@@ -628,8 +608,6 @@ export class WorklistMainComponent implements OnInit {
WorklistMainComponent.PASS_RES_ATTR
);
console.log("c" + this.P_RESPOND_ATTRIBUTES_TBL);
-
- // this.common.openWorklistRollReplacement();
this.openRepRolModal();
} else if (
ButtonAction == "UPDATE_ACTION" ||
@@ -655,11 +633,6 @@ export class WorklistMainComponent implements OnInit {
this.getPassNotificationDetails,
AbsenceNotificatonBodyResponse.NOT_WORKLIST
);
- // this.navCtrl.push("SubmitAbsencePage", {
- // dirfromNotificationPage: true,
- // submitAbsObjList: this.notificationBodyRes[0].Collection_Notification
- // });
- //this.common.openConfirmAbsece();
this.dirfromNotificationPage = true,
this.common.sharedService.setSharedData(
this.dirfromNotificationPage,
@@ -689,9 +662,6 @@ export class WorklistMainComponent implements OnInit {
}
openActionHistory() {
- // this.navCtrl.push("WorkListActionHistoryPage", {
- // passNotificationInfo: this.getPassNotificationDetails
- // });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
@@ -699,12 +669,7 @@ export class WorklistMainComponent implements OnInit {
this.common.openWorklistHistoryPage();
}
-
-
openSupportDocuments() {
- // this.navCtrl.push("WorkListAttachPage", {
- // passNotificationInfo: this.getPassNotificationDetails
- // });
this.common.sharedService.setSharedData(
this.getPassNotificationDetails,
WorklistMainComponent.PASS_NOTIFICATION_INFO
@@ -723,8 +688,6 @@ export class WorklistMainComponent implements OnInit {
handleNotificationResAttrResult(result) {
if (this.common.validResponse(result)) {
- // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
-
this.NotRespondAttributeList = [];
result.NotificationGetRespondAttributesList;
if (
@@ -859,52 +822,32 @@ export class WorklistMainComponent implements OnInit {
}
public checkLines(note) {
-
-
if (note && note != null) {
-
-
return (note.length > this.lines_note_limit) ? true : false;
-
-
}
-
-
-
return false;
};
-
public turnCateFun(actionHis) {
for (let i = 0; i < actionHis.length; i++) {
actionHis[i].visible = false;
-
}
-
this.actionHistoryRes = actionHis;
console.log("test");
}
async openMoreActions() {
-
-
-
-
const modal = await this.modalCtrl.create({
component: MoreActionModalComponent,
backdropDismiss: false,
-
});
modal.cssClass = 'note-modal';
-
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
-
if (data.data == "cancel" || data.data == undefined) {
return;
} else {
-
// this.selectedAction = data.data;
this.actionType = data.data.BUTTON_ACTION;
console.log(this.actionType);
@@ -912,21 +855,14 @@ export class WorklistMainComponent implements OnInit {
this.actionButton(this.actionType);
}
});
-
return await modal.present();
-
-
-
-
}
- async OpenAttachFiles(value, Type) {
-
+ async OpenAttachFiles(value, Type) {
this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage')
const modal = await this.modalCtrl.create({
component: WorkListAttachViewComponent
});
-
return await modal.present();
}
@@ -934,7 +870,6 @@ export class WorklistMainComponent implements OnInit {
///calling getSubleave
getSubordinatesleave(list) {
-
console.log(list);
let to;
let from;
@@ -946,33 +881,20 @@ export class WorklistMainComponent implements OnInit {
from = list[i].DATE_VALUE;
}
}
- console.log(new Date(to));
- console.log(new Date(from));
-
-
-
-
const request = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = "/Date(" + Date.parse(from) + '+0300' + ")/";//new Date(from);
request.P_DATE_TO = "/Date(" + Date.parse(to) + '+0300' + ")/" //new Date(to);
request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp;
- // ="'/Date(" + Date.parse(from) + ")'"
-
-
this.dashboredService.getSubordinatesLeaves(request).
subscribe((result: any) => {
-
this.handleSubordinatesLeavesResult(result);
});
}
+
public handleSubordinatesLeavesResult(result) {
if (this.common.validResponse(result)) {
- // GetSubordinatesLeavesList it used in dashbored
- // if (this.common.hasData(result.GetSubordinatesLeavesList)) {
if (this.common.hasData(result.SubordinatesOnLeavesList)) {
-
this.subordinatesleaveList = result.SubordinatesOnLeavesList;
-
}
}
}
@@ -984,6 +906,7 @@ export class WorklistMainComponent implements OnInit {
this.handleSubmitterInfoResult(result);
});
}
+
handleSubmitterInfoResult(result) {
if (this.common.validResponse(result)) {
// this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA);
@@ -995,107 +918,66 @@ export class WorklistMainComponent implements OnInit {
}// End handleWorkListButtonsResult
async openRepRolModal() {
-
const modal = await this.modalCtrl.create({
component: WorkListReplacementRollComponent,
backdropDismiss: false,
-
});
modal.cssClass = 'replaceRoll-modal';
-
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
-
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
- // this.openNotificationsDashboard();
this.nextNotfification();
-
}
});
-
return await modal.present();
-
-
-
-
}
async openRFCModal() {
-
-
-
-
const modal = await this.modalCtrl.create({
component: WorkListRfcComponent,
backdropDismiss: false,
-
});
modal.cssClass = 'replaceRoll-modal';
-
modal.onDidDismiss()
.then((data) => {
console.log(data.data);
-
if (data.data == "cancel" || data.data == undefined) {
return;
} else if (data.data == "Success") {
// this.openNotificationsDashboard();
this.nextNotfification();
-
}
});
-
return await modal.present();
-
-
-
-
}
-
async openApplyModal(WorkListActionObj) {
-
this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO);
this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage')
- // this.common.sharedService.setSharedData(
- // this.WorkListActionObj,
- // WorklistMainPRComponent.PASS_NOTIFICATION_INFO
- // );
-
const modal = await this.modalCtrl.create({
component: ApplyActionModalComponent,
backdropDismiss: false,
-
});
modal.cssClass = 'note-modal';
-
modal.onDidDismiss()
.then((data) => {
console.log(data); // Here's your selected user!
});
-
-
return await modal.present();
-
}
-
-
loadMoreActionHistory() {
-
if (!this.IsReachEnd) {
console.log("doInfinite action history MR");
-
this.worklistService.getActionHistory(this.WorkListActionHistoryObj).
subscribe((result: any) => {
if (this.common.validResponse(result)) {
if (result.GetActionHistoryList != undefined) {
this.P_PAGE_NUM++;
this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM;
-
(result.GetActionHistoryList).forEach(element => {
if (element.ROW_NUM == element.NO_OF_ROWS) {
this.IsReachEnd = true;
@@ -1113,17 +995,12 @@ export class WorklistMainComponent implements OnInit {
}// if response == 1
//this.pageNum++;
// infiniteScroll.target.complete();
-
});
} else {
console.log("no doInfinite action history MR");
-
- //if (infiniteScroll)
- //infiniteScroll.target.complete();
}
}//end infiniteScroll
-
openNotificationsDashboard() {
this.dashboredService.getOpenNotifications('', '', this.isPostNoLoad).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
@@ -1133,5 +1010,4 @@ export class WorklistMainComponent implements OnInit {
}
});
}
-
}
diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html
index 261988e0..86ee5a08 100644
--- a/Mohem/src/app/profile/home/home.component.html
+++ b/Mohem/src/app/profile/home/home.component.html
@@ -20,7 +20,8 @@
diff --git a/Mohem/src/app/profile/home/home.component.scss b/Mohem/src/app/profile/home/home.component.scss
index d60f3b9c..23f91321 100644
--- a/Mohem/src/app/profile/home/home.component.scss
+++ b/Mohem/src/app/profile/home/home.component.scss
@@ -18,21 +18,13 @@ ion-col.colBold, ion-col.colBold > label{
// background-color: #d9d7d7 !important;
-.menubutton{
- white-space: normal;
- color: var(--light);
- text-transform: capitalize;
- min-height: 39px;
- background: #f0ecec;
- font-size: 2rem;
- position: absolute;
- width: 35px !important;
- height: 19px;
- box-shadow: 3px 0px 7px 0px #c5c2c2;
- border-radius: 50%;
-
-
- }
+.menubutton {
+ background: #f0ecec;
+ min-height: 39px;
+ width: 35px !important;
+ height: 20px;
+ border-radius: 50%;
+}
.changeIcon{
/* background: #c1c1c1; */
diff --git a/Mohem/src/assets/imgs/check_padding.png b/Mohem/src/assets/imgs/check_padding.png
new file mode 100644
index 00000000..9434b89c
Binary files /dev/null and b/Mohem/src/assets/imgs/check_padding.png differ
diff --git a/Mohem/src/assets/imgs/edit-image.svg b/Mohem/src/assets/imgs/edit-image.svg
new file mode 100644
index 00000000..fc5a615a
--- /dev/null
+++ b/Mohem/src/assets/imgs/edit-image.svg
@@ -0,0 +1,14 @@
+
diff --git a/Mohem/src/assets/imgs/rippleNFC.gif b/Mohem/src/assets/imgs/rippleNFC.gif
index 85454c24..5ed39424 100644
Binary files a/Mohem/src/assets/imgs/rippleNFC.gif and b/Mohem/src/assets/imgs/rippleNFC.gif differ
diff --git a/Mohem/src/assets/imgs/wifiConnect.gif b/Mohem/src/assets/imgs/wifiConnect.gif
new file mode 100644
index 00000000..cdf56666
Binary files /dev/null and b/Mohem/src/assets/imgs/wifiConnect.gif differ
diff --git a/Mohem/src/assets/imgs/wifi_icon.png b/Mohem/src/assets/imgs/wifi_icon.png
new file mode 100644
index 00000000..9d112b82
Binary files /dev/null and b/Mohem/src/assets/imgs/wifi_icon.png differ
diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json
index d47d9752..ac593c6b 100644
--- a/Mohem/src/assets/localization/i18n.json
+++ b/Mohem/src/assets/localization/i18n.json
@@ -887,6 +887,22 @@
"en": "NFC",
"ar": "NFC"
},
+ "wifi-not-enable-text": {
+ "en": "The Wi-Fi is not enabled. Please enable it",
+ "ar": "يرجى تفعيل خدمة الواي فاي"
+ },
+ "wifi-text": {
+ "en": "Wi-Fi",
+ "ar": "واي فاي"
+ },
+ "wifi-connection-failed-text": {
+ "en": "Failed to validate, please visit the nearest receptions in the branch",
+ "ar": "فشل التحقق ، يرجى زيارة أقرب مكتب استقبال في الفرع"
+ },
+ "forget-wifi-connection-text": {
+ "en": "Invalid Wi-Fi configuration exists with 'HMG-MOHEMM', please forget the Wi-Fi from settings.",
+ "ar": "فشل الاتصال بشبكة 'HMG-MOHEMM' الرجاء اختيار نسيت الاتصال من اعدادت الشبكة"
+ },
"qr-text": {
"en": "QR Code",
"ar": "الشفرة QR"
@@ -914,6 +930,14 @@
"nfc-cancel": {
"en": "CANCEL",
"ar": "إلغاء"
+ },
+ "wifi-connect-message": {
+ "en": "Please wait",
+ "ar": "أرجو الإنتظار"
+ },
+ "success-attendance": {
+ "en": "Your attendance is marked successfully.",
+ "ar": "تم تسجيل حضورك بنجاح"
}
},
"home": {
diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss
index 31c8d1ee..35c54fcc 100644
--- a/Mohem/src/theme/styles.scss
+++ b/Mohem/src/theme/styles.scss
@@ -1382,6 +1382,12 @@ border:0px
--border-radius: 0.4cm;
}
+.wifi-modal {
+ --height: 10cm !important;
+ --width: 90% !important;
+ --border-radius: 0.4cm;
+}
+
.monthview-datetable {
@media screen and (min-width: 300px) and (max-width:360px) {
*{
diff --git a/WifiWizard2.java b/WifiWizard2.java
new file mode 100644
index 00000000..03647d0a
--- /dev/null
+++ b/WifiWizard2.java
@@ -0,0 +1,1891 @@
+// /*
+// * Copyright 2018 Myles McNamara
+// *
+// * Licensed under the Apache License, Version 2.0 (the "License");
+// * you may not use this file except in compliance with the License.
+// * You may obtain a copy of the License at
+// *
+// * http://www.apache.org/licenses/LICENSE-2.0
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS,
+// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// * See the License for the specific language governing permissions and
+// * limitations under the License.
+// */
+// package wifiwizard2;
+
+// import org.apache.cordova.*;
+
+// import java.util.List;
+// import java.lang.InterruptedException;
+
+// import org.json.JSONArray;
+// import org.json.JSONException;
+// import org.json.JSONObject;
+
+// import android.annotation.SuppressLint;
+// import android.app.PendingIntent;
+// import android.content.pm.PackageManager;
+// import android.content.BroadcastReceiver;
+// import android.content.Intent;
+// import android.content.IntentFilter;
+
+// import android.net.Network;
+// import android.net.NetworkCapabilities;
+// import android.net.NetworkInfo;
+// import android.net.NetworkRequest;
+// import android.net.DhcpInfo;
+
+// import android.net.wifi.WifiManager;
+// import android.net.wifi.WifiConfiguration;
+// import android.net.wifi.ScanResult;
+// import android.net.wifi.WifiInfo;
+// import android.net.wifi.SupplicantState;
+// import android.net.wifi.WifiNetworkSpecifier;
+// import android.net.ConnectivityManager;
+
+// import android.content.Context;
+// import android.os.AsyncTask;
+// import android.util.Log;
+// import android.os.Build.VERSION;
+// import android.os.PatternMatcher;
+
+// import java.net.URL;
+// import java.net.InetAddress;
+// import java.net.Inet4Address;
+// import java.net.InterfaceAddress;
+// import java.net.NetworkInterface;
+// import java.net.HttpURLConnection;
+
+// import java.net.UnknownHostException;
+
+// public class WifiWizard2 extends CordovaPlugin {
+// private boolean hiddenSSID = false;
+
+// private static final String TAG = "WifiWizard2";
+// private static final int API_VERSION = VERSION.SDK_INT;
+
+// private static final String ADD_NETWORK = "add";
+// private static final String REMOVE_NETWORK = "remove";
+// private static final String CONNECT_NETWORK = "connect";
+// private static final String DISCONNECT_NETWORK = "disconnectNetwork";
+// private static final String DISCONNECT = "disconnect";
+// private static final String LIST_NETWORKS = "listNetworks";
+// private static final String START_SCAN = "startScan";
+// private static final String GET_SCAN_RESULTS = "getScanResults";
+// private static final String GET_CONNECTED_SSID = "getConnectedSSID";
+// private static final String GET_CONNECTED_BSSID = "getConnectedBSSID";
+// private static final String GET_CONNECTED_NETWORKID = "getConnectedNetworkID";
+// private static final String IS_WIFI_ENABLED = "isWifiEnabled";
+// private static final String SET_WIFI_ENABLED = "setWifiEnabled";
+// private static final String SCAN = "scan";
+// private static final String ENABLE_NETWORK = "enable";
+// private static final String DISABLE_NETWORK = "disable";
+// private static final String GET_SSID_NET_ID = "getSSIDNetworkID";
+// private static final String REASSOCIATE = "reassociate";
+// private static final String RECONNECT = "reconnect";
+// private static final String REQUEST_FINE_LOCATION = "requestFineLocation";
+// private static final String GET_WIFI_IP_ADDRESS = "getWifiIP";
+// private static final String GET_WIFI_ROUTER_IP_ADDRESS = "getWifiRouterIP";
+// private static final String CAN_PING_WIFI_ROUTER = "canPingWifiRouter";
+// private static final String CAN_CONNECT_TO_ROUTER = "canConnectToRouter";
+// private static final String CAN_CONNECT_TO_INTERNET = "canConnectToInternet";
+// private static final String IS_CONNECTED_TO_INTERNET = "isConnectedToInternet";
+// private static final String RESET_BIND_ALL = "resetBindAll";
+// private static final String SET_BIND_ALL = "setBindAll";
+// private static final String GET_WIFI_IP_INFO = "getWifiIPInfo";
+
+
+
+// private static final int SCAN_RESULTS_CODE = 0; // Permissions request code for getScanResults()
+// private static final int SCAN_CODE = 1; // Permissions request code for scan()
+// private static final int LOCATION_REQUEST_CODE = 2; // Permissions request code
+// private static final int WIFI_SERVICE_INFO_CODE = 3;
+// private static final String ACCESS_FINE_LOCATION = android.Manifest.permission.ACCESS_FINE_LOCATION;
+
+// private static int LAST_NET_ID = -1;
+// // This is for when SSID or BSSID is requested but permissions have not been granted for location
+// // we store whether or not BSSID was requested, to recall the getWifiServiceInfo fn after permissions are granted
+// private static boolean bssidRequested = false;
+
+// private WifiManager wifiManager;
+// private CallbackContext callbackContext;
+// private JSONArray passedData;
+
+// private ConnectivityManager connectivityManager;
+// private ConnectivityManager.NetworkCallback networkCallback;
+
+// // Store AP, previous, and desired wifi info
+// private AP previous, desired;
+
+// private PendingIntent pending_intent_net_req_received;
+// private final BroadcastReceiver networkChangedReceiver = new NetworkChangedReceiver();
+// private static final IntentFilter NETWORK_STATE_CHANGED_FILTER = new IntentFilter();
+
+// static {
+// NETWORK_STATE_CHANGED_FILTER.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+// }
+
+// /**
+// * WEP has two kinds of password, a hex value that specifies the key or a character string used to
+// * generate the real hex. This checks what kind of password has been supplied. The checks
+// * correspond to WEP40, WEP104 & WEP232
+// */
+// private static boolean getHexKey(String s) {
+// if (s == null) {
+// return false;
+// }
+
+// int len = s.length();
+// if (len != 10 && len != 26 && len != 58) {
+// return false;
+// }
+
+// for (int i = 0; i < len; ++i) {
+// char c = s.charAt(i);
+// if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))) {
+// return false;
+// }
+// }
+// return true;
+// }
+
+// @Override
+// public void initialize(CordovaInterface cordova, CordovaWebView webView) {
+// super.initialize(cordova, webView);
+// this.wifiManager = (WifiManager) cordova.getActivity().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
+// this.connectivityManager = (ConnectivityManager) cordova.getActivity().getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
+// }
+
+// @Override
+// public boolean execute(String action, JSONArray data, CallbackContext callbackContext)
+// throws JSONException {
+
+// this.callbackContext = callbackContext;
+// this.passedData = data;
+
+// // Actions that do not require WiFi to be enabled
+// if (action.equals(IS_WIFI_ENABLED)) {
+// this.isWifiEnabled(callbackContext);
+// return true;
+// } else if (action.equals(SET_WIFI_ENABLED)) {
+// this.setWifiEnabled(callbackContext, data);
+// return true;
+// } else if (action.equals(REQUEST_FINE_LOCATION)) {
+// this.requestLocationPermission(LOCATION_REQUEST_CODE);
+// return true;
+// } else if (action.equals(GET_WIFI_ROUTER_IP_ADDRESS)) {
+
+// String ip = getWiFiRouterIP();
+
+// if ( ip == null || ip.equals("0.0.0.0")) {
+// callbackContext.error("NO_VALID_ROUTER_IP_FOUND");
+// return true;
+// } else {
+// callbackContext.success(ip);
+// return true;
+// }
+
+// } else if (action.equals(GET_WIFI_IP_ADDRESS) || action.equals(GET_WIFI_IP_INFO)) {
+// String[] ipInfo = getWiFiIPAddress();
+// String ip = ipInfo[0];
+// String subnet = ipInfo[1];
+// if (ip == null || ip.equals("0.0.0.0")) {
+// callbackContext.error("NO_VALID_IP_IDENTIFIED");
+// return true;
+// }
+
+// // Return only IP address
+// if( action.equals( GET_WIFI_IP_ADDRESS ) ){
+// callbackContext.success(ip);
+// return true;
+// }
+
+// // Return Wifi IP Info (subnet and IP as JSON object)
+// JSONObject result = new JSONObject();
+
+// result.put("ip", ip);
+// result.put("subnet", subnet);
+
+// callbackContext.success(result);
+// return true;
+// }
+
+// boolean wifiIsEnabled = verifyWifiEnabled();
+// if (!wifiIsEnabled) {
+// callbackContext.error("WIFI_NOT_ENABLED");
+// return true; // Even though enable wifi failed, we still return true and handle error in callback
+// }
+
+// // Actions that DO require WiFi to be enabled
+// if (action.equals(ADD_NETWORK)) {
+// this.add(callbackContext, data);
+// } else if (action.equals(IS_CONNECTED_TO_INTERNET)) {
+// this.canConnectToInternet(callbackContext, true);
+// } else if (action.equals(CAN_CONNECT_TO_INTERNET)) {
+// this.canConnectToInternet(callbackContext, false);
+// } else if (action.equals(CAN_PING_WIFI_ROUTER)) {
+// this.canConnectToRouter(callbackContext, true);
+// } else if (action.equals(CAN_CONNECT_TO_ROUTER)) {
+// this.canConnectToRouter(callbackContext, false);
+// } else if (action.equals(ENABLE_NETWORK)) {
+// this.enable(callbackContext, data);
+// } else if (action.equals(DISABLE_NETWORK)) {
+// this.disable(callbackContext, data);
+// } else if (action.equals(GET_SSID_NET_ID)) {
+// this.getSSIDNetworkID(callbackContext, data);
+// } else if (action.equals(REASSOCIATE)) {
+// this.reassociate(callbackContext);
+// } else if (action.equals(RECONNECT)) {
+// this.reconnect(callbackContext);
+// } else if (action.equals(SCAN)) {
+// this.scan(callbackContext, data);
+// } else if (action.equals(REMOVE_NETWORK)) {
+// this.remove(callbackContext, data);
+// } else if (action.equals(CONNECT_NETWORK)) {
+// this.connect(callbackContext, data);
+// } else if (action.equals(DISCONNECT_NETWORK)) {
+// this.disconnectNetwork(callbackContext, data);
+// } else if (action.equals(LIST_NETWORKS)) {
+// this.listNetworks(callbackContext);
+// } else if (action.equals(START_SCAN)) {
+// this.startScan(callbackContext);
+// } else if (action.equals(GET_SCAN_RESULTS)) {
+// this.getScanResults(callbackContext, data);
+// } else if (action.equals(DISCONNECT)) {
+// this.disconnect(callbackContext);
+// } else if (action.equals(GET_CONNECTED_SSID)) {
+// this.getConnectedSSID(callbackContext);
+// } else if (action.equals(GET_CONNECTED_BSSID)) {
+// this.getConnectedBSSID(callbackContext);
+// } else if (action.equals(GET_CONNECTED_NETWORKID)) {
+// this.getConnectedNetworkID(callbackContext);
+// } else if (action.equals(RESET_BIND_ALL)) {
+// this.resetBindAll(callbackContext);
+// } else if (action.equals(SET_BIND_ALL)) {
+// this.setBindAll(callbackContext);
+// } else {
+// callbackContext.error("Incorrect action parameter: " + action);
+// // The ONLY time to return FALSE is when action does not exist that was called
+// // Returning false results in an INVALID_ACTION error, which translates to an error callback invoked on the JavaScript side
+// // All other errors should be handled with the fail callback (callbackContext.error)
+// // @see https://cordova.apache.org/docs/en/latest/guide/platforms/android/plugin.html
+// return false;
+// }
+
+// return true;
+// }
+
+// /**
+// * Scans networks and sends the list back on the success callback
+// *
+// * @param callbackContext A Cordova callback context
+// * @param data JSONArray with [0] == JSONObject
+// * @return true
+// */
+// private boolean scan(final CallbackContext callbackContext, final JSONArray data) {
+// Log.v(TAG, "Entering startScan");
+// final ScanSyncContext syncContext = new ScanSyncContext();
+
+// final BroadcastReceiver receiver = new BroadcastReceiver() {
+// public void onReceive(Context context, Intent intent) {
+// Log.v(TAG, "Entering onReceive");
+
+// synchronized (syncContext) {
+// if (syncContext.finished) {
+// Log.v(TAG, "In onReceive, already finished");
+// return;
+// }
+// syncContext.finished = true;
+// context.unregisterReceiver(this);
+// }
+
+// Log.v(TAG, "In onReceive, success");
+// getScanResults(callbackContext, data);
+// }
+// };
+
+// final Context context = cordova.getActivity().getApplicationContext();
+
+// Log.v(TAG, "Submitting timeout to threadpool");
+
+// cordova.getThreadPool().submit(new Runnable() {
+
+// public void run() {
+
+// Log.v(TAG, "Entering timeout");
+
+// final int TEN_SECONDS = 10000;
+
+// try {
+// Thread.sleep(TEN_SECONDS);
+// } catch (InterruptedException e) {
+// Log.e(TAG, "Received InterruptedException e, " + e);
+// // keep going into error
+// }
+
+// Log.v(TAG, "Thread sleep done");
+
+// synchronized (syncContext) {
+// if (syncContext.finished) {
+// Log.v(TAG, "In timeout, already finished");
+// return;
+// }
+// syncContext.finished = true;
+// context.unregisterReceiver(receiver);
+// }
+
+// Log.v(TAG, "In timeout, error");
+// callbackContext.error("TIMEOUT_WAITING_FOR_SCAN");
+// }
+
+// });
+
+// Log.v(TAG, "Registering broadcastReceiver");
+// context.registerReceiver(
+// receiver,
+// new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)
+// );
+
+// if (!wifiManager.startScan()) {
+// Log.v(TAG, "Scan failed");
+// callbackContext.error("SCAN_FAILED");
+// return false;
+// }
+
+// Log.v(TAG, "Starting wifi scan");
+// return true;
+// }
+
+// /**
+// * This methods adds a network to the list of available WiFi networks. If the network already
+// * exists, then it updates it.
+// *
+// * @return true if add successful, false if add fails
+// * @params callbackContext A Cordova callback context.
+// * @params data JSON Array with [0] == SSID, [1] == password
+// */
+// private boolean add(CallbackContext callbackContext, JSONArray data) {
+
+// Log.d(TAG, "WifiWizard2: add entered.");
+
+
+// try {
+// // data's order for ANY object is
+// // 0: SSID
+// // 1: authentication algorithm,
+// // 2: authentication information
+// // 3: whether or not the SSID is hidden
+// String newSSID = data.getString(0);
+// String newPass = data.getString(2);
+// String authType = data.getString(1);
+// boolean isHiddenSSID = data.getBoolean(3);
+
+// if(API_VERSION >= 29){
+// // Remove Double Quotes
+// newSSID = newSSID.replace("\"", "");
+// newPass = newPass.replace("\"", "");
+
+// this.networkCallback = new ConnectivityManager.NetworkCallback() {
+// @Override
+// public void onAvailable(Network network) {
+// connectivityManager.bindProcessToNetwork(network);
+// Log.d(TAG, "onAvailable");
+// callbackContext.success("onAvailable");
+// }
+// @Override
+// public void onUnavailable() {
+// super.onUnavailable();
+// Log.d(TAG, "onUnavailable");
+// callbackContext.error("onUnavailable");
+// }
+// };
+
+// // Connect Wifi using WifiNetworkSpecifier
+// WifiNetworkSpecifier.Builder builder = new WifiNetworkSpecifier.Builder();
+// builder.setIsHiddenSsid(this.hiddenSSID);
+
+// if (newSSID.endsWith("#")) {
+// newSSID = newSSID.replace("#", "");
+// builder.setSsidPattern(new PatternMatcher(newSSID, PatternMatcher.PATTERN_PREFIX));
+// }else {
+// builder.setSsid(newSSID);
+// }
+// builder.setWpa2Passphrase(newPass);
+
+// WifiNetworkSpecifier wifiNetworkSpecifier = builder.build();
+
+// NetworkRequest.Builder networkRequestBuilder1 = new NetworkRequest.Builder();
+// networkRequestBuilder1.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);
+// //removeCapability added for hotspots without internet
+// networkRequestBuilder1.removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
+// networkRequestBuilder1.setNetworkSpecifier(wifiNetworkSpecifier);
+
+// NetworkRequest nr = networkRequestBuilder1.build();
+// //timeout add because "No devices found" wasn't handled correct and doesn't throw Unavailable
+// connectivityManager.requestNetwork(nr, this.networkCallback, 30000);
+
+// }else{
+
+// // Initialize the WifiConfiguration object
+// WifiConfiguration wifi = new WifiConfiguration();
+// wifi.hiddenSSID = this.hiddenSSID;
+// wifi.SSID = newSSID;
+// wifi.preSharedKey = newPass;
+// wifi.status = WifiConfiguration.Status.ENABLED;
+// wifi.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
+// wifi.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
+// wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
+// wifi.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
+// wifi.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
+// wifi.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
+// wifi.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
+
+// wifi.networkId = ssidToNetworkId(newSSID);
+
+// // Set network to highest priority (deprecated in API >= 26)
+// if(API_VERSION < 26) {
+// wifi.priority = getMaxWifiPriority(wifiManager) + 1;
+// }
+
+// // After processing authentication types, add or update network
+// if(wifi.networkId == -1) { // -1 means SSID configuration does not exist yet
+
+// int newNetId = wifiManager.addNetwork(wifi);
+// if( newNetId > -1 ){
+// callbackContext.success( newNetId );
+// } else {
+// callbackContext.error( "ERROR_ADDING_NETWORK" );
+// }
+
+// } else {
+
+// int updatedNetID = wifiManager.updateNetwork(wifi);
+
+// if(updatedNetID == -1)
+// updatedNetID = wifiManager.addNetwork(wifi);
+
+// if(updatedNetID > -1) {
+// callbackContext.success( updatedNetID );
+// } else {
+// callbackContext.error("ERROR_UPDATING_NETWORK");
+// }
+
+// }
+
+// // WifiManager configurations are presistent for API 26+
+// if(API_VERSION < 26) {
+// wifiManager.saveConfiguration(); // Call saveConfiguration for older < 26 API
+// }
+// }
+
+// return true;
+
+
+// } catch (Exception e) {
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return false;
+// }
+// }
+
+// /**
+// * This method connects a network.
+// *
+// * @param callbackContext A Cordova callback context
+// * @param data JSON Array, with [0] being SSID to connect
+// */
+// private void enable(CallbackContext callbackContext, JSONArray data) {
+// Log.d(TAG, "WifiWizard2: enable entered.");
+
+// if (!validateData(data)) {
+// callbackContext.error("ENABLE_INVALID_DATA");
+// Log.d(TAG, "WifiWizard2: enable invalid data.");
+// return;
+// }
+
+// String ssidToEnable = "";
+// String bindAll = "false";
+// String waitForConnection = "false";
+
+// try {
+// ssidToEnable = data.getString(0);
+// bindAll = data.getString(1);
+// waitForConnection = data.getString(2);
+// } catch (Exception e) {
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return;
+// }
+
+// int networkIdToEnable = ssidToNetworkId(ssidToEnable);
+
+// try {
+
+// if(networkIdToEnable > -1) {
+
+// Log.d(TAG, "Valid networkIdToEnable: attempting connection");
+
+// // Bind all requests to WiFi network (only necessary for Lollipop+ - API 21+)
+// if(bindAll.equals("true")) {
+// registerBindALL(networkIdToEnable);
+// }
+
+// if(wifiManager.enableNetwork(networkIdToEnable, true)) {
+
+// if( waitForConnection.equals("true") ){
+// callbackContext.success("NETWORK_ENABLED");
+// return;
+// } else {
+// new ConnectAsync().execute(callbackContext, networkIdToEnable);
+// return;
+// }
+
+// } else {
+// callbackContext.error("ERROR_ENABLING_NETWORK");
+// return;
+// }
+
+// } else {
+// callbackContext.error("UNABLE_TO_ENABLE");
+// return;
+// }
+
+// } catch (Exception e) {
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return;
+// }
+
+// }
+
+// /**
+// * This method disables a network.
+// *
+// * @param callbackContext A Cordova callback context
+// * @param data JSON Array, with [0] being SSID to connect
+// * @return true if network disconnected, false if failed
+// */
+// private boolean disable(CallbackContext callbackContext, JSONArray data) {
+// Log.d(TAG, "WifiWizard2: disable entered.");
+
+// if (!validateData(data)) {
+// callbackContext.error("DISABLE_INVALID_DATA");
+// Log.d(TAG, "WifiWizard2: disable invalid data");
+// return false;
+// }
+
+// String ssidToDisable = "";
+
+// try {
+// ssidToDisable = data.getString(0);
+// } catch (Exception e) {
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return false;
+// }
+
+// int networkIdToDisconnect = ssidToNetworkId(ssidToDisable);
+
+// try {
+
+// if (networkIdToDisconnect > 0) {
+// if(wifiManager.disableNetwork(networkIdToDisconnect)){
+// maybeResetBindALL();
+// callbackContext.success("Network " + ssidToDisable + " disabled!");
+// } else {
+// callbackContext.error("UNABLE_TO_DISABLE");
+// }
+// return true;
+// } else {
+// callbackContext.error("DISABLE_NETWORK_NOT_FOUND");
+// Log.d(TAG, "WifiWizard2: Network not found to disable.");
+// return false;
+// }
+
+// } catch (Exception e) {
+
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return false;
+
+// }
+// }
+
+// /**
+// * This method removes a network from the list of configured networks.
+// *
+// * @param callbackContext A Cordova callback context
+// * @param data JSON Array, with [0] being SSID to remove
+// * @return true if network removed, false if failed
+// */
+// private boolean remove(CallbackContext callbackContext, JSONArray data) {
+// Log.d(TAG, "WifiWizard2: remove entered.");
+
+// if (!validateData(data)) {
+// callbackContext.error("REMOVE_INVALID_DATA");
+// Log.d(TAG, "WifiWizard2: remove data invalid");
+// return false;
+// }
+
+// // TODO: Verify the type of data!
+// try {
+// String ssidToDisconnect = data.getString(0);
+
+// if(API_VERSION >= 29){
+// if (networkCallback != null) {
+// connectivityManager.unregisterNetworkCallback(networkCallback);
+// networkCallback = null;
+// }
+// connectivityManager.releaseNetworkRequest(pending_intent_net_req_received);
+// // WifiNetworkSuggestion wifiNetworkSuggestion = new WifiNetworkSuggestion.Builder()
+// // .setSsid(ssidToDisconnect)
+// // .build();
+// // List list = new ArrayList();
+// // list.add(wifiNetworkSuggestion);
+// // wifiManager.removeNetworkSuggestions(list);
+// callbackContext.success("NETWORK_REMOVED");
+// return true;
+// }
+
+
+// int networkIdToRemove = ssidToNetworkId(ssidToDisconnect);
+
+// if (networkIdToRemove > -1) {
+
+// if( wifiManager.removeNetwork(networkIdToRemove) ){
+
+// // Configurations persist by default in API 26+
+// if (API_VERSION < 26) {
+// wifiManager.saveConfiguration();
+// }
+
+// callbackContext.success("NETWORK_REMOVED");
+
+// } else {
+
+// callbackContext.error( "UNABLE_TO_REMOVE" );
+// }
+
+// return true;
+// } else {
+// callbackContext.error("REMOVE_NETWORK_NOT_FOUND");
+// Log.d(TAG, "WifiWizard2: Network not found, can't remove.");
+// return false;
+// }
+// } catch (Exception e) {
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return false;
+// }
+// }
+
+// /**
+// * This method connects a network.
+// *
+// * @param callbackContext A Cordova callback context
+// * @param data JSON Array, with [0] being SSID to connect
+// */
+// private void connect(CallbackContext callbackContext, JSONArray data) {
+// Log.d(TAG, "WifiWizard2: connect entered.");
+
+// if(API_VERSION >= 29){
+// // No need to connect, its already connected via WifiNetworkSpecifier at add(...) method
+// callbackContext.success("NETWORK_CONNECTION_COMPLETED");
+// return;
+// }
+
+// if (!validateData(data)) {
+// callbackContext.error("CONNECT_INVALID_DATA");
+// Log.d(TAG, "WifiWizard2: connect invalid data.");
+// return;
+// }
+
+// String ssidToConnect = "";
+// String bindAll = "false";
+
+// try {
+// ssidToConnect = data.getString(0);
+// bindAll = data.getString(1);
+// } catch (Exception e) {
+// callbackContext.error(e.getMessage());
+// Log.d(TAG, e.getMessage());
+// return;
+// }
+
+// int networkIdToConnect = ssidToNetworkId(ssidToConnect);
+
+// if (networkIdToConnect > -1) {
+// // We disable the network before connecting, because if this was the last connection before
+// // a disconnect(), this will not reconnect.
+
+// Log.d(TAG, "Valid networkIdToConnect: attempting connection");
+
+// // Bind all requests to WiFi network (only necessary for Lollipop+ - API 21+)
+// if( bindAll.equals("true") ){
+// registerBindALL(networkIdToConnect);
+// }
+
+// if (API_VERSION >= 26) {
+// // wifiManager.disconnect();
+// } else {
+// wifiManager.disableNetwork(networkIdToConnect);
+// }
+
+// wifiManager.enableNetwork(networkIdToConnect, true);
+
+// if (API_VERSION >= 26) {
+// // wifiManager.reassociate();
+// }
+
+// new ConnectAsync().execute(callbackContext, networkIdToConnect);
+// return;
+
+// } else {
+// callbackContext.error("INVALID_NETWORK_ID_TO_CONNECT");
+// return;
+// }
+// }
+
+// /**
+// * Wait for connection before returning error or success
+// *
+// * This method will wait up to 60 seconds for WiFi connection to specified network ID be in COMPLETED state, otherwise will return error.
+// *
+// * @param callbackContext
+// * @param networkIdToConnect
+// * @return
+// */
+// private class ConnectAsync extends AsyncTask