diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts index b0287761..dc145977 100644 --- a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts +++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts @@ -77,6 +77,7 @@ export class SubmitAbsenceComponent implements OnInit { /*****for resubmit******* */ getPassNotificationDetails: any; getPassdirfromNotifiPage: boolean = false; + direction: string; functionName: string = ""; private submitAbsObjList: any = []; @ViewChild(IonSelect) select: IonSelect; @@ -93,6 +94,7 @@ export class SubmitAbsenceComponent implements OnInit { private changeDetectorRef: ChangeDetectorRef ) { + this.direction = TranslatorService.getCurrentLanguageName(); ////*new add*///// /**********resubmit************ */ this.getPassNotificationDetails = this.common.sharedService.getSharedData(AbsenceNotificatonBodyResponse.NOT_WORKLIST, true); @@ -411,7 +413,8 @@ export class SubmitAbsenceComponent implements OnInit { containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, - feildsList[i].REQUIRED_FLAG + feildsList[i].REQUIRED_FLAG, + this.direction ); } else { this.timeInput = new TimeInput( @@ -421,20 +424,10 @@ export class SubmitAbsenceComponent implements OnInit { containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, - feildsList[i].REQUIRED_FLAG + feildsList[i].REQUIRED_FLAG, + this.direction ); } - const elem = document.getElementById( - feildsList[i].APPLICATION_COLUMN_NAME - ); - elem.addEventListener("click", e => { - if (feildsList[i].MOBILE_ENABLED != "Y") return false; - this.showTimePicker( - feildsList[i].APPLICATION_COLUMN_NAME, - feildsList[i].MAXIMUM_SIZE - ); - e.stopImmediatePropagation(); - }); } } else { if (feildsList[i].READ_ONLY == "Y") { diff --git a/Mohem/src/app/eit/add-eit/add-eit.component.ts b/Mohem/src/app/eit/add-eit/add-eit.component.ts index 384143a2..3095a548 100644 --- a/Mohem/src/app/eit/add-eit/add-eit.component.ts +++ b/Mohem/src/app/eit/add-eit/add-eit.component.ts @@ -23,7 +23,6 @@ import { AddEitResponse } from "../models/add.eit.response"; import { element } from '@angular/core/src/render3'; // import { EITNotificatonBodyResponse } from 'src/app/notification/models/EITNotificationBodyRes'; import { EITNotificatonBodyResponse } from "../models/EITNotificationBodyRes"; - @Component({ selector: "app-add-eit", templateUrl: "./add-eit.component.html", @@ -67,6 +66,7 @@ export class AddEitComponent implements OnInit { //private updatedNotObject:any=[]; private updatedValues: any = []; addEITData: any; + direction:string; constructor( public modalController: ModalController, @@ -75,6 +75,7 @@ export class AddEitComponent implements OnInit { private eitService: EitService, public datePicker: DatePicker ) { + this.direction = TranslatorService.getCurrentLanguageName(); this.selEmp = this.cs.sharedService.getSharedData( MenuResponse.SHARED_SEL_EMP, false @@ -216,7 +217,8 @@ export class AddEitComponent implements OnInit { containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, - feildsList[i].REQUIRED_FLAG + feildsList[i].REQUIRED_FLAG, + this.direction ); } else { this.dateInput = new DateInput( @@ -226,7 +228,8 @@ export class AddEitComponent implements OnInit { containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, - feildsList[i].REQUIRED_FLAG + feildsList[i].REQUIRED_FLAG, + this.direction ); } // else if(feildsList[i].DEFAULT_TYPE=="D"){//current date @@ -291,11 +294,12 @@ export class AddEitComponent implements OnInit { this.timeInput = new TimeInput( feildsList[i].SEGMENT_PROMPT, feildsList[i].APPLICATION_COLUMN_NAME, - defaultVal, + "", containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, - feildsList[i].REQUIRED_FLAG + feildsList[i].REQUIRED_FLAG, + this.direction ); } else { this.timeInput = new TimeInput( @@ -305,25 +309,10 @@ export class AddEitComponent implements OnInit { containerId, feildsList[i].MOBILE_ENABLED, feildsList[i].DISPLAY_FLAG, - feildsList[i].REQUIRED_FLAG + feildsList[i].REQUIRED_FLAG, + this.direction ); } - const elem = document.getElementById( - feildsList[i].APPLICATION_COLUMN_NAME - ); - elem.addEventListener("click", e => { - if (feildsList[i].MOBILE_ENABLED != "Y") return false; - this.showTimePicker( - feildsList[i].APPLICATION_COLUMN_NAME, - feildsList[i].MAXIMUM_SIZE - ); - e.stopImmediatePropagation(); - }); - // else if(feildsList[i].DEFAULT_TYPE=="T"){ - // this.timeInput = new TimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,"currentTime",containerId,feildsList[i].MOBILE_ENABLED); - // }else if(feildsList[i].DEFAULT_TYPE=="P"||feildsList[i].DEFAULT_TYPE=="S"){ - // this.timeInput = new TimeInput(feildsList[i].SEGMENT_PROMPT,feildsList[i].APPLICATION_COLUMN_NAME,this.getDefaultValue(feildsList[i].DESC_FLEX_NAME,feildsList[i].DESC_FLEX_CONTEXT_CODE,feildsList[i].SEGMENT_NAME,feildsList[i].PARENT_SEGMENTS_VS_SplitedVS,feildsList[i].PARENT_SEGMENTS_DV_Splited),containerId,feildsList[i].MOBILE_ENABLED); - // } } } else { if (feildsList[i].READ_ONLY == "Y") { @@ -1225,7 +1214,7 @@ export class AddEitComponent implements OnInit { this.eitResponse[i].DISPLAY_FLAG != "N" ) { //time - elemVal = elem.dataset.dtvalue; + elemVal = elemVal.substring(11, 16); } if (this.eitResponse[i].REQUIRED_FLAG == "Y" && !elemVal) { elem.classList.add("requiredClassElm"); diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html index 040f240e..f2837622 100644 --- a/Mohem/src/app/my-team/details/details.component.html +++ b/Mohem/src/app/my-team/details/details.component.html @@ -60,7 +60,7 @@ + [ngClass]="[activeSegment == 'Team Members' ? 'active-Segment' : 'normal-Segment', empSubordinate.length === 0 ? 'disable-phone': '']"> {{ts.trPK('myTeam','team-members')}} - {{ts.trPK('myTeam','attendance-statistics')}} + {{ts.trPK('myTeam','attendance-statistics')}} diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts index 46d4048a..262d9ead 100644 --- a/Mohem/src/app/my-team/home/home.component.ts +++ b/Mohem/src/app/my-team/home/home.component.ts @@ -27,6 +27,7 @@ export class HomeComponent implements OnInit { public selMenu: any; public selEmpNo: any; public totalEmployees = 0; + public pageFirstVisit = false; public options = { cutoutPercentage: 80, @@ -146,7 +147,10 @@ export class HomeComponent implements OnInit { this.getEmployeeSubordinatesRequestObject = body; this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => { if (this.common.validResponse(result)) { - this.totalEmployees = result.P_NUM_OF_SUBORDINATES; + if (!this.pageFirstVisit) { + this.pageFirstVisit = true; + this.totalEmployees = result.P_NUM_OF_SUBORDINATES; + } this.handleEmpResult(result.GetEmployeeSubordinatesList); } }); diff --git a/Mohem/src/app/uI-elements/date.input.ts b/Mohem/src/app/uI-elements/date.input.ts index a813416e..c0f7b0a6 100644 --- a/Mohem/src/app/uI-elements/date.input.ts +++ b/Mohem/src/app/uI-elements/date.input.ts @@ -1,7 +1,6 @@ -import { UiElement } from "./ui-element"; - +import { UiElement } from './ui-element'; export class DateInput extends UiElement { - private currentDate: any = "" + private currentDate: any = ''; constructor( private label: string, private elementId: string, @@ -9,10 +8,10 @@ export class DateInput extends UiElement { private containerId: string, private disabled: string, private hidden: string, - private required: string) { + private required: string, + private language: string = 'en') { super(elementId, containerId, ''); this.createElement(this.getTemplate()); - } formatDate() { @@ -24,6 +23,8 @@ export class DateInput extends UiElement { } public getTemplate() { let requiredClass: string = ""; + const doneText = this.language === 'en' ? 'Done' : 'تم'; + const cancelText = this.language === 'en' ? 'Cancel' : 'إلغاء'; if (this.disabled == "N") { this.disabled = "disabled" } else { this.disabled = "" } if (this.hidden == "N") { this.hidden = "display:none;" } else { this.hidden = "" } if (this.value == "currentDate") { @@ -44,7 +45,7 @@ export class DateInput extends UiElement { "" + " " + this.label + "" + // " " + this.value + "" + - "" + + "" + // " "+ // " "+ // " "+ diff --git a/Mohem/src/app/uI-elements/time.input.ts b/Mohem/src/app/uI-elements/time.input.ts index 84da28a6..2c7d5591 100644 --- a/Mohem/src/app/uI-elements/time.input.ts +++ b/Mohem/src/app/uI-elements/time.input.ts @@ -1,5 +1,4 @@ import { UiElement } from './ui-element'; -// import { TranslatorService } from '../hmg-common/services/translator/translator.service'; export class TimeInput extends UiElement { // public direction: string; @@ -10,9 +9,9 @@ export class TimeInput extends UiElement { private containerId: string, private disabled: string, private hidden: string, - private required: string) { + private required: string, + private language: string = 'en') { super(elementId, containerId, ''); - // this.direction = TranslatorService.getCurrentLanguageName(); this.createElement(this.getTemplate()); } @@ -22,11 +21,16 @@ export class TimeInput extends UiElement { this.value = date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); } + setDate() { + console.log('umar'); + } public getTemplate() { let requiredClass = ''; let disaledClass = ''; + const doneText = this.language === 'en' ? 'Done' : 'تم'; + const cancelText = this.language === 'en' ? 'Cancel' : 'إلغاء'; // tslint:disable-next-line: triple-equals if (this.required == 'Y') { requiredClass = 'requiredClass'; @@ -37,29 +41,12 @@ export class TimeInput extends UiElement { if (this.value === 'currentTime') { this.formatDate(); } - const template = - '' + - ' ' + this.label + '' + - // tslint:disable-next-line: max-line-length - // " "+ - // tslint:disable-next-line: max-line-length - ' ' + this.value + '' + - ''; - - // "" + - // " " + this.label + "" + - // tslint:disable-next-line: max-line-length - // // " " + this.value + "" + - // tslint:disable-next-line: max-line-length - // "" + - // tslint:disable-next-line: max-line-length - // // " "+ - // // " "+ - // tslint:disable-next-line: max-line-length - // // " "+ - // "" + const template = + "" + + " " + this.label + "" + + "" + + "" return template; } - } diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 27ca32e7..ba3da662 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -1557,6 +1557,14 @@ } }, "eit": { + "done-text": { + "en": "Done", + "ar": "تم" + }, + "cancel-text": { + "en": "Cancel", + "ar": "إلغاء" + }, "my-requests": { "en": "My Requests", "ar": "طلباتي"