Loading module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceService.php +23 −8 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Soutenance\Service\Notifier; use Application\Entity\Db\Doctorant; use Application\Entity\Db\Individu; use Application\Entity\Db\IndividuRole; use Application\Entity\Db\Role; use Application\Entity\Db\These; use Application\Entity\Db\Utilisateur; use Application\Entity\Db\Validation; Loading Loading @@ -51,6 +52,7 @@ class NotifierSoutenanceService extends NotifierService { $variable = $this->variableService->getRepository()->findByCodeAndThese(Variable::CODE_EMAIL_BDD, $these); return $variable->getValeur(); } /** Loading Loading @@ -97,6 +99,18 @@ class NotifierSoutenanceService extends NotifierService return $this->fetchEmailsByEtablissement($individuRoles, $these); } /** * @param These $these * @return string[] */ protected function fetchEmailMaisonDuDoctorat(These $these) { /** @var IndividuRole[] $individuRoles */ $individuRoles = $this->roleService->getIndividuRoleByStructure($these->getEtablissement()->getStructure()); $individuRoles = array_filter($individuRoles, function (IndividuRole $ir) { return $ir->getRole()->getCode() === Role::CODE_BDD;}); return $this->fetchEmailsByEtablissement($individuRoles, $these); } /** * @param These $these * @return string[] Loading Loading @@ -231,7 +245,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerNotificationBureauDesDoctoratsProposition($these) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading @@ -250,7 +264,7 @@ class NotifierSoutenanceService extends NotifierService /** @param These $these */ public function triggerNotificationPropositionValidee($these) { $emailsBDD = [$this->fetchEmailBdd($these)]; $emailsBDD = $this->fetchEmailMaisonDuDoctorat($these); $emailsED = $this->fetchEmailEcoleDoctorale($these); $emailsUR = $this->fetchEmailUniteRecherche($these); $emailsActeurs = $this->fetchEmailActeursDirects($these); Loading @@ -276,7 +290,7 @@ class NotifierSoutenanceService extends NotifierService /** @param These $these */ public function triggerNotificationPresoutenance($these) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading Loading @@ -354,7 +368,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerSignatureEngagementImpartialite($these, $proposition, $membre) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading @@ -379,8 +393,9 @@ class NotifierSoutenanceService extends NotifierService public function triggerRefusEngagementImpartialite($these, $proposition, $membre) { $emails = $this->fetchEmailActeursDirects($these); $emails[] = $this->fetchEmailBdd($these); $emailsAD = $this->fetchEmailActeursDirects($these); $emailsBDD = $this->fetchEmailMaisonDuDoctorat($these); $emails = array_merge($emailsAD, $emailsBDD); $emails = array_filter($emails, function ($s) { return $s !== null; Loading Loading @@ -454,7 +469,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerAvisRendus($these) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading @@ -476,7 +491,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerAvisFavorable($these, $avis, $url = null) { $emailBDD = [$this->fetchEmailBdd($these)]; $emailBDD = $this->fetchEmailMaisonDuDoctorat($these); $emailsDirecteurs = $this->fetchEmailEncadrants($these); $emailsED = $this->fetchEmailEcoleDoctorale($these); $emailsUR = $this->fetchEmailUniteRecherche($these); Loading Loading
module/Soutenance/src/Soutenance/Service/Notifier/NotifierSoutenanceService.php +23 −8 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Soutenance\Service\Notifier; use Application\Entity\Db\Doctorant; use Application\Entity\Db\Individu; use Application\Entity\Db\IndividuRole; use Application\Entity\Db\Role; use Application\Entity\Db\These; use Application\Entity\Db\Utilisateur; use Application\Entity\Db\Validation; Loading Loading @@ -51,6 +52,7 @@ class NotifierSoutenanceService extends NotifierService { $variable = $this->variableService->getRepository()->findByCodeAndThese(Variable::CODE_EMAIL_BDD, $these); return $variable->getValeur(); } /** Loading Loading @@ -97,6 +99,18 @@ class NotifierSoutenanceService extends NotifierService return $this->fetchEmailsByEtablissement($individuRoles, $these); } /** * @param These $these * @return string[] */ protected function fetchEmailMaisonDuDoctorat(These $these) { /** @var IndividuRole[] $individuRoles */ $individuRoles = $this->roleService->getIndividuRoleByStructure($these->getEtablissement()->getStructure()); $individuRoles = array_filter($individuRoles, function (IndividuRole $ir) { return $ir->getRole()->getCode() === Role::CODE_BDD;}); return $this->fetchEmailsByEtablissement($individuRoles, $these); } /** * @param These $these * @return string[] Loading Loading @@ -231,7 +245,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerNotificationBureauDesDoctoratsProposition($these) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading @@ -250,7 +264,7 @@ class NotifierSoutenanceService extends NotifierService /** @param These $these */ public function triggerNotificationPropositionValidee($these) { $emailsBDD = [$this->fetchEmailBdd($these)]; $emailsBDD = $this->fetchEmailMaisonDuDoctorat($these); $emailsED = $this->fetchEmailEcoleDoctorale($these); $emailsUR = $this->fetchEmailUniteRecherche($these); $emailsActeurs = $this->fetchEmailActeursDirects($these); Loading @@ -276,7 +290,7 @@ class NotifierSoutenanceService extends NotifierService /** @param These $these */ public function triggerNotificationPresoutenance($these) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading Loading @@ -354,7 +368,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerSignatureEngagementImpartialite($these, $proposition, $membre) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading @@ -379,8 +393,9 @@ class NotifierSoutenanceService extends NotifierService public function triggerRefusEngagementImpartialite($these, $proposition, $membre) { $emails = $this->fetchEmailActeursDirects($these); $emails[] = $this->fetchEmailBdd($these); $emailsAD = $this->fetchEmailActeursDirects($these); $emailsBDD = $this->fetchEmailMaisonDuDoctorat($these); $emails = array_merge($emailsAD, $emailsBDD); $emails = array_filter($emails, function ($s) { return $s !== null; Loading Loading @@ -454,7 +469,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerAvisRendus($these) { $email = $this->fetchEmailBdd($these); $email = $this->fetchEmailMaisonDuDoctorat($these); if ($email !== null) { $notif = new Notification(); Loading @@ -476,7 +491,7 @@ class NotifierSoutenanceService extends NotifierService */ public function triggerAvisFavorable($these, $avis, $url = null) { $emailBDD = [$this->fetchEmailBdd($these)]; $emailBDD = $this->fetchEmailMaisonDuDoctorat($these); $emailsDirecteurs = $this->fetchEmailEncadrants($these); $emailsED = $this->fetchEmailEcoleDoctorale($these); $emailsUR = $this->fetchEmailUniteRecherche($these); Loading