Loading module/Soutenance/src/Soutenance/Controller/PresoutenanceController.php +13 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ use Soutenance\Service\Validation\ValidatationServiceAwareTrait; use UnicaenApp\Exception\LogicException; use UnicaenApp\Exception\RuntimeException; use UnicaenAuth\Service\Traits\UserServiceAwareTrait; use UnicaenAuthToken\Service\TokenServiceAwareTrait; use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger; use Zend\View\Model\ViewModel; use Zend\View\Renderer\PhpRenderer; Loading @@ -56,6 +57,7 @@ class PresoutenanceController extends AbstractController use EngagementImpartialiteServiceAwareTrait; use FichierServiceAwareTrait; use StructureDocumentServiceAwareTrait; use TokenServiceAwareTrait; use DateRenduRapportFormAwareTrait; use AdresseSoutenanceFormAwareTrait; Loading Loading @@ -209,8 +211,17 @@ class PresoutenanceController extends AbstractController $user = $this->utilisateurService->createFromIndividu($individu, $this->generateUsername($membre), 'none'); $user->setEmail($membre->getEmail()); $this->userService->updateUserPasswordResetToken($user); $url = $this->url()->fromRoute('utilisateur/init-compte', ['token' => $user->getPasswordResetToken()], ['force_canonical' => true], true); $this->getNotifierSoutenanceService()->triggerInitialisationCompte($these, $user, $url); $token = $this->tokenService->createUserToken($proposition->getDate()); $token->setUser($user); $this->tokenService->saveUserToken($token); $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, $url); // $url = $this->url()->fromRoute('utilisateur/init-compte', ['token' => $user->getPasswordResetToken()], ['force_canonical' => true], true); // $this->getNotifierSoutenanceService()->triggerInitialisationCompte($these, $user, $url); } } Loading module/Soutenance/src/Soutenance/Controller/PresoutenanceControllerFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Proposition\PropositionService; use Soutenance\Service\Validation\ValidationService; use UnicaenAuth\Service\User as UserService; use UnicaenAuthToken\Service\TokenService; use Zend\View\Renderer\PhpRenderer; class PresoutenanceControllerFactory Loading @@ -46,6 +47,7 @@ class PresoutenanceControllerFactory * @var EngagementImpartialiteService $engagementImpartialiteService * @var FichierService $fichierService * @var StructureDocumentService $structureDocumentService * @var TokenService $tokenService */ $propositionService = $container->get(PropositionService::class); $membreService = $container->get(MembreService::class); Loading @@ -62,6 +64,7 @@ class PresoutenanceControllerFactory $engagementImpartialiteService = $container->get(EngagementImpartialiteService::class); $fichierService = $container->get(FichierService::class); $structureDocumentService = $container->get(StructureDocumentService::class); $tokenService = $container->get(TokenService::class); /** * @var DateRenduRapportForm $dateRenduRapportForm Loading Loading @@ -90,6 +93,7 @@ class PresoutenanceControllerFactory $controller->setEngagementImpartialiteService($engagementImpartialiteService); $controller->setFichierService($fichierService); $controller->setStructureDocumentService($structureDocumentService); $controller->setTokenService($tokenService); $controller->setDateRenduRapportForm($dateRenduRapportForm); $controller->setAdresseSoutenanceForm($adresseSoutenanceForm); Loading module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceService.php +27 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ class NotifierSoutenanceService extends NotifierService $this->urlHelper = $urlHelper; } /** * @param These $these * @return string Loading Loading @@ -639,6 +641,31 @@ class NotifierSoutenanceService extends NotifierService } } /** * @param These $these * @param Utilisateur $user * @param string $url */ public function triggerConnexionRapporteur(These $these, Utilisateur $user, string $url) { $email = $user->getEmail(); if ($email === null) throw new LogicException("Aucun email de fourni !"); if (!empty($email)) { $notif = new Notification(); $notif ->setSubject("Connexion à SyGAL en tant que rapporteur de la thèse de " . $these->getDoctorant()->getIndividu()->getNomComplet()) ->setTo($email) ->setTemplatePath('soutenance/notification/connexion-rapporteur') ->setTemplateVariables([ 'these' => $these, 'username' => $user->getUsername(), 'url' => $url, ]); $this->trigger($notif); } } /** * @param Membre $membre * @param string $url Loading module/Soutenance/view/soutenance/notification/connexion-rapporteur.phtml 0 → 100644 +54 −0 Original line number Diff line number Diff line <?php use Application\Entity\Db\These; use Application\View\Renderer\PhpRenderer; /** * @see \Soutenance\Service\Notifier\NotifierSoutenanceService::triggerConnexionRapporteur() * * @var PhpRenderer $this * @var These $these * @var string $username * @var string $url */ $doctorant = $these->getDoctorant()->getIndividu()->getNomComplet(false, false, false, true, false, true); $titre = $these->getTitre(); $justification = true; ?> <p><em>-- Version française----------------------------------------------------</em></p> <p> Bonjour, </p> <p> Vous venez d'être désigné comme rapporteur pour la thèse de <strong><?php echo $doctorant; ?></strong> intitulée <strong><?php echo $titre; ?></strong>. Afin de pouvoir vous connecter à l'application <strong> <?php echo $this->appInfos()->nom; ?> </strong> et ainsi pouvoir rendre votre avis de pré-soutenance, vous pouvez utiliser l'adresse suivante : <a href="<?php echo $url; ?>"><?php echo $url;?> </a>. </p> <p> Cordialement, </p> <p><em>-- English version -----------------------------------------------------</em></p> <p> Dear Mrs/Mr, </p> <p> You have been appointed as an external referee for the PhD thesis presented by <strong><?php echo $doctorant; ?></strong> entitled <strong><?php echo $titre; ?></strong>. In order to have access to the <strong> <?php echo $this->appInfos()->nom; ?> </strong> web-based application for submitting your report, you can use the following link : <a href="<?php echo $url; ?>"><?php echo $url;?> </a>. </p> <p> Best regards, </p> <?php if ($justification) : ?> <p> Vous recevez ce mail, car votre rôle dans la soutenance de thèse de <?php echo $doctorant; ?> nécessite un compte SyGAL. </p> <?php endif; ?> Loading
module/Soutenance/src/Soutenance/Controller/PresoutenanceController.php +13 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ use Soutenance\Service\Validation\ValidatationServiceAwareTrait; use UnicaenApp\Exception\LogicException; use UnicaenApp\Exception\RuntimeException; use UnicaenAuth\Service\Traits\UserServiceAwareTrait; use UnicaenAuthToken\Service\TokenServiceAwareTrait; use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger; use Zend\View\Model\ViewModel; use Zend\View\Renderer\PhpRenderer; Loading @@ -56,6 +57,7 @@ class PresoutenanceController extends AbstractController use EngagementImpartialiteServiceAwareTrait; use FichierServiceAwareTrait; use StructureDocumentServiceAwareTrait; use TokenServiceAwareTrait; use DateRenduRapportFormAwareTrait; use AdresseSoutenanceFormAwareTrait; Loading Loading @@ -209,8 +211,17 @@ class PresoutenanceController extends AbstractController $user = $this->utilisateurService->createFromIndividu($individu, $this->generateUsername($membre), 'none'); $user->setEmail($membre->getEmail()); $this->userService->updateUserPasswordResetToken($user); $url = $this->url()->fromRoute('utilisateur/init-compte', ['token' => $user->getPasswordResetToken()], ['force_canonical' => true], true); $this->getNotifierSoutenanceService()->triggerInitialisationCompte($these, $user, $url); $token = $this->tokenService->createUserToken($proposition->getDate()); $token->setUser($user); $this->tokenService->saveUserToken($token); $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, $url); // $url = $this->url()->fromRoute('utilisateur/init-compte', ['token' => $user->getPasswordResetToken()], ['force_canonical' => true], true); // $this->getNotifierSoutenanceService()->triggerInitialisationCompte($these, $user, $url); } } Loading
module/Soutenance/src/Soutenance/Controller/PresoutenanceControllerFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ use Soutenance\Service\Parametre\ParametreService; use Soutenance\Service\Proposition\PropositionService; use Soutenance\Service\Validation\ValidationService; use UnicaenAuth\Service\User as UserService; use UnicaenAuthToken\Service\TokenService; use Zend\View\Renderer\PhpRenderer; class PresoutenanceControllerFactory Loading @@ -46,6 +47,7 @@ class PresoutenanceControllerFactory * @var EngagementImpartialiteService $engagementImpartialiteService * @var FichierService $fichierService * @var StructureDocumentService $structureDocumentService * @var TokenService $tokenService */ $propositionService = $container->get(PropositionService::class); $membreService = $container->get(MembreService::class); Loading @@ -62,6 +64,7 @@ class PresoutenanceControllerFactory $engagementImpartialiteService = $container->get(EngagementImpartialiteService::class); $fichierService = $container->get(FichierService::class); $structureDocumentService = $container->get(StructureDocumentService::class); $tokenService = $container->get(TokenService::class); /** * @var DateRenduRapportForm $dateRenduRapportForm Loading Loading @@ -90,6 +93,7 @@ class PresoutenanceControllerFactory $controller->setEngagementImpartialiteService($engagementImpartialiteService); $controller->setFichierService($fichierService); $controller->setStructureDocumentService($structureDocumentService); $controller->setTokenService($tokenService); $controller->setDateRenduRapportForm($dateRenduRapportForm); $controller->setAdresseSoutenanceForm($adresseSoutenanceForm); Loading
module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceService.php +27 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ class NotifierSoutenanceService extends NotifierService $this->urlHelper = $urlHelper; } /** * @param These $these * @return string Loading Loading @@ -639,6 +641,31 @@ class NotifierSoutenanceService extends NotifierService } } /** * @param These $these * @param Utilisateur $user * @param string $url */ public function triggerConnexionRapporteur(These $these, Utilisateur $user, string $url) { $email = $user->getEmail(); if ($email === null) throw new LogicException("Aucun email de fourni !"); if (!empty($email)) { $notif = new Notification(); $notif ->setSubject("Connexion à SyGAL en tant que rapporteur de la thèse de " . $these->getDoctorant()->getIndividu()->getNomComplet()) ->setTo($email) ->setTemplatePath('soutenance/notification/connexion-rapporteur') ->setTemplateVariables([ 'these' => $these, 'username' => $user->getUsername(), 'url' => $url, ]); $this->trigger($notif); } } /** * @param Membre $membre * @param string $url Loading
module/Soutenance/view/soutenance/notification/connexion-rapporteur.phtml 0 → 100644 +54 −0 Original line number Diff line number Diff line <?php use Application\Entity\Db\These; use Application\View\Renderer\PhpRenderer; /** * @see \Soutenance\Service\Notifier\NotifierSoutenanceService::triggerConnexionRapporteur() * * @var PhpRenderer $this * @var These $these * @var string $username * @var string $url */ $doctorant = $these->getDoctorant()->getIndividu()->getNomComplet(false, false, false, true, false, true); $titre = $these->getTitre(); $justification = true; ?> <p><em>-- Version française----------------------------------------------------</em></p> <p> Bonjour, </p> <p> Vous venez d'être désigné comme rapporteur pour la thèse de <strong><?php echo $doctorant; ?></strong> intitulée <strong><?php echo $titre; ?></strong>. Afin de pouvoir vous connecter à l'application <strong> <?php echo $this->appInfos()->nom; ?> </strong> et ainsi pouvoir rendre votre avis de pré-soutenance, vous pouvez utiliser l'adresse suivante : <a href="<?php echo $url; ?>"><?php echo $url;?> </a>. </p> <p> Cordialement, </p> <p><em>-- English version -----------------------------------------------------</em></p> <p> Dear Mrs/Mr, </p> <p> You have been appointed as an external referee for the PhD thesis presented by <strong><?php echo $doctorant; ?></strong> entitled <strong><?php echo $titre; ?></strong>. In order to have access to the <strong> <?php echo $this->appInfos()->nom; ?> </strong> web-based application for submitting your report, you can use the following link : <a href="<?php echo $url; ?>"><?php echo $url;?> </a>. </p> <p> Best regards, </p> <?php if ($justification) : ?> <p> Vous recevez ce mail, car votre rôle dans la soutenance de thèse de <?php echo $doctorant; ?> nécessite un compte SyGAL. </p> <?php endif; ?>