Commit c4c266b2 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Création/modification de formation/session : intialisation et prise en...

[FIX] Création/modification de formation/session : intialisation et prise en compte correcte de l'url de recherche d'individu (responsable).
parent 5d13f498
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ infobulle d'explication en cas de contrainte non respectée (ex: nb d'émérites
- [FIX] Proposition de soutenance : bouton 'Valider la proposition de soutenance' visible à tort pour le doctorant.
- [FIX] Saisie du titre d'accès d'une thèse : exclusion des établissements historisés dans la liste déroulante.
- [FIX] Notification d'ouverture des inscriptions à une session de formation : correction pour le cas où la structure valide est de type établissement.
- [FIX] Création/modification de formation/session : intialisation et prise en compte correcte de l'url de recherche d'individu (responsable).

9.1.1
-----
+2 −1
Changes for module/Formation/src/Formation/Controller/SessionController.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ use Doctrine\ORM\PersistentCollection;
use Formation\Service\Notification\FormationNotificationFactoryAwareTrait;
use Formation\Service\Session\Search\SessionSearchServiceAwareTrait;
use Notification\Exception\ExceptionInterface;
use Notification\Exception\RuntimeException;
use Notification\Exception\RuntimeException as NotificationRuntimeException;
use These\Entity\Db\These;
use Fichier\Service\Fichier\FichierStorageServiceAwareTrait;
use Fichier\Service\Storage\Adapter\Exception\StorageAdapterException;
@@ -144,6 +144,7 @@ class SessionController extends AbstractController
        $session = $this->getSessionService()->getRepository()->getRequestedSession($this);

        $form = $this->getSessionForm();
        $form->setUrlResponsable($this->url()->fromRoute('individu/rechercher', [], [], true));
        $form->setAttribute('action', $this->url()->fromRoute('formation/session/modifier', ['session' => $session->getId()], [], true));
        $form->bind($session);

+9 −1
Changes for module/Formation/src/Formation/Form/Formation/FormationForm.php: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@ class FormationForm extends Form {
        //responsable
        $responsable = new SearchAndSelect('responsable', ['label' => "Responsable du module de formation :"]);
        $responsable
            ->setAutocompleteSource($this->urlResponsable)
            ->setSelectionRequired()
            ->setAttributes([
                'id' => 'responsable',
@@ -223,4 +222,13 @@ class FormationForm extends Form {
            'programme'=> [ 'required' => false, ],
        ]));
    }

    public function prepare(): static
    {
        /** @var SearchAndSelect $responsableSearchAndSelect */
        $responsableSearchAndSelect = $this->get('responsable');
        $responsableSearchAndSelect->setAutocompleteSource($this->urlResponsable);

        return parent::prepare();
    }
}
 No newline at end of file
+9 −1
Changes for module/Formation/src/Formation/Form/Session/SessionForm.php: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ class SessionForm extends Form {
        //responsable
        $responsable = new SearchAndSelect('responsable', ['label' => "Responsable de la formation <span class='icon icon-obligatoire' style='color: darkred;font-size: 0.8em;' data-bs-toggle='tooltip' title='Obligatoire'></span> :"]);
        $responsable
            ->setAutocompleteSource($this->urlResponsable)
            ->setSelectionRequired()
            ->setAttributes([
                'id' => 'responsable',
@@ -210,4 +209,13 @@ class SessionForm extends Form {
            'date_publication'=> [ 'required' => false, ],
        ]));
    }

    public function prepare(): static
    {
        /** @var SearchAndSelect $responsableSearchAndSelect */
        $responsableSearchAndSelect = $this->get('responsable');
        $responsableSearchAndSelect->setAutocompleteSource($this->urlResponsable);

        return parent::prepare();
    }
}
 No newline at end of file
+1 −1
Changes for module/Formation/view/formation/session/modifier.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ use Formation\Form\Formation\FormationForm;
<h2> Information sur la formation </h2>

<?php
echo $this->form()->openTag($form);
echo $this->form()->openTag($form->prepare());
?>

<?php echo $this->formControlGroup($form->get('libelle')); ?>