DatenStruktur

main
manueltauber 2023-06-01 11:42:14 +02:00
parent 6a9dd38280
commit f14b82921c
1 changed files with 106 additions and 33 deletions

View File

@ -167,6 +167,8 @@ export class NttGanttComponent implements OnInit {
this.deMap.set('tooltipDate', 'Geplantes Start Datum'); this.deMap.set('tooltipDate', 'Geplantes Start Datum');
this.enMap.set('tooltipDate', 'Planned Start Date'); this.enMap.set('tooltipDate', 'Planned Start Date');
this.deMap.set('permit', 'Zur Genehmigung');
this.enMap.set('permit', 'Permit');
this.deMap.set('genehmigen', 'Genehmigen'); this.deMap.set('genehmigen', 'Genehmigen');
this.enMap.set('genehmigen', 'Approve'); this.enMap.set('genehmigen', 'Approve');
this.deMap.set('ablehnen', 'Ablehnen'); this.deMap.set('ablehnen', 'Ablehnen');
@ -222,14 +224,11 @@ export class NttGanttComponent implements OnInit {
} }
public logg(args){ public logg(args){
console.log(args); console.log(args);
} }
/** /**
* The function ngOnInit sets values which are required for rendering the gantt Chart. Furthermore it trims the resources (Changes Array) and sets the paginator to the first page. * The function ngOnInit sets values which are required for rendering the gantt Chart. Furthermore it trims the resources (Changes Array) and sets the paginator to the first page.
*/ */
@ -609,6 +608,11 @@ public logg(args){
this.selRecs = this.selectedrecords; this.selRecs = this.selectedrecords;
} }
let allStates: boolean = true; let allStates: boolean = true;
let allPermit: boolean = true;
let allApprove: boolean = true;
let allReject: boolean = true;
let allCancel: boolean = true;
let allImplementer: boolean = true;
this.selectedRescourceIds = []; this.selectedRescourceIds = [];
for (const change of this.selRecs) { for (const change of this.selRecs) {
if(change.taskData.approvalStatus == 1){ if(change.taskData.approvalStatus == 1){
@ -622,23 +626,54 @@ public logg(args){
}else{ }else{
allStates = false; allStates = false;
} }
if(change.taskData.flagPermit == true && allPermit == true){
allPermit = true;
}else{
allPermit = false;
}
if(change.taskData.flagApproval == true && allApprove == true){
allApprove = true;
}else{
allApprove = false;
}
if(change.taskData.flagReject == true && allCancel == true){
allReject = true;
}else{
allReject = false;
}
if(change.taskData.flagCancel == true && allCancel == true){
allCancel = true;
}else{
allCancel = false;
}
if(change.taskData.implementerEdit == true && allImplementer == true){
allImplementer = true;
}else{
allImplementer = false;
}
} }
if(allStates){ if(allStates){
if(this.approvalPending == true){ this.toolbar = [];
this.toolbar = ['Cancel',{text: this.lMap.get("genehmigen"), id: "7"},{text:this.lMap.get("ablehnen"), id: "8"}]; this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
if(allPermit){
this.toolbar.push({text: this.lMap.get("permit"), id: "5"});
} }
else{ if(allApprove){
if(this.selRecs[0].taskData.state > 0 &&this.selRecs[0].taskData.state < 4){ this.toolbar.push({text: this.lMap.get("genehmigen"), id: "7"});
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
}else{
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"}];
if(this.selRecs[0].taskData.state == 0){
this.toolbar = [{text: this.lMap.get("stornieren"), id: "11"},{text:this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}];
}
}
} }
if(allReject){
this.toolbar.push({text: this.lMap.get("ablehnen"), id: "8"});
}
if(allCancel){
this.toolbar.push({text: this.lMap.get("stornieren"), id: "11"});
}
if(allImplementer){
this.toolbar.push({text: this.lMap.get("implementer"), id: "10"});
}
}else{ }else{
this.toolbar = ['Cancel']; this.toolbar = [];
} }
@ -672,6 +707,11 @@ public logg(args){
this.selRecs = this.selectedrecords; this.selRecs = this.selectedrecords;
} }
let allStates: boolean = true; let allStates: boolean = true;
let allPermit: boolean = true;
let allApprove: boolean = true;
let allReject: boolean = true;
let allCancel: boolean = true;
let allImplementer: boolean = true;
this.selectedRescourceIds = []; this.selectedRescourceIds = [];
for (const change of this.selRecs) { for (const change of this.selRecs) {
if(change.taskData.state == this.selRecs[0].taskData.state){ if(change.taskData.state == this.selRecs[0].taskData.state){
@ -685,24 +725,57 @@ public logg(args){
}else{ }else{
allStates = false; allStates = false;
} }
}
if(allStates){
if(this.approvalPending == true){ if(change.taskData.flagPermit == true && allPermit == true){
this.toolbar = ['Cancel',{text: this.lMap.get("genehmigen"), id: "7"},{text: this.lMap.get("ablehnen"), id: "8"}]; allPermit = true;
} }else{
else{ allPermit = false;
if(this.selRecs[0].taskData.state > 0 &&this.selRecs[0].taskData.state < 4){ }
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}]; if(change.taskData.flagApproval == true && allApprove == true){
}else{ allApprove = true;
this.toolbar = ['Cancel',{text: this.lMap.get("stateChange"), id: "6"}]; }else{
if(this.selRecs[0].taskData.state == 0){ allApprove = false;
this.toolbar = [{text: this.lMap.get("stornieren"), id: "11"},{text: this.lMap.get("stateChange"), id: "6"} ,{text: this.lMap.get("implementer"), id: "10"}]; }
} if(change.taskData.flagReject == true && allReject == true){
} allReject = true;
} }else{
}else{ allReject = false;
this.toolbar = ['Cancel']; }
} if(change.taskData.flagCancel == true && allCancel == true){
allCancel = true;
}else{
allCancel = false;
}
if(change.taskData.implementerEdit == true && allImplementer == true){
allImplementer = true;
}else{
allImplementer = false;
}
}
if(allStates){
this.toolbar = [];
this.toolbar.push({text:this.lMap.get("stateChange"), id: "6"});
if(allPermit){
this.toolbar.push({text: this.lMap.get("permit"), id: "5"});
}
if(allApprove){
this.toolbar.push({text: this.lMap.get("genehmigen"), id: "7"});
}
if(allReject){
this.toolbar.push({text: this.lMap.get("ablehnen"), id: "8"});
}
if(allCancel){
this.toolbar.push({text: this.lMap.get("stornieren"), id: "11"});
}
if(allImplementer){
this.toolbar.push({text: this.lMap.get("implementer"), id: "10"});
}
}else{
this.toolbar = [];
}
this.selRecs = []; this.selRecs = [];
this.selectedrecords = []; this.selectedrecords = [];
this.selectedrowindex = []; this.selectedrowindex = [];