fix notification & home

MOHEMM-Q3-DEV-LATEST
mohamed.mekawy 5 years ago
parent 492eb5d912
commit ad56814966

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.cloudsolutions.alhabibmohemm" version="1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="com.cloudsolutions.alhabibmohemm" version="1.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MOHEMM</name>
<description>an app created by cloud Solutions</description>
<author email="eservices.hmg@drsulaimanalhabib.com" href="http://cloudsolution-sa.com">Cloud Solutions</author>

@ -1,34 +1,34 @@
{
"project_info": {
"project_number": "608631731238",
"firebase_url": "https://mohemm-cs.firebaseio.com",
"project_id": "mohemm-cs",
"storage_bucket": "mohemm-cs.appspot.com"
"project_number": "679409052782",
"firebase_url": "https://mohemm-dce93.firebaseio.com",
"project_id": "mohemm-dce93",
"storage_bucket": "mohemm-dce93.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:608631731238:android:3a8384007f8700ec",
"mobilesdk_app_id": "1:679409052782:android:dba155ac0859d7fea78a7f",
"android_client_info": {
"package_name": "com.cloudsolutions.mohemm"
"package_name": "hmg.cloudSolutions.mohem"
}
},
"oauth_client": [
{
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com",
"client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB5zpz9vC2NOxsU1dPr0TK0dVaMY5D4Mjg"
"current_key": "AIzaSyDgWjuSBIKGghWxYg_KGBRIZTi-O_UA8mU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com",
"client_id": "679409052782-mtd6d8rjltucnm9uatn6g7et08sm6lbv.apps.googleusercontent.com",
"client_type": 3
}
]

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain>localhost</domain>
</domain-config>
</network-security-config>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 KiB

After

Width:  |  Height:  |  Size: 132 KiB

@ -48,8 +48,8 @@
</ion-item>
</ion-list>
<div class="">
<div> <img src="{{companyUrl}}" class="CompanyImg logoImg"></div>
<div class="" style="text-align:center">
<img src="{{companyUrl}}" class="CompanyImg logoImg">
<p class="companyTxt">{{CompanyImageDescription}}</p>
</div>
<div class="menuFooter">

@ -171,8 +171,6 @@ button.menu-item.item.item-block.item-ios {
.logoImg{
width: 120px;
position: relative;
left: 100px;
top: 120px;
}
.companyTxt {

@ -1,4 +1,3 @@
<ion-content padding>
<ion-grid class="customGrid">
<ion-row>
@ -27,6 +26,11 @@
</ion-input>
</ion-item>
<ion-item>
<ion-label>{{ts.trPK('login','remeber-me')}}</ion-label>
<ion-checkbox [(ngModel)]="remeberMe" (ionChange)="addValue($event)" ></ion-checkbox>
</ion-item>
<div class="centerDiv signupDiv" *ngIf="isAppleStore==false">
<a (click)="signUp()">{{ts.trPK('login','signup')}}</a>
</div>

@ -2,7 +2,7 @@ import { Component, OnInit, NgZone, OnDestroy } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { Router } from "@angular/router";
import { AlertController } from "@ionic/angular";
import { AlertController, Platform } from "@ionic/angular";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { CheckUserAuthenticationResponse } from "src/app/hmg-common/services/authentication/models/check-user-auth.response";
import { SmsReaderService } from "src/app/hmg-common/services/sms/sms-reader.service";
@ -14,6 +14,7 @@ import { LoginModel } from "../models/LoginModel";
import { LoginRequest } from "src/app/hmg-common/services/authentication/models/login.request";
import { Password } from '../models/password';
import { CheckUserAuthenticationRequest } from 'src/app/hmg-common/services/authentication/models/check-user-auth.request';
import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response';
@Component({
selector: "login",
@ -29,6 +30,9 @@ export class LoginComponent implements OnInit, OnDestroy {
private password: string;
private language: string;
private username: string;
private remeberMe: boolean;
private iosLink: string;
private androidLink: string;
private currentLang: any = 1;
private patientOutSA: boolean;
private loginTokenID: string;
@ -47,10 +51,21 @@ export class LoginComponent implements OnInit, OnDestroy {
public ngZone: NgZone,
public device: Device,
public splash: SplashScreen,
public sharedData: SharedDataService
public sharedData: SharedDataService,
public plt: Platform
) { }
ngOnInit() { }
ngOnInit() {
this.username = localStorage.getItem("user");
this.password = localStorage.getItem("password");
let remember = localStorage.getItem("remember");
if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false }
// alert("user>>" + this.username);
// alert("pass>>>" + this.password);
// alert("remember>>>" + this.remeberMe);
}
ngOnDestroy(): void {
this.backClicked();
@ -74,11 +89,55 @@ export class LoginComponent implements OnInit, OnDestroy {
}
}
public addValue(e): void {
// console.log(e.currentTarget.checked);
this.remeberMe = e.currentTarget.checked;
this.remeberMyInfo();
}
public remeberMyInfo() {
if (this.remeberMe) {
if(this.username){localStorage.setItem("user", this.username);}
if(this.password){localStorage.setItem("password", this.password);}
localStorage.setItem("remember", "true");
} else {
localStorage.setItem("user", "");
localStorage.setItem("password", "");
localStorage.setItem("remember", "false");
}
}
public onLogin() {
this.checkAppUpdated();
// this.checkUserAuthentication();
}
public checkAppUpdated() {
this.authService.checkApplicationVersion(
() => {
/* Write code for error */
}).subscribe((result: CheckAppVersionResponse) => {
if (result.MessageStatus == 2 && result.ErrorType == 4) {
this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{
this.handleAppUpdate(result)
});
} else if (result.MessageStatus == 1) {
this.checkUserAuthentication();
}
});
}
private handleAppUpdate(result){
this.iosLink = result.IOSLink;
this.androidLink = result.AndroidLink;
if (this.plt.is('android')) {
if (this.androidLink)
window.open(this.androidLink, '_system');
}
else if (this.plt.is('ios')) {
if (this.iosLink)
window.open(this.iosLink, '_system');
}
}
private checkUserAuthentication() {
console.log("debug Here!!");
@ -104,12 +163,12 @@ export class LoginComponent implements OnInit, OnDestroy {
this.loginData.P_USER_NAME = this.username;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo();
this.cs.openSMSPage();
} else {
console.log("result.IsPasswordExpired");
console.log(result.IsPasswordExpired);
if(result.IsPasswordExpired)
{
if (result.IsPasswordExpired) {
this.presentPasswordExpiredDialog();
}
}

@ -147,6 +147,7 @@ export class SmsPageComponent implements OnInit {
.subscribe((result: SMSCheckResponse) => {
console.log(result);
if (this.common.validResponse(result)) {
AuthenticationService.servicePrivilage=result.Privilege_List;
this.authService.setAuthenticatedUser(result).subscribe(() => {
this.common.openHome();
});

@ -22,11 +22,13 @@ import { UserLocalNotificationService } from "../user-local-notification/user-lo
import { GetLoginInfoRequest } from "./models/get-login-info.request";
import { GetLoginInfoResponse } from "./models/get-login-info.response";
import { analyzeAndValidateNgModules } from "@angular/compiler";
import { Events } from "@ionic/angular";
import { Events, MenuController } from "@ionic/angular";
import { InternationalMobileComponent } from "../../ui/mobile-number/international-mobile/international-mobile.component";
import { SMSCheckRequest } from "./models/smscheck.request";
import { SMSCheckResponse } from "./models/smscheck.response";
import { ForgetPassword } from 'src/app/authentication/models/forget.password';
import { CheckAppVersionResponse } from './models/check-app-version.response';
import { PrivilageModel } from './models/privilage-model';
@Injectable({
providedIn: "root"
@ -58,12 +60,14 @@ export class AuthenticationService {
public static sendSMSForgotFileNoURL = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber';
public static forgotFileIDURL = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo';
public static user: AuthenticatedUser;
public static servicePrivilage : PrivilageModel[];
/*user checking methods */
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static changePasswordForget ='Services/ERP.svc/REST/ChangePassword_Forget';
public static changePassword ='Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static expiredPassword = 'Services/ERP.svc/REST/ChangePassword_Expired';
public static checkAppVersion = 'Services/Utilities.svc/REST/CheckMobileAppVersion';
public static LOGIN_EVENT = 'user-login-event';
public static FAMILY_LOGIN_EVENT = 'family-login-event';
@ -78,7 +82,8 @@ export class AuthenticationService {
public ts: TranslatorService,
public nativeStorage: NativeStorage,
public localNotifications: UserLocalNotificationService,
private events: Events
private events: Events,
private menu: MenuController,
) { }
public authenticateRequest(request: Request, automaticLogin = true): Request {
@ -110,8 +115,8 @@ export class AuthenticationService {
}
public setPublicFields(request: Request): Request {
request.VersionID = 1;
request.Channel = 31;
request.VersionID = 1.1;
request.Channel = 33;
request.LanguageID = TranslatorService.getCurrentLanguageCode();
//request.IPAdress = '10.10.10.10';
//request.SessionID = "any thing"; // ??? required for not authorized login funny
@ -179,6 +184,12 @@ export class AuthenticationService {
return request;
}
public checkApplicationVersion(onError: any): Observable<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
}
public login(request: LoginRequest, onError: any, errorLabel: string): Observable<Response> {
this.setPublicFields(request);
@ -608,10 +619,11 @@ export class AuthenticationService {
}
private sessionTimeOutDialog() {
this.cs.presentConfirmDialog(
this.cs.presentAcceptDialog(
this.ts.trPK("general", "idle-relogin"),
() => {
// this.cs.openUserLogin();
this.cs.sharedService.clearAll();
this.cs.openLogin();
}
);
}

@ -0,0 +1,7 @@
import { Response } from '../../models/response';
export class CheckAppVersionResponse extends Response {
public IOSLink :string;
public AndroidLink :string;
}

@ -0,0 +1,6 @@
export class PrivilageModel extends Request{
ID: number;
Previlege: boolean;
ServiceName: string;
}

@ -1,8 +1,10 @@
import { Response } from '../../models/response';
import { AuthenticatedUser } from './authenticated-user';
import { PrivilageModel } from './privilage-model';
export class SMSCheckResponse extends Response {
AuthenticationTokenID: string;
MemberInformationList:AuthenticatedUser[];
Privilege_List:PrivilageModel[];
public TokenID: string;
public SessionID: string;
public MobileType: string;

@ -4,7 +4,8 @@ import {
ToastController,
LoadingController,
AlertController,
Platform
Platform,
MenuController
} from "@ionic/angular";
import { Router } from "@angular/router";
import { TranslatorService } from "../translator/translator.service";
@ -95,7 +96,8 @@ export class CommonService {
public lifeCycle: LifeCycleService,
public diagnostic: Diagnostic,
public callNumber: CallNumber,
public iab: InAppBrowser
public iab: InAppBrowser,
private menu: MenuController,
) {}
public back() {
@ -237,14 +239,15 @@ export class CommonService {
) {
this.alertDialog(
onClick,
okLabel,
this.ts.trPK("general", "ok"),
this.ts.trPK("general", "alert"),
message
);
}
public userNeedToReLogin() {
this.presentConfirmDialog(this.ts.trPK("general", "relogin"), () => {
this.presentAcceptDialog(this.ts.trPK("general", "relogin"), () => {
this.sharedService.clearAll();
this.openLogin();
});
}
@ -254,7 +257,7 @@ export class CommonService {
onClick,
okLabel,
this.ts.trPK("general", "alert"),
this.ts.trPK("error", "conn")
this.ts.trPK("general", "connError")
);
}

@ -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/';
@ -122,7 +122,14 @@ export class ConnectorService {
// not authorized
console.log(result.MessageStatus);
console.log("erroe")
if (result.ErrorType === 2) {
if(result.IsAuthenticated==false){
this.cs.presentAcceptDialog(result.ErrorEndUserMessage,()=>{
this.cs.sharedService.clearAll();
this.cs.openLogin();
});
return false;
}
else if (result.ErrorType === 2||result.ErrorType === 4) {
//console.log("error expired");
} else {
this.cs.showErrorMessageDialog(onError, errorLabel, result.ErrorEndUserMessage);

@ -37,13 +37,13 @@
</button>
</ion-col>
<ion-col size="6" class="col-grid" >
<button ion-button block class="serviceItem" (click)="Vacation_Rule()">
<button ion-button block class="serviceItem" id="vacationRule" (click)="Vacation_Rule()">
<ion-img class="serviceItemImg" src="../assets/imgs/vacationrule.png"></ion-img>
<p>{{ts.trPK('vacation-rule','vacationRule')}}</p>
</button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="accrualBalance()">
<button ion-button block class="serviceItem" id="accrualBalance" (click)="accrualBalance()">
<ion-img class="serviceItemImg" src="../assets/imgs/accu.png"></ion-img>
<p>{{ts.trPK('absenceList','accrualBalances')}}</p>
</button>

@ -49,6 +49,7 @@ export class HomePage implements OnInit {
ngOnInit() {
this.getUserDetails();
this.getMenu();
this.setServicesPrivilage();
this.geolocation
.getCurrentPosition()
.then(resp => {
@ -65,6 +66,13 @@ export class HomePage implements OnInit {
});
this.getCount();
}
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");
}
}
getCount() {
const req: any = {};
this.menuService.getNotificationCount(req).subscribe((result: any) => {

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('home','worklist')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
<nav-buttons backLink="/home"></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>

@ -15,6 +15,7 @@ import { IonInfiniteScroll } from '@ionic/angular';
export class HomeComponent implements OnInit {
// @ViewChild(Navbar) navBar: Navbar;
public static NOTIFICATION_DATA='notification_data';
public static NOTIFICATION_ARR='notification_arr';
@ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll;
private WorkListObj: WorkListRequest;
WorkListResObj: any; //WorKListResponse;
@ -134,6 +135,7 @@ export class HomeComponent implements OnInit {
if (this.common.hasData(result.GetWorkList)) {
this.WorkListObj.P_PAGE_NUM++;
this.WorkListResObj = result.GetWorkList;
this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR);
let lastItemIndex = this.WorkListResObj.length - 1;
if (result.GetWorkList[lastItemIndex]) {
let lastitem = result.GetWorkList[lastItemIndex];

@ -2,7 +2,7 @@
<ion-toolbar class="header-toolbar">
<ion-title color="light"> {{ts.trPK('worklistMain','title')}}</ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
<nav-buttons backLink="/notification/homepage"></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
@ -109,7 +109,12 @@
</ion-card>
<div>
<!-- ATTRIBUTE_DISPLAY_NAME: "Note"
ATTRIBUTE_FORMAT: "4000"
ATTRIBUTE_NAME: "WF_NOTE"
ATTRIBUTE_TYPE: "VARCHAR2" -->
<div id="notificationDynamicFields">
</div>
<!-- <json-schema-form *ngIf="schemaNotific" [form]="schemaNotific" [(ngModel)]="notExampleJsonObject">
</json-schema-form> -->
</div>
@ -125,4 +130,7 @@
<div class="centerDiv" >
<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>
</div>
</ion-footer>

@ -12,6 +12,8 @@ import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-respo
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';
import { TextAreaInput } from 'src/app/uI-elements/text-area.input';
@Component({
selector: "app-worklist-main",
templateUrl: "./worklist-main.component.html",
@ -43,6 +45,10 @@ export class WorklistMainComponent implements OnInit {
P_RESPOND_ATTRIBUTES_TBL: any;
selEmployeeID: any;
actionType: string = "";
notificationArray: any;
notificationDynamicAttributeArr:any;
private textInput: TextInput;
private textArea: TextAreaInput;
constructor(
public common: CommonService,
public ts: TranslatorService,
@ -51,10 +57,20 @@ export class WorklistMainComponent implements OnInit {
) { }
ngOnInit() {
this.intializeNotificationDetail();
}
intializeNotificationDetail() {
document.getElementById("notificationDynamicFields").innerHTML="";
this.getPassNotificationDetails = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_DATA,
false
);
console.log(this.getPassNotificationDetails.ROW_NUM);
this.notificationArray = this.common.sharedService.getSharedData(
HomeComponent.NOTIFICATION_ARR,
false
);
this.WorkListBodyObj = new WorkListBodyRequest();
this.WorkListButtonsObj = new WorkListButtonRequest();
@ -145,26 +161,54 @@ export class WorklistMainComponent implements OnInit {
if (result.MessageStatus == 1) {
// this.navCtrl.push("HomePage");
//this.common.openHome();
this.common.openNotificationPage();
//this.common.openNotificationPage();
// for( var i = 0; i < this.notificationArray.length; i++){
// if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) {
// this.notificationArray.splice(i, 1);
// }
// }
this.nextNotfification();
}
} // valid it
}
public nextNotfification() {
//let itemExist = false;
let itemNo = this.getPassNotificationDetails.ROW_NUM;
itemNo += 1;
if (itemNo > this.notificationArray.length) {
this.common.openNotificationPage();
} else {
for (let i = 0; i <= this.notificationArray.length; i++) {
if (this.notificationArray[i].ROW_NUM == itemNo) {
this.common.sharedService.setSharedData(this.notificationArray[i], HomeComponent.NOTIFICATION_DATA);
// itemExist = true;
this.intializeNotificationDetail();
break;
}
}
// if(itemExist==false){
// this.nextNotfification();
// }
}
}
actionButton() {
console.log("test>>>>>>>>>>>>>>");
let ButtonAction: string = this.actionType;
var responseAttrDic = this.notExampleJsonObject;
this.P_RESPOND_ATTRIBUTES_TBL = [];
for (let key in responseAttrDic) {
for (let i=0;i<this.notificationDynamicAttributeArr.length;i++) {
let obj: any = {};
obj.ATTRIBUTE_NAME = key;
if (typeof responseAttrDic[key] === "number") {
obj.ATTRIBUTE_NUMBER_VALUE = responseAttrDic[key];
obj.ATTRIBUTE_NAME = this.notificationDynamicAttributeArr[i].ATTRIBUTE_NAME;
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 {
obj.ATTRIBUTE_TEXT_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;
}
this.P_RESPOND_ATTRIBUTES_TBL.push(obj);
}
@ -345,11 +389,27 @@ export class WorklistMainComponent implements OnInit {
this.Resp2_val = result.NotificationRespondRolesList[0].ATTRIBUTE_NAME;
this.hideForwordEmployee = result.NotificationRespondRolesList[0];
}
this.notificationDynamicFields(result.NotificationGetRespondAttributesList);
this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList;
if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema);
} // valid it
} // End handleWorkListButtonsResult
notificationDynamicFields(notificationAttr){
const containerId = 'notificationDynamicFields';
for(let i=0;i<notificationAttr.length;i++){
if(notificationAttr[i].ATTRIBUTE_TYPE=="VARCHAR2"){
this.textArea = new TextAreaInput(notificationAttr[i].ATTRIBUTE_DISPLAY_NAME, notificationAttr[i].ATTRIBUTE_NAME, "", containerId,"","","");
}else if(notificationAttr[i].ATTRIBUTE_TYPE=="ROLE"){
}else if(notificationAttr[i].ATTRIBUTE_TYPE=="DATE"){
}else if(notificationAttr[i].ATTRIBUTE_TYPE=="NUMBER"){
}
}
}
openNotificationBody() {
if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") {
this.common.sharedService.setSharedData(

@ -71,7 +71,8 @@
</ion-item>
</ion-radio-group>
</ion-list>
<div id="CVDynamicFields">
</div>
<!-- <json-schema-form *ngIf="schemaNotific && notifTypeSel =='RESPOND'" [form]="schemaNotific"
[(ngModel)]="exampleJsonObject">
</json-schema-form> -->

@ -13,6 +13,10 @@ import { NavController, ModalController } from '@ionic/angular';
import { notificationTypeResponse } from '../model/notification.Respond';
import { Router, ActivatedRoute } from '@angular/router';
import { ReplacementListComponent } from '../replacement-list/replacement-list.component';
import { TextInput } from 'src/app/uI-elements/text.input';
import { NumberInput } from 'src/app/uI-elements/number.input';
import { SelectInput } from 'src/app/uI-elements/select.input';
import { DateInput } from 'src/app/uI-elements/date.input';
@Component({
selector: 'app-create-vacation-rule',
@ -50,6 +54,10 @@ export class CreateVacationRuleComponent implements OnInit {
SelAction: string = "";
hideForwordEmployee: any;
exampleJsonObject: any;
private numberInput: NumberInput;
private textInput: TextInput;
private selectInput: SelectInput;
private dateInput: DateInput;
constructor(public vacationRuleService: VacationRuleServiceService, public ts: TranslatorService, public cs: CommonService,
private elementRef: ElementRef, public navCtrl: NavController, public router: Router, public modalController: ModalController,
@ -434,8 +442,10 @@ export class CreateVacationRuleComponent implements OnInit {
this.hideForwordEmployee = result.RespondRolesList[0];
}
if (result.P_Schema)
this.schemaNotific = JSON.parse(result.P_Schema);
if (result.RespondAttributesList){
//this.schemaNotific = JSON.parse(result.P_Schema);
this.createVacationDynamicFields(result.RespondAttributesList);
}
this.reverseAction();
if (this.isUpdate) {
this.fillResposeAtrributes(result.RespondAttributesList);
@ -447,6 +457,21 @@ export class CreateVacationRuleComponent implements OnInit {
}
}
createVacationDynamicFields(RespondAttributesList){
const containerId = 'CVDynamicFields';
for(let i=0;i<RespondAttributesList.length;i++){
if(RespondAttributesList[i].ATTRIBUTE_TYPE=="VARCHAR2"){
this.textInput = new TextInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","","");
}else if(RespondAttributesList[i].ATTRIBUTE_TYPE=="LOOKUP"){
this.selectInput = new SelectInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","");
}else if(RespondAttributesList[i].ATTRIBUTE_TYPE=="DATE"){
this.dateInput = new DateInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","");
}else if(RespondAttributesList[i].ATTRIBUTE_TYPE=="NUMBER"){
this.numberInput = new NumberInput(RespondAttributesList[i].ATTRIBUTE_DISPLAY_NAME, RespondAttributesList[i].ATTRIBUTE_NAME, "", containerId,"","","");
}
}
}
fillResposeAtrributes(respList) {
let body = {
P_RULE_ID: this.updateData.RULE_ID,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 66 KiB

@ -13,6 +13,10 @@
"en": "User Name",
"ar": "اسم المستخدم"
},
"remeber-me": {
"en": "Remember Me",
"ar": "تذكرنى"
},
"login-type": {
"en": "Login Type",
"ar": "نوع الدخول"
@ -709,10 +713,6 @@
"en":"Delete",
"ar":"حذف"
},
"ok": {
"en":"Ok",
"ar":"موافق"
},
"cancel":{
"en": "Cancel",
"ar": "إلغاء"

@ -0,0 +1,40 @@
{
"project_info": {
"project_number": "608631731238",
"firebase_url": "https://mohemm-cs.firebaseio.com",
"project_id": "mohemm-cs",
"storage_bucket": "mohemm-cs.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:608631731238:android:3a8384007f8700ec",
"android_client_info": {
"package_name": "com.cloudsolutions.mohemm"
}
},
"oauth_client": [
{
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB5zpz9vC2NOxsU1dPr0TK0dVaMY5D4Mjg"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "608631731238-83a5qndedia496ssa6ekkd3db5jo8khr.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

@ -0,0 +1,6 @@
CS :
android:hmg.cloudSolutions.mohem
IOS :com.cloudsolutions.mohemm
HMG :
com.cloudsolutions.alhabibmohemm
Loading…
Cancel
Save