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

Ajout de la discipline pour la saisie d'ODF complémentaire

parent 3d7c07a5
Loading
Loading
Loading
Loading
+30 −2
Changes for module/Application/src/Application/Form/OffreFormation/ElementPedagogiqueSaisie.php: 30 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Application\Form\OffreFormation;
use Application\Filter\FloatFromString;
use Application\Filter\StringFromFloat;
use Application\Form\AbstractForm;
use Application\Service\Traits\DisciplineServiceAwareTrait;
use Application\Service\Traits\EtapeServiceAwareTrait;
use Application\Service\Traits\LocalContextServiceAwareTrait;
use Application\Service\Traits\PeriodeServiceAwareTrait;
@@ -22,6 +23,7 @@ class ElementPedagogiqueSaisie extends AbstractForm
    use EtapeServiceAwareTrait;
    use PeriodeServiceAwareTrait;
    use StructureServiceAwareTrait;
    use DisciplineServiceAwareTrait;



@@ -48,7 +50,7 @@ class ElementPedagogiqueSaisie extends AbstractForm
            ],
            'attributes' => [
                'class'            => 'selectpicker',
                'data-live-search' => 'true'
                'data-live-search' => 'true',
            ],
            'type'       => 'Select',
        ]);
@@ -61,6 +63,18 @@ class ElementPedagogiqueSaisie extends AbstractForm
            'type'    => 'Text',
        ]);

        $this->add([
            'name'       => 'discipline',
            'options'    => [
                'label' => 'Discipline',
            ],
            'attributes' => [
                'class'            => 'selectpicker',
                'data-live-search' => 'true',
            ],
            'type'       => 'Select',
        ]);

        $this->add([
            'name'    => 'libelle',
            'options' => [
@@ -140,7 +154,7 @@ class ElementPedagogiqueSaisie extends AbstractForm
            ],
            'attributes' => [
                'class'            => 'selectpicker',
                'data-live-search' => 'true'
                'data-live-search' => 'true',
            ],
            'type'       => 'Select',
        ]);
@@ -168,6 +182,14 @@ class ElementPedagogiqueSaisie extends AbstractForm
            $this->get('etape')->setValue($etape->getId());
        }

        $this->get('discipline')->setValueOptions(
            \UnicaenApp\Util::collectionAsOptions(
                $this->getServiceDiscipline()->getList(
                    $this->getServiceDiscipline()->finderByHistorique()
                )
            )
        );

        // peuplement liste des périodes
        $this->get('periode')
            ->setEmptyOption("")
@@ -217,6 +239,9 @@ class ElementPedagogiqueSaisie extends AbstractForm
            'code'       => [
                'required' => true,
            ],
            'discipline' => [
                'required' => true,
            ],
            'libelle'    => [
                'required' => true,
            ],
@@ -247,6 +272,7 @@ class ElementPedagogiqueSaisieHydrator implements HydratorInterface
    use EtapeServiceAwareTrait;
    use PeriodeServiceAwareTrait;
    use StructureServiceAwareTrait;
    use DisciplineServiceAwareTrait;



@@ -261,6 +287,7 @@ class ElementPedagogiqueSaisieHydrator implements HydratorInterface
    public function hydrate(array $data, $object)
    {
        $object->setCode($data['code']);
        $object->setDiscipline($this->getServiceDiscipline()->get($data['discipline']));
        $object->setSourceCode($data['code']);
        $object->setLibelle($data['libelle']);
        $object->setEtape($this->getServiceEtape()->get($data['etape']));
@@ -291,6 +318,7 @@ class ElementPedagogiqueSaisieHydrator implements HydratorInterface
        $data = [
            'etape'      => ($e = $object->getEtape()) ? $e->getId() : null,
            'code'       => $object->getCode(),
            'discipline' => $object->getDiscipline() ? $object->getDiscipline()->getId() : null,
            'libelle'    => $object->getLibelle(),
            'id'         => $object->getId(),
            'periode'    => ($p = $object->getPeriode()) ? $p->getId() : null,
+5
Changes for module/Application/view/application/offre-formation/element-pedagogique/saisir.phtml: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -34,6 +34,11 @@ if ($errors) {
        echo $this->formControlGroup($form->get('code'));
        ?>
    </div>
    <div class="col-sm-8">
        <?php
        echo $this->formControlGroup($form->get('discipline'));
        ?>
    </div>
</div>
<div class="row">
    <div class="col-sm-12">