|
|
@ -3,8 +3,15 @@ import { Component, OnInit } from '@angular/core'; |
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
import {ActivatedRoute} from '@angular/router'; |
|
|
|
import {ActivatedRoute} from '@angular/router'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import {MatTableDataSource} from '@angular/material/table'; |
|
|
|
|
|
|
|
import {MatPaginator} from '@angular/material/paginator'; |
|
|
|
|
|
|
|
import {MatSort} from '@angular/material/sort'; |
|
|
|
|
|
|
|
|
|
|
|
import { FormationsService } from '@shared/api-swagger/api/api'; |
|
|
|
import { FormationsService } from '@shared/api-swagger/api/api'; |
|
|
|
import { FormationModel } from "@shared/api-swagger/model/models"; |
|
|
|
import { FormationModel } from "@shared/api-swagger/model/models"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { DisplayParticipation } from "@shared/displayInfo/displays"; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
@ -15,7 +22,11 @@ export class FormationComponent implements OnInit { |
|
|
|
formation:FormationModel; |
|
|
|
formation:FormationModel; |
|
|
|
dateTexte:string = "Prévue le"; |
|
|
|
dateTexte:string = "Prévue le"; |
|
|
|
formationSubscription: Subscription; |
|
|
|
formationSubscription: Subscription; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
participationsDisplay: DisplayParticipation[]; |
|
|
|
|
|
|
|
|
|
|
|
dataSource : MatTableDataSource<DisplayParticipation>; |
|
|
|
dataSource : MatTableDataSource<DisplayParticipation>; |
|
|
|
|
|
|
|
displayedColumns: string[]= ["agence", "collaborateur", "dateinscription", "ep"]; |
|
|
|
|
|
|
|
|
|
|
|
constructor(private service:FormationsService,private route:ActivatedRoute) {} |
|
|
|
constructor(private service:FormationsService,private route:ActivatedRoute) {} |
|
|
|
|
|
|
|
|
|
|
@ -30,11 +41,35 @@ export class FormationComponent implements OnInit { |
|
|
|
this.formation = formation; |
|
|
|
this.formation = formation; |
|
|
|
if(this.formation.statut == 2) { |
|
|
|
if(this.formation.statut == 2) { |
|
|
|
this.dateTexte = "Effecutée le"; |
|
|
|
this.dateTexte = "Effecutée le"; |
|
|
|
|
|
|
|
this.displayedColumns.push("evaluation"); |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.formation.statut == 3) { |
|
|
|
if(this.formation.statut == 3) { |
|
|
|
this.dateTexte = "Initialement prévue le"; |
|
|
|
this.dateTexte = "Initialement prévue le"; |
|
|
|
} |
|
|
|
} |
|
|
|
//if(formation.participantsFormation != undefined )
|
|
|
|
if(formation.participantsFormation != undefined && formation.participantsFormation.length != 0 ) { |
|
|
|
|
|
|
|
this.initParticpationFormation(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initParticpationFormation() { |
|
|
|
|
|
|
|
let participationDisplay : DisplayParticipation; |
|
|
|
|
|
|
|
this.participationsDisplay = []; |
|
|
|
|
|
|
|
for(let participation of this.formation.participantsFormation ) { |
|
|
|
|
|
|
|
participationDisplay = new DisplayParticipation(); |
|
|
|
|
|
|
|
participationDisplay.id =participation.id; |
|
|
|
|
|
|
|
participationDisplay.dateCreation = participation.dateCreation; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
participationDisplay.estEvaluee = participation.estEvaluee; |
|
|
|
|
|
|
|
participationDisplay.idEP = participation.demandeformation.ep.id; |
|
|
|
|
|
|
|
participationDisplay.statutEP = participation.demandeformation.ep.etat; |
|
|
|
|
|
|
|
participationDisplay.idCollaborateur = participation.demandeformation.ep.collaborateur.id; |
|
|
|
|
|
|
|
participationDisplay.collaborateur = participation.demandeformation.ep.collaborateur.prenom + " " + participation.demandeformation.ep.collaborateur.nom; |
|
|
|
|
|
|
|
participationDisplay.agence = participation.demandeformation.ep.collaborateur.businessUnit.nom; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.participationsDisplay.push(participationDisplay); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(this.participationsDisplay); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getStatut(statut:number) { |
|
|
|
getStatut(statut:number) { |
|
|
|