Commit 3d829c1d authored by Thomas Hamel's avatar Thomas Hamel
Browse files

affichage des sessions en fonction des séances les plus proches du jour actuel

parent c586dfb7
Loading
Loading
Loading
Loading
+2 −2
Changes for module/Application/src/Application/Service/ListeDiffusion/ListeDiffusionServiceFactory.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -32,8 +32,8 @@ class ListeDiffusionServiceFactory
        /**
         * @var \Application\Service\ListeDiffusion\Url\UrlService $urlService
         */
//        $urlService = $container->get(UrlService::class);
//        $service->setUrlService($urlService);
        $urlService = $container->get(UrlService::class);
        $service->setUrlService($urlService);

        return $service;
    }
+1 −1
Changes for module/Formation/src/Formation/Controller/IndexController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class IndexController extends AbstractController
            $debut = $this->anneeUnivService->computeDateDebut($anneeScolaire);
            $fin = $this->anneeUnivService->computeDateFin($anneeScolaire);
            $ouvertes = $this->getEntityManager()->getRepository(Session::class)->findSessionsByDoctorant($doctorant, Etat::CODE_OUVERTE, $debut, $fin);
            $preparations = $this->getEntityManager()->getRepository(Session::class)->findSessionsByDoctorant($doctorant, Etat::CODE_PREPARATION);
            $preparations = $this->getEntityManager()->getRepository(Session::class)->findSessionsByDoctorant($doctorant, Etat::CODE_PREPARATION, $debut, $fin);
            /** @var Inscription[] $inscription */
            $inscriptions = $this->getEntityManager()->getRepository(Inscription::class)->findInscriptionsByDoctorant($doctorant);
        } else {
+2 −1
Changes for module/Formation/src/Formation/Entity/Db/Repository/SessionRepository.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -86,7 +86,8 @@ class SessionRepository extends DefaultEntityRepository
            ->andWhere('etat.code = :etat')
            ->setParameter('structures', array_unique($structures))
            ->setParameter('etat', $etat)
            ->orderBy("seance.debut", "DESC");
            ->addOrderBy('ABS(DATE_DIFF(CURRENT_DATE(), seance.debut))', 'ASC')
        ;

        if ($debut !== null && $fin !== null) {
            $qb->andWhere('seance.debut >= :debut')->setParameter('debut', $debut)
+20 −2
Changes for module/Formation/src/Formation/View/Helper/partial/seances.phtml: 20 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -27,8 +27,18 @@ $nbSeances = count($seances);
 -
<?php echo $session->getDuree(); ?> h.
<ul>
    <?php foreach ($seances as $seance) : ?>
    <li>
    <?php foreach ($seances as $seance) :
        $class = "seance-non-passee";
        if($dateFin = $seance->getFin()){
            $aujourdhui = new DateTime();
            $dateFinObj = $dateFin;
            $class= $dateFinObj < $aujourdhui ? "seance-passee" : $class;
        }
        if($class === "seance-non-passee"): ?>
            <li class=<?=$class?>>
        <?php else: ?>
            <li class=<?=$class?> data-bs-toggle="tooltip" title="Séance passée">
        <?php endif; ?>
        <?php echo $seance->getDebut()->format("d/m/Y"); ?>
        <?php echo $seance->getDebut()->format("H:i"); ?>
        &rightarrow;
@@ -37,3 +47,11 @@ $nbSeances = count($seances);
    <?php endforeach; ?>
</ul>

<style>
    .seance-passee {
        color: gray; /* Changer la couleur du texte */
        text-decoration: line-through; /* Barrer le texte pour indiquer qu'il est passé */
        opacity: 0.7; /* Rendre l'élément un peu transparent */
    }
</style>
+1 −1
Changes for module/Formation/view/formation/index/index-doctorant.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ $now = new DateTime();
                            <?php echo $session->getDateClotureInscription()->format('d/m/Y'); ?>
                            <br/>
                        <?php endif; ?>
                        <?php echo $this->seances($session, 'DESC'); ?>
                        <?php echo $this->seances($session, 'ASC'); ?>
                    </td>
                    <td> <?php echo $this->modalite($session); ?></td>
                    <td> <?php echo $this->type($session); ?></td>