Loading module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceService.php +17 −3 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ use Application\Entity\Db\Variable; use Application\Service\Acteur\ActeurServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\These\TheseServiceAwareTrait; use Application\Service\Utilisateur\UtilisateurServiceAwareTrait; use Application\Service\Variable\VariableServiceAwareTrait; use DateTime; use Notification\Notification; Loading @@ -34,6 +35,7 @@ class NotifierSoutenanceService extends NotifierService use RoleServiceAwareTrait; use VariableServiceAwareTrait; use TheseServiceAwareTrait; use UtilisateurServiceAwareTrait; /** * @var UrlHelper Loading Loading @@ -69,12 +71,24 @@ class NotifierSoutenanceService extends NotifierService $emails = []; foreach ($individuRoles as $individuRole) { $individu = $individuRole->getIndividu(); if ($individu->getEmail() !== null) { if ($individu->getEtablissement() === $these->getEtablissement()) { if ($individu->getEmail() !== null) { { $emails[] = $individu->getEmail(); } $allEmails[] = $individu->getEmail(); } } else { $utilisateurs = $this->getUtilisateurService()->getRepository()->findByIndividu($individu); foreach ($utilisateurs as $utilisateur) { if ($utilisateur->getEmail()) { $emails[] = $utilisateur->getEmail(); $allEmails[] = $utilisateur->getEmail(); break; } } } } } if (! empty($emails)) return $emails; return $allEmails; Loading @@ -84,7 +98,7 @@ class NotifierSoutenanceService extends NotifierService * @param These $these * @return array */ protected function fetchEmailEcoleDoctorale(These $these) protected function fetchEmailEcoleDoctorale(These $these) : array { /** @var IndividuRole[] $individuRoles */ $individuRoles = $this->roleService->getIndividuRoleByStructure($these->getEcoleDoctorale()->getStructure()); Loading module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceServiceFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Application\Service\Acteur\ActeurService; use Application\Service\Notification\NotificationFactory; use Application\Service\Role\RoleService; use Application\Service\These\TheseService; use Application\Service\Utilisateur\UtilisateurService; use Application\Service\Variable\VariableService; use Interop\Container\ContainerInterface; use Notification\Service\NotifierServiceFactory; Loading Loading @@ -34,12 +35,14 @@ class NotifierSoutenanceServiceFactory extends NotifierServiceFactory * @var RoleService $roleService * @var VariableService $variableService * @var TheseService $theseService * @var UtilisateurService $utilisateurService */ $acteurService = $container->get(ActeurService::class); $membreService = $container->get(MembreService::class); $roleService = $container->get('RoleService'); $variableService = $container->get('VariableService'); $theseService = $container->get('TheseService'); $utilisateurService = $container->get('UtilisateurService'); /** @var HttpViewManager|ConsoleViewManager $vm */ $vm = $container->get('ViewManager'); Loading @@ -57,6 +60,7 @@ class NotifierSoutenanceServiceFactory extends NotifierServiceFactory $service->setRoleService($roleService); $service->setVariableService($variableService); $service->setTheseService($theseService); $service->setUtilisateurService($utilisateurService); return $service; } Loading Loading
module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceService.php +17 −3 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ use Application\Entity\Db\Variable; use Application\Service\Acteur\ActeurServiceAwareTrait; use Application\Service\Role\RoleServiceAwareTrait; use Application\Service\These\TheseServiceAwareTrait; use Application\Service\Utilisateur\UtilisateurServiceAwareTrait; use Application\Service\Variable\VariableServiceAwareTrait; use DateTime; use Notification\Notification; Loading @@ -34,6 +35,7 @@ class NotifierSoutenanceService extends NotifierService use RoleServiceAwareTrait; use VariableServiceAwareTrait; use TheseServiceAwareTrait; use UtilisateurServiceAwareTrait; /** * @var UrlHelper Loading Loading @@ -69,12 +71,24 @@ class NotifierSoutenanceService extends NotifierService $emails = []; foreach ($individuRoles as $individuRole) { $individu = $individuRole->getIndividu(); if ($individu->getEmail() !== null) { if ($individu->getEtablissement() === $these->getEtablissement()) { if ($individu->getEmail() !== null) { { $emails[] = $individu->getEmail(); } $allEmails[] = $individu->getEmail(); } } else { $utilisateurs = $this->getUtilisateurService()->getRepository()->findByIndividu($individu); foreach ($utilisateurs as $utilisateur) { if ($utilisateur->getEmail()) { $emails[] = $utilisateur->getEmail(); $allEmails[] = $utilisateur->getEmail(); break; } } } } } if (! empty($emails)) return $emails; return $allEmails; Loading @@ -84,7 +98,7 @@ class NotifierSoutenanceService extends NotifierService * @param These $these * @return array */ protected function fetchEmailEcoleDoctorale(These $these) protected function fetchEmailEcoleDoctorale(These $these) : array { /** @var IndividuRole[] $individuRoles */ $individuRoles = $this->roleService->getIndividuRoleByStructure($these->getEcoleDoctorale()->getStructure()); Loading
module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceServiceFactory.php +4 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ use Application\Service\Acteur\ActeurService; use Application\Service\Notification\NotificationFactory; use Application\Service\Role\RoleService; use Application\Service\These\TheseService; use Application\Service\Utilisateur\UtilisateurService; use Application\Service\Variable\VariableService; use Interop\Container\ContainerInterface; use Notification\Service\NotifierServiceFactory; Loading Loading @@ -34,12 +35,14 @@ class NotifierSoutenanceServiceFactory extends NotifierServiceFactory * @var RoleService $roleService * @var VariableService $variableService * @var TheseService $theseService * @var UtilisateurService $utilisateurService */ $acteurService = $container->get(ActeurService::class); $membreService = $container->get(MembreService::class); $roleService = $container->get('RoleService'); $variableService = $container->get('VariableService'); $theseService = $container->get('TheseService'); $utilisateurService = $container->get('UtilisateurService'); /** @var HttpViewManager|ConsoleViewManager $vm */ $vm = $container->get('ViewManager'); Loading @@ -57,6 +60,7 @@ class NotifierSoutenanceServiceFactory extends NotifierServiceFactory $service->setRoleService($roleService); $service->setVariableService($variableService); $service->setTheseService($theseService); $service->setUtilisateurService($utilisateurService); return $service; } Loading