Commit fe468574 authored by Thomas Hamel's avatar Thomas Hamel Committed by Bertrand Gauthier
Browse files

Module Formation : Possibilité de déposer un fichier PDF pour la fiche de...

Module Formation : Possibilité de déposer un fichier PDF pour la fiche de présentation d'une formation
parent 6e64f609
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ Journal des modifications

9.3.0
-----
- Module Formation : Possibilité de déposer un fichier PDF pour la fiche de présentation d'une formation
- Module Formation : Ajout d'un tri pour les individus sur l'écran Inscriptions
- Module Formation : Ajout d'un bouton sur la fiche d'une session pour envoyer la feuille d'émargement aux formateurs
- Module Formation : Amélioration de l'UI concernant l'affichage des inscrits à une session de formation
+13 −0
Changes for module/Formation/config/others/formation.config.php: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ return [
                    'controller' => FormationController::class,
                    'action' => [
                        'afficher',
                        'telecharger-fiche',
                    ],
                    'privileges' => [
                        FormationPrivileges::FORMATION_AFFICHER,
@@ -227,6 +228,18 @@ return [
                                    ],
                                ],
                            ],
                            'telecharger-fiche' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/telecharger-fiche/:formation',
                                    'defaults' => [
                                        'controller' => FormationController::class,
                                        /** @see FormationController::telechargerFicheAction() */
                                        'action'     => 'telecharger-fiche',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
+25 −0
Changes for module/Formation/src/Formation/Controller/FormationController.php: 25 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,7 +7,9 @@ use Application\RouteMatch;
use Application\Service\AnneeUniv\AnneeUnivServiceAwareTrait;
use Fichier\Entity\Db\NatureFichier;
use Fichier\Service\Fichier\FichierServiceAwareTrait;
use Fichier\Service\Fichier\FichierStorageServiceAwareTrait;
use Fichier\Service\NatureFichier\NatureFichierServiceAwareTrait;
use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException;
use Formation\Entity\Db\Formation;
use Formation\Entity\Db\Session;
use Formation\Form\Formation\FormationFormAwareTrait;
@@ -19,6 +21,7 @@ use Laminas\Http\Response;
use Laminas\View\Model\ViewModel;
use Notification\Service\NotifierServiceAwareTrait;
use Structure\Service\Etablissement\EtablissementServiceAwareTrait;
use UnicaenApp\Exception\RuntimeException;
use UnicaenApp\Service\EntityManagerAwareTrait;

class FormationController extends AbstractController
@@ -33,6 +36,7 @@ class FormationController extends AbstractController
    use AnneeUnivServiceAwareTrait;
    use NatureFichierServiceAwareTrait;
    use FichierServiceAwareTrait;
    use FichierStorageServiceAwareTrait;

    use EtablissementServiceAwareTrait;

@@ -188,6 +192,27 @@ class FormationController extends AbstractController
        return $vm;
    }

    public function telechargerFicheAction(): void
    {
        $formation = $this->getFormationService()->getRepository()->getRequestedFormation($this);
        $fichier = $formation->getFiche();

        if (!$fichier) {
            return;
        }

        // injection préalable du contenu du fichier pour pouvoir utiliser le plugin Uploader
        try {
            $contenuFichier = $this->fichierStorageService->getFileContentForFichier($fichier);
        } catch (StorageAdapterException $e) {
            throw new RuntimeException("Impossible d'obtenir le contenu du fichier", null, $e);
        }
        $fichier->setContenuFichierData($contenuFichier);

        // Envoi du fichier au client (navigateur)
        $this->uploader()->download($fichier);
    }

    public function supprimerFicheAction(): Response|ViewModel
    {
        $formation = $this->getFormationService()->getRepository()->getRequestedFormation($this);
+4 −0
Changes for module/Formation/src/Formation/Controller/FormationControllerFactory.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Formation\Controller;
use Application\Service\AnneeUniv\AnneeUnivService;
use Doctrine\ORM\EntityManager;
use Fichier\Service\Fichier\FichierService;
use Fichier\Service\Fichier\FichierStorageService;
use Fichier\Service\NatureFichier\NatureFichierService;
use Formation\Form\Formation\FormationForm;
use Formation\Service\Formation\FormationService;
@@ -33,6 +34,7 @@ class FormationControllerFactory {
         * @var FormationService $formationService
         * @var ModuleService $moduleService
         * @var SessionService $sessionService
         * @var FichierStorageService $fichierStorageService
         */
        $entityManager = $container->get('doctrine.entitymanager.orm_default');
        $etablissementService = $container->get(EtablissementService::class);
@@ -45,6 +47,7 @@ class FormationControllerFactory {
        $anneeUnivService = $container->get(AnneeUnivService::class);
        $natureFichier = $container->get(NatureFichierService::class);
        $fichierService = $container->get(FichierService::class);
        $fichierStorageService = $container->get(FichierStorageService::class);

        /**
         * @var FormationForm $formationForm
@@ -63,6 +66,7 @@ class FormationControllerFactory {
        $controller->setAnneeUnivService($anneeUnivService);
        $controller->setFichierService($fichierService);
        $controller->setNatureFichierService($natureFichier);
        $controller->setFichierStorageService($fichierStorageService);

        return $controller;
    }
+1 −0
Changes for module/Formation/src/Formation/View/Helper/partial/inscription.phtml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ $these = current($doctorant->getTheses());
                </span>
            </div>
            <div class="doctorant-extra">
                <?php if (!($these->getEtatThese() === These::ETAT_EN_COURS and $these->estNonHistorise())) echo "<br/>"; ?>
                Inscrit le <?php echo $inscription->getHistoCreation()->format("d/m/Y à H:i"); ?>
                <?php if ($inscription->getSursisEnquete()) : ?>
                    <br><b>Possède un sursis personnel de <?= $inscription->getSursisEnquete() ?> jours pour répondre à l'enquête</b>
Loading