Loading module/Application/src/Application/Service/ListeDiffusion/ListeDiffusionServiceFactory.php +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 Loading @@ -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; } Loading module/Formation/config/others/session.config.php +20 −0 Changes for module/Formation/config/others/session.config.php: 20 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -57,6 +57,15 @@ return [ SessionPrivileges::SESSION_INDEX, ], ], [ 'controller' => SessionController::class, 'action' => [ 'generer-export-csv' ], 'privileges' => [ SessionPrivileges::SESSION_INDEX, ], ], [ 'controller' => SessionController::class, 'action' => [ Loading Loading @@ -311,6 +320,17 @@ return [ ], ], ], 'generer-export-csv' => [ 'type' => Segment::class, 'options' => [ 'route' => '/generer-export-csv', 'defaults' => [ /** @see SessionController::genererExportCsvAction() */ 'controller' => SessionController::class, 'action' => 'generer-export-csv', ], ], ], ], ], ], Loading module/Formation/src/Formation/Controller/InscriptionController.php +0 −1 Changes for module/Formation/src/Formation/Controller/InscriptionController.php: 0 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -378,7 +378,6 @@ class InscriptionController extends AbstractController } public function genererExportCsvAction(): Response|CsvModel { $queryParams = $this->params()->fromQuery(); Loading module/Formation/src/Formation/Controller/SessionController.php +80 −0 Changes for module/Formation/src/Formation/Controller/SessionController.php: 80 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,9 +3,11 @@ namespace Formation\Controller; use Application\Controller\AbstractController; use Application\Search\SearchServiceAwareTrait; use Application\Service\AnneeUniv\AnneeUnivServiceAwareTrait; use Doctrine\ORM\PersistentCollection; use Formation\Service\Notification\FormationNotificationFactoryAwareTrait; use Formation\Service\Session\Search\SessionSearchServiceAwareTrait; use Notification\Exception\ExceptionInterface; use Notification\Exception\RuntimeException; use These\Entity\Db\These; Loading Loading @@ -46,6 +48,8 @@ class SessionController extends AbstractController use SessionServiceAwareTrait; use SessionStructureValideServiceAwareTrait; use AnneeUnivServiceAwareTrait; use SessionSearchServiceAwareTrait; use SessionFormAwareTrait; Loading Loading @@ -563,4 +567,80 @@ class SessionController extends AbstractController ]); $export->exportAll($seances, 'SYGAL_emargement_' . $session->getId() . ".pdf"); } public function genererExportCsvAction(): Response|CsvModel { $queryParams = array_filter($this->params()->fromQuery(), function($value) { return !is_null($value) && $value !== ''; }); $this->sessionSearchService->init(); $this->sessionSearchService->processQueryParams($queryParams); $qb = $this->sessionSearchService->getQueryBuilder(); $listing = $qb->getQuery()->getResult(); //export $headers = ['Module', 'Formation', 'Établissement organisateur', 'Responsable de la formation', 'Formateur(s)', 'État de la session', 'Structures valides pour l\'inscription', 'Modalité', 'Nombre d\'heures', 'Séance(s)', 'Effectif Liste principale', 'Effectif Liste complémentaire', 'Nombre d\'inscrits', 'Nombre d\'inscrits sur liste principale', 'Inscrits sur liste principale']; $records = []; /** @var Session $session */ foreach ($listing as $session) { $formation = $session->getFormation(); $structuresValides = $session->getStructuresValides(); $structuresValidesStrings = array_map(function($structureValide) { return $structureValide->getStructure()->getLibelle(); }, $structuresValides->toArray()); $formateurs = $session->getFormateurs(); $formateursStrings = array_map(function($formateur) { return $formateur->getIndividu(); }, $formateurs->toArray()); $inscrits = $session->getInscriptions()->toArray(); $nbInscrits = count($inscrits); /** @var Seance[] $seances */ $seances = $session->getSeances()->toArray(); usort($seances, function(Seance $a, Seance $b) { return $a->getDebut() > $b->getDebut();}); $seanceStrings = array_map(function($seance) { return $seance->getDebut()->format('d/m/Y'); }, $seances); $inscritsPrincipale = $session->getInscriptionsByListe(Inscription::LISTE_PRINCIPALE); $nbInscritsListePrincipale = count($inscritsPrincipale); $inscritsPrincipaleStrings = array_map(function($inscritPrincipale) { return $inscritPrincipale->getDoctorant()->getIndividu(); }, $inscritsPrincipale); $entry = []; $entry['Module'] = $formation && $formation->getModule() ? $formation->getModule()->getLibelle() : null; $entry['Formation'] = $formation ? $formation->getLibelle() : null; $entry['Établissement organisateur'] = $session->getSite() ? $session->getSite()->getStructure()->getLibelle() : null; $entry['Responsable de la formation'] = $session->getResponsable() ? $session->getResponsable() : null; $entry['Formateur(s)'] = implode("/", $formateursStrings);; $entry['État de la session'] = $session->getEtat(); $entry["Structures valides pour l'inscription"] = implode("/", $structuresValidesStrings); $entry['Modalité'] = $session->getModalite(); $entry['Nombre d\'heures'] = (string) $session->getDuree(); $entry['Séance(s)'] = implode(' / ', $seanceStrings); $entry['Effectif Liste principale'] = $session->getTailleListePrincipale(); $entry['Effectif Liste complémentaire'] = $session->getTailleListeComplementaire(); $entry['Nombre d\'inscrits'] = $nbInscrits; $entry['Nombre d\'inscrits sur liste principale'] = $nbInscritsListePrincipale; $entry['Inscrits sur liste principale'] = implode(' / ', $inscritsPrincipaleStrings);; $records[] = $entry; } $filename = (new DateTime())->format('Ymd') . '_sessions.csv'; $CSV = new CsvModel(); $CSV->setDelimiter(';'); $CSV->setEnclosure('"'); $CSV->setHeader($headers); $CSV->setData($records); $CSV->setFilename($filename); return $CSV; } } No newline at end of file module/Formation/src/Formation/Controller/SessionControllerFactory.php +3 −0 Changes for module/Formation/src/Formation/Controller/SessionControllerFactory.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Fichier\Service\Fichier\FichierStorageService; use Formation\Service\Formation\FormationService; use Formation\Service\Notification\FormationNotificationFactory; use Formation\Service\Presence\PresenceService; use Formation\Service\Session\Search\SessionSearchService; use Formation\Service\SessionStructureValide\SessionStructureValideService; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; Loading Loading @@ -50,6 +51,7 @@ class SessionControllerFactory { $sessionService = $container->get(SessionService::class); $sessionStructureComplementaireService = $container->get(SessionStructureValideService::class); $anneeUnivService = $container->get(AnneeUnivService::class); $searchService = $container->get(SessionSearchService::class); /** * @var SessionForm $sessionForm Loading @@ -71,6 +73,7 @@ class SessionControllerFactory { $controller->setSessionService($sessionService); $controller->setSessionStructureValideService($sessionStructureComplementaireService); $controller->setAnneeUnivService($anneeUnivService); $controller->setSessionSearchService($searchService); /** Form ******************************************************************************************************/ $controller->setSessionForm($sessionForm); /** Autre *****************************************************************************************************/ Loading Loading
module/Application/src/Application/Service/ListeDiffusion/ListeDiffusionServiceFactory.php +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 Loading @@ -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; } Loading
module/Formation/config/others/session.config.php +20 −0 Changes for module/Formation/config/others/session.config.php: 20 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -57,6 +57,15 @@ return [ SessionPrivileges::SESSION_INDEX, ], ], [ 'controller' => SessionController::class, 'action' => [ 'generer-export-csv' ], 'privileges' => [ SessionPrivileges::SESSION_INDEX, ], ], [ 'controller' => SessionController::class, 'action' => [ Loading Loading @@ -311,6 +320,17 @@ return [ ], ], ], 'generer-export-csv' => [ 'type' => Segment::class, 'options' => [ 'route' => '/generer-export-csv', 'defaults' => [ /** @see SessionController::genererExportCsvAction() */ 'controller' => SessionController::class, 'action' => 'generer-export-csv', ], ], ], ], ], ], Loading
module/Formation/src/Formation/Controller/InscriptionController.php +0 −1 Changes for module/Formation/src/Formation/Controller/InscriptionController.php: 0 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -378,7 +378,6 @@ class InscriptionController extends AbstractController } public function genererExportCsvAction(): Response|CsvModel { $queryParams = $this->params()->fromQuery(); Loading
module/Formation/src/Formation/Controller/SessionController.php +80 −0 Changes for module/Formation/src/Formation/Controller/SessionController.php: 80 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,9 +3,11 @@ namespace Formation\Controller; use Application\Controller\AbstractController; use Application\Search\SearchServiceAwareTrait; use Application\Service\AnneeUniv\AnneeUnivServiceAwareTrait; use Doctrine\ORM\PersistentCollection; use Formation\Service\Notification\FormationNotificationFactoryAwareTrait; use Formation\Service\Session\Search\SessionSearchServiceAwareTrait; use Notification\Exception\ExceptionInterface; use Notification\Exception\RuntimeException; use These\Entity\Db\These; Loading Loading @@ -46,6 +48,8 @@ class SessionController extends AbstractController use SessionServiceAwareTrait; use SessionStructureValideServiceAwareTrait; use AnneeUnivServiceAwareTrait; use SessionSearchServiceAwareTrait; use SessionFormAwareTrait; Loading Loading @@ -563,4 +567,80 @@ class SessionController extends AbstractController ]); $export->exportAll($seances, 'SYGAL_emargement_' . $session->getId() . ".pdf"); } public function genererExportCsvAction(): Response|CsvModel { $queryParams = array_filter($this->params()->fromQuery(), function($value) { return !is_null($value) && $value !== ''; }); $this->sessionSearchService->init(); $this->sessionSearchService->processQueryParams($queryParams); $qb = $this->sessionSearchService->getQueryBuilder(); $listing = $qb->getQuery()->getResult(); //export $headers = ['Module', 'Formation', 'Établissement organisateur', 'Responsable de la formation', 'Formateur(s)', 'État de la session', 'Structures valides pour l\'inscription', 'Modalité', 'Nombre d\'heures', 'Séance(s)', 'Effectif Liste principale', 'Effectif Liste complémentaire', 'Nombre d\'inscrits', 'Nombre d\'inscrits sur liste principale', 'Inscrits sur liste principale']; $records = []; /** @var Session $session */ foreach ($listing as $session) { $formation = $session->getFormation(); $structuresValides = $session->getStructuresValides(); $structuresValidesStrings = array_map(function($structureValide) { return $structureValide->getStructure()->getLibelle(); }, $structuresValides->toArray()); $formateurs = $session->getFormateurs(); $formateursStrings = array_map(function($formateur) { return $formateur->getIndividu(); }, $formateurs->toArray()); $inscrits = $session->getInscriptions()->toArray(); $nbInscrits = count($inscrits); /** @var Seance[] $seances */ $seances = $session->getSeances()->toArray(); usort($seances, function(Seance $a, Seance $b) { return $a->getDebut() > $b->getDebut();}); $seanceStrings = array_map(function($seance) { return $seance->getDebut()->format('d/m/Y'); }, $seances); $inscritsPrincipale = $session->getInscriptionsByListe(Inscription::LISTE_PRINCIPALE); $nbInscritsListePrincipale = count($inscritsPrincipale); $inscritsPrincipaleStrings = array_map(function($inscritPrincipale) { return $inscritPrincipale->getDoctorant()->getIndividu(); }, $inscritsPrincipale); $entry = []; $entry['Module'] = $formation && $formation->getModule() ? $formation->getModule()->getLibelle() : null; $entry['Formation'] = $formation ? $formation->getLibelle() : null; $entry['Établissement organisateur'] = $session->getSite() ? $session->getSite()->getStructure()->getLibelle() : null; $entry['Responsable de la formation'] = $session->getResponsable() ? $session->getResponsable() : null; $entry['Formateur(s)'] = implode("/", $formateursStrings);; $entry['État de la session'] = $session->getEtat(); $entry["Structures valides pour l'inscription"] = implode("/", $structuresValidesStrings); $entry['Modalité'] = $session->getModalite(); $entry['Nombre d\'heures'] = (string) $session->getDuree(); $entry['Séance(s)'] = implode(' / ', $seanceStrings); $entry['Effectif Liste principale'] = $session->getTailleListePrincipale(); $entry['Effectif Liste complémentaire'] = $session->getTailleListeComplementaire(); $entry['Nombre d\'inscrits'] = $nbInscrits; $entry['Nombre d\'inscrits sur liste principale'] = $nbInscritsListePrincipale; $entry['Inscrits sur liste principale'] = implode(' / ', $inscritsPrincipaleStrings);; $records[] = $entry; } $filename = (new DateTime())->format('Ymd') . '_sessions.csv'; $CSV = new CsvModel(); $CSV->setDelimiter(';'); $CSV->setEnclosure('"'); $CSV->setHeader($headers); $CSV->setData($records); $CSV->setFilename($filename); return $CSV; } } No newline at end of file
module/Formation/src/Formation/Controller/SessionControllerFactory.php +3 −0 Changes for module/Formation/src/Formation/Controller/SessionControllerFactory.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Fichier\Service\Fichier\FichierStorageService; use Formation\Service\Formation\FormationService; use Formation\Service\Notification\FormationNotificationFactory; use Formation\Service\Presence\PresenceService; use Formation\Service\Session\Search\SessionSearchService; use Formation\Service\SessionStructureValide\SessionStructureValideService; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; Loading Loading @@ -50,6 +51,7 @@ class SessionControllerFactory { $sessionService = $container->get(SessionService::class); $sessionStructureComplementaireService = $container->get(SessionStructureValideService::class); $anneeUnivService = $container->get(AnneeUnivService::class); $searchService = $container->get(SessionSearchService::class); /** * @var SessionForm $sessionForm Loading @@ -71,6 +73,7 @@ class SessionControllerFactory { $controller->setSessionService($sessionService); $controller->setSessionStructureValideService($sessionStructureComplementaireService); $controller->setAnneeUnivService($anneeUnivService); $controller->setSessionSearchService($searchService); /** Form ******************************************************************************************************/ $controller->setSessionForm($sessionForm); /** Autre *****************************************************************************************************/ Loading