fixed job title throughout the application

enad-Q1
umasoodch 4 years ago
parent 4011346cdd
commit 7c3e6501cc

@ -18,7 +18,7 @@
<ion-row> <ion-row>
<ion-col> <ion-col>
<p><b style="font-size: 20px !important;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</b></p> <p><b style="font-size: 20px !important;">{{userInfo.EMPLOYEE_DISPLAY_NAME}}</b></p>
<p style="font-size: 15px !important;">{{userInfo.JOB_NAME}}</p> <p style="font-size: 15px !important;">{{userJobName}}</p>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
@ -50,7 +50,7 @@
</ion-row> </ion-row>
<ion-row style="padding: 0%;"> <ion-row style="padding: 0%;">
<ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;"> <ion-col style="text-align: center;font-weight: bold;font-family: 'WorkSans-Bold'; padding: 0%;">
<p style="font-size: 15px; padding: 0%;">{{userInfo.JOB_NAME}}</p> <p style="font-size: 15px; padding: 0%;">{{userJobName}}</p>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>

@ -9,6 +9,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
}) })
export class DigitalIdComponent implements OnInit { export class DigitalIdComponent implements OnInit {
@Input() userInfo: any; @Input() userInfo: any;
public userJobName: any;
constructor( constructor(
public modalCtrl: ModalController, public modalCtrl: ModalController,
@ -20,6 +21,12 @@ export class DigitalIdComponent implements OnInit {
this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser')); this.userInfo = JSON.parse(localStorage.getItem('digitalIDUser'));
} }
console.log(this.userInfo); 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];
}
}
} }

@ -22,7 +22,13 @@ public direction: string;
this.direction = TranslatorService.getCurrentLanguageName(); 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() { getDetails() {
this.onGetDetails.emit(); this.onGetDetails.emit();

@ -19,13 +19,12 @@
<span class="Nametext">{{EmpName}}</span> <span class="Nametext">{{EmpName}}</span>
<p class="p1">{{EmpEmail}}</p> <p class="p1">{{EmpEmail}}</p>
<!-- <span>{{EmpJob}}</span> -->
</div> </div>
<div > <div >
<ion-row> <ion-row>
<ion-col style="border-right: 1px solid rgb(221 221 221);"> <ion-col style="border-right: 1px solid rgb(221 221 221);">
<p class="p">{{ts.trPK('userProfile','role')}}</p> <p class="p">{{ts.trPK('userProfile','role')}}</p>
<span class="Boldtext">{{EmpJob}}</span> <span class="Boldtext">{{EmpPosition}}</span>
</ion-col> </ion-col>
<ion-col> <ion-col>
@ -65,7 +64,7 @@
</ion-col> </ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12"> <ion-col style="margin-bottom: -22px;" [size]="12">
<h2>{{ts.trPK('userProfile','job')}}</h2> <h2>{{ts.trPK('userProfile','job')}}</h2>
<p>{{EmpJob}}</p> <p>{{EmpPosition}}</p>
</ion-col> </ion-col>
<ion-col style="margin-bottom: -22px;" [size]="12"> <ion-col style="margin-bottom: -22px;" [size]="12">

@ -85,10 +85,19 @@ export class HRRequestComponent implements OnInit {
this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER; this.EmpNum = result.MemberInformationList[0].EMPLOYEE_NUMBER;
this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME; this.EmpGroup = result.MemberInformationList[0].BUSINESS_GROUP_NAME;
this.EmpMobile = result.MemberInformationList[0].EMPLOYEE_MOBILE_NUMBER; 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.EmpOrgName = result.MemberInformationList[0].ORGANIZATION_NAME;
this.EmpPayrol = result.MemberInformationList[0].PAYROLL_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.EmpEmail = result.MemberInformationList[0].EMPLOYEE_EMAIL_ADDRESS;
this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING; this.EmpCatMeaning = result.MemberInformationList[0].EMPLOYMENT_CATEGORY_MEANING;
this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME; this.EmpGRADENAME = result.MemberInformationList[0].GRADE_NAME;

@ -32,13 +32,12 @@
<div style="margin-top: 25px;"> <div style="margin-top: 25px;">
<h1 class="name">{{employee.EMPLOYEE_NAME}}</h1> <h1 class="name">{{employee.EMPLOYEE_NAME}}</h1>
<span class="email">{{employee.EMPLOYEE_EMAIL_ADDRESS}}</span> <span class="email">{{employee.EMPLOYEE_EMAIL_ADDRESS}}</span>
<!-- <span>{{employee.JOB_NAME}}</span> -->
</div> </div>
<div > <div >
<ion-row style="margin-top: 11px;"> <ion-row style="margin-top: 11px;">
<ion-col [size]="6"> <ion-col [size]="6">
<p class="subTitle">{{ts.trPK('userProfile','role')}}</p> <p class="subTitle">{{ts.trPK('userProfile','role')}}</p>
<span class="Boldtext">{{employee.JOB_NAME}}</span> <span class="Boldtext">{{jobName}}</span>
</ion-col> </ion-col>
<ion-col [size]="6" style="border-left: 1px solid rgb(221 221 221);"> <ion-col [size]="6" style="border-left: 1px solid rgb(221 221 221);">
<p class="subTitle" style="line-height: 12px !important;">{{ts.trPK('userProfile','empNo')}}</p> <p class="subTitle" style="line-height: 12px !important;">{{ts.trPK('userProfile','empNo')}}</p>
@ -505,7 +504,7 @@
</ion-col> </ion-col>
<ion-col [size]="12"> <ion-col [size]="12">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','job')}}</h2> <h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','job')}}</h2>
<p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{employee.JOB_NAME}}</p> <p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{jobName}}</p>
</ion-col> </ion-col>
<ion-col [size]="12"> <ion-col [size]="12">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','payrol')}}</h2> <h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','payrol')}}</h2>
@ -517,7 +516,7 @@
</ion-col> --> </ion-col> -->
<ion-col [size]="12"> <ion-col [size]="12">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','position')}}</h2> <h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','position')}}</h2>
<p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{employee.POSITION_NAME}}</p> <p [ngClass]="direction == 'en' ? 'label2':'label2-ar' ">{{jobName}}</p>
</ion-col> </ion-col>
<ion-col [size]="12" style="border-bottom: none;"> <ion-col [size]="12" style="border-bottom: none;">
<h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','grade')}}</h2> <h2 [ngClass]="direction == 'en' ? 'label1':'label1-ar' ">{{ts.trPK('userProfile','grade')}}</h2>

