Commit 5dda8e4c authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Merge branch 'fix_notif_rapporteur'

parents b213725a 9bdd0e1a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ class PresoutenanceController extends AbstractController

            $url_rapporteur = $this->url()->fromRoute("soutenance/index-rapporteur", ['these' => $these->getId()], ['force_canonical' => true], true);
            $url = $this->url()->fromRoute('zfcuser/login', ['type'=> 'token'], ['query' => ['token' => $token->getToken(), 'redirect' => $url_rapporteur, 'role' => $acteur->getRole()->getRoleId()], 'force_canonical' => true], true );
            $this->getNotifierSoutenanceService()->triggerConnexionRapporteur($these, $user, $url);
            $this->getNotifierSoutenanceService()->triggerConnexionRapporteur($proposition, $user, $url);
        }


+5 −4
Original line number Diff line number Diff line
@@ -643,11 +643,11 @@ class NotifierSoutenanceService extends NotifierService
    }

    /**
     * @param These $these
     * @param Proposition $proposition
     * @param Utilisateur $user
     * @param string $url
     */
    public function triggerConnexionRapporteur(These $these, Utilisateur $user, string $url)
    public function triggerConnexionRapporteur(Proposition $proposition, Utilisateur $user, string $url)
    {
        $email = $user->getEmail();
        if ($email === null) throw new LogicException("Aucun email de fourni !");
@@ -655,11 +655,12 @@ class NotifierSoutenanceService extends NotifierService
        if (!empty($email)) {
            $notif = new Notification();
            $notif
                ->setSubject("Connexion à SyGAL en tant que rapporteur de la thèse de " . $these->getDoctorant()->getIndividu()->getNomComplet())
                ->setSubject("Connexion à SyGAL en tant que rapporteur de la thèse de " . $proposition->getThese()->getDoctorant()->getIndividu()->getNomComplet())
                ->setTo($email)
                ->setTemplatePath('soutenance/notification/connexion-rapporteur')
                ->setTemplateVariables([
                    'these' => $these,
                    'proposition' => $proposition,
                    'these' => $proposition->getThese(),
                    'username' => $user->getUsername(),
                    'url' => $url,
                ]);