Commit ce901995 authored by Florian Joriot's avatar Florian Joriot
Browse files

Correction reload page apres eidtion employeur

Mise en place suppression employeur
parent 17c8eb3d
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Application\Entity\Db\Employeur;
use Application\Form\Employeur\Traits\EmployeurSaisieFormAwareTrait;
use Application\Service\Traits\EmployeurServiceAwareTrait;
use Laminas\View\Model\JsonModel;
use UnicaenApp\View\Model\MessengerViewModel;

/**
 * Description of EmployeurController
@@ -28,6 +29,8 @@ class EmployeurController extends AbstractController
        return compact('employeurs');
    }



    public function saisieAction()
    {
        $employeur = $this->getEvent()->getParam('employeur');
@@ -57,12 +60,18 @@ class EmployeurController extends AbstractController
        return compact('form', 'title');
    }



    public function supprimerAction()
    {
        return true;
        $employeur = $this->getEvent()->getParam('employeur');
        $this->getServiceEmployeur()->delete($employeur, true);

        return new MessengerViewModel();
    }



    public function rechercheAction()
    {

@@ -78,6 +87,7 @@ class EmployeurController extends AbstractController
    }



    public function rechercheJsonAction()
    {
        $critere = $this->params()->fromPost('critere');
+2 −2
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ $canEdit = true;

<?php if ($canEdit): ?>
    <tr class="champ-triable">
        <a class="btn btn-primary ajax-modal " data-event="employeur-edition"
        <a class="btn btn-primary ajax-modal " data-event="employeur-saisie"
           href="<?= $this->url('employeur/saisie'); ?>"><i
                    class="fas fa-plus"></i>
            Ajout d'un employeur</a>
@@ -60,7 +60,7 @@ $canEdit = true;

<script type="text/javascript">
    $(function () {
        $("body").on("employeur-edition", function (event, data) {
        $("body").on("employeur-saisie", function (event, data) {
            window.location.reload();
        });
    });