Commit 347aa25b authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Formation : Amélioration de l'affichage de la liste des inscrits (état de la...

Formation : Amélioration de l'affichage de la liste des inscrits (état de la session, état de la saisie de l'enquête)
parent 3b170321
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ Journal des modifications
5.2.9
-----
- Masquage des membres du CSI et de leurs saisies
- Formation : Amélioration de l'affichage de la liste des inscrits (état de la session, état de la saisie de l'enquête)

5.2.8
-----
+24 −3
Changes for module/Formation/view/formation/inscription/recherche/index.phtml: 24 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

namespace Application;

use DateInterval;
use DateTime;
use Formation\Entity\Db\Etat;
use Formation\Entity\Db\Inscription;
use Formation\Provider\Privilege\InscriptionPrivileges;
use Formation\Provider\Privilege\SessionPrivileges;
@@ -19,9 +22,10 @@ use Laminas\Paginator\Paginator as LaminasPaginator;
$this->headTitle($this->translate($title));

$canVoirSession     = $this->isAllowed(SessionPrivileges::getResourceId(SessionPrivileges::SESSION_AFFICHER));

$canHistoriserInscription      = $this->isAllowed(InscriptionPrivileges::getResourceId(InscriptionPrivileges::INSCRIPTION_HISTORISER));
$canSupprimerInscription       = $this->isAllowed(InscriptionPrivileges::getResourceId(InscriptionPrivileges::INSCRIPTION_SUPPRIMER));

$now = new DateTime();
?>

<h1 class="page-header"><?php echo $title ?></h1>
@@ -58,15 +62,21 @@ $canSupprimerInscription = $this->isAllowed(InscriptionPrivileges::getReso
        <tbody>
        <?php /** @var Inscription $inscription*/ ?>
        <?php foreach ($paginator as $inscription) : ?>
            <?php
                $session = $inscription->getSession();
                $individu = $inscription->getDoctorant()->getIndividu();
                $dateButoir = $session->getDateFin()->add(new DateInterval('P1M'));
            ?>
            <tr>
                <td> <?php echo $inscription->getId(); ?> </td>
                <td>
                    <span class="<?php if ($inscription->estHistorise()) echo "historise text-danger"; ?>"
                          title="<?php echo $inscription->getDescription(); ?>" data-bs-toggle="tooltip" data-bs-html="true"
                    >
                    <?php echo $inscription->getSession()->getId(); ?>
                    <?php echo $inscription->getSession()->getFormation()->getLibelle(); ?>
                    <?php // echo $session->getId(); ?>
                    <?php echo $session->getFormation()->getLibelle(); ?>
                    </span>
                    <?php echo $this->etat($session); ?>
                </td>
                <td>
                    <span class="<?php if ($inscription->estHistorise()) echo "historise text-danger"; ?>"
@@ -74,6 +84,17 @@ $canSupprimerInscription = $this->isAllowed(InscriptionPrivileges::getReso
                    >
                        <?php echo $inscription->getDoctorant()->getIndividu()->getNomComplet(); ?>
                    </span>
                    <?php if ($session->getEtat()->getCode() === Etat::CODE_CLOTURER) : ?>
                        <?php if ($inscription->getValidationEnquete()) : ?>
                            <span class="icon icon-checked text-success" title="<?echo $inscription->getValidationEnquete()->format('d/m/Y'); ?>"></span>
                        <?php else : ?>
                            <?php if ($now > $dateButoir) : ?>
                                <span class="icon icon-wait text-info" title="Enquète non validée (date butoir: <?php echo $dateButoir->format('d/m/Y'); ?>)"></span>
                            <?php else : ?>
                                <span class="icon icon-unchecked text-danger" title="Enquète non saisie (date butoir: <?php echo $dateButoir->format('d/m/Y'); ?>)"></span>
                            <?php endif; ?>
                        <?php endif; ?>
                    <?php endif; ?>
                </td>
                <td>
                    <?php if ($inscription->isListePrincipale()) : ?>