Commit 1bfd924b authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout des formations suivies

parent 2b416d3e
Loading
Loading
Loading
Loading
+74 −0
Original line number Diff line number Diff line
<?php

/**
 * @var EntretienProfessionnel $entretien
 * @var FormationElement[] $formations
 */

/**
 * @var FormationElement $formationElement
 */
use EntretienProfessionnel\Entity\Db\EntretienProfessionnel;
use Formation\Entity\Db\FormationElement;

$anneeCampagne = $entretien->getCampagne()->getAnnee();

$array = [];
foreach ($formations as $formation) {
    if ($formation->estNonHistorise()) {
        $anneeFormation = explode(" - ", $formation->getCommentaire())[0];
        if ( $anneeFormation===$anneeCampagne ) {
            $array[($formation->getFormation()->getGroupe()) ? $formation->getFormation()->getGroupe()->getLibelle() : "Sans groupe"][] = $formation;
        }
    }
}
ksort($array);

?>

<div class="row">
    <div class="col-md-1"></div>
    <div class="col-md-10">
        <table class="formations">
            <tbody>
            <?php foreach($array as $groupe => $listing) : ?>
                <tr>
                    <th class="titre" colspan="3">
                        <?php echo $groupe; ?>
                    </th>
                </tr>
                <?php foreach ($listing as $formationElement) : ?>
                    <tr>
                        <td class="libelle-cell">
                            <?php echo $formationElement->getFormation()->getLibelle(); ?>
                        </td>
                        <td class="info-cell">
                            <?php echo $formationElement->getCommentaire(); ?>
                        </td>
                        <td class="validation-cell">
                            <?php $validation = $formationElement->getValidation(); ?>
                            <?php if ($validation === null ) : ?>
                                Aucune validation
                            <?php else : ?>
                                <?php if ($validation->getValeur() === null) : ?>
                                    <span class="icon ok" style="color: darkgreen;"
                                          data-toggle="tooltip" data-html="true"
                                          title="Validée le <?php echo $validation->getHistoModification()->format('d/m/Y'); ?> par <?php echo $validation->getHistoModificateur()->getDisplayName(); ?>"
                                    > Validée</span>
                                <?php else : ?>
                                    <span class="icon ko" style="color: darkred;"
                                          data-toggle="tooltip" data-html="true"
                                          title="Refusée le <?php echo $validation->getHistoModification()->format('d/m/Y'); ?> par <?php echo $validation->getHistoModificateur()->getDisplayName(); ?>"
                                    >Refusée</span>
                                <?php endif; ?>
                            <?php endif; ?>
                        </td>
                    </tr>
                <?php endforeach;?>
            <?php endforeach;?>
            </tbody>
        </table>
    </div>
</div>

<br/>
 No newline at end of file
+6 −0
Original line number Diff line number Diff line
@@ -84,6 +84,12 @@ $dayAfter = $date->add(new DateInterval('P1D'));

<?php echo $this->portenote('EntretienProfessionnelController::renseignerAction()>formation', '', []); ?>


<h3> Formation survie durant la période de la campagne (<?php echo $entretien->getCampagne()->getAnnee(); ?>)</h3>

<?php echo $this->partial("partial/formations-suivies-campagne", ["entretien" => $entretien, 'formations' => $agent->getFormationListe()]); ?>


<?php
$instance = $entretien->getFormationInstance();
$formulaire = $instance->getFormulaire();