Loading module/Application/src/Application/Entity/Db/Repository/TheseRepository.php +28 −0 Changes for module/Application/src/Application/Entity/Db/Repository/TheseRepository.php: 28 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -62,6 +62,32 @@ class TheseRepository extends DefaultEntityRepository return $results; } /** * @param Etablissement|null $etablissement * @return int[] * @see Year */ public function fetchDistinctAnneesSoutenance(Etablissement $etablissement = null) { $qb = $this->createQueryBuilder('t'); $qb ->distinct() ->select("year(t.dateSoutenance)") ->orderBy("year(t.dateSoutenance)"); if ($etablissement !== null) { $qb ->join('t.etablissement', 'etab', Join::WITH, 'etab = :etablissement') ->setParameter('etablissement', $etablissement); } $results = array_map(function($value) { return current($value); }, $qb->getQuery()->getScalarResult()); return $results; } /** * @param Etablissement|null $etablissement * @return string[] Loading @@ -86,4 +112,6 @@ class TheseRepository extends DefaultEntityRepository return $results; } } No newline at end of file module/Application/src/Application/Service/These/Filter/TheseSelectFilter.php +12 −0 Changes for module/Application/src/Application/Service/These/Filter/TheseSelectFilter.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ class TheseSelectFilter extends TheseFilter const NAME_ecoleDoctorale = 'ecoleDoctorale'; const NAME_uniteRecherche = 'uniteRecherche'; const NAME_anneePremiereInscription = 'anneePremiereInscription'; const NAME_anneeSoutenance = 'anneeSoutenance'; const NAME_discipline = 'discipline'; /** Loading Loading @@ -100,6 +101,17 @@ class TheseSelectFilter extends TheseFilter } break; case self::NAME_anneeSoutenance: if ($filterValue === 'NULL') { $qb ->andWhere('t.dateSoutenance IS NULL'); } else { $qb ->andWhere('year(t.dateSoutenance) = :anneeSoutenance') ->setParameter('anneeSoutenance', $filterValue); } break; case self::NAME_discipline: if ($filterValue === 'NULL') { $qb Loading module/Application/src/Application/Service/These/TheseRechercheService.php +34 −0 Changes for module/Application/src/Application/Service/These/TheseRechercheService.php: 34 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ class TheseRechercheService $ecolesDoctorales = []; $unitesRecherches = []; $anneesPremiereInscription = []; $anneesSoutenance = []; $disciplines = []; $this->filters = [ Loading Loading @@ -96,6 +97,11 @@ class TheseRechercheService TheseSelectFilter::NAME_anneePremiereInscription, $anneesPremiereInscription ), TheseSelectFilter::NAME_anneeSoutenance => new TheseSelectFilter( "soutenance", TheseSelectFilter::NAME_anneeSoutenance, $anneesSoutenance ), TheseSelectFilter::NAME_discipline => new TheseSelectFilter( "Discipline", TheseSelectFilter::NAME_discipline, Loading Loading @@ -127,6 +133,7 @@ class TheseRechercheService $ecolesDoctorales = $this->fetchEcolesDoctoralesOptions(); $unitesRecherches = $this->fetchUnitesRecherchesOptions(); $anneesPremiereInscription = $this->fetchAnneesInscriptionOptions(); $anneesSoutenance = $this->fetchAnneesSoutenance(); $disciplines = $this->fetchDisciplinesOptions(); $this->filters = [ Loading Loading @@ -157,6 +164,11 @@ class TheseRechercheService TheseSelectFilter::NAME_anneePremiereInscription, $anneesPremiereInscription ), TheseSelectFilter::NAME_anneeSoutenance => new TheseSelectFilter( "soutenance", TheseSelectFilter::NAME_anneeSoutenance, $anneesSoutenance ), TheseSelectFilter::NAME_discipline => new TheseSelectFilter( "Discipline", TheseSelectFilter::NAME_discipline, Loading Loading @@ -562,6 +574,28 @@ class TheseRechercheService return $this->addEmptyOption($options, "Toutes"); } private function fetchAnneesSoutenance() { $role = $this->getSelectedIdentityRole(); if ($role->isEtablissementDependant()) { $etablissement = $role->getStructure()->getEtablissement(); $annees = $this->theseService->getRepository()->fetchDistinctAnneesSoutenance($etablissement); } else { $annees = $this->theseService->getRepository()->fetchDistinctAnneesSoutenance(); } $annees = array_reverse(array_filter($annees)); $options = []; $options[] = $this->optionify(null); // option spéciale pour valeur === null foreach ($annees as $annee) { $options[] = $this->optionify($annee); } return $this->addEmptyOption($options, "Toutes"); } private function fetchDisciplinesOptions() { $role = $this->getSelectedIdentityRole(); Loading Loading
module/Application/src/Application/Entity/Db/Repository/TheseRepository.php +28 −0 Changes for module/Application/src/Application/Entity/Db/Repository/TheseRepository.php: 28 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -62,6 +62,32 @@ class TheseRepository extends DefaultEntityRepository return $results; } /** * @param Etablissement|null $etablissement * @return int[] * @see Year */ public function fetchDistinctAnneesSoutenance(Etablissement $etablissement = null) { $qb = $this->createQueryBuilder('t'); $qb ->distinct() ->select("year(t.dateSoutenance)") ->orderBy("year(t.dateSoutenance)"); if ($etablissement !== null) { $qb ->join('t.etablissement', 'etab', Join::WITH, 'etab = :etablissement') ->setParameter('etablissement', $etablissement); } $results = array_map(function($value) { return current($value); }, $qb->getQuery()->getScalarResult()); return $results; } /** * @param Etablissement|null $etablissement * @return string[] Loading @@ -86,4 +112,6 @@ class TheseRepository extends DefaultEntityRepository return $results; } } No newline at end of file
module/Application/src/Application/Service/These/Filter/TheseSelectFilter.php +12 −0 Changes for module/Application/src/Application/Service/These/Filter/TheseSelectFilter.php: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ class TheseSelectFilter extends TheseFilter const NAME_ecoleDoctorale = 'ecoleDoctorale'; const NAME_uniteRecherche = 'uniteRecherche'; const NAME_anneePremiereInscription = 'anneePremiereInscription'; const NAME_anneeSoutenance = 'anneeSoutenance'; const NAME_discipline = 'discipline'; /** Loading Loading @@ -100,6 +101,17 @@ class TheseSelectFilter extends TheseFilter } break; case self::NAME_anneeSoutenance: if ($filterValue === 'NULL') { $qb ->andWhere('t.dateSoutenance IS NULL'); } else { $qb ->andWhere('year(t.dateSoutenance) = :anneeSoutenance') ->setParameter('anneeSoutenance', $filterValue); } break; case self::NAME_discipline: if ($filterValue === 'NULL') { $qb Loading
module/Application/src/Application/Service/These/TheseRechercheService.php +34 −0 Changes for module/Application/src/Application/Service/These/TheseRechercheService.php: 34 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ class TheseRechercheService $ecolesDoctorales = []; $unitesRecherches = []; $anneesPremiereInscription = []; $anneesSoutenance = []; $disciplines = []; $this->filters = [ Loading Loading @@ -96,6 +97,11 @@ class TheseRechercheService TheseSelectFilter::NAME_anneePremiereInscription, $anneesPremiereInscription ), TheseSelectFilter::NAME_anneeSoutenance => new TheseSelectFilter( "soutenance", TheseSelectFilter::NAME_anneeSoutenance, $anneesSoutenance ), TheseSelectFilter::NAME_discipline => new TheseSelectFilter( "Discipline", TheseSelectFilter::NAME_discipline, Loading Loading @@ -127,6 +133,7 @@ class TheseRechercheService $ecolesDoctorales = $this->fetchEcolesDoctoralesOptions(); $unitesRecherches = $this->fetchUnitesRecherchesOptions(); $anneesPremiereInscription = $this->fetchAnneesInscriptionOptions(); $anneesSoutenance = $this->fetchAnneesSoutenance(); $disciplines = $this->fetchDisciplinesOptions(); $this->filters = [ Loading Loading @@ -157,6 +164,11 @@ class TheseRechercheService TheseSelectFilter::NAME_anneePremiereInscription, $anneesPremiereInscription ), TheseSelectFilter::NAME_anneeSoutenance => new TheseSelectFilter( "soutenance", TheseSelectFilter::NAME_anneeSoutenance, $anneesSoutenance ), TheseSelectFilter::NAME_discipline => new TheseSelectFilter( "Discipline", TheseSelectFilter::NAME_discipline, Loading Loading @@ -562,6 +574,28 @@ class TheseRechercheService return $this->addEmptyOption($options, "Toutes"); } private function fetchAnneesSoutenance() { $role = $this->getSelectedIdentityRole(); if ($role->isEtablissementDependant()) { $etablissement = $role->getStructure()->getEtablissement(); $annees = $this->theseService->getRepository()->fetchDistinctAnneesSoutenance($etablissement); } else { $annees = $this->theseService->getRepository()->fetchDistinctAnneesSoutenance(); } $annees = array_reverse(array_filter($annees)); $options = []; $options[] = $this->optionify(null); // option spéciale pour valeur === null foreach ($annees as $annee) { $options[] = $this->optionify($annee); } return $this->addEmptyOption($options, "Toutes"); } private function fetchDisciplinesOptions() { $role = $this->getSelectedIdentityRole(); Loading