|
|
|
@ -14,6 +14,9 @@ export class ReferencementComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
referencements: Referencement[] = []; |
|
|
|
|
collaborateurs: Collaborateur[] = []; |
|
|
|
|
collaborateursSansRef: Collaborateur[] = []; |
|
|
|
|
idReferredTab: number[] = []; |
|
|
|
|
isOld: boolean = false; |
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
|
private http: HttpClient, |
|
|
|
@ -23,13 +26,35 @@ export class ReferencementComponent implements OnInit { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getReferencements(); |
|
|
|
|
this.getCollaborateurs(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getCollaborateurs(): void { |
|
|
|
|
this.collaborateurService.getCollaborateurs() |
|
|
|
|
.subscribe(collaborateurs => this.collaborateurs = collaborateurs); |
|
|
|
|
.subscribe(collaborateurs => { |
|
|
|
|
this.collaborateurs = collaborateurs; |
|
|
|
|
|
|
|
|
|
this.referencementService.getReferencements() |
|
|
|
|
.subscribe(referencements => { |
|
|
|
|
|
|
|
|
|
this.referencements = referencements; |
|
|
|
|
this.referencements.forEach(ref => { |
|
|
|
|
|
|
|
|
|
if (this.idReferredTab.find(id => ref.id == id) == undefined) { |
|
|
|
|
this.idReferredTab.push(ref.referredId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.collaborateurs.forEach(collab => { |
|
|
|
|
if (this.idReferredTab.find(id => collab.id == id) == undefined) { |
|
|
|
|
this.collaborateursSansRef.push(collab); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isOldReverse() { |
|
|
|
|
this.isOld = !this.isOld; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getCollaborateurById(id: number): Collaborateur { |
|
|
|
@ -44,11 +69,6 @@ export class ReferencementComponent implements OnInit { |
|
|
|
|
return collab; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getReferencements(): void { |
|
|
|
|
this.referencementService.getReferencements() |
|
|
|
|
.subscribe(referencements => this.referencements = referencements); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getSplitDate(date: string | undefined): string { |
|
|
|
|
if (date == undefined) { |
|
|
|
|
return ""; |
|
|
|
|