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

Module Formation : Ajout d'un bouton sur la fiche d'une session pour envoyer...

Module Formation : Ajout d'un bouton sur la fiche d'une session pour envoyer la feuille d'émargement aux formateurs
parent 0c6e9c3c
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ Journal des modifications
9.3.0
-----
- 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

9.2.1
-----
+10 −0
Changes for doc/release-notes/v9/9.3.0/01_formation.sql: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,3 +4,13 @@ INSERT INTO nature_fichier (id, code, libelle) VALUES (nextval('nature_fichier_i
update formation_etat set description = 'La session est imminente' where code = 'I';
update formation_etat set description = 'Les inscriptions sont ouvertes' where code = 'O';
update formation_etat set description = 'Les inscriptions sont à présent fermées' where code = 'F'

--
-- Template Renderer (Envoi de la liste des inscrits à une session au(x) formateur(s))
--
INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#ListeInscritsSessionFormation', '<p>Fourni l''url vers la liste des inscrits à une session de formation</p>', 'Url', 'getUrlListeInscritsSessionFormation');
INSERT INTO unicaen_renderer_template (code, description, document_type, document_sujet, document_corps, document_css, namespace, engine) VALUES ('FORMATION_TRANSMETTRE_LISTE_INSCRITS_FORMATEURS', '<p>Mail envoyé aux formateurs afin qu''ils accèdent aux inscrits d''une de leur session </p>', 'mail', 'Liste des inscrits à la session de formation VAR[Formation#Libelle]', e'<p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; color: #212529; font-family: ubuntu, arial, sans-serif; font-size: 12px;"><span style="color: #212529; font-family: ubuntu, arial, sans-serif;"><span style="font-size: 12px;">Bonjour, </span></span></p>
<p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; color: #212529; font-family: ubuntu, arial, sans-serif; font-size: 12px;"><span style="color: #212529; font-family: ubuntu, arial, sans-serif;"><span style="font-size: 12px;">Voici la liste des inscrits à la formation VAR[Formation#Libelle] dont vous êtes déclaré·e comme formateur·trice. </span></span></p>
<p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; color: #212529; font-family: ubuntu, arial, sans-serif; font-size: 12px;"><span style="color: #212529; font-family: ubuntu, arial, sans-serif;"><span style="font-size: 12px;">Afin d''y accéder, veuillez cliquer sur ce lien : VAR[Url#ListeInscritsSessionFormation] </span></span></p>
<p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; color: #212529; font-family: ubuntu, arial, sans-serif; font-size: 12px;"><span style="color: #212529; font-family: ubuntu, arial, sans-serif;"><span style="font-size: 12px;">Pour rappel, les séances de cette formation se tiendront : VAR[Session#SeancesTable] </span></span></p>
<p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; color: #212529; font-family: ubuntu, arial, sans-serif; font-size: 12px;"><span style="color: #212529; font-family: ubuntu, arial, sans-serif;"><span style="font-size: 12px;">Cordialement, VAR[Formation#Responsable]</span></span></p>', null, 'Formation\Provider\Template', 'default');
+12 −0
Changes for module/Formation/config/others/session.config.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ return [
                        'afficher',
                        'generer-emargements',
                        'generer-export',
                        'transmettre-liste-inscrits'
                    ],
                    'privileges' => [
                        SessionPrivileges::SESSION_AFFICHER,
@@ -331,6 +332,17 @@ return [
                                    ],
                                ],
                            ],
                            'transmettre-liste-inscrits' => [
                                'type'          => Segment::class,
                                'options'       => [
                                    'route'    => '/transmettre-liste-inscrits/:session',
                                    'defaults' => [
                                        /** @see SessionController::transmettreListeInscritsAction() */
                                        'controller'    => SessionController::class,
                                        'action'        => 'transmettre-liste-inscrits',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
+24 −10
Changes for module/Formation/src/Formation/Controller/SessionController.php: 24 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationInscriptionListePrincipale($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -295,7 +295,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationInscriptionListeComplementaire($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -355,7 +355,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationInscriptionClose($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -372,7 +372,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationInscriptionEchec($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -385,7 +385,7 @@ class SessionController extends AbstractController
        try {
            $notif = $this->formationNotificationFactory->createNotificationSessionImminenteFormateur($session);
            $this->notifierService->trigger($notif);
        } catch (\Notification\Exception\RuntimeException $e) {
        } catch (NotificationRuntimeException $e) {
            // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
        }

@@ -393,7 +393,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationSessionImminente($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -408,7 +408,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationSessionTerminee($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -422,7 +422,7 @@ class SessionController extends AbstractController
            try {
                $notif = $this->formationNotificationFactory->createNotificationSessionAnnulee($inscription);
                $this->notifierService->trigger($notif);
            } catch (\Notification\Exception\RuntimeException $e) {
            } catch (NotificationRuntimeException $e) {
                // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
            }
        }
@@ -453,7 +453,7 @@ class SessionController extends AbstractController
                    try {
                        $notif = $this->formationNotificationFactory->createNotificationInscriptionListePrincipale($inscription);
                        $this->notifierService->trigger($notif);
                    } catch (\Notification\Exception\RuntimeException $e) {
                    } catch (NotificationRuntimeException $e) {
                        // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
                    }
                }
@@ -466,7 +466,7 @@ class SessionController extends AbstractController
                        try {
                            $notif = $this->formationNotificationFactory->createNotificationInscriptionListeComplementaire($inscription);
                            $this->notifierService->trigger($notif);
                        } catch (\Notification\Exception\RuntimeException $e) {
                        } catch (NotificationRuntimeException $e) {
                            // aucun destinataire trouvé lors de la construction de la notif : cas à gérer !
                        }
                    }
@@ -543,6 +543,20 @@ class SessionController extends AbstractController
        return $CSV;
    }

    public function transmettreListeInscritsAction() : Response
    {
        $session = $this->getSessionService()->getRepository()->getRequestedSession($this);

        try {
            $notif = $this->formationNotificationFactory->createNotificationTransmettreInscritsSession($session);
            $this->notifierService->trigger($notif);
        } catch (NotificationRuntimeException) {
            // aucun destinataire, todo : cas à gérer !
        }

        return $this->redirect()->toRoute('formation/session/afficher', ['session' => $session->getId()], [], true);
    }

    public function genererEmargementsAction()
    {
        $session = $this->getSessionService()->getRepository()->getRequestedSession($this);
+2 −0
Changes for module/Formation/src/Formation/Provider/Template/MailTemplates.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,4 +18,6 @@ class MailTemplates

    const FORMATION_SPECIFIQUE_AJOUTEE = "FORMATION_FORMATION_SPECIFIQUE_OUVERTE";

    const TRANSMETTRE_LISTE_INSCRITS_FORMATEURS = "FORMATION_TRANSMETTRE_LISTE_INSCRITS_FORMATEURS";

}
 No newline at end of file
Loading