Loading doc/release-notes/v6.0.8.md +2 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,6 @@ systemctl reload php8.0-fpm CREATE UNIQUE INDEX soutenance_proposition_uniq ON soutenance_proposition(these_id) WHERE (histo_destruction is null); CREATE UNIQUE INDEX soutenance_proposition_uniq_histo ON soutenance_proposition(these_id, histo_destruction) WHERE (histo_destruction is not null); INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#Enquete', '<p>Ajoute le lien vers l''enquête</p>', 'Url', 'getUrlEnquete'); ``` No newline at end of file module/Formation/src/Formation/Service/Notification/FormationNotificationFactory.php +1 −1 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ class FormationNotificationFactory extends NotificationFactory 'doctorant' => $inscription->getDoctorant(), 'formation' => $inscription->getSession()->getFormation(), 'session' => $inscription->getSession(), 'inscription' => $inscription, ]; $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::SESSION_TERMINEE, $vars); $mail = $inscription->getDoctorant()->getIndividu()->getEmailPro(); Loading @@ -220,7 +221,6 @@ class FormationNotificationFactory extends NotificationFactory ->setSubject($rendu->getSujet()) ->setBody($rendu->getCorps()) ; return $notif; } Loading module/Formation/src/Formation/Service/Url/UrlService.php +17 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Formation\Service\Url; use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException; use Formation\Entity\Db\Inscription; use Formation\Provider\NatureFichier\NatureFichier; use Laminas\View\Renderer\PhpRenderer; use Structure\Entity\Db\Etablissement; Loading @@ -15,9 +16,13 @@ class UrlService { use StructureDocumentServiceAwareTrait; /** @var PhpRenderer */ protected $renderer; protected PhpRenderer $renderer; protected array $variables = []; public function setRenderer(PhpRenderer $renderer): void { $this->renderer = $renderer; } public function setVariables(array $variables) : void { $this->variables = $variables; Loading @@ -43,4 +48,15 @@ class UrlService { } return '<img src="data:image/png;base64,'. base64_encode($content). '" style="max-width:5cm;"/>'; } /** @noinspection PhpUnused */ public function getUrlEnquete(): string { if (!isset($this->vars['inscription'])) throw new RuntimeException("Variable inscription non fournie à [".UrlService::class."]"); /** @var Inscription $inscription */ $inscription = $this->vars['inscription']; $url = $this->renderer->url('formation/enquete/repondre-questions', ['inscription' => $inscription->getId()], [], true); return "<a href='".$url."'>Formulaire d'enquête de retour de formation</a>"; } } No newline at end of file module/Formation/src/Formation/Service/Url/UrlServiceFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Formation\Service\Url; use Fichier\Service\Fichier\FichierStorageService; use Laminas\View\Renderer\PhpRenderer; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; Loading @@ -18,13 +19,16 @@ class UrlServiceFactory { { /** * @var FichierStorageService $fichierStorageService * @var PhpRenderer $renderer * @var StructureDocumentService $structureDocumentService */ $fichierStorageService = $container->get(FichierStorageService::class); $renderer = $container->get('ViewRenderer'); $structureDocumentService = $container->get(StructureDocumentService::class); $service = new UrlService(); $service->setFichierStorageService($fichierStorageService); $service->setRenderer($renderer); $service->setStructureDocumentService($structureDocumentService); return $service; } Loading Loading
doc/release-notes/v6.0.8.md +2 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,6 @@ systemctl reload php8.0-fpm CREATE UNIQUE INDEX soutenance_proposition_uniq ON soutenance_proposition(these_id) WHERE (histo_destruction is null); CREATE UNIQUE INDEX soutenance_proposition_uniq_histo ON soutenance_proposition(these_id, histo_destruction) WHERE (histo_destruction is not null); INSERT INTO unicaen_renderer_macro (code, description, variable_name, methode_name) VALUES ('Url#Enquete', '<p>Ajoute le lien vers l''enquête</p>', 'Url', 'getUrlEnquete'); ``` No newline at end of file
module/Formation/src/Formation/Service/Notification/FormationNotificationFactory.php +1 −1 Original line number Diff line number Diff line Loading @@ -206,6 +206,7 @@ class FormationNotificationFactory extends NotificationFactory 'doctorant' => $inscription->getDoctorant(), 'formation' => $inscription->getSession()->getFormation(), 'session' => $inscription->getSession(), 'inscription' => $inscription, ]; $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::SESSION_TERMINEE, $vars); $mail = $inscription->getDoctorant()->getIndividu()->getEmailPro(); Loading @@ -220,7 +221,6 @@ class FormationNotificationFactory extends NotificationFactory ->setSubject($rendu->getSujet()) ->setBody($rendu->getCorps()) ; return $notif; } Loading
module/Formation/src/Formation/Service/Url/UrlService.php +17 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Formation\Service\Url; use Fichier\Service\Fichier\FichierStorageServiceAwareTrait; use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException; use Formation\Entity\Db\Inscription; use Formation\Provider\NatureFichier\NatureFichier; use Laminas\View\Renderer\PhpRenderer; use Structure\Entity\Db\Etablissement; Loading @@ -15,9 +16,13 @@ class UrlService { use StructureDocumentServiceAwareTrait; /** @var PhpRenderer */ protected $renderer; protected PhpRenderer $renderer; protected array $variables = []; public function setRenderer(PhpRenderer $renderer): void { $this->renderer = $renderer; } public function setVariables(array $variables) : void { $this->variables = $variables; Loading @@ -43,4 +48,15 @@ class UrlService { } return '<img src="data:image/png;base64,'. base64_encode($content). '" style="max-width:5cm;"/>'; } /** @noinspection PhpUnused */ public function getUrlEnquete(): string { if (!isset($this->vars['inscription'])) throw new RuntimeException("Variable inscription non fournie à [".UrlService::class."]"); /** @var Inscription $inscription */ $inscription = $this->vars['inscription']; $url = $this->renderer->url('formation/enquete/repondre-questions', ['inscription' => $inscription->getId()], [], true); return "<a href='".$url."'>Formulaire d'enquête de retour de formation</a>"; } } No newline at end of file
module/Formation/src/Formation/Service/Url/UrlServiceFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Formation\Service\Url; use Fichier\Service\Fichier\FichierStorageService; use Laminas\View\Renderer\PhpRenderer; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; Loading @@ -18,13 +19,16 @@ class UrlServiceFactory { { /** * @var FichierStorageService $fichierStorageService * @var PhpRenderer $renderer * @var StructureDocumentService $structureDocumentService */ $fichierStorageService = $container->get(FichierStorageService::class); $renderer = $container->get('ViewRenderer'); $structureDocumentService = $container->get(StructureDocumentService::class); $service = new UrlService(); $service->setFichierStorageService($fichierStorageService); $service->setRenderer($renderer); $service->setStructureDocumentService($structureDocumentService); return $service; } Loading