Commit 87586422 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge remote-tracking branch 'origin/b24'

parents 97d062c5 b275b98d
Loading
Loading
Loading
Loading
Loading
+34
Changes for module/Administration/src/Migration/V24ServiceHorsEtablissement.php: 34 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Administration\Migration;

use Unicaen\BddAdmin\Migration\MigrationAction;

class V24ServiceHorsEtablissement extends MigrationAction
{

    public function description(): string
    {
        return "Suppression des etape_id de la table service pour les services hors établissement...";
    }



    public function utile(): bool
    {
        return true;
    }



    public function before()
    {
        $bdd = $this->getBdd();

        $this->logMsg('Suppression des etape_id de la table service pour les services hors établissement...');
        $this->manager()->sauvegarderTable('SERVICE', 'SAVE_SERVICE');
        $bdd->exec('UPDATE service SET etape_id = NULL WHERE element_pedagogique_id IS null AND etape_id IS NOT null ');

    }

}
 No newline at end of file
+4
Changes for module/Enseignement/src/Controller/EnseignementController.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -218,6 +218,9 @@ class EnseignementController extends AbstractController
                    $this->getProcessusPlafond()->beginTransaction();
                    try {
                        $this->em()->getConnection()->setAutoCommit(true);
                        //Uniquement pour le service fait dans l'établissement

                        if ($form->get('service')->get('interne-externe')->getValue() != 'service-externe') {
                            //Récupération de l'id de l'étape qui a été selectionné pour la recherche de la formation
                            $etapeId = $form->get('service')
                                            ->get('element-pedagogique')
@@ -226,6 +229,7 @@ class EnseignementController extends AbstractController

                            $etape   = $etapeId ? $this->getServiceEtape()->get($etapeId) : null;
                            $service = $service->setEtape($etape);
                        }

                        $service = $this->getServiceService()->save($service);
                        $this->em()->getConnection()->setAutoCommit(false);