Commit 8cbf2d5f authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Notifications de demande d''engagement d'impartialité et d'avis de...

[FIX] Notifications de demande d''engagement d'impartialité et d'avis de soutenance : utilisation en priorité du mail de l'acteur.
parent 4f3ba972
Loading
Loading
Loading
Loading
+4 −0
Changes for CHANGELOG.md: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
Journal des modifications
=========================

8.6.1
-----
- [FIX] Notifications de demande d'engagement d'impartialité et d'avis de soutenance : utilisation en priorité du mail de l'acteur.

8.6.0
-----
- Possibilité de déclarer un individu apatride (i.e. sans nationalité) ; réorganisation du formulaire.
+2 −2
Changes for module/Soutenance/src/Soutenance/Entity/Membre.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -262,9 +262,9 @@ class Membre implements HistoriqueAwareInterface {
    }

    /**
     * @return Acteur
     * @return Acteur|null
     */
    public function getActeur()
    public function getActeur(): ?Acteur
    {
        return $this->acteur;
    }
+2 −2
Changes for module/Soutenance/src/Soutenance/Service/Notification/SoutenanceNotificationFactory.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ class SoutenanceNotificationFactory extends NotificationFactory
        $vars['Url'] = $url;

        $rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::DEMANDE_ENGAGEMENT_IMPARTIALITE, $vars);
        $mail = $membre->getEmail();
        $mail = $membre->getActeur()?->getEmail(true);
        if ($mail === null) {
            throw new RuntimeException("Aucun mail trouvé pour le rapporteur");
        }
@@ -451,7 +451,7 @@ class SoutenanceNotificationFactory extends NotificationFactory

    public function createNotificationDemandeAvisSoutenance(These $these, Membre $rapporteur): Notification
    {
        $email = $rapporteur->getEmail();
        $email = $rapporteur->getActeur()?->getEmail(true);
        if ($email === null) {
            throw new RuntimeException("Aucune adresse mail trouvée pour la notification [" . MailTemplates::DEMANDE_PRERAPPORT . "] la thèse {$these->getId()}");
        }
+2 −1
Changes for module/Soutenance/view/soutenance/presoutenance/partial/avis-soutenance.phtml: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ $tousLesAvis = count($rapporteurs) === count($avis) ;

                <?php
                $acteur = $rapporteur->getActeur();
                $emailActeur = $acteur?->getEmail(true);
                $avi = ($acteur !== null && isset($avis[$acteur->getIndividu()->getId()]))?$avis[$acteur->getIndividu()->getId()]:null;

                ?>
@@ -121,7 +122,7 @@ $tousLesAvis = count($rapporteurs) === count($avis) ;
                            <?php if ($canNotifierAvisSoutenance && isset($engagements[$rapporteur->getIndividu()->getId()]) && !isset($avis[$acteur->getIndividu()->getId()])) : ?>
                                <a  <?php /** @see \Soutenance\Controller\PresoutenanceController::notifierDemandeAvisSoutenanceAction() */ ?>
                                    href="<?php echo $this->url('soutenance/presoutenance/notifier-demande-avis-soutenance', ['these' => $these->getId(), 'membre' => $rapporteur->getId()], [], true); ?>">
                                    <span class="icon icon-notify"      title="Notifier le rapporteur '<?php echo $rapporteur->getEmail(); ?>'"></span>
                                    <span class="icon icon-notify"      title="Notifier ce rapporteur (<?php echo $emailActeur ?>)"></span>
                                </a>
                            <?php else: ?>
                                <span class="icon icon-notify" title="Notifier le rapporteur" style="color:lightgray;" ></span>
+6 −4
Changes for module/Soutenance/view/soutenance/presoutenance/partial/engagement-impartialite.phtml: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ $canRevoquerEngagementImpartialite = $this->isAllowed($these, EngagementImpartia

                <?php
                $acteur = $rapporteur->getActeur();
                $emailActeur = $acteur?->getEmail(true);
                $engagement = ($acteur) ? ($engagements[$rapporteur->getIndividu()->getId()])??null : null;
                ?>

@@ -74,7 +75,7 @@ $canRevoquerEngagementImpartialite = $this->isAllowed($these, EngagementImpartia
                    <!-- Signature ------------------------------------------------------------------------------------>
                    <td>
                        <?php if ($acteur !== null) : ?>
                            <?php if ($acteur->getMembre()->getEmail() !== null) : ?>
                            <?php if ($emailActeur !== null) : ?>
                                <?php if ($engagement !== null): ?>
                                    <?php
                                    echo $engagement->getHistoCreation()->format(Constants::DATETIME_FORMAT);
@@ -87,7 +88,8 @@ $canRevoquerEngagementImpartialite = $this->isAllowed($these, EngagementImpartia
                            <?php else : ?>
                                <span class="text-danger">
                                <span class="fas fa-exclamation-triangle"></span>
                                <i> Aucun email de trouvé</i>
                                <i> Aucun email trouvé</i>
                                <i> Aucun email trouvé</i>
                                <span class="fas fa-exclamation-triangle"></span>
                            </span>
                            <?php endif; ?>
@@ -102,7 +104,7 @@ $canRevoquerEngagementImpartialite = $this->isAllowed($these, EngagementImpartia

                    <!-- Actions -------------------------------------------------------------------------------------->
                    <td>
                        <?php if ($acteur !== null and $acteur->getMembre()->getEmail() !== null) : ?>
                        <?php if ($acteur !== null and $emailActeur !== null) : ?>

                            <?php if ($canNotifierEngagementImpartialite) : ?>
                                <?php if ($engagement) : ?>
@@ -113,7 +115,7 @@ $canRevoquerEngagementImpartialite = $this->isAllowed($these, EngagementImpartia
                                        <?php /** @see \Soutenance\Controller\EngagementImpartialiteController::notifierEngagementImpartialiteAction() */ ?>
                                            href="<?php echo $this->url('soutenance/engagement-impartialite/notifier', ['these' => $these->getId(), 'proposition' => $proposition->getId(), 'membre' => $rapporteur->getId()], [], true); ?>">
                                        <span class="icon icon-notify"
                                              title="Notifier le rapporteur '<?php echo $acteur->getMembre()->getEmail(); ?>'"></span>
                                              title="Notifier ce rapporteur (<?php echo $emailActeur; ?>)"></span>
                                    </a>
                                <?php endif; ?>
                            <?php endif; ?>
Loading