From 17e29b1c3647f73d41d0f4bd9a1e573db9724be2 Mon Sep 17 00:00:00 2001 From: Alexandre Zvenigorosky Date: Wed, 23 May 2018 14:58:01 +0200 Subject: [PATCH 1/6] Interface d'administration des motifs de non paiement. --- .../config/motif-non-paiement.config.php | 103 ++++++++++++++ .../Controller/MotifNonPaiementController.php | 69 +++++++++ .../MotifNonPaiementSaisieForm.php | 132 ++++++++++++++++++ .../MotifNonPaiementSaisieFormAwareTrait.php | 48 +++++++ .../motif-non-paiement/index.phtml | 66 +++++++++ 5 files changed, 418 insertions(+) create mode 100644 module/Application/config/motif-non-paiement.config.php create mode 100644 module/Application/src/Application/Controller/MotifNonPaiementController.php create mode 100644 module/Application/src/Application/Form/MotifNonPaiement/MotifNonPaiementSaisieForm.php create mode 100644 module/Application/src/Application/Form/MotifNonPaiement/Traits/MotifNonPaiementSaisieFormAwareTrait.php create mode 100644 module/Application/view/application/motif-non-paiement/index.phtml diff --git a/module/Application/config/motif-non-paiement.config.php b/module/Application/config/motif-non-paiement.config.php new file mode 100644 index 000000000..dba2b8efe --- /dev/null +++ b/module/Application/config/motif-non-paiement.config.php @@ -0,0 +1,103 @@ + [ + 'routes' => [ + 'motif-non-paiement' => [ + 'type' => 'Literal', + 'options' => [ + 'route' => '/motif-non-paiement', + 'defaults' => [ + 'controller' => 'Application\Controller\MotifNonPaiement', + 'action' => 'index', + ], + ], + 'may_terminate' => true, + 'child_routes' => [ + 'delete' => [ + 'type' => 'Segment', + 'options' => [ + 'route' => '/delete/:motif-non-paiement', + 'constraints' => [ + 'motif-non-paiement' => '[0-9]*', + ], + 'defaults' => [ + 'action' => 'delete', + ], + ], + ], + 'saisie' => [ + 'type' => 'Segment', + 'options' => [ + 'route' => '/saisie/[:motif-non-paiement]', + 'constraints' => [ + 'motif-non-paiement' => '[0-9]*', + ], + 'defaults' => [ + 'action' => 'saisie', + ], + ], + ], + ], + ], + ], + ], + 'navigation' => [ + 'default' => [ + 'home' => [ + 'pages' => [ + 'administration' => [ + 'pages' => [ + 'motif-non-paiement' => [ + 'label' => 'MotifNonPaiement', + 'icon' => 'fa fa-graduation-cap', + 'route' => 'motif-non-paiement', + 'resource' => PrivilegeController::getResourceId('Application\Controller\MotifNonPaiement', 'index'), + 'order' => 80, + 'border-color' => '#BBCF55', + ], + ], + ], + ], + ], + ], + ], + 'bjyauthorize' => [ + 'guards' => [ + PrivilegeController::class => [ + [ + 'controller' => 'Application\Controller\MotifNonPaiement', + 'action' => ['index'], + 'privileges' => Privileges::MOTIF_NON_PAIEMENT_VISUALISATION, + ], + [ + 'controller' => 'Application\Controller\MotifNonPaiement', + 'action' => ['saisie','delete'], + 'privileges' => Privileges::MOTIF_NON_PAIEMENT_EDITION, + ], + ], + ], + ], + 'controllers' => [ + 'invokables' => [ + 'Application\Controller\MotifNonPaiement' => Controller\MotifNonPaiementController::class, + ], + ], + 'service_manager' => [ + 'invokables' => [ + Service\MotifNonPaiementService::class => Service\MotifNonPaiementService::class, + ], + ], + 'view_helpers' => [ + ], + 'form_elements' => [ + 'invokables' => [ + Form\MotifNonPaiement\Saisie::class => Form\MotifNonPaiement\Saisie::class, + ], + ], +]; diff --git a/module/Application/src/Application/Controller/MotifNonPaiementController.php b/module/Application/src/Application/Controller/MotifNonPaiementController.php new file mode 100644 index 000000000..44a6c11b0 --- /dev/null +++ b/module/Application/src/Application/Controller/MotifNonPaiementController.php @@ -0,0 +1,69 @@ +em()->getFilters()->enable('historique')->init([ + MotifNonPaiement::class, + ]); + + $motifNonPaiements = $this->getServiceMotifNonPaiement()->getList(); + + return compact('motifNonPaiements'); + } + + + + public function saisieAction() + { + /* @var $motifNonPaiement MotifNonPaiement */ + + $motifNonPaiement = $this->getEvent()->getParam('motif-non-paiement'); + + $form = $this->getFormMotifNonPaiementSaisie(); + if (empty($motifNonPaiement)) { + $title = 'Création d\'une nouvelle MotifNonPaiement'; + $motifNonPaiement = $this->getServiceMotifNonPaiement()->newEntity(); + } else { + $title = 'Édition d\'une MotifNonPaiement'; + } + + $form->bindRequestSave($motifNonPaiement, $this->getRequest(), function (MotifNonPaiement $fr) { + try { + $this->getServiceMotifNonPaiement()->save($fr); + $this->flashMessenger()->addSuccessMessage('Enregistrement effectué'); + } catch (\Exception $e) { + $e = DbException::translate($e); + $this->flashMessenger()->addErrorMessage($e->getMessage() . ':' . $fr->getId()); + } + }); + + return compact('form', 'title'); + } + + public function deleteAction() + { + $motifNonPaiement = $this->getEvent()->getParam('motif-non-paiement'); + + try { + $this->getServiceMotifNonPaiement()->delete($motifNonPaiement); + $this->flashMessenger()->addSuccessMessage("MotifNonPaiement supprimée avec succès."); + } catch (\Exception $e) { + $this->flashMessenger()->addErrorMessage(DbException::translate($e)->getMessage()); + } + return new MessengerViewModel(compact('motifNonPaiement')); + } +} diff --git a/module/Application/src/Application/Form/MotifNonPaiement/MotifNonPaiementSaisieForm.php b/module/Application/src/Application/Form/MotifNonPaiement/MotifNonPaiementSaisieForm.php new file mode 100644 index 000000000..cb6ce4848 --- /dev/null +++ b/module/Application/src/Application/Form/MotifNonPaiement/MotifNonPaiementSaisieForm.php @@ -0,0 +1,132 @@ + + */ +class MotifNonPaiementSaisieForm extends AbstractForm +{ + + public function init() + { + $hydrator = new MotifNonPaiementHydrator(); + $this->setHydrator($hydrator); + + $this->setAttribute('action', $this->getCurrentUrl()); + $this->add([ + 'name' => 'code', + 'options' => [ + 'label' => "Code", + ], + 'type' => 'Text', + ]); + $this->add([ + 'name' => 'libelle-court', + 'options' => [ + 'label' => "Libelle Court", + ], + 'type' => 'Text', + ]); + $this->add([ + 'name' => 'libelle-long', + 'options' => [ + 'label' => "Libelle Long", + ], + 'type' => 'Text', + ]); + + $this->add(new Csrf('security')); + $this->add([ + 'name' => 'submit', + 'type' => 'Submit', + 'attributes' => [ + 'value' => "Enregistrer", + 'class' => 'btn btn-primary', + ], + ]); + + return $this; + } + + + + /** + * Should return an array specification compatible with + * {@link Zend\InputFilter\Factory::createInputFilter()}. + * + * @return array + */ + public function getInputFilterSpecification() + { + return [ + 'code' => [ + 'required' => true, + ], + + 'libelle-court' => [ + 'required' => true, + ], + + 'libelle-long' => [ + 'required' => true, + ], + + ]; + } + +} + + + + + +class MotifNonPaiementHydrator implements HydratorInterface +{ + + /** + * Hydrate $object with the provided $data. + * + * @param array $data + * @param \Application\Entity\Db\MotifNonPaiement $object + * + * @return object + */ + public function hydrate(array $data, $object) + { + $object->setCode($data['code']); + $object->setLibelleCourt($data['libelle-court']); + $object->setLibelleLong($data['libelle-long']); + + return $object; + } + + + + /** + * Extract values from an object + * + * @param \Application\Entity\Db\MotifNonPaiement $object + * + * @return array + */ + public function extract($object) + { + $data = [ + 'id' => $object->getId() + , 'code' => $object->getCode() + , 'libelle-court' => $object->getLibelleCourt() + , 'libelle-long' => $object->getLibelleLong() + , + ]; + + return $data; + } +} + \ No newline at end of file diff --git a/module/Application/src/Application/Form/MotifNonPaiement/Traits/MotifNonPaiementSaisieFormAwareTrait.php b/module/Application/src/Application/Form/MotifNonPaiement/Traits/MotifNonPaiementSaisieFormAwareTrait.php new file mode 100644 index 000000000..2450c0990 --- /dev/null +++ b/module/Application/src/Application/Form/MotifNonPaiement/Traits/MotifNonPaiementSaisieFormAwareTrait.php @@ -0,0 +1,48 @@ +formMotifNonPaiementSaisie = $formMotifNonPaiementSaisie; + + return $this; + } + + + + /** + * Retourne un nouveau formulaire ou fieldset systématiquement, sauf si ce dernier a été fourni manuellement. + * + * @return MotifNonPaiementSaisieForm + */ + public function getFormMotifNonPaiementSaisie() + { + if (!empty($this->formMotifNonPaiementSaisie)) { + return $this->formMotifNonPaiementSaisie; + } + + return \Application::$container->get('FormElementManager')->get(MotifNonPaiementSaisieForm::class); + } +} diff --git a/module/Application/view/application/motif-non-paiement/index.phtml b/module/Application/view/application/motif-non-paiement/index.phtml new file mode 100644 index 000000000..3dda0f818 --- /dev/null +++ b/module/Application/view/application/motif-non-paiement/index.phtml @@ -0,0 +1,66 @@ +headTitle()->append("MOTIF_NON_PAIEMENTs"); + +$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_EDITION)); + +?> +

