Commit 942cac0f authored by Thomas Hamel's avatar Thomas Hamel
Browse files

Index des sessions : ajout d'un filtre sur les séances

parent 579867d0
Loading
Loading
Loading
Loading
+11 −0
Changes for module/Formation/src/Formation/Service/Session/Search/SessionSearchService.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ class SessionSearchService extends SearchService
    const NAME_structure = 'structure';
    const NAME_anneeUniv = 'anneeUniv';
    const NAME_type = 'type';
    const NAME_seances = 'seances';


    public function init()
@@ -85,6 +86,7 @@ class SessionSearchService extends SearchService
            $this->createResponsableSorter(),
            $this->createEtatSorter(),
            $this->createModaliteSorter(),
            $this->createSeancesSorter(),
        ]);

        //tri descendant par les dates des séances (lorsqu'aucun sorter n'est sélectionné)
@@ -253,4 +255,13 @@ class SessionSearchService extends SearchService
    {
        return new SearchSorter("Libellé", self::NAME_libelle);
    }

    private function createSeancesSorter(): SearchSorter
    {
        $sorter = new SearchSorter("Séances", self::NAME_seances);
        $sorter->setQueryBuilderApplier(function (SearchSorter $sorter, QueryBuilder $qb){
            $qb->addOrderBy('seance.debut', $sorter->getDirection());
        });
        return $sorter;
    }
}
 No newline at end of file
+6 −1
Changes for module/Formation/view/formation/session/recherche/index.phtml: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -78,7 +78,12 @@ $canSupprimerSession = $this->isAllowed(SessionPrivileges::getResourceId(Sess
                    <?php echo $this->translate("État") ?>
                </a> <?php echo $s->icon() ?>
            </th>
            <th style="min-width: 14rem;">Séances</th>
            <th>
                <a href="<?php echo $s = $this->sortable(SessionSearchService::NAME_seances) ?>"
                   data-bs-toggle="tooltip" title="<?php echo $this->translate("Tri sur la date de début/fin d'une séance") ?> ">
                    <?php echo $this->translate("Séances") ?>
                </a> <?php echo $s->icon() ?>
            </th>
            <th style="min-width: 9rem;">Inscriptions</th>
            <th style="min-width: 4rem;">Action</th>
        </tr>