my team enhancment

MOE_DEV_NEW_TEMPORARY_DESIGN
Mohamed Mekawy 6 years ago
parent ad56814966
commit 2117526e5f

@ -13,7 +13,6 @@
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
@ -82,11 +81,14 @@
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
</platform>
<platform name="android">
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="28" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
<plugin name="call-number" spec="^1.0.1" />
<plugin name="cordova-android-support-gradle-release" spec="^2.1.0" />
<plugin name="cordova-plugin-nativestorage" spec="^2.3.2" />
<plugin name="cordova-plugin-globalization" spec="^1.11.0" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.0" />
@ -105,6 +107,5 @@
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<engine name="browser" spec="5.0.4" />
<engine name="android" spec="7.1.4" />
<engine name="ios" spec="4.5.5" />
</widget>

File diff suppressed because it is too large Load Diff

@ -29,11 +29,11 @@
"@ionic-native/barcode-scanner": "^5.14.0",
"@ionic-native/ble": "^5.8.0",
"@ionic-native/call-number": "^5.8.0",
"@ionic-native/camera": "^5.8.0",
"@ionic-native/camera": "^5.14.0",
"@ionic-native/core": "^5.8.0",
"@ionic-native/date-picker": "^5.10.0",
"@ionic-native/device": "^5.8.0",
"@ionic-native/diagnostic": "^5.8.0",
"@ionic-native/diagnostic": "^5.14.0",
"@ionic-native/fingerprint-aio": "^5.8.0",
"@ionic-native/geolocation": "^5.10.0",
"@ionic-native/globalization": "^5.8.0",
@ -43,6 +43,7 @@
"@ionic-native/launch-navigator": "^5.8.0",
"@ionic-native/local-notifications": "^5.8.0",
"@ionic-native/native-storage": "^5.8.0",
"@ionic-native/open-native-settings": "^5.14.0",
"@ionic-native/push": "^5.8.0",
"@ionic-native/sms": "^5.8.0",
"@ionic-native/splash-screen": "^5.0.0",
@ -57,13 +58,15 @@
"app": "0.1.0",
"call-number": "^1.0.1",
"chart.js": "^2.8.0",
"cordova-android": "7.1.4",
"cordova-android-support-gradle-release": "^2.1.0",
"cordova-android": "8.1.0",
"cordova-android-support-gradle-release": "^3.0.1",
"cordova-browser": "5.0.4",
"cordova-ios": "4.5.5",
"cordova-open-native-settings": "^1.5.2",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-android-permissions": "^1.0.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-geolocation": "^4.0.2",
@ -78,6 +81,7 @@
"cordova-plugin-whitelist": "^1.3.4",
"cordova-sms-plugin": "^1.0.0",
"cordova-support-google-services": "^1.1.0",
"cordova.plugins.diagnostic": "^5.0.1",
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"mx.ferreyra.callnumber": "0.0.2",
@ -133,9 +137,6 @@
"mx.ferreyra.callnumber": {},
"cordova-plugin-badge": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"call-number": {},
"cordova-sms-plugin": {},
"cordova-plugin-datepicker": {},
@ -145,12 +146,22 @@
},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"cordova.plugins.diagnostic": {
"ANDROID_SUPPORT_VERSION": "28.+"
},
"cordova-open-native-settings": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},
"platforms": [
"browser",
"android",
"ios"
"ios",
"android"
]
}
}

@ -53,7 +53,7 @@
<p class="companyTxt">{{CompanyImageDescription}}</p>
</div>
<div class="menuFooter">
<div> <img src="../assets/imgs/HMG.png" class="CompanyImg"></div>
<div> <img src="../assets/imgs/CS.png" class="CompanyImg"></div>
<p class="companyTxt">{{companyDesc}}</p>
</div>
</ion-content>

