diff --git a/module/Application/config/domaine-fonctionnel.config.php b/module/Application/config/domaine-fonctionnel.config.php index a4461367ce55a3d58969afb351b0df222fe1883f..23e18544d296a1954c668291a31a5c6c6b3a2739 100644 --- a/module/Application/config/domaine-fonctionnel.config.php +++ b/module/Application/config/domaine-fonctionnel.config.php @@ -13,18 +13,18 @@ return [ 'options' => [ 'route' => '/domaine-fonctionnel', 'defaults' => [ - 'controller' => 'Application\Controller\DomaineFonctionnel', - 'action' => 'index', + 'controller' => 'Application\Controller\DomaineFonctionnel', + 'action' => 'index', ], ], 'may_terminate' => true, 'child_routes' => [ - 'delete' => [ + 'delete' => [ 'type' => 'Segment', 'options' => [ - 'route' => '/delete/:domaine-fonctionnel', + 'route' => '/delete/:domaineFonctionnel', 'constraints' => [ - 'domaine-fonctionnel' => '[0-9]*', + 'domaineFonctionnel' => '[0-9]*', ], 'defaults' => [ 'action' => 'delete', @@ -34,9 +34,9 @@ return [ 'saisie' => [ 'type' => 'Segment', 'options' => [ - 'route' => '/saisie/[:domaine-fonctionnel]', + 'route' => '/saisie/[:domaineFonctionnel]', 'constraints' => [ - 'domaine-fonctionnel' => '[0-9]*', + 'domaineFonctionnel' => '[0-9]*', ], 'defaults' => [ 'action' => 'saisie', @@ -47,7 +47,7 @@ return [ ], ], ], - 'navigation' => [ + 'navigation' => [ 'default' => [ 'home' => [ 'pages' => [ @@ -66,7 +66,7 @@ return [ ], ], ], - ], + ], 'bjyauthorize' => [ 'guards' => [ PrivilegeController::class => [ @@ -77,7 +77,7 @@ return [ ], [ 'controller' => 'Application\Controller\DomaineFonctionnel', - 'action' => ['saisie','delete'], + 'action' => ['saisie', 'delete'], 'privileges' => Privileges::DOMAINES_FONCTIONNELS_ADMINISTRATION_EDITION, ], ], @@ -90,14 +90,14 @@ return [ ], 'service_manager' => [ 'invokables' => [ - Service\DomaineFonctionnelService::class => Service\DomaineFonctionnelService::class, + Service\DomaineFonctionnelService::class => Service\DomaineFonctionnelService::class, ], ], 'view_helpers' => [ ], 'form_elements' => [ 'invokables' => [ - Form\DomaineFonctionnel\DomaineFonctionnelSaisieForm::class => Form\DomaineFonctionnel\DomaineFonctionnelSaisieForm::class, + Form\DomaineFonctionnel\DomaineFonctionnelSaisieForm::class => Form\DomaineFonctionnel\DomaineFonctionnelSaisieForm::class, ], ], ]; diff --git a/module/Application/src/Application/Controller/DomaineFonctionnelController.php b/module/Application/src/Application/Controller/DomaineFonctionnelController.php index 9691f5b063dfe793b4921dc24bcd9b7c25ce7e9c..dfcf8612d440ff964b87a3a970caa7c0e0b9f586 100644 --- a/module/Application/src/Application/Controller/DomaineFonctionnelController.php +++ b/module/Application/src/Application/Controller/DomaineFonctionnelController.php @@ -14,6 +14,8 @@ class DomaineFonctionnelController extends AbstractController use DomaineFonctionnelSaisieFormAwareTrait; use SourceServiceAwareTrait; + + public function indexAction() { $this->em()->getFilters()->enable('historique')->init([ @@ -31,14 +33,13 @@ class DomaineFonctionnelController extends AbstractController { /* @var $domaineFonctionnel DomaineFonctionnel */ - $domaineFonctionnel = $this->getEvent()->getParam('domaine-fonctionnel'); + $domaineFonctionnel = $this->getEvent()->getParam('domaineFonctionnel'); $form = $this->getFormDomaineFonctionnelSaisie(); if (empty($domaineFonctionnel)) { - $title = 'Création d\'un nouveau domaine fonctionnel'; + $title = 'Création d\'un nouveau domaine fonctionnel'; $domaineFonctionnel = $this->getServiceDomaineFonctionnel()->newEntity() - ->setSource($this->getServiceSource()->getOse()); - + ->setSource($this->getServiceSource()->getOse()); } else { $title = 'Édition d\'un domaine fonctionnel'; } @@ -56,9 +57,11 @@ class DomaineFonctionnelController extends AbstractController return compact('form', 'title'); } + + public function deleteAction() { - $domaineFonctionnel = $this->getEvent()->getParam('domaine-fonctionnel'); + $domaineFonctionnel = $this->getEvent()->getParam('domaineFonctionnel'); try { $this->getServiceDomaineFonctionnel()->delete($domaineFonctionnel); @@ -66,6 +69,7 @@ class DomaineFonctionnelController extends AbstractController } catch (\Exception $e) { $this->flashMessenger()->addErrorMessage(DbException::translate($e)->getMessage()); } + return new MessengerViewModel(compact('domaineFonctionnel')); } } diff --git a/module/Application/view/application/domaine-fonctionnel/index.phtml b/module/Application/view/application/domaine-fonctionnel/index.phtml index ac612381b3608cf1448acaf611dca75ceb447f09..8cc0810803da991803d518b83f1475d32298fc79 100644 --- a/module/Application/view/application/domaine-fonctionnel/index.phtml +++ b/module/Application/view/application/domaine-fonctionnel/index.phtml @@ -29,11 +29,11 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::DOMAINES_FONCT <?php if (($canEdit) && ($fr->getSource() == 'OSE')) { ?> <td style="text-align:center;width:1px;white-space: nowrap"> <a class="ajax-modal" data-event="domaine-fonctionnel-saisie" - href="<?= $this->url('domaine-fonctionnel/saisie', ['domaine-fonctionnel' => $fr->getId()]) ?>" + href="<?= $this->url('domaine-fonctionnel/saisie', ['domaineFonctionnel' => $fr->getId()]) ?>" title="Modifier la DomaineFonctionnel"> <span class="glyphicon glyphicon-edit"></span></a> <a class="pop-ajax" - href="<?= $this->url('domaine-fonctionnel/delete', ['domaine-fonctionnel' => $fr->getId()]) ?>" + href="<?= $this->url('domaine-fonctionnel/delete', ['domaineFonctionnel' => $fr->getId()]) ?>" title="Supprimer la DomaineFonctionnel" data-content="<p class='lead text-danger'><strong>Attention!</strong> Confirmez-vous cette suppression ?</p>" data-confirm="true"