diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index 705bd712..e456a8b8 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -42,16 +42,21 @@ export class WorkListReplacementRollComponent implements OnInit { searchKeyEnter: boolean = false; messageSuccess: boolean =false; public direction: string; + P_RESPOND_ATTRIBUTES_TBL: any[]; constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { this.P_PAGE_NUM = 1; this.P_PAGE_LIMIT = 50; this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false); + console.log(this.getPassActionMode); + this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false); + console.log(this.getpassResAttr); this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false); if (this.getPassActionMode == "ANSWER_INFO") { this.isAnswer = true; } + this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; @@ -210,17 +215,42 @@ export class WorkListReplacementRollComponent implements OnInit { console.log("selEmp "+ this.selEmp.USER_NAME); if (this.selectedUserInf && this.selectedUserInf.USER_NAME) { + console.log("userInfo "+this.selectedUserInf.USER_NAME); if (this.userNote) { + + if(this.getPassActionMode == "APPROVE_AND_FORWARD" || this.getPassActionMode == "FORWARD"){ + + let index_FORWARD = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "FORWARD_TO_USERNAME_RESPONSE"); + this.getpassResAttr[index_FORWARD].ATTRIBUTE_TEXT_VALUE = this.selectedUserInf.USER_NAME; + // this.userNote; + let index_Note = this.getpassResAttr.findIndex(x => x.ATTRIBUTE_NAME === "NOTE"); + this.getpassResAttr[index_Note].ATTRIBUTE_TEXT_VALUE = this.userNote; + + this.P_RESPOND_ATTRIBUTES_TBL= this.getpassResAttr; + console.log(this.P_RESPOND_ATTRIBUTES_TBL); + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; + this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; + this.WorkListActionObj.P_COMMENTS =""// response Attr + this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; + + }else{ + + + + + this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr // this.modalCtrl.dismiss(); + } this.workListMainService.actionButton(this.WorkListActionObj). subscribe((result: any) => { this.handleApplayActionResult(result); }); + } else { let msg: string = this.ts.trPK("replacementRoll", "enterNote"); this.cs.showErrorMessageDialog(() => { @@ -237,12 +267,13 @@ export class WorkListReplacementRollComponent implements OnInit { this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + // here must send response attr // this.modalCtrl.dismiss(); - this.workListMainService.actionButton(this.WorkListActionObj). - subscribe((result: any) => { - this.handleApplayActionResult(result); - }); + // this.workListMainService.actionButton(this.WorkListActionObj). + // subscribe((result: any) => { + // this.handleApplayActionResult(result); + // }); } else { let msg: string = this.ts.trPK("replacementRoll", "enterNote"); this.cs.showErrorMessageDialog(() => { diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html index 576f9d2b..7c7095f6 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -185,24 +185,7 @@ - - - - - - - - - - + @@ -509,8 +492,8 @@ {{actionHistory.ACTION}} + [ngClass]="{'bg-blue-txt' : actionHistory.ACTION_CODE === 'SUBMIT' ,'bg-orange-txt' : actionHistory.ACTION_CODE === 'PENDING' ,'bg-red-txt' : actionHistory.ACTION_CODE === 'REJECT','bg-green-txt' : actionHistory.ACTION_CODE != 'PENDING' && actionHistory.ACTION_CODE != 'REJECT' && actionHistory.ACTION_CODE != 'SUBMIT'}" + class=""> {{actionHistory.ACTION}} @@ -530,14 +513,15 @@ - + + 0"> {{ 'general, notAttch' | translate}} 0 "> - + - - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + + {{i+1 }}. {{attachList.FILE_NAME}} @@ -566,19 +550,20 @@ + + - + - + @@ -590,19 +575,14 @@ - Transaction Successful + {{'worklistMain, Tran_Succ' | translate}} - + - - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + + {{i+1}}. {{attachList.FILE_NAME}} @@ -681,14 +674,15 @@ - + + - + @@ -698,7 +692,7 @@ - Transaction Successful + {{'worklistMain, Tran_Succ' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index c56399d3..2cd68a18 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -153,7 +153,7 @@ export class WorklistMainPoComponent implements OnInit { }//ngOn intializeNotificationDetail() { if (this.messageSuccess) { - document.getElementById("notificationDynamicFields").innerHTML = ""; + document.getElementById("notificationDynamicFieldsPO").innerHTML = ""; } console.log("intializeNotificationDetail"); this.getPassNotificationDetails = this.common.sharedService.getSharedData( @@ -378,6 +378,11 @@ export class WorklistMainPoComponent implements OnInit { public nextNotfification() { //let itemExist = false; + if( document.getElementById("notificationDynamicFieldsPO") != null){ + + document.getElementById("notificationDynamicFieldsPO").innerHTML = ""; + + } let itemNo = this.getPassNotificationDetails.ROW_NUM; console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); @@ -429,14 +434,17 @@ export class WorklistMainPoComponent implements OnInit { } this.P_RESPOND_ATTRIBUTES_TBL.push(obj); } + console.log("a"+ this.P_RESPOND_ATTRIBUTES_TBL); + let repUserName = this.selEmployeeID; - if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { - let obj: any = {}; - repUserName = ""; - obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; - obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; - this.P_RESPOND_ATTRIBUTES_TBL.push(obj); - } + // if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { + // let obj: any = {}; + // repUserName = ""; + // obj.ATTRIBUTE_NAME = this.hideForwordEmployee.ATTRIBUTE_NAME; + // obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; + // this.P_RESPOND_ATTRIBUTES_TBL.push(obj); + // } + if ( ButtonAction == "APPROVE" || ButtonAction == "REJECT" || @@ -447,6 +455,7 @@ export class WorklistMainPoComponent implements OnInit { this.WorkListActionObj.P_ACTION_MODE = ButtonAction; this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.RespondAttributeList = this.P_RESPOND_ATTRIBUTES_TBL; + //sheardData // this.common.sharedService.setSharedData( @@ -471,7 +480,7 @@ export class WorklistMainPoComponent implements OnInit { this.common.confirmAlertDialogAction( () => { - this.applyAction(this.WorkListActionObj); + // this.applyAction(this.WorkListActionObj); }, this.ts.trPK('general', 'ok'), () => { }, this.ts.trPK('general', 'cancel'), this.ts.trPK('vacation-rule', 'confirmation'), @@ -536,6 +545,8 @@ export class WorklistMainPoComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPoComponent.PASS_RES_ATTR ); + console.log("c"+ this.P_RESPOND_ATTRIBUTES_TBL); + // this.common.openWorklistRollReplacement(); this.openRepRolModal(); } else if ( @@ -639,6 +650,8 @@ export class WorklistMainPoComponent implements OnInit { } getNotificationResAttr(notificationButtonsObj) { + console.log("getNotificationResAttr"); + this.worklistMainService .notificationResponseAttr(notificationButtonsObj) .subscribe((result: NotificatonButtonResponse) => { @@ -673,10 +686,12 @@ export class WorklistMainPoComponent implements OnInit { } // End handleWorkListButtonsResult notificationDynamicFields(notificationAttr) { - const containerId = 'notificationDynamicFields'; + const containerId = 'notificationDynamicFieldsPO'; 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, "", "", ""); + console.log(this.textArea ); + } else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == "DATE") { diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html index eb59b682..045344e2 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -171,23 +171,7 @@ - - - - - - - - - + @@ -359,7 +343,7 @@ {{actionHistory.ACTION}} @@ -378,8 +362,8 @@ - + + 0"> {{ 'general, notAttch' | translate}} @@ -387,7 +371,7 @@ 0 "> - + - - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + + {{i+1}}. {{attachList.FILE_NAME}} @@ -416,12 +400,12 @@ - + + - + @@ -431,7 +415,7 @@ - Transaction Successful + {{'worklistMain, Tran_Succ' | translate}} diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index b3f12921..d581b7e7 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -144,7 +144,7 @@ export class WorklistMainPRComponent implements OnInit { intializeNotificationDetail() { if (this.messageSuccess) { - document.getElementById('notificationDynamicFields').innerHTML = ''; + document.getElementById('notificationDynamicFieldsPR').innerHTML = ''; } console.log('intializeNotificationDetail'); @@ -375,6 +375,11 @@ export class WorklistMainPRComponent implements OnInit { public nextNotfification() { //let itemExist = false; + if( document.getElementById("notificationDynamicFieldsPR") != null){ + + document.getElementById("notificationDynamicFieldsPR").innerHTML = ""; + + } let itemNo = this.getPassNotificationDetails.ROW_NUM; console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); @@ -637,6 +642,8 @@ export class WorklistMainPRComponent implements OnInit { } getNotificationResAttr(notificationButtonsObj) { + console.log("getNotificationResAttr"); + this.worklistMainService .notificationResponseAttr(notificationButtonsObj) .subscribe((result: NotificatonButtonResponse) => { @@ -671,10 +678,12 @@ export class WorklistMainPRComponent implements OnInit { } // End handleWorkListButtonsResult notificationDynamicFields(notificationAttr) { - const containerId = 'notificationDynamicFields'; + const containerId = 'notificationDynamicFieldsPR'; 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, '', '', ''); + console.log(this.textArea ); + } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'ROLE') { } else if (notificationAttr[i].ATTRIBUTE_TYPE == 'DATE') { 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 fe27a6d1..fd34b96c 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -40,7 +40,7 @@ 0 "> - + + @@ -368,7 +369,7 @@ {{actionHistory.ACTION}} @@ -390,14 +391,19 @@ + + 0"> {{ 'general, notAttch' | translate}} + + + 0 "> - + - - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + + {{i+1 }}. {{attachList.FILE_NAME}} @@ -426,29 +432,12 @@ + + - - - - - - - - + @@ -457,12 +446,13 @@ + + - - Transaction Successful + {{'worklistMain, Tran_Succ' | translate}} 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 0a2eb0fc..44c227a5 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -138,6 +138,14 @@ export class WorklistMainComponent implements OnInit { }); } + //name=document.getElementById('notificationDynamicFields').value; + //removeElement('parentDiv', name);" + + + //var navbar = document.getElementById("notificationDynamicFields").value; + // document.querySelector('svg .gauge.chart > text').remove(); + // var inputValue = (document.getElementById("notificationDynamicFields")).value; + console.log(" this.selEmp" + this.selEmp); this.intializeNotificationDetail(); @@ -149,9 +157,11 @@ export class WorklistMainComponent implements OnInit { } intializeNotificationDetail() { + if (this.messageSuccess) { document.getElementById("notificationDynamicFields").innerHTML = ""; } + this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, false @@ -355,6 +365,7 @@ export class WorklistMainComponent implements OnInit { setTimeout(() => { this.messageSuccess = false; this.openNotificationsDashboard(); + this.nextNotfification(); }, 5000); @@ -390,6 +401,11 @@ export class WorklistMainComponent implements OnInit { public nextNotfification() { //let itemExist = false; + if( document.getElementById("notificationDynamicFields") != null){ + + document.getElementById("notificationDynamicFields").innerHTML = ""; + + } let itemNo = this.getPassNotificationDetails.ROW_NUM; console.log(itemNo); let index = this.notificationArray.findIndex(x => x.ROW_NUM === itemNo); @@ -409,6 +425,7 @@ export class WorklistMainComponent implements OnInit { if(this.notificationArray[index].REQUEST_TYPE == "MR" ){ this.common.openWorklistMainMRPage() }else{ + this.intializeNotificationDetail(); } @@ -444,6 +461,8 @@ export class WorklistMainComponent implements OnInit { } this.P_RESPOND_ATTRIBUTES_TBL.push(obj); } + console.log("a"+ this.P_RESPOND_ATTRIBUTES_TBL); + let repUserName = this.selEmployeeID; if (this.hideForwordEmployee && this.hideForwordEmployee.ATTRIBUTE_NAME) { let obj: any = {}; @@ -452,6 +471,8 @@ export class WorklistMainComponent implements OnInit { obj.ATTRIBUTE_TEXT_VALUE = this.selEmployeeID; this.P_RESPOND_ATTRIBUTES_TBL.push(obj); } + + console.log( "b"+ this.P_RESPOND_ATTRIBUTES_TBL); if ( ButtonAction == "APPROVED" || @@ -576,6 +597,8 @@ export class WorklistMainComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainComponent.PASS_RES_ATTR ); + console.log("c"+ this.P_RESPOND_ATTRIBUTES_TBL); + // this.common.openWorklistRollReplacement(); this.openRepRolModal(); } else if ( @@ -660,6 +683,7 @@ export class WorklistMainComponent implements OnInit { } getNotificationResAttr(notificationButtonsObj) { + console.log("getNotificationResAttr"); this.worklistMainService .notificationResponseAttr(notificationButtonsObj) .subscribe((result: NotificatonButtonResponse) => { @@ -696,6 +720,7 @@ export class WorklistMainComponent implements OnInit { 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, "", "", ""); + console.log(this.textArea ); } else if (notificationAttr[i].ATTRIBUTE_TYPE == "ROLE") { } else if (notificationAttr[i].ATTRIBUTE_TYPE == "DATE") { diff --git a/Mohem/src/app/uI-elements/text-area.input.ts b/Mohem/src/app/uI-elements/text-area.input.ts index b16fa4f6..a2e9e07b 100644 --- a/Mohem/src/app/uI-elements/text-area.input.ts +++ b/Mohem/src/app/uI-elements/text-area.input.ts @@ -15,6 +15,7 @@ export class TextAreaInput extends UiElement { } public getTemplate() { + console.log("getTemplate"); let requiredClass: string = ""; if (this.required == 'Y') requiredClass = "requiredClass" @@ -30,6 +31,7 @@ export class TextAreaInput extends UiElement { "" + this.label + "" + "" + this.value + "" + ""; + console.log("template"+ template); return template; } diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html index a015a78c..a216c9cc 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.html @@ -75,7 +75,7 @@ {{'vacation-rule, notification' | translate}} - {{x.NOTIFICATION_DISPLAY_NAME}} diff --git a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss index 1aa1c1c6..7edf7d17 100644 --- a/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss +++ b/Mohem/src/app/vacation-rule/vacation-type/vacation-type.component.scss @@ -92,7 +92,6 @@ color: black !important; margin:0; } - // .progcontainer { // margin: auto; // text-align: center; diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 8dd65dbf..972d306f 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -2364,7 +2364,12 @@ "ITEM_AMU": { "en": "AMU (Last 3 months)", "ar": "AMU (Last 3 months)" + }, + "Tran_Succ":{ + "en": "Transaction Successful", + "ar":"عملية ناجحه" } + }, "payslip": { "title": { diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index b4ce084a..66492f00 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -1517,4 +1517,4 @@ table.monthview-datetable th small { .alert-wrapper { min-width: 80% !important;//what ever you like - } \ No newline at end of file + }
{{ 'general, notAttch' | translate}}