@ -24,7 +24,7 @@ export class AppComponent implements OnInit, AfterViewInit {
user_image: string = "../assets/imgs/profile.png";
menuSide: string = "left";
notBadge: number;
companyUrl: string = "../assets/imgs/HMG.png";
companyUrl: string = "../assets/imgs/CS.png";
companyDesc: string = "Powered By Cloud Solutions";
public direction = "ltr";
constructor(
@ -63,7 +63,7 @@ export class AppComponent implements OnInit, AfterViewInit {
if (user) {
this.companyUrl = user.CompanyImageURL
? user.CompanyImageURL
: "../assets/imgs/HMG.png";
: "../assets/imgs/CS.png";
this.companyDesc = user.CompanyImageDescription
? user.CompanyImageDescription

@ -2,7 +2,7 @@
<ion-grid class="customGrid">
<ion-row>
<ion-col class="colPad">
<img class="centerDiv" src="../assets/imgs/HMG.png" />
<img class="centerDiv" src="../assets/imgs/CS.png" />
</ion-col>
</ion-row>
<ion-row>

@ -11,7 +11,7 @@
<ion-grid>
<ion-row>
<ion-col class="colPad">
<ion-img class="centerDiv" src="../assets/imgs/HMG.png"></ion-img>
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col>
</ion-row>
<ion-row>

@ -1,7 +1,8 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/eit/eit-list/" ></ion-back-button>
<nav-buttons backLink=""></nav-buttons>
<!-- <ion-back-button color="light" class="btnBack" defaultHref="/eit/eit-list/" ></ion-back-button> -->
</ion-buttons>
<ion-title color="light">{{headerTitle}}</ion-title>

@ -1,8 +1,8 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/eit/homepage" ></ion-back-button>
<!-- <ion-back-button color="light" class="btnBack" defaultHref="/eit/homepage" ></ion-back-button> -->
<nav-buttons backLink=""></nav-buttons>
</ion-buttons>
<ion-title color="light">{{headerTitle}}</ion-title>
</ion-toolbar>

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar">
<ion-title color="light">{{headerTitle}}</ion-title>
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home" ></ion-back-button>
<nav-buttons backLink=""></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>

@ -94,6 +94,7 @@ import { ReplacementListComponent } from '../vacation-rule/replacement-list/repl
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 { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
@NgModule({
imports: [
@ -245,7 +246,8 @@ import { WorkListAttachViewComponent } from '../notification/work-list-attach-vi
InAppBrowser,
RateService,
PaymentService,
MenuService
MenuService,
OpenNativeSettings
]
})
export class HmgCommonModule { }

@ -115,8 +115,8 @@ export class AuthenticationService {
}
public setPublicFields(request: Request): Request {
request.VersionID = 1.1;
request.Channel = 33;
request.VersionID = 1.3;
request.Channel = 31;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
//request.IPAdress = '10.10.10.10';
//request.SessionID = "any thing"; // ??? required for not authorized login funny
@ -193,7 +193,7 @@ export class AuthenticationService {
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
request.P_APP_VERSION="HMG";
request.P_APP_VERSION="CS";
return this.con.post(AuthenticationService.login, request, onError, errorLabel);
}
@ -448,7 +448,7 @@ export class AuthenticationService {
public checkUserAuthentication(request: CheckUserAuthenticationRequest, onError: any, errorLabel: string)
: Observable<CheckUserAuthenticationResponse> {
this.setPublicFields(request);
request.P_APP_VERSION="HMG";
request.P_APP_VERSION="CS";
return this.con.post(AuthenticationService.userChecking, request, onError, errorLabel);
}

@ -255,7 +255,7 @@ export class CommonService {
public showConnectionErrorDialog(onClick: any, okLabel: string) {
this.alertDialog(
onClick,
okLabel,
this.ts.trPK("general", "ok"),
this.ts.trPK("general", "alert"),
this.ts.trPK("general", "connError")
);
@ -266,7 +266,7 @@ export class CommonService {
onClick,
okLabel,
this.ts.trPK("general", "alert"),
this.ts.trPK("error", "timeout")
this.ts.trPK("general", "timeout")
);
}
@ -371,7 +371,7 @@ export class CommonService {
message: message,
buttons: [
{
text: acceptLabel,
text:this.ts.trPK("general", "ok"),
handler: () => {
if (onAccept) {
onAccept();

@ -19,8 +19,8 @@ export class ConnectorService {
public static timeOut = 30 * 1000;
// public static host = 'http://10.50.100.113:6060/'; // development service
//public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
// public static host = 'http://10.50.100.198:6060/';
// public static host = 'http://10.50.100.113:6060/'; // development service
/* public static host = 'http://10.50.100.198:6060/';

@ -3,51 +3,55 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Observable } from 'rxjs';
import { SubjectSubscriber } from 'rxjs/internal/Subject';
import { TranslatorService } from '../translator/translator.service';
import { promise } from 'protractor';
import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
@Injectable({
providedIn: 'root'
})
export class DevicePermissionsService {
public static granted = 'granted';
public camera;
public mic;
public storage;
public static GRANTED = 'GRANTED';
public static DENIED_ALWAYS = 'DENIED_ALWAYS';
public static CAMERA_MIC = 'camera_mic_permission';
public static LOCATION = 'location_permission';
public onSucess;
public onerror;
constructor(public diagnostic: Diagnostic,
public cs: CommonService) { }
constructor(
public diagnostic: Diagnostic,
public cs: CommonService,
public nativeStorage: NativeStorage,
public ts: TranslatorService,
public nativeSettings: OpenNativeSettings) { }
public requestCameraPermission(camera: boolean, mic: boolean, storage: boolean): Observable<boolean> {
this.camera = camera;
this.mic = mic;
this.storage = storage;
return Observable.create( observer => {
this.requestCamera( observer);
});
}
public requestCameraPermission(): Observable<boolean> {
public requestCamera(observer: any) {
this.diagnostic.isCameraAvailable().then((isAvailable) => {
return Observable.create(observer => {
this.requestCamera(observer);
});
}
private requestCamera(observer: any) {
//console.log("Camera permission????????")
this.hasCameraPermission().then((isAvailable) => {
if (isAvailable) {
if ( this.mic ) {
this.requestMicophonePermission(observer);
} else {
this.observerDone(observer, true);
}
// this.requestMicophonePermission(observer);
this.observerDone(observer, true);
} else {
this.diagnostic.requestCameraAuthorization(false).then((value) => {
// alert( JSON.stringify(value));
if (value.toLowerCase() === DevicePermissionsService.granted) {
if ( this.mic ) {
this.requestMicophonePermission(observer);
} else {
this.observerDone(observer, true);
}
this.diagnostic.requestCameraAuthorization(true).then((value) => {
if (value == DevicePermissionsService.GRANTED) {
//this.requestMicophonePermission(observer);
this.observerDone(observer, true);
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
// this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false);
} else {
this.cameraError(observer);
this.observerDone(observer, false);
}
});
}
@ -56,7 +60,6 @@ export class DevicePermissionsService {
});
}
private cameraError(observer) {
this.cs.presentConfirmDialog('camera permission required', () => {
@ -66,7 +69,6 @@ export class DevicePermissionsService {
});
}
private requestMicophonePermission(observer: any) {
this.diagnostic.isMicrophoneAuthorized().then((isAvailable) => {
@ -75,10 +77,13 @@ export class DevicePermissionsService {
this.observerDone(observer, true);
} else {
this.diagnostic.requestMicrophoneAuthorization().then((value) => {
if (value.toLowerCase() === DevicePermissionsService.granted) {
if (value == DevicePermissionsService.GRANTED) {
this.observerDone(observer, true);
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, true);
this.observerDone(observer, false);
} else {
this.micError(observer);
this.observerDone(observer, false);
}
});
}
@ -97,8 +102,197 @@ export class DevicePermissionsService {
});
}
private observerDone (observer: any, success: boolean ) {
observer.next( success ) ;
private observerDone(observer: any, success: boolean) {
observer.next(success);
observer.complete();
}
public async hasCameraPermission(): Promise<boolean> {
return this.diagnostic.isCameraAuthorized(true);
}
public async hasCameraAndMicPermissions(): Promise<boolean> {
let camera = await this.hasCameraPermission();
//let mic = await this.diagnostic.isMicrophoneAuthorized();
if (camera) {
// await this.setAlwaysDenied(DevicePermissionsService.CAMERA_MIC, false);
return true;
} else {
return false;
}
}
private permissionRequestDialog(message: string): Promise<boolean> {
return new Promise((resolve, reject) => {
this.cs.confirmAlertDialogPrimarySecondary(() => {
resolve(true);
}, this.ts.trPK('general', 'accept'),
() => {
resolve(false)
}, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message
);
});
}
private permissionSettingsDialog(message) {
return new Promise((resolve, reject) => {
this.cs.confirmAlertDialogPrimarySecondary(() => {
resolve(true);
}, this.ts.trPK('general', 'settings'),
() => {
resolve(false)
}, this.ts.trPK('general', 'not-now'), this.ts.trPK('general', 'confirm'), message
);
});
}
public static APP_SETTINGS = 'application_details';
public async openApplicationSettings() {
// return new Promise((resolver, reject) => {
// this.nativeSettings.open(DevicePermissionsService.APP_SETTINGS).then(result => {
// setTimeout(() => {
// this.cs.presentConfirmDialog(this.ts.trPK('permissions', 'check-updates'),
// () => resolver(true), () => resolver(false)
// );
// }, 1500);
// });
// });
}
private async isPermissionAlwaysDenied(permissionKey: string) {
// return new Promise((resolver, rejector) => {
// this.nativeStorage.getItem(permissionKey).then(denied => {
// resolver(denied != null && denied == true);
// }, () => {
// resolver(false);
// });
// });
}
private async resetAlwaysDenied(permissionKey: string) {
return new Promise((resolver, rejector) => {
this.nativeStorage.setItem(permissionKey, false).then(done => {
resolver(done);
}, () => {
resolver(false);
});
});
}
private async setAlwaysDenied(permissionKey: string, dendied: boolean) {
// let result = await this.nativeStorage.setItem(permissionKey, dendied);
// return result;
}
public async openCameraAndMicSettings2() {
// return new Promise((resolver, reject) => {
// this.nativeSettings.open('application_details').then(result => {
// setTimeout(() => {
// this.cs.presentConfirmDialog(this.ts.trPK('permissions', 'check-updates'), () => {
// this.hasCameraAndMicPermissions().then(
// granted => resolver(granted), () => resolver(false));
// });
// }, 1000);
// });
// });
}
public async requestCameraAutherization() {
if (await this.hasCameraAndMicPermissions()) {
return true;
} else {
let message = this.ts.trPK('permissions', 'camera');
// if (await this.isPermissionAlwaysDenied(DevicePermissionsService.CAMERA_MIC)) {
// if (await this.permissionSettingsDialog(message)) {
// return this.openCameraAndMicSettings();
// }
// } else {
if (await this.permissionRequestDialog(message)) {
return this.requestCameraPermission().toPromise();
}
// }
return false;
}
}
/* geolocation permission */
public async requestLocationAutherization() {
if ( await this.isLocationEnabled()) {
if (await this.hasLocationPermissions()) {
return true;
} else {
let message = this.ts.trPK('permissions', 'location');
// if (await this.isPermissionAlwaysDenied(DevicePermissionsService.LOCATION)) {
// if (await this.permissionSettingsDialog(message)) {
// return this.openLocationSettings();
// }
// } else {
if (await this.permissionRequestDialog(message)) {
return this.requestLocationPermission();
}
// }
return false;
}
} else {
return false;
}
}
private async isLocationEnabled() {
let isAvailable = await this.diagnostic.isLocationEnabled();
if (!isAvailable) {
this.cs.presentAlert(this.ts.trPK('permissions', 'enable-location'), () => {
});
}
return isAvailable;
}
public async hasLocationPermissions(): Promise<boolean> {
let location = await this.diagnostic.isLocationAvailable();
if (location) {
await this.setAlwaysDenied(DevicePermissionsService.LOCATION, false);
return true;
} else {
return false;
}
}
public async openCameraAndMicSettings() {
// let update = await this.openApplicationSettings();
// return update ? this.hasCameraAndMicPermissions() : false;
}
public async openLocationSettings() {
// let update = await this.openApplicationSettings();
// return update ? this.hasLocationPermissions() : false;
}
private async requestLocationPermission() {
let hasPermissions = await this.hasLocationPermissions();
if (!hasPermissions) {
let value = await this.diagnostic.requestLocationAuthorization();
if (value == DevicePermissionsService.GRANTED) {
return true;
} else if (value == DevicePermissionsService.DENIED_ALWAYS) {
this.setAlwaysDenied(DevicePermissionsService.LOCATION, true);
}
}
return false;
}
}

@ -8,7 +8,7 @@
<ion-grid>
<ion-row>
<ion-col class="colPad">
<ion-img class="centerDiv" src="../assets/imgs/HMG.png"></ion-img>
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
</ion-col>
</ion-row>
<ion-row>

@ -31,7 +31,7 @@
</button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="attendance()">
<button ion-button block class="serviceItem" (click)="getDeviceLocation()">
<ion-img class="serviceItemImg" src="../assets/imgs/attend.png"></ion-img>
<p>{{ts.trPK('attendance','attendance')}}</p>
</button>

@ -15,6 +15,7 @@ import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request"
import { Response } from "src/app/hmg-common/services/models/response";
import { AttendanceService } from "./services/attendance.services";
import { LoginRequest } from "../hmg-common/services/authentication/models/login.request";
import { DevicePermissionsService } from '../hmg-common/services/device-permissions/device-permissions.service';
@Component({
selector: "app-home",
@ -31,6 +32,8 @@ export class HomePage implements OnInit {
lat: any;
longt: any;
deviceID: string;
location: boolean;
camera: boolean
constructor(
public ts: TranslatorService,
public menu: MenuController,
@ -43,35 +46,54 @@ export class HomePage implements OnInit {
private geolocation: Geolocation,
private attendance_service: AttendanceService,
private eitService: EitService,
private barcodeScanner: BarcodeScanner
private barcodeScanner: BarcodeScanner,
private permissions: DevicePermissionsService
) { }
ngOnInit() {
this.getUserDetails();
this.getMenu();
this.setServicesPrivilage();
this.geolocation
.getCurrentPosition()
.then(resp => {
// resp.coords.latitude
// resp.coords.longitude
//console.log("Loc 3");
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
this.lat=resp.coords.latitude;
this.longt=resp.coords.longitude;
})
.catch(error => {
console.log("Error getting location", error);
});
this.getCount();
this.events.subscribe("getNotCount", badge => {
this.notBadge = badge;
});
}
setServicesPrivilage(){
for(let i=0;i<AuthenticationService.servicePrivilage.length;i++)
if(AuthenticationService.servicePrivilage[i].Previlege==false){
document.getElementById(AuthenticationService.servicePrivilage[i].ServiceName).setAttribute("disabled","disabled");
}
getDeviceLocation() {
//console.log("mekaaaaaaaaaaaaa?????????");
this.permissions.requestLocationAutherization().then(granted => {
this.location = granted as boolean;
if (this.location) {
this.geolocation
.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true })
.then(resp => {
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
})
.catch(error => {
console.log("Error getting location", error);
});
} else {
return false;
}
});
}
setServicesPrivilage() {
for (let i = 0; i < AuthenticationService.servicePrivilage.length; i++)
if (AuthenticationService.servicePrivilage[i].Previlege == false) {
document.getElementById(AuthenticationService.servicePrivilage[i].ServiceName).setAttribute("disabled", "disabled");
document.getElementById(AuthenticationService.servicePrivilage[i].ServiceName).style.filter = "grayscale(1)"
}
}
getCount() {
const req: any = {};
@ -117,8 +139,8 @@ export class HomePage implements OnInit {
//console.log("Loc 1");
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
this.lat=resp.coords.latitude;
this.longt=resp.coords.longitude;
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
})
.catch(error => {
console.log("Error getting location", error);
@ -241,8 +263,13 @@ export class HomePage implements OnInit {
// };
//console.log("your currnt location is");
//console.log("Loc");
this.scanCode();
this.permissions.requestCameraAutherization().then(granted => {
this.camera = granted as boolean;
if (this.camera) {
this.scanCode();
}
}
);
}
scanCode() {
@ -260,16 +287,16 @@ export class HomePage implements OnInit {
// alert(error); // Error message
// });
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
// let strResult = JSON.parse(barcodeData);
// console.log(strResult.QRValue);
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
this.swipeAttendance();
}).catch(err => {
console.log('Error', err);
});
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
// let strResult = JSON.parse(barcodeData);
// console.log(strResult.QRValue);
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
this.swipeAttendance();
}).catch(err => {
console.log('Error', err);
});
}
swipeAttendance() {

@ -2,7 +2,7 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" (click)="goback()"></ion-back-button>
<nav-buttons [navigate] = "false" (backClick)="goback()"></nav-buttons>
<ion-icon class="search-icons" color="light" name="arrow-back" *ngIf="modalFlag" (click)="dismiss()"></ion-icon>
</ion-buttons>
<ion-title color="light" >{{headerTitle}}</ion-title>

@ -15,6 +15,7 @@ import { IonInfiniteScroll } from '@ionic/angular';
})
export class DetailsComponent implements OnInit {
public static opendEmployeesARR='opend_employees_arr';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
pageNum: number = 1;
pageLimit: number = 50;
@ -27,6 +28,7 @@ export class DetailsComponent implements OnInit {
infiniteRequest: any;
isSpecialist: boolean = false;
selMenu: MenuResponse = new MenuResponse();
public opendEmployees :any=[];
public headerTitle: string = "";
constructor(
public menuService: MenuService,
@ -34,17 +36,30 @@ export class DetailsComponent implements OnInit {
public myTeamService: MyTeamService,
public ts: TranslatorService,
public modalController: ModalController,
private location: Location
private location: Location,
public authService: AuthenticationService,
) {
console.log("Constuctor called");
}
ngOnInit() {
this.intializeMemberDetail();
}
intializeMemberDetail(userID?){
this.pageLimit = 50;
this.pageNum = 1;
this.employee = this.common.sharedService.getSharedData(
MyTeamService.EMPLOYEE_SHARED_DATA,
false
);
let employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false);
if( employees ){
this.opendEmployees.push(this.employee);
this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR);
}
//this.opendEmployees = employees;
console.log(this.employee);
this.selMenu = this.common.sharedService.getSharedData(
MenuResponse.SHARED_DATA,
@ -62,12 +77,30 @@ export class DetailsComponent implements OnInit {
// ? this.navParams.get("isSpecialist")
// : false;
if (this.employee) this.getEmpSubordinate();
if (this.employee) this.getEmpSubordinate(userID);
}
goback() {
this.location.back();
//this.location.back();
const user = this.authService.getAuthenticatedUser();
if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER){
this.opendEmployees=[];
this.common.openMyTeamPage();
}else{
for(let i=0;i<this.opendEmployees.length;i++){
if(this.opendEmployees[i].EMPLOYEE_NUMBER==this.employee.SUPERVISOR_NUMBER){
this.common.sharedService.setSharedData(
this.opendEmployees[i],
MyTeamService.EMPLOYEE_SHARED_DATA
);
break;
}
}
this.intializeMemberDetail(this.employee.SUPERVISOR_NUMBER);
}
}
getEmpSubordinate() {
getEmpSubordinate(userID) {
this.modalFlag = this.employee.isModal;
let selEmpNo: string = null;
this.pageNum = 1;
@ -108,7 +141,11 @@ export class DetailsComponent implements OnInit {
searchEmpName = "";
searchEmpEmail = "";
}
if(userID){
selEmpNo=userID;
}else{
selEmpNo = this.employee.EMPLOYEE_NUMBER;
}
const body = {
P_SELECTED_EMPLOYEE_NUMBER: selEmpNo,
P_SEARCH_EMPLOYEE_NUMBER: searchEmpNum,
@ -182,12 +219,13 @@ export class DetailsComponent implements OnInit {
}
}
getDetails(index) {
this.empSubordinate[index].isModal = true;
//this.empSubordinate[index].isModal = true;
this.common.sharedService.setSharedData(
this.empSubordinate[index],
MyTeamService.EMPLOYEE_SHARED_DATA
);
this.presentModal();
this.intializeMemberDetail();
// this.presentModal();
}
async presentModal() {
//this.modalFlag = true;
@ -241,7 +279,10 @@ export class DetailsComponent implements OnInit {
}
}
}
sortMenuEntires(list) {
this.close().then(() => {
});
let tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, "menuEntries");
// this.common.navigateForward("/eit/homepage");
@ -250,6 +291,12 @@ export class DetailsComponent implements OnInit {
// this.navCtrl.push("MenuEntriesPage", { menuEntries: tree });
}
public async close() {
const modal = await this.modalController.getTop();
if (modal) {
modal.dismiss();
}
}
goToSubordinate() {
this.selMenu.search=true;
this.common.sharedService.setSharedData(

@ -17,8 +17,7 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" defaultHref="/home" ></ion-back-button>
<nav-buttons backLink="/home" *ngIf="!isSearch"></nav-buttons>
<ion-icon class="search-icons" color="light" name="arrow-back" *ngIf="isSearch" (click)="dismiss()"></ion-icon>
</ion-buttons>
<ion-title color="light" >{{headerTitle}}</ion-title>

@ -6,6 +6,7 @@ import { AuthenticationService } from "src/app/hmg-common/services/authenticatio
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { MyTeamService } from "../service/my-team.service";
import { ModalController } from "@ionic/angular";
import { DetailsComponent } from '../details/details.component';
@Component({
selector: "app-home",
templateUrl: "./home.component.html",
@ -34,6 +35,7 @@ export class HomeComponent implements OnInit {
) {}
ngOnInit() {
this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR);
this.setIntitial();
}
goback() {
@ -205,6 +207,7 @@ export class HomeComponent implements OnInit {
animated: false,
componentProps: { isSearch: true }
});
modal.cssClass="full-modal";
let dismissed = modal.onDidDismiss();
dismissed.then(() => {
this.isSearch = false;
@ -216,4 +219,5 @@ export class HomeComponent implements OnInit {
dismissed: true
});
}
}

@ -131,6 +131,6 @@
<ion-button color="customnavy" class="gridBtn" (click)="actionButton()"> {{ts.trPK('general','submit')}}</ion-button>
</div>
<div class="centerDiv" >
<ion-button color="customnavy" class="gridBtn" (click)="nextNotfification()">next</ion-button>
<ion-button color="customnavy" class="gridBtn" (click)="nextNotfification()">{{ts.trPK('workListMain','skip')}}</ion-button>
</div>
</ion-footer>

@ -14,6 +14,8 @@ 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';
import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
import { Events } from '@ionic/angular';
@Component({
selector: "app-worklist-main",
templateUrl: "./worklist-main.component.html",
@ -49,11 +51,14 @@ export class WorklistMainComponent implements OnInit {
notificationDynamicAttributeArr:any;
private textInput: TextInput;
private textArea: TextAreaInput;
notificationCount: any;
constructor(
public common: CommonService,
public ts: TranslatorService,
public worklistMainService: WorklistMainService,
public elementRef: ElementRef,
public menuService: MenuService,
public events: Events,
) { }
ngOnInit() {
@ -167,6 +172,7 @@ export class WorklistMainComponent implements OnInit {
// this.notificationArray.splice(i, 1);
// }
// }
this.getNotificationCountAfterSubmit();
this.nextNotfification();
}
} // valid it
@ -194,7 +200,6 @@ export class WorklistMainComponent implements OnInit {
}
actionButton() {
console.log("test>>>>>>>>>>>>>>");
let ButtonAction: string = this.actionType;
var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = [];
@ -357,6 +362,8 @@ export class WorklistMainComponent implements OnInit {
this.common.openWorklistHistoryPage();
}
openSupportDocuments() {
// this.navCtrl.push("WorkListAttachPage", {
// passNotificationInfo: this.getPassNotificationDetails
@ -437,4 +444,18 @@ export class WorklistMainComponent implements OnInit {
this.common.openNotificationDetailsPage();
}
}
getNotificationCountAfterSubmit() {
const req: any = {};
this.menuService.getNotificationCount(req).subscribe((result: any) => {
if (this.common.validResponse(result)) {
this.notificationCount =
result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM;
if (this.notificationCount <= 0) {
this.notificationCount = null;
}
this.events.publish("getNotCount", this.notificationCount);
}
});
}
}

@ -129,6 +129,10 @@
"en": "Birth Date",
"ar": "تاريخ الميلاد"
},
"timeout": {
"en": " The connection timeout expired due to an error in the network or servers may be busy!",
"ar": " انتهت مهلة الاتصال بسبب خطأ في الشبكة أو الخوادم قد تكون مشغولة!"
},
"alert": {
"en": "Alert",
"ar": "تنبية"
@ -1363,11 +1367,33 @@
"ar": "قائمة الموافقين"
}
},
"permissions": {
"camera": {
"en": "Camera access require user permission",
"ar": "وصول الكاميرا تتطلب إذن المستخدم"
},
"location": {
"en": "Location access require user permission",
"ar": "وصول تحديد الموقع تتطلب إذن المستخدم"
},
"check-updates": {
"en": "Update new access permissions",
"ar": "تحديث صلاحيات الإستخدام الجديدة"
},
"enable-location": {
"en": "Location services must be enabled to use this service",
"ar": "يجب تمكين خدمات تحديد الموقع لاستخدام هذه الخدمة"
}
},
"workListMain": {
"suppDoc": {
"en": "Support Documents",
"ar": "مستندات الدعم"
},
"skip": {
"en": "skip",
"ar": "تخطى"
},
"rfc": {
"en": "Return for correction",
"ar": "عودة لتصحيح"

@ -42,6 +42,10 @@ ion-label{
.profileDiv{
margin: 5px auto !important;
}
.full-modal{
--height:100%;
--width:100%;
}
.profileImg{
width: 90px;
height: 90px;

@ -0,0 +1 @@
,HMG/Mohamed.Mekawy,CS-1F-MOHAMED,01.10.2019 15:25,file:///C:/Users/mohamed.mekawy/AppData/Roaming/LibreOffice/4;

@ -0,0 +1,48 @@
GET_SHIFT_TYPES
GET_TIME_CARD_SUMMARY
GET_DAY_HOURS_TYPE_DETAILS
GET_SCHEDULE_SHIFTS_DETAILS
GET_SWIPES
GET_PAYSLIP
GET_SUMMARY_OF_PAYMENT
GET_EARNINGS
GET_DEDUCTIONS
GET_PAYMENT_INFORMATION
GET_MO_NOTIFICATION_BODY
GET_PR_NOTIFICATION_BODY
GET_PO_NOTIFICATION_BODY
GET_PO_ITEM_HISTORY
GET_QUOTATION_ANALYSIS
GET_PENDING_REQ_FUNCTIONS
GET_PENDING_REQ_DETAILS
UPDATE_EMPLOYEE_IMAGE
GET_OBJECT_VALUES
GET_EMPLOYEE_PHONES
SUBMIT_PHONES_TRANSACTION
START_PHONES_APPROVAL_PROCESS
GET_PHONES_NOTIFICATION_BODY
GET_EMPLOYEE_BASIC_DETAILS
GET_BASIC_DET_COLS_STRUCTURE
GET_BASIC_DET_DFF_STRUCTURE
SUBMIT_BASIC_DET_TRANSACTION
START_BASIC_DET_APPR_PROCESS
GET_BASIC_DET_NTF_BODY
GET_MO_ITEM_HISTORY
GET_COUNTRIES
GET_EMPLOYEE_ADDRESS
GET_ADDRESS_DFF_STRUCTURE
SUBMIT_ADDRESS_TRANSACTION
START_ADDRESS_APPROVAL_PROCESS
GET_ADDRESS_NOTIFICATION_BODY
GET_EMPLOYEE_CONTACTS
GET_CONTACT_DETAILS
GET_CONTACT_COLS_STRUCTURE
GET_CONTACT_DFF_STRUCTURE
SUBMIT_CONTACT_TRANSACTION
START_CONTACT_APPROVAL_PROCESS
GET_TERM_COLS_STRUCTURE
GET_TERM_DFF_STRUCTURE
SUBMIT_TERM_TRANSACTION
START_TERM_APPROVAL_PROCESS
GET_TERM_NOTIFICATION_BODY
GET_CONTACT_NOTIFICATION_BODY
Loading…
Cancel
Save