diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.html b/Mohem/src/app/authentication/digital-id/digital-id.component.html
index 5d4807eb..54e4d4fc 100644
--- a/Mohem/src/app/authentication/digital-id/digital-id.component.html
+++ b/Mohem/src/app/authentication/digital-id/digital-id.component.html
@@ -18,7 +18,7 @@
{{userInfo.EMPLOYEE_DISPLAY_NAME}}
- {{userInfo.JOB_NAME}}
+ {{userJobName}}
@@ -50,7 +50,7 @@
- {{userInfo.JOB_NAME}}
+ {{userJobName}}
diff --git a/Mohem/src/app/authentication/digital-id/digital-id.component.ts b/Mohem/src/app/authentication/digital-id/digital-id.component.ts
index 9472fff8..ab17b063 100644
--- a/Mohem/src/app/authentication/digital-id/digital-id.component.ts
+++ b/Mohem/src/app/authentication/digital-id/digital-id.component.ts
@@ -9,6 +9,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
})
export class DigitalIdComponent implements OnInit {
@Input() userInfo: any;
+ public userJobName: any;
constructor(
public modalCtrl: ModalController,
@@ -20,6 +21,12 @@ export class DigitalIdComponent implements OnInit {
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
}
console.log(this.userInfo);
+ if (this.userInfo) {
+ let jobTitle = this.userInfo.POSITION_NAME.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ this.userJobName = jobTitle[0] + " " + jobTitle[1];
+ }
+ }
}
diff --git a/Mohem/src/app/authentication/sms-page/sms-page.page.html b/Mohem/src/app/authentication/sms-page/sms-page.page.html
index 52bf201e..1fa9de7b 100644
--- a/Mohem/src/app/authentication/sms-page/sms-page.page.html
+++ b/Mohem/src/app/authentication/sms-page/sms-page.page.html
@@ -58,7 +58,7 @@
-
+
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 9d9cab9b..69778fb6 100644
--- a/Mohem/src/app/authentication/sms-page/sms-page.page.ts
+++ b/Mohem/src/app/authentication/sms-page/sms-page.page.ts
@@ -50,6 +50,8 @@ export class SmsPageComponent implements OnInit {
loginType: any;
activeType: any;
public isNFCAvailable = false;
+ public showErrorMessage = false;
+ public messageValue: string;
constructor(
public navCtrl: NavController,
@@ -183,6 +185,7 @@ export class SmsPageComponent implements OnInit {
}
public checkSMS() {
+ this.showErrorMessage = false;
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
request.LogInTokenID = data.LogInTokenID;
@@ -190,9 +193,8 @@ export class SmsPageComponent implements OnInit {
request.P_USER_NAME = data.P_USER_NAME;
request.MobileNumber = data.MobileNumber;
request.IsDeviceNFC = this.isNFCAvailable;
- this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok')).subscribe((result: SMSCheckResponse) => {
- if (this.common.validResponse(result)) {
-
+ this.authService.checkSMS(request, () => {}, this.translate.trPK('general', 'ok'), true).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;
@@ -210,6 +212,16 @@ export class SmsPageComponent implements OnInit {
this.activeType =this.common.setActiveTypeLogin(0);
this.common.openHome();
});
+ } else {
+ let errorResult: any;
+ errorResult = result;
+ this.showErrorMessage = true;
+ this.messageValue = errorResult.ErrorEndUserMessage;
+ this.smc_code = [];
+ (document.activeElement as HTMLElement).blur();
+ setTimeout(() => {
+ this.showErrorMessage = false;
+ }, 5000);
}
});
}
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 c8927aa9..09c1e993 100644
--- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
+++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts
@@ -485,10 +485,10 @@ export class AuthenticationService {
return this.con.post(AuthenticationService.activationCodeURL, request, onError, errorLabel);
}
- public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
+ public checkSMS(request: SMSCheckRequest, onError: any, errorLabel: string, fromSMS = false )
: Observable {
this.setPublicFields(request);
- return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel);
+ return this.con.post(AuthenticationService.smsCheck, request, onError, errorLabel, fromSMS);
}
public checkForgetSMS(request: SMSCheckRequest, onError: any, errorLabel: string)
diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts
index 352d691d..ddd23f6d 100644
--- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts
+++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts
@@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 120 * 1000;
- // 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/';
constructor(public httpClient: HttpClient,
public cs: CommonService,
@@ -39,7 +39,8 @@ export class ConnectorService {
service: string,
data: any,
onError: any,
- errorLabel?: string
+ errorLabel?: string,
+ fromSMS = false
): Observable {
this.cs.startLoading();
return this.httpClient
@@ -52,7 +53,7 @@ export class ConnectorService {
timeout(ConnectorService.timeOut),
retry(ConnectorService.retryTimes),
tap(
- res => this.handleResponse(res, onError, errorLabel),
+ res => this.handleResponse(res, onError, errorLabel, false, fromSMS),
error => this.handleError(error, onError, errorLabel)
)
);
@@ -218,7 +219,8 @@ export class ConnectorService {
});
}
- public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false) {
+ public handleResponse(result: Response, onError: any, errorLabel: string, isPostNoLoad = false, fromSMS = false) {
+ console.log('fromSMSValue ' + fromSMS)
if (!isPostNoLoad) {
this.cs.stopLoading();
}
@@ -236,11 +238,16 @@ export class ConnectorService {
this.cs.stopLoading();
} else {
this.cs.stopLoading();
- this.cs.showErrorMessageDialog(
- onError,
- errorLabel,
- result.ErrorEndUserMessage
- );
+ if (!fromSMS) {
+ this.cs.showErrorMessageDialog(
+ onError,
+ errorLabel,
+ result.ErrorEndUserMessage
+ );
+ } else {
+ console.log('its an error from sms')
+ }
+
//add flag if user not auth
}
diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts
index 26b1ab47..9125f322 100644
--- a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts
+++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts
@@ -22,7 +22,13 @@ public direction: string;
this.direction = TranslatorService.getCurrentLanguageName();
}
- ngOnInit() {}
+ ngOnInit() {
+ console.log(this.title);
+ let jobTitle = this.title.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ this.title = jobTitle[0] + " " + jobTitle[1];
+ }
+ }
getDetails() {
this.onGetDetails.emit();
diff --git a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.html b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.html
index 80f753d0..d201af44 100644
--- a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.html
+++ b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.html
@@ -19,13 +19,12 @@
{{EmpName}}
{{EmpEmail}}
-
{{ts.trPK('userProfile','role')}}
- {{EmpJob}}
+ {{EmpPosition}}
@@ -65,7 +64,7 @@
{{ts.trPK('userProfile','job')}}
- {{EmpJob}}
+ {{EmpPosition}}
diff --git a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts
index baed17b0..149a8596 100644
--- a/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts
+++ b/Mohem/src/app/mowadhafi/hr-request/hr-request.component.ts
@@ -85,10 +85,19 @@ export class HRRequestComponent implements OnInit {
this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER;
this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME;
this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER;
- this.EmpJob = result.MemberInformationList[0].JOB_NAME;
+ // this.EmpJob = result.MemberInformationList[0].JOB_NAME;
this.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME;
this.EmpPayrol = result.MemberInformationList[0].PAYROLL_NAME;
- this.EmpPosition = result.MemberInformationList[0].POSITION_NAME;
+ // this.EmpPosition = result.MemberInformationList[0].POSITION_NAME;
+
+ let jobTitle = result.MemberInformationList[0].POSITION_NAME
+ jobTitle = jobTitle.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ this.EmpPosition = jobTitle[0] + " " + jobTitle[1];
+ } else {
+ this.EmpPosition = '';
+ }
+
this.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS;
this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING;
this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME;
diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html
index 6123eb8f..f65b4100 100644
--- a/Mohem/src/app/my-team/details/details.component.html
+++ b/Mohem/src/app/my-team/details/details.component.html
@@ -32,13 +32,12 @@
{{employee.EMPLOYEE_NAME}}
{{employee.EMPLOYEE_EMAIL_ADDRESS}}
-
{{ts.trPK('userProfile','role')}}
- {{employee.JOB_NAME}}
+ {{jobName}}
{{ts.trPK('userProfile','empNo')}}
@@ -505,7 +504,7 @@
{{ts.trPK('userProfile','job')}}
- {{employee.JOB_NAME}}
+ {{jobName}}
{{ts.trPK('userProfile','payrol')}}
@@ -517,7 +516,7 @@
-->
{{ts.trPK('userProfile','position')}}
- {{employee.POSITION_NAME}}
+ {{jobName}}
{{ts.trPK('userProfile','grade')}}
diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts
index 0a4a5311..4a2b0d4a 100644
--- a/Mohem/src/app/my-team/details/details.component.ts
+++ b/Mohem/src/app/my-team/details/details.component.ts
@@ -215,6 +215,8 @@ export class DetailsComponent implements OnInit {
spaceBetween: 1
};
+ public jobName: any;
+
constructor(
public timeCardService: TimeCardService,
public menuService: MenuService,
@@ -235,15 +237,18 @@ export class DetailsComponent implements OnInit {
this.showAttendanceTracking();
// tslint:disable-next-line: max-line-length
this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
- // this.getSuborinatesAttStatus();
- // this.getFavorit();
-
-
}
showAttendanceTracking() {
this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false);
+ console.log(this.employee);
+
+ let jobTitle = this.employee.POSITION_NAME.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ this.jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
};
diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.html b/Mohem/src/app/notification/work-list-details/work-list-details.component.html
index eefc7a43..3c25611b 100644
--- a/Mohem/src/app/notification/work-list-details/work-list-details.component.html
+++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.html
@@ -38,7 +38,7 @@
-
+
@@ -54,7 +54,7 @@
-
+
diff --git a/Mohem/src/app/notification/work-list-details/work-list-details.component.ts b/Mohem/src/app/notification/work-list-details/work-list-details.component.ts
index 460148c8..2635ee81 100644
--- a/Mohem/src/app/notification/work-list-details/work-list-details.component.ts
+++ b/Mohem/src/app/notification/work-list-details/work-list-details.component.ts
@@ -44,6 +44,19 @@ export class WorkListDetailsComponent implements OnInit {
this.handleNotificationBody();
}
+ public formatJobName(title: any) {
+ let jobName: any;
+ if (title) {
+ let jobTitle = title.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+ } else {
+ jobName = '';
+ }
+ return jobName;
+ }
+
getsubmitterInfo(notificationSubmitterInfoObj) {
this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj).
subscribe((result: WorklistsubmitterInfoResponse) => {
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 98b83c0d..7366e112 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html
@@ -223,7 +223,7 @@
-
+
@@ -239,7 +239,7 @@
-
+
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 35d8d555..d12c5fb4 100644
--- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
+++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts
@@ -868,6 +868,19 @@ export class WorklistMainComponent implements OnInit {
}
}
+ public formatJobName(title: any) {
+ let jobName: any;
+ if (title) {
+ let jobTitle = title.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+ } else {
+ jobName = '';
+ }
+ return jobName;
+ }
+
public checkLines(note) {
if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false;
diff --git a/Mohem/src/app/profile/home/home.component.html b/Mohem/src/app/profile/home/home.component.html
index 4114138f..7b87ba62 100644
--- a/Mohem/src/app/profile/home/home.component.html
+++ b/Mohem/src/app/profile/home/home.component.html
@@ -26,7 +26,7 @@
{{ts.trPK('userProfile','role')}}
- {{personalInfo.JOB_NAME}}
+ {{jobName}}
{{ts.trPK('userProfile','empNo')}}
diff --git a/Mohem/src/app/profile/home/home.component.ts b/Mohem/src/app/profile/home/home.component.ts
index 626c7b98..36520a84 100644
--- a/Mohem/src/app/profile/home/home.component.ts
+++ b/Mohem/src/app/profile/home/home.component.ts
@@ -50,6 +50,8 @@ export class HomeComponent implements OnInit {
public postalCode: any;
public country: any;
public employeeAdress: any = [];
+ public jobName: any;
+
constructor(
public ts: TranslatorService,
public cs: CommonService,
@@ -143,6 +145,12 @@ export class HomeComponent implements OnInit {
if (user) {
console.log(user);
this.personalInfo = user;
+
+ let jobTitle = user.POSITION_NAME.split('.');
+ if (jobTitle && jobTitle.length > 1) {
+ this.jobName = jobTitle[0] + " " + jobTitle[1];
+ }
+
if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else {