Commit 6eb24238 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajustement divers

parent f0cb1422
Loading
Loading
Loading
Loading
+2 −2
Changes for module/Formation/config/others/formation.config.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -133,10 +133,10 @@ return [
                                ],
                            ],
                            'ajouter' => [
                                'type'  => Literal::class,
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/ajouter',
                                    'route'    => '/ajouter[/:module]',
                                    'defaults' => [
                                        'controller' => FormationController::class,
                                        'action'     => 'ajouter',
+5 −1
Changes for module/Formation/src/Formation/Controller/FormationController.php: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Formation\Controller;
use Application\Controller\AbstractController;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Formation\Entity\Db\Formation;
use Formation\Entity\Db\Module;
use Formation\Form\Formation\FormationFormAwareTrait;
use Formation\Service\Formation\FormationServiceAwareTrait;
use UnicaenApp\Service\EntityManagerAwareTrait;
@@ -57,10 +58,13 @@ class FormationController extends AbstractController

    public function ajouterAction()
    {
        $module = $this->getEntityManager()->getRepository(Module::class)->getRequestedModule($this);
        $formation = new Formation();

        if ($module !== null) $formation->setModule($module);

        $form = $this->getFormationForm();
        $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', [], [], true));
        $form->setAttribute('action', $this->url()->fromRoute('formation/formation/ajouter', ['module' => $module->getId()], [], true));
        $form->bind($formation);

        $request = $this->getRequest();
+1 −1
Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Formation.dcm.xml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
        </id>
        <field name="libelle"             type="string"       length="1024"       column="LIBELLE"          nullable="false"/>
        <field name="description"         type="string"       length="9999"       column="DESCRIPTION"      nullable="true"/>
        <field name="lien"                type="string"       length="1024"       column="LIEN"             nullable="true"/>
        <field name="lien"                type="string"       length="9999"       column="LIEN"             nullable="true"/>

        <one-to-many field="sessions" target-entity="Formation\Entity\Db\Session" mapped-by="formation"/>

+1
Changes for module/Formation/src/Formation/Entity/Db/Mapping/Formation.Entity.Db.Module.dcm.xml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
        </id>
        <field name="libelle"             type="string"       length="1024"       column="LIBELLE"          nullable="false"/>
        <field name="description"         type="string"       length="9999"       column="DESCRIPTION"      nullable="true"/>
        <field name="lien"                type="string"       length="9999"       column="LIEN"             nullable="true"/>

        <one-to-many field="formations" target-entity="Formation\Entity\Db\Formation" mapped-by="module"/>

+20
Changes for module/Formation/src/Formation/Entity/Db/Module.php: 20 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ class Module implements HistoriqueAwareInterface

    /** @var string|null */
    private $description;
    /** @var string|null */
    private $lien;

    /** @var Collection (Formation) */
    private $formations;
@@ -66,6 +68,24 @@ class Module implements HistoriqueAwareInterface
        return $this;
    }

    /**
     * @return string|null
     */
    public function getLien(): ?string
    {
        return $this->lien;
    }

    /**
     * @param string|null $lien
     * @return Module
     */
    public function setLien(?string $lien): Module
    {
        $this->lien = $lien;
        return $this;
    }

    /**
     * @return Collection
     */
Loading