MOTIF_NON_PAIEMENTs

+ + + + + + +Actions' ?> + + + + + + + + + + + + + +
CodeLibelle CourtLibelle Long
getCode() ?>getLibelleCourt() ?>getLibelleLong() ?> + + + + + +
+ + + + Ajouter une MOTIF_NON_PAIEMENT + + + -- GitLab From a78036a1b3919f51d5cb42fef63f0c995973593e Mon Sep 17 00:00:00 2001 From: Alexandre Zvenigorosky Date: Wed, 23 May 2018 15:27:59 +0200 Subject: [PATCH 2/6] Interface d'administration des motifs de non paiement. --- .../view/application/motif-non-paiement/saisie.phtml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 module/Application/view/application/motif-non-paiement/saisie.phtml diff --git a/module/Application/view/application/motif-non-paiement/saisie.phtml b/module/Application/view/application/motif-non-paiement/saisie.phtml new file mode 100644 index 000000000..41a85d055 --- /dev/null +++ b/module/Application/view/application/motif-non-paiement/saisie.phtml @@ -0,0 +1,8 @@ +messenger()->addCurrentMessagesFromFlashMessenger(); +echo $this->form($form); -- GitLab From cf7226000e2cd4084c3e218d21f5b58e8d707317 Mon Sep 17 00:00:00 2001 From: Alexandre Zvenigorosky Date: Wed, 23 May 2018 15:34:42 +0200 Subject: [PATCH 3/6] Interface d'administration des motifs de non paiement. --- .../Application/view/application/motif-non-paiement/index.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/Application/view/application/motif-non-paiement/index.phtml b/module/Application/view/application/motif-non-paiement/index.phtml index 3dda0f818..4a4177fad 100644 --- a/module/Application/view/application/motif-non-paiement/index.phtml +++ b/module/Application/view/application/motif-non-paiement/index.phtml @@ -6,7 +6,7 @@ use Application\Provider\Privilege\Privileges; -$this->headTitle()->append("MOTIF_NON_PAIEMENTs"); +$this->headTitle()->append("Motifs de non paiement"); $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_EDITION)); -- GitLab From 6fb55069afc6cf9b4d1a721192d98bed0c96a51d Mon Sep 17 00:00:00 2001 From: Alexandre Zvenigorosky Date: Wed, 23 May 2018 15:46:34 +0200 Subject: [PATCH 4/6] Interface d'administration des motifs de non paiement. --- code/template/GenerateRubrique/config_php | 103 ++++++++++++++++++++++ code/template/GenerateRubrique/idx1 | 17 ++++ code/template/GenerateRubrique/idx20 | 5 ++ code/template/GenerateRubrique/idx3 | 38 ++++++++ 4 files changed, 163 insertions(+) create mode 100644 code/template/GenerateRubrique/config_php create mode 100644 code/template/GenerateRubrique/idx1 create mode 100644 code/template/GenerateRubrique/idx20 create mode 100644 code/template/GenerateRubrique/idx3 diff --git a/code/template/GenerateRubrique/config_php b/code/template/GenerateRubrique/config_php new file mode 100644 index 000000000..47cd7c84a --- /dev/null +++ b/code/template/GenerateRubrique/config_php @@ -0,0 +1,103 @@ + [ + 'routes' => [ + 'nomtiret' => [ + 'type' => 'Literal', + 'options' => [ + 'route' => '/nomtiret', + 'defaults' => [ + 'controller' => 'Application\Controller\nommaj', + 'action' => 'index', + ], + ], + 'may_terminate' => true, + 'child_routes' => [ + 'delete' => [ + 'type' => 'Segment', + 'options' => [ + 'route' => '/delete/:nomtiret', + 'constraints' => [ + 'nomtiret' => '[0-9]*', + ], + 'defaults' => [ + 'action' => 'delete', + ], + ], + ], + 'saisie' => [ + 'type' => 'Segment', + 'options' => [ + 'route' => '/saisie/[:nomtiret]', + 'constraints' => [ + 'nomtiret' => '[0-9]*', + ], + 'defaults' => [ + 'action' => 'saisie', + ], + ], + ], + ], + ], + ], + ], + 'navigation' => [ + 'default' => [ + 'home' => [ + 'pages' => [ + 'administration' => [ + 'pages' => [ + 'nomtiret' => [ + 'label' => 'nomphrase', + 'icon' => 'fa fa-graduation-cap', + 'route' => 'nomtiret', + 'resource' => PrivilegeController::getResourceId('Application\Controller\nommaj', 'index'), + 'order' => 80, + 'border-color' => '#BBCF55', + ], + ], + ], + ], + ], + ], + ], + 'bjyauthorize' => [ + 'guards' => [ + PrivilegeController::class => [ + [ + 'controller' => 'Application\Controller\nommaj', + 'action' => ['index'], + 'privileges' => Privileges::droitvisualisation, + ], + [ + 'controller' => 'Application\Controller\nommaj', + 'action' => ['saisie','delete'], + 'privileges' => Privileges::droitedition, + ], + ], + ], + ], + 'controllers' => [ + 'invokables' => [ + 'Application\Controller\nommaj' => Controller\nommajController::class, + ], + ], + 'service_manager' => [ + 'invokables' => [ + Service\nommajService::class => Service\nommajService::class, + ], + ], + 'view_helpers' => [ + ], + 'form_elements' => [ + 'invokables' => [ + Form\nommaj\Saisie::class => Form\nommaj\Saisie::class, + ], + ], +]; diff --git a/code/template/GenerateRubrique/idx1 b/code/template/GenerateRubrique/idx1 new file mode 100644 index 000000000..aa04fdc1a --- /dev/null +++ b/code/template/GenerateRubrique/idx1 @@ -0,0 +1,17 @@ +headTitle()->append("nomphrases"); + +$canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::droitedition)); + +?> +

