Commit b369ba1d authored by Thomas Hamel's avatar Thomas Hamel
Browse files

[FIX] Module Formation : Possibilité de valider plusieurs fois la même...

[FIX] Module Formation : Possibilité de valider plusieurs fois la même formation externe, ce qui faisait planter ultérieurement la page
parent f37908dd
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Formation/view/formation/index/index-gestion.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ $this->headTitle('Tableau de bord des formations de '. $doctorant);
        <div role="tabpanel" class="tab-pane" id="formation-externe">
            <h2> Formations suivies à l'extérieur </h2>
            <?php
                $returnUrl = $this->url('formation/index-gestion', ['these' => $these->getId()]);
                $returnUrl = $this->url('formation/index-gestion', ['these' => $these->getId()], ['fragment' => 'formation-externe'], true);
                echo $this->partial('formation/index/partial/formations-externes-tab', [
                    'doctorant' => $doctorant,
                    'formationsExternes' => $formationsExternes,
+16 −1
Changes for module/Formation/view/formation/index/partial/formations-externes-tab.phtml: 16 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ $these = (!empty($theses))?current($theses):null;
                                <a      <?php /** @see FormationExterneController::validerFormationExterneAction()  */ ?>
                                    href="<?php echo $this->url('formation/formation/valider-formation-externe', ['formationExterne' => $formationExterne->getId()], ['query' => ['redirect' => $returnUrl]], true); ?>"
                                    style="width:80%;"
                                    class="validation-formation-externe"
                                    title="Valider cette formation externe ? <br><br> Cette validation fera remonter cette formation dans le rapport d'activité"
                                    data-bs-toggle="tooltip" data-bs-html="true">
                                    <span class="fas fa-thumbs-up text-success"></span>
@@ -169,6 +170,7 @@ $these = (!empty($theses))?current($theses):null;
                                <a      <?php /** @see FormationExterneController::refuserFormationExterneAction()  */ ?>
                                    href="<?php echo $this->url('formation/formation/refuser-formation-externe', ['formationExterne' => $formationExterne->getId()], ['query' => ['redirect' => $returnUrl]], true); ?>"
                                    style="width:80%;"
                                    class="validation-formation-externe"
                                    title="Refuser cette formation externe"
                                    data-bs-toggle="tooltip" data-bs-html="true">
                                    <span class="fas fa-thumbs-down text-danger"></span>
@@ -177,7 +179,8 @@ $these = (!empty($theses))?current($theses):null;
                                <?php /** @see FormationExterneController::revoquerFormationExterneAction() */ ?>
                                <a href="<?php echo $this->url('formation/formation/revoquer-formation-externe', ['formationExterne' => $formationExterne->getId()], ['query' => ['redirect' => $returnUrl]], true); ?>"
                                   title="Révoquer la validation de cette formation externe <br>(Une confirmation avant la révocation vous sera demandée)"
                                   data-bs-toggle="tooltip" data-bs-html="true"
                                   class="validation-formation-externe"
                                   data-bs-toggle="tooltip" data-bs-html="true" data-toggle="confirmationx"
                                >
                                    <span class="icon icon-unchecked text-danger"></span>
                                </a>
@@ -227,4 +230,16 @@ $these = (!empty($theses))?current($theses):null;
        toggleAnnee();
        $("select#annee").on("change", toggleAnnee).selectpicker();
    });

    document.addEventListener('click', function(event) {
        const clickedLink = event.target.closest('a.validation-formation-externe');

        if (clickedLink) {
            document.querySelectorAll('a.validation-formation-externe').forEach(function(link) {
                link.style.pointerEvents = 'none';
                link.style.opacity = '0.6';
                link.style.cursor = 'default';
            });
        }
    });
</script>
 No newline at end of file