Commit f697248b authored by Thomas Hamel's avatar Thomas Hamel
Browse files

ajout de la possibilité de dupliquer une séance, fix undefined variable...

ajout de la possibilité de dupliquer une séance, fix undefined variable justificatfOui, justificatifNon
parent 7c009c9d
Loading
Loading
Loading
Loading
+2 −2
Changes for module/ComiteSuiviIndividuel/view/comite-suivi-individuel/default/confirmation.phtml: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    <tr><td style="width: 50%;">
<form method="post" action="<?php echo $action; ?>">
    <input type="hidden" name="reponse" value="oui">
    <?php if ($justificationOui === true) : ?>
    <?php if (isset($justificationOui) && $justificationOui === true) : ?>
        <label for="justification-oui"> Justification </label>
        <textarea id="justification-oui" name="justification-oui" style="width: 95%;" placeholder="Merci de justifier"></textarea><br/>
    <?php endif; ?>
@@ -28,7 +28,7 @@
        </td><td style="width: 50%;">
<form method="post" action="<?php echo $action; ?>">
    <input type="hidden" name="reponse" value="non">
    <?php if ($justificationNon === true) : ?>
    <?php if (isset($justificationNon) && $justificationNon === true) : ?>
        <label for="justification-non"> Justification </label>
        <textarea id="justification-non" name="justification-non"  style="width: 95%;" placeholder="Merci de justifier"></textarea><br/>
    <?php endif; ?>
+12 −0
Changes for module/Formation/config/others/seance.config.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ return [
                    'controller' => SeanceController::class,
                    'action' => [
                        'modifier',
                        'dupliquer'
                    ],
                    'privileges' => [
                        SeancePrivileges::SEANCE_MODIFIER,
@@ -135,6 +136,17 @@ return [
                                    ],
                                ],
                            ],
                            'dupliquer' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route'    => '/dupliquer/:seance',
                                    'defaults' => [
                                        'controller' => SeanceController::class,
                                        'action'     => 'dupliquer',
                                    ],
                                ],
                            ],
                            'historiser' => [
                                'type'  => Segment::class,
                                'may_terminate' => true,
+26 −0
Changes for module/Formation/src/Formation/Controller/SeanceController.php: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -95,6 +95,32 @@ class SeanceController extends AbstractController
        return $vm;
    }

    public function dupliquerAction() : ViewModel
    {
        $seance = clone $this->getSeanceService()->getRepository()->getRequestedSeance($this);
        $seance->setDebut($seance->getDebut()->setDate(0,0,0  ));

        $form = $this->getSeanceForm();
        $form->setAttribute('action', $this->url()->fromRoute('formation/seance/dupliquer', ['seance' => $seance->getId()], [], true));
        $form->bind($seance);

        $request = $this->getRequest();
        if ($request->isPost()) {
            $data = $request->getPost();
            $form->setData($data);
            if ($form->isValid()) {
                $this->getSeanceService()->create($seance);
            }
        }

        $vm = new ViewModel([
            'title' => "Ajout d'une séance pour la seance de formation",
            'form' => $form,
        ]);
        $vm->setTemplate('formation/default/default-form');
        return $vm;
    }

    public function historiserAction() : Response
    {
        $seance = $this->getSeanceService()->getRepository()->getRequestedSeance($this);
+2 −2
Changes for module/Formation/view/formation/default/confirmation.phtml: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    <tr><td style="width: 50%;">
<form method="post" action="<?php echo $action; ?>">
    <input type="hidden" name="reponse" value="oui">
    <?php if ($justificationOui === true) : ?>
    <?php if (isset($justificationOui) && $justificationOui === true) : ?>
        <label for="justification-oui"> Justification </label>
        <textarea id="justification-oui" name="justification-oui" style="width: 95%;" placeholder="Merci de justifier"></textarea><br/>
    <?php endif; ?>
@@ -28,7 +28,7 @@
        </td><td style="width: 50%;">
<form method="post" action="<?php echo $action; ?>">
    <input type="hidden" name="reponse" value="non">
    <?php if ($justificationNon === true) : ?>
    <?php if (isset($justificationNon) && $justificationNon === true) : ?>
        <label for="justification-non"> Justification </label>
        <textarea id="justification-non" name="justification-non"  style="width: 95%;" placeholder="Merci de justifier"></textarea><br/>
    <?php endif; ?>
+7 −0
Changes for module/Formation/view/formation/session/afficher.phtml: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -360,6 +360,13 @@ echo $this->messenger()->addMessagesFromFlashMessengerWithNoNamespace();
                    >
                        <span class="icon icon-modifier"></span>
                    </a>
                    <?php /** @see \Formation\Controller\SeanceController::dupliquerAction() */ ?>
                    <a href="<?php echo $this->url('formation/seance/dupliquer', ['seance' => $seance->getId()], [], true); ?>"
                       class="ajax-modal" data-event="modification"
                       title="Duplication de la séance" data-bs-toggle="tooltip" data-bs-html="true"
                    >
                        <span class="icon icon-refresh"></span>
                    </a>
                <?php endif; ?>
                <?php if ($canEmargementSeance) : ?>
                    <?php /** @see \Formation\Controller\SeanceController::genererEmargementAction() */ ?>
Loading