@ -215,6 +215,8 @@ export class DetailsComponent implements OnInit {
spaceBetween: 1 spaceBetween: 1
}; };
public jobName: any;
constructor( constructor(
public timeCardService: TimeCardService, public timeCardService: TimeCardService,
public menuService: MenuService, public menuService: MenuService,
@ -235,15 +237,18 @@ export class DetailsComponent implements OnInit {
this.showAttendanceTracking(); this.showAttendanceTracking();
// tslint:disable-next-line: max-line-length // tslint:disable-next-line: max-line-length
this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex); this.currentMonthName = this.direction === 'en' ? this.common.getMonthName(this.monthIndex) : this.common.getMonthNameAr(this.monthIndex);
// this.getSuborinatesAttStatus();
// this.getFavorit();
} }
showAttendanceTracking() { showAttendanceTracking() {
this.common.startLoading(); this.common.startLoading();
this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false); 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 = { const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER
}; };

@ -38,7 +38,7 @@
<label for="">{{'userProfile, position' | translate}}</label> <label for="">{{'userProfile, position' | translate}}</label>
</ion-col> </ion-col>
<ion-col col-7> <ion-col col-7>
<label for="">{{submitterInfo.POSITION_NAME}}</label> <label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>
@ -54,7 +54,7 @@
<label for="">{{'userProfile, job' | translate}}</label> <label for="">{{'userProfile, job' | translate}}</label>
</ion-col> </ion-col>
<ion-col col-7> <ion-col col-7>
<label for="">{{submitterInfo.JOB_NAME}}</label> <label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row> <ion-row>

@ -44,6 +44,19 @@ export class WorkListDetailsComponent implements OnInit {
this.handleNotificationBody(); 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) { getsubmitterInfo(notificationSubmitterInfoObj) {
this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj). this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj).
subscribe((result: WorklistsubmitterInfoResponse) => { subscribe((result: WorklistsubmitterInfoResponse) => {

@ -223,7 +223,7 @@
<label class="colItemReq" for="">{{'worklistMain, job-name' | <label class="colItemReq" for="">{{'worklistMain, job-name' |
translate}}</label> translate}}</label>
<br /> <br />
<label for="">{{submitterInfo.POSITION_NAME}}</label> <label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row class="rowBorder submitterInfo"> <ion-row class="rowBorder submitterInfo">
@ -239,7 +239,7 @@
<label class="colItemReq" for="">{{'worklistMain, job_cate' | <label class="colItemReq" for="">{{'worklistMain, job_cate' |
translate}}</label> translate}}</label>
<br /> <br />
<label for="">{{submitterInfo.JOB_NAME}}</label> <label for="">{{formatJobName(submitterInfo.POSITION_NAME)}}</label>
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-row class="rowBorder submitterInfo"> <ion-row class="rowBorder submitterInfo">

@ -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) { public checkLines(note) {
if (note && note != null) { if (note && note != null) {
return (note.length > this.lines_note_limit) ? true : false; return (note.length > this.lines_note_limit) ? true : false;

@ -26,7 +26,7 @@
<ion-row style="margin-top: 11px;"> <ion-row style="margin-top: 11px;">
<ion-col [size]="6"> <ion-col [size]="6">
<p class="subTitle">{{ts.trPK('userProfile','role')}}</p> <p class="subTitle">{{ts.trPK('userProfile','role')}}</p>
<span class="boldText">{{personalInfo.JOB_NAME}}</span> <span class="boldText">{{jobName}}</span>
</ion-col> </ion-col>
<ion-col [size]="6" style="border-left: 1px solid rgb(221 221 221);"> <ion-col [size]="6" style="border-left: 1px solid rgb(221 221 221);">
<p class="subTitle" style="line-height: 8px !important;">{{ts.trPK('userProfile','empNo')}}</p> <p class="subTitle" style="line-height: 8px !important;">{{ts.trPK('userProfile','empNo')}}</p>

@ -50,6 +50,8 @@ export class HomeComponent implements OnInit {
public postalCode: any; public postalCode: any;
public country: any; public country: any;
public employeeAdress: any = []; public employeeAdress: any = [];
public jobName: any;
constructor( constructor(
public ts: TranslatorService, public ts: TranslatorService,
public cs: CommonService, public cs: CommonService,
@ -143,6 +145,12 @@ export class HomeComponent implements OnInit {
if (user) { if (user) {
console.log(user); console.log(user);
this.personalInfo = 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) { if (this.cs.getUpdateImage().status) {
this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img); this.user_image = this.sanitizer.bypassSecurityTrustUrl('data:image/png;base64,' + this.cs.getUpdateImage().img);
} else { } else {

Loading…
Cancel
Save