Loading module/Application/config/administration.config.php +13 −1 Changes for module/Application/config/administration.config.php: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -19,6 +19,17 @@ return [ ], 'may_terminate' => true, ], 'administration-type' => [ 'type' => 'Literal', 'options' => [ 'route' => '/administration-type', 'defaults' => [ 'controller' => 'Application\Controller\Administration', 'action' => 'administration-types', ], ], 'may_terminate' => true, ], ], ], Loading @@ -43,7 +54,7 @@ return [ PrivilegeController::class => [ [ 'controller' => 'Application\Controller\Administration', 'action' => ['index'], 'action' => ['index', 'administration-types'], 'privileges' => [ Privileges::IMPORT_ECARTS, Privileges::IMPORT_MAJ, Loading @@ -59,6 +70,7 @@ return [ Privileges::PARAMETRES_GENERAL_VISUALISATION, Privileges::REFERENTIEL_ADMIN_VISUALISATION, Privileges::TYPE_INTERVENTION_VISUALISATION, Privileges::TYPE_RESSOURCE_VISUALISATION, Privileges::PIECE_JUSTIFICATIVE_GESTION_VISUALISATION, Privileges::PLAFONDS_GESTION_VISUALISATION, Privileges::CENTRES_COUTS_ADMINISTRATION_VISUALISATION, Loading module/Application/config/type-intervention.config.php +10 Changes for module/Application/config/type-intervention.config.php: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -133,6 +133,14 @@ return [ 'home' => [ 'pages' => [ 'administration' => [ 'pages' => [ 'gestion-types' => [ 'label' => 'Gestion des types (ressources, etc...)', 'icon' => 'glyphicon glyphicon - list-alt', 'route' => 'administration-type', 'resource' => PrivilegeController::getResourceId('Application\Controller\Administration', 'administration-types'), 'order' => 0, 'border - color' => '#111', 'pages' => [ 'type-intervention' => [ 'label' => 'Types d\'interventions', Loading @@ -148,6 +156,8 @@ return [ ], ], ], ], ], 'bjyauthorize' => [ 'resource_providers' => [ 'BjyAuthorize\Provider\Resource\Config' => [ Loading module/Application/config/type-ressource.config.php +14 −10 Changes for module/Application/config/type-ressource.config.php: 14 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -54,6 +54,15 @@ return [ 'home' => [ 'pages' => [ 'administration' => [ 'pages' => [ 'gestion-types' => [ 'label' => 'Gestion des types (ressources, etc...)', 'icon' => 'glyphicon glyphicon - list-alt', 'route' => 'administration-type', 'resource' => PrivilegeController::getResourceId('Application\Controller\Administration', 'administration-types'), 'order' => 0, 'border - color' => '#111', 'pages' => [ 'type-ressource' => [ 'label' => 'Types de ressources', Loading @@ -63,6 +72,9 @@ return [ 'order' => 60, 'border-color' => '#71DFD7', ], ], ], ], ], ], Loading Loading @@ -100,17 +112,9 @@ return [ 'Application\Controller\TypeRessource' => Controller\TypeRessourceController::class, ], ], /*'form_elements' => [ 'form_elements' => [ 'invokables' => [ Form\TypeIntervention\TypeInterventionSaisieForm::class => Form\TypeIntervention\TypeInterventionSaisieForm::class, Form\TypeIntervention\TypeInterventionStructureSaisieForm::class => Form\TypeIntervention\TypeInterventionStructureSaisieForm::class, Form\TypeIntervention\TypeInterventionStatutSaisieForm::class => Form\TypeIntervention\TypeInterventionStatutSaisieForm::class, Form\TypeIntervention\TypeInterventionStatutDeleteForm::class => Form\TypeIntervention\TypeInterventionStatutDeleteForm::class, Form\TypeRessource\TypeRessourceSaisieForm::class => Form\TypeRessource\TypeRessourceSaisieForm::class, ], ],*/ /*'view_helpers' => [ 'invokables' => [ 'typeInterventionAdmin' => View\Helper\TypeInterventionAdminViewHelper::class, ], ],*/ ]; module/Application/src/Application/Controller/AdministrationController.php +6 Changes for module/Application/src/Application/Controller/AdministrationController.php: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,4 +17,10 @@ class AdministrationController extends AbstractController return []; } public function administrationTypesAction() { return []; } } No newline at end of file module/Application/src/Application/Controller/TypeRessourceController.php +20 −8 Changes for module/Application/src/Application/Controller/TypeRessourceController.php: 20 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ namespace Application\Controller; use Application\Entity\Db\TypeRessource; use Application\Form\TypeRessource\Traits\TypeRessourceSaisieFormAwareTrait; use Application\Service\Traits\TypeRessourceServiceAwareTrait; use UnicaenApp\View\Model\MessengerViewModel; class TypeRessourceController extends AbstractController { Loading @@ -14,23 +15,27 @@ class TypeRessourceController extends AbstractController public function indexAction() { $title = 'Gestion des types de ressources'; $this->em()->getFilters()->enable('historique')->init([ TypeRessource::class, ]); $listTypesRessources = $this->getServiceTypeRessource()->getList(); return compact('listTypesRessources'); return compact('listTypesRessources', 'title'); } public function saisieAction() { $typ = $this->getEvent()->getParam('typeIntervention'); $form = $this->getFormTypeRessourceSaisie(); $title = 'Édition d\'un type de ressource'; $typeRessource = $this->getEvent()->getParam('typeRessource'); $form = $this->getFormTypeRessourceSaisie(); if (empty($typeRessource)) { $title = 'Création d\'un nouveau type de ressource'; $typeRessource = $this->getServiceTypeRessource()->newEntity(); } else { $title = 'Édition d\'un type de ressource'; } $form->bindRequestSave($typeRessource, $this->getRequest(), function (TypeRessource $type) { try { Loading @@ -43,13 +48,20 @@ class TypeRessourceController extends AbstractController return compact('form', 'title'); return compact(); } public function deleteAction() { return compact(); $typeRessource = $this->getEvent()->getParam('typeRessource'); try { $this->getServiceTypeRessource()->delete($typeRessource); $this->flashMessenger()->addSuccessMessage("Type de ressource supprimé avec succès."); } catch (\Exception $e) { $this->flashMessenger()->addErrorMessage($this->translate($e)); } return new MessengerViewModel(compact('typeRessource')); } } Loading
module/Application/config/administration.config.php +13 −1 Changes for module/Application/config/administration.config.php: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -19,6 +19,17 @@ return [ ], 'may_terminate' => true, ], 'administration-type' => [ 'type' => 'Literal', 'options' => [ 'route' => '/administration-type', 'defaults' => [ 'controller' => 'Application\Controller\Administration', 'action' => 'administration-types', ], ], 'may_terminate' => true, ], ], ], Loading @@ -43,7 +54,7 @@ return [ PrivilegeController::class => [ [ 'controller' => 'Application\Controller\Administration', 'action' => ['index'], 'action' => ['index', 'administration-types'], 'privileges' => [ Privileges::IMPORT_ECARTS, Privileges::IMPORT_MAJ, Loading @@ -59,6 +70,7 @@ return [ Privileges::PARAMETRES_GENERAL_VISUALISATION, Privileges::REFERENTIEL_ADMIN_VISUALISATION, Privileges::TYPE_INTERVENTION_VISUALISATION, Privileges::TYPE_RESSOURCE_VISUALISATION, Privileges::PIECE_JUSTIFICATIVE_GESTION_VISUALISATION, Privileges::PLAFONDS_GESTION_VISUALISATION, Privileges::CENTRES_COUTS_ADMINISTRATION_VISUALISATION, Loading
module/Application/config/type-intervention.config.php +10 Changes for module/Application/config/type-intervention.config.php: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -133,6 +133,14 @@ return [ 'home' => [ 'pages' => [ 'administration' => [ 'pages' => [ 'gestion-types' => [ 'label' => 'Gestion des types (ressources, etc...)', 'icon' => 'glyphicon glyphicon - list-alt', 'route' => 'administration-type', 'resource' => PrivilegeController::getResourceId('Application\Controller\Administration', 'administration-types'), 'order' => 0, 'border - color' => '#111', 'pages' => [ 'type-intervention' => [ 'label' => 'Types d\'interventions', Loading @@ -148,6 +156,8 @@ return [ ], ], ], ], ], 'bjyauthorize' => [ 'resource_providers' => [ 'BjyAuthorize\Provider\Resource\Config' => [ Loading
module/Application/config/type-ressource.config.php +14 −10 Changes for module/Application/config/type-ressource.config.php: 14 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -54,6 +54,15 @@ return [ 'home' => [ 'pages' => [ 'administration' => [ 'pages' => [ 'gestion-types' => [ 'label' => 'Gestion des types (ressources, etc...)', 'icon' => 'glyphicon glyphicon - list-alt', 'route' => 'administration-type', 'resource' => PrivilegeController::getResourceId('Application\Controller\Administration', 'administration-types'), 'order' => 0, 'border - color' => '#111', 'pages' => [ 'type-ressource' => [ 'label' => 'Types de ressources', Loading @@ -63,6 +72,9 @@ return [ 'order' => 60, 'border-color' => '#71DFD7', ], ], ], ], ], ], Loading Loading @@ -100,17 +112,9 @@ return [ 'Application\Controller\TypeRessource' => Controller\TypeRessourceController::class, ], ], /*'form_elements' => [ 'form_elements' => [ 'invokables' => [ Form\TypeIntervention\TypeInterventionSaisieForm::class => Form\TypeIntervention\TypeInterventionSaisieForm::class, Form\TypeIntervention\TypeInterventionStructureSaisieForm::class => Form\TypeIntervention\TypeInterventionStructureSaisieForm::class, Form\TypeIntervention\TypeInterventionStatutSaisieForm::class => Form\TypeIntervention\TypeInterventionStatutSaisieForm::class, Form\TypeIntervention\TypeInterventionStatutDeleteForm::class => Form\TypeIntervention\TypeInterventionStatutDeleteForm::class, Form\TypeRessource\TypeRessourceSaisieForm::class => Form\TypeRessource\TypeRessourceSaisieForm::class, ], ],*/ /*'view_helpers' => [ 'invokables' => [ 'typeInterventionAdmin' => View\Helper\TypeInterventionAdminViewHelper::class, ], ],*/ ];
module/Application/src/Application/Controller/AdministrationController.php +6 Changes for module/Application/src/Application/Controller/AdministrationController.php: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,4 +17,10 @@ class AdministrationController extends AbstractController return []; } public function administrationTypesAction() { return []; } } No newline at end of file
module/Application/src/Application/Controller/TypeRessourceController.php +20 −8 Changes for module/Application/src/Application/Controller/TypeRessourceController.php: 20 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ namespace Application\Controller; use Application\Entity\Db\TypeRessource; use Application\Form\TypeRessource\Traits\TypeRessourceSaisieFormAwareTrait; use Application\Service\Traits\TypeRessourceServiceAwareTrait; use UnicaenApp\View\Model\MessengerViewModel; class TypeRessourceController extends AbstractController { Loading @@ -14,23 +15,27 @@ class TypeRessourceController extends AbstractController public function indexAction() { $title = 'Gestion des types de ressources'; $this->em()->getFilters()->enable('historique')->init([ TypeRessource::class, ]); $listTypesRessources = $this->getServiceTypeRessource()->getList(); return compact('listTypesRessources'); return compact('listTypesRessources', 'title'); } public function saisieAction() { $typ = $this->getEvent()->getParam('typeIntervention'); $form = $this->getFormTypeRessourceSaisie(); $title = 'Édition d\'un type de ressource'; $typeRessource = $this->getEvent()->getParam('typeRessource'); $form = $this->getFormTypeRessourceSaisie(); if (empty($typeRessource)) { $title = 'Création d\'un nouveau type de ressource'; $typeRessource = $this->getServiceTypeRessource()->newEntity(); } else { $title = 'Édition d\'un type de ressource'; } $form->bindRequestSave($typeRessource, $this->getRequest(), function (TypeRessource $type) { try { Loading @@ -43,13 +48,20 @@ class TypeRessourceController extends AbstractController return compact('form', 'title'); return compact(); } public function deleteAction() { return compact(); $typeRessource = $this->getEvent()->getParam('typeRessource'); try { $this->getServiceTypeRessource()->delete($typeRessource); $this->flashMessenger()->addSuccessMessage("Type de ressource supprimé avec succès."); } catch (\Exception $e) { $this->flashMessenger()->addErrorMessage($this->translate($e)); } return new MessengerViewModel(compact('typeRessource')); } }