Commit 2f12c358 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Correction filtre étape offre de formation

parent 0ce6f13e
Loading
Loading
Loading
Loading
+13 −1
Changes for module/OffreFormation/src/Controller/OffreFormationController.php: 13 added lines, 1 removed line.
Original line number Diff line number Diff line
<?php

namespace OffreFormation\Controller;

use Application\Service\Traits\AnneeServiceAwareTrait;
@@ -66,6 +67,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
        if (($element = $this->params()->fromPost('element')) && isset($element['id'])) {
            $form->get('element')->setValue($element);
        }

        return [
            'structures'     => $structures,
            'niveaux'        => $niveaux,
@@ -81,6 +83,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    public function exportAction ()
    {
        $this->initFilters();
@@ -172,12 +175,14 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    public function administrationOffreAction ()
    {
        return [];
    }



    public function reconductionAction ()
    {
        $this->initFilterHistorique();
@@ -234,6 +239,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    public function reconductionCentreCoutAction ()
    {
        $this->initFilterHistorique();
@@ -285,6 +291,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    public function reconductionModulateurAction ()
    {
        $this->initFilterHistorique();
@@ -337,6 +344,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    protected function initFilters ()
    {
        $this->initFilterAnnee();
@@ -344,6 +352,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    protected function initFilterAnnee ()
    {
        $this->em()->getFilters()->enable('annee')->init([
@@ -354,6 +363,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    protected function initFilterHistorique ()
    {
        /* Mise en place des filtres */
@@ -368,18 +378,20 @@ class OffreFormationController extends \Application\Controller\AbstractControlle
    }



    protected function disableFilters ($name)
    {
        $this->em()->getFilters()->disable($name);
    }



    protected function getParams ()
    {
        $structure = $this->context()->structureFromQuery() ? : $this->getServiceContext()->getStructure();
        $niveau    = $this->context()->niveauFromQuery();
        $etape     = $this->context()->etapeFromQuery();
        if ($etape) $etape = $this->getServiceEtape()->get($etape); // entité Niveau
        if ($etape) $etape = $this->getServiceEtape()->get($etape->getId()); // entité Niveau
        if ($niveau) $niveau = $this->getServiceNiveauEtape()->get($niveau); // entité Niveau

        return [$structure, $niveau, $etape];