nomsouss

+ + + diff --git a/code/template/GenerateRubrique/idx20 b/code/template/GenerateRubrique/idx20 new file mode 100644 index 000000000..f436f2d9e --- /dev/null +++ b/code/template/GenerateRubrique/idx20 @@ -0,0 +1,5 @@ +Actions' ?> + + + + diff --git a/code/template/GenerateRubrique/idx3 b/code/template/GenerateRubrique/idx3 new file mode 100644 index 000000000..03107a477 --- /dev/null +++ b/code/template/GenerateRubrique/idx3 @@ -0,0 +1,38 @@ + + + + + + +
+ + + + + +
+ + + + Ajouter une nomsous + + + -- GitLab From f486df5955bd4527a791e6db59208f88567cbe06 Mon Sep 17 00:00:00 2001 From: Alexandre Zvenigorosky Date: Wed, 23 May 2018 15:47:20 +0200 Subject: [PATCH 5/6] Interface d'administration des motifs de non paiement. --- code/template/GenerateRubrique/champInput | 7 ++ code/template/GenerateRubrique/champListe | 14 ++++ code/template/GenerateRubrique/controller_php | 69 +++++++++++++++++++ .../GenerateRubrique/saisieFormAwareTrait_php | 48 +++++++++++++ code/template/GenerateRubrique/saisie_phtml | 8 +++ .../GenerateRubrique/serviceTrait_php | 46 +++++++++++++ code/template/GenerateRubrique/service_php | 38 ++++++++++ 7 files changed, 230 insertions(+) create mode 100644 code/template/GenerateRubrique/champInput create mode 100644 code/template/GenerateRubrique/champListe create mode 100644 code/template/GenerateRubrique/controller_php create mode 100644 code/template/GenerateRubrique/saisieFormAwareTrait_php create mode 100644 code/template/GenerateRubrique/saisie_phtml create mode 100644 code/template/GenerateRubrique/serviceTrait_php create mode 100644 code/template/GenerateRubrique/service_php diff --git a/code/template/GenerateRubrique/champInput b/code/template/GenerateRubrique/champInput new file mode 100644 index 000000000..9c1cc705d --- /dev/null +++ b/code/template/GenerateRubrique/champInput @@ -0,0 +1,7 @@ +$this->add([ + 'name' => 'champtiret', + 'options' => [ + 'label' => "champphrase", + ], + 'type' => 'Text', + ]); diff --git a/code/template/GenerateRubrique/champListe b/code/template/GenerateRubrique/champListe new file mode 100644 index 000000000..37e3d23bc --- /dev/null +++ b/code/template/GenerateRubrique/champListe @@ -0,0 +1,14 @@ +$this->add([ + 'name' => 'champtiret', + 'options' => [ + 'label' => 'champphrase', + ], + 'attributes' => [ + 'class' => 'selectpicker', + 'data-live-search' => 'true', + ], + 'type' => 'Select', + ]); + $this->get('champtiret') + ->setEmptyOption("(Aucun)") + ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServicechampmaj()->getList())); diff --git a/code/template/GenerateRubrique/controller_php b/code/template/GenerateRubrique/controller_php new file mode 100644 index 000000000..0d8f8ec95 --- /dev/null +++ b/code/template/GenerateRubrique/controller_php @@ -0,0 +1,69 @@ +em()->getFilters()->enable('historique')->init([ + nommaj::class, + ]); + + $nomms = $this->getServicenommaj()->getList(); + + return compact('nomms'); + } + + + + public function saisieAction() + { + /* @var $nomm nommaj */ + + $nomm = $this->getEvent()->getParam('nomtiret'); + + $form = $this->getFormnommajSaisie(); + if (empty($nomm)) { + $title = 'Création d\'une nouvelle nommaj'; + $nomm = $this->getServicenommaj()->newEntity(); + } else { + $title = 'Édition d\'une nommaj'; + } + + $form->bindRequestSave($nomm, $this->getRequest(), function (nommaj $fr) { + try { + $this->getServicenommaj()->save($fr); + $this->flashMessenger()->addSuccessMessage('Enregistrement effectué'); + } catch (\Exception $e) { + $e = DbException::translate($e); + $this->flashMessenger()->addErrorMessage($e->getMessage() . ':' . $fr->getId()); + } + }); + + return compact('form', 'title'); + } + + public function deleteAction() + { + $nomm = $this->getEvent()->getParam('nomtiret'); + + try { + $this->getServicenommaj()->delete($nomm); + $this->flashMessenger()->addSuccessMessage("nommaj supprimée avec succès."); + } catch (\Exception $e) { + $this->flashMessenger()->addErrorMessage(DbException::translate($e)->getMessage()); + } + return new MessengerViewModel(compact('nomm')); + } +} diff --git a/code/template/GenerateRubrique/saisieFormAwareTrait_php b/code/template/GenerateRubrique/saisieFormAwareTrait_php new file mode 100644 index 000000000..c8ada69ba --- /dev/null +++ b/code/template/GenerateRubrique/saisieFormAwareTrait_php @@ -0,0 +1,48 @@ +formnommajSaisie = $formnommajSaisie; + + return $this; + } + + + + /** + * Retourne un nouveau formulaire ou fieldset systématiquement, sauf si ce dernier a été fourni manuellement. + * + * @return nommajSaisieForm + */ + public function getFormnommajSaisie() + { + if (!empty($this->formnommajSaisie)) { + return $this->formnommajSaisie; + } + + return \Application::$container->get('FormElementManager')->get(nommajSaisieForm::class); + } +} diff --git a/code/template/GenerateRubrique/saisie_phtml b/code/template/GenerateRubrique/saisie_phtml new file mode 100644 index 000000000..3f25fc91b --- /dev/null +++ b/code/template/GenerateRubrique/saisie_phtml @@ -0,0 +1,8 @@ +messenger()->addCurrentMessagesFromFlashMessenger(); +echo $this->form($form); diff --git a/code/template/GenerateRubrique/serviceTrait_php b/code/template/GenerateRubrique/serviceTrait_php new file mode 100644 index 000000000..1c4de1dfd --- /dev/null +++ b/code/template/GenerateRubrique/serviceTrait_php @@ -0,0 +1,46 @@ +servicenommaj = $servicenommaj; + + return $this; + } + + + + /** + * @return nommajService + */ + public function getServicenommaj() + { + if (empty($this->servicenommaj)) { + $this->servicenommaj = \Application::$container->get(nommajService::class); + } + + return $this->servicenommaj; + } +} diff --git a/code/template/GenerateRubrique/service_php b/code/template/GenerateRubrique/service_php new file mode 100644 index 000000000..ed37814c3 --- /dev/null +++ b/code/template/GenerateRubrique/service_php @@ -0,0 +1,38 @@ +initQuery(); + return parent::getList($qb, $alias); + } +} -- GitLab From 420199a9144f199b94850cc1c7f9d794bb23f9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= Date: Wed, 10 Jul 2019 15:59:28 +0200 Subject: [PATCH 6/6] Correction de l'IHM de gestion des motifs de non paiements --- .../config/motif-non-paiement.config.php | 32 +++---- .../Controller/MotifNonPaiementController.php | 19 ++-- .../motif-non-paiement/index.phtml | 87 ++++++++++--------- .../{saisie.phtml => saisir.phtml} | 0 4 files changed, 71 insertions(+), 67 deletions(-) rename module/Application/view/application/motif-non-paiement/{saisie.phtml => saisir.phtml} (100%) diff --git a/module/Application/config/motif-non-paiement.config.php b/module/Application/config/motif-non-paiement.config.php index dba2b8efe..395b8370f 100644 --- a/module/Application/config/motif-non-paiement.config.php +++ b/module/Application/config/motif-non-paiement.config.php @@ -13,33 +13,33 @@ return [ 'options' => [ 'route' => '/motif-non-paiement', 'defaults' => [ - 'controller' => 'Application\Controller\MotifNonPaiement', - 'action' => 'index', + 'controller' => 'Application\Controller\MotifNonPaiement', + 'action' => 'index', ], ], 'may_terminate' => true, 'child_routes' => [ - 'delete' => [ + 'supprimer' => [ 'type' => 'Segment', 'options' => [ - 'route' => '/delete/:motif-non-paiement', + 'route' => '/supprimer/:motifNonPaiement', 'constraints' => [ - 'motif-non-paiement' => '[0-9]*', + 'motifNonPaiement' => '[0-9]*', ], 'defaults' => [ - 'action' => 'delete', + 'action' => 'supprimer', ], ], ], - 'saisie' => [ + 'saisir' => [ 'type' => 'Segment', 'options' => [ - 'route' => '/saisie/[:motif-non-paiement]', + 'route' => '/saisir/[:motifNonPaiement]', 'constraints' => [ - 'motif-non-paiement' => '[0-9]*', + 'motifNonPaiement' => '[0-9]*', ], 'defaults' => [ - 'action' => 'saisie', + 'action' => 'saisir', ], ], ], @@ -47,14 +47,14 @@ return [ ], ], ], - 'navigation' => [ + 'navigation' => [ 'default' => [ 'home' => [ 'pages' => [ 'administration' => [ 'pages' => [ 'motif-non-paiement' => [ - 'label' => 'MotifNonPaiement', + 'label' => 'Motifs de non paiement', 'icon' => 'fa fa-graduation-cap', 'route' => 'motif-non-paiement', 'resource' => PrivilegeController::getResourceId('Application\Controller\MotifNonPaiement', 'index'), @@ -66,7 +66,7 @@ return [ ], ], ], - ], + ], 'bjyauthorize' => [ 'guards' => [ PrivilegeController::class => [ @@ -77,7 +77,7 @@ return [ ], [ 'controller' => 'Application\Controller\MotifNonPaiement', - 'action' => ['saisie','delete'], + 'action' => ['saisir', 'supprimer'], 'privileges' => Privileges::MOTIF_NON_PAIEMENT_EDITION, ], ], @@ -90,14 +90,14 @@ return [ ], 'service_manager' => [ 'invokables' => [ - Service\MotifNonPaiementService::class => Service\MotifNonPaiementService::class, + Service\MotifNonPaiementService::class => Service\MotifNonPaiementService::class, ], ], 'view_helpers' => [ ], 'form_elements' => [ 'invokables' => [ - Form\MotifNonPaiement\Saisie::class => Form\MotifNonPaiement\Saisie::class, + Form\MotifNonPaiement\Saisie::class => Form\MotifNonPaiement\Saisie::class, ], ], ]; diff --git a/module/Application/src/Application/Controller/MotifNonPaiementController.php b/module/Application/src/Application/Controller/MotifNonPaiementController.php index 44a6c11b0..9f1482317 100644 --- a/module/Application/src/Application/Controller/MotifNonPaiementController.php +++ b/module/Application/src/Application/Controller/MotifNonPaiementController.php @@ -14,6 +14,7 @@ class MotifNonPaiementController extends AbstractController use MotifNonPaiementSaisieFormAwareTrait; + public function indexAction() { $this->em()->getFilters()->enable('historique')->init([ @@ -27,18 +28,17 @@ class MotifNonPaiementController extends AbstractController - public function saisieAction() + public function saisirAction() { /* @var $motifNonPaiement MotifNonPaiement */ - - $motifNonPaiement = $this->getEvent()->getParam('motif-non-paiement'); + $motifNonPaiement = $this->getEvent()->getParam('motifNonPaiement'); $form = $this->getFormMotifNonPaiementSaisie(); if (empty($motifNonPaiement)) { - $title = 'Création d\'une nouvelle MotifNonPaiement'; + $title = 'Création d\'un nouveau motif de non paiement'; $motifNonPaiement = $this->getServiceMotifNonPaiement()->newEntity(); } else { - $title = 'Édition d\'une MotifNonPaiement'; + $title = 'Édition d\'un motif de non paiement'; } $form->bindRequestSave($motifNonPaiement, $this->getRequest(), function (MotifNonPaiement $fr) { @@ -54,16 +54,19 @@ class MotifNonPaiementController extends AbstractController return compact('form', 'title'); } - public function deleteAction() + + + public function supprimerAction() { - $motifNonPaiement = $this->getEvent()->getParam('motif-non-paiement'); + $motifNonPaiement = $this->getEvent()->getParam('motifNonPaiement'); try { $this->getServiceMotifNonPaiement()->delete($motifNonPaiement); - $this->flashMessenger()->addSuccessMessage("MotifNonPaiement supprimée avec succès."); + $this->flashMessenger()->addSuccessMessage("Motif de non paiement supprimée avec succès."); } catch (\Exception $e) { $this->flashMessenger()->addErrorMessage(DbException::translate($e)->getMessage()); } + return new MessengerViewModel(compact('motifNonPaiement')); } } diff --git a/module/Application/view/application/motif-non-paiement/index.phtml b/module/Application/view/application/motif-non-paiement/index.phtml index 4a4177fad..b11ebf432 100644 --- a/module/Application/view/application/motif-non-paiement/index.phtml +++ b/module/Application/view/application/motif-non-paiement/index.phtml @@ -1,60 +1,61 @@ headTitle()->append("Motifs de non paiement"); +$title = "Motifs de non paiement"; + +$this->headTitle()->append($title); $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::MOTIF_NON_PAIEMENT_EDITION)); ?> -

MOTIF_NON_PAIEMENTs

+

- - - - - -Actions' ?> - - - - - - - - - - - - - -
CodeLibelle CourtLibelle Long
getCode() ?>getLibelleCourt() ?>getLibelleLong() ?> - - - - - -
- + + + + + + Actions' ?> + + + + + + + + + + + + + +
CodeLibelle CourtLibelle Long
getCode() ?>getLibelleCourt() ?>getLibelleLong() ?> + + + + + +
+ + href="url('motif-non-paiement/saisir') ?>"> - Ajouter une MOTIF_NON_PAIEMENT + Ajouter un motif de non paiement