Commit 2b285c2e authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Finalisation gestion des types de ressources + regroupement menu admin

parent 754e45cc
Loading
Loading
Loading
Loading
+13 −1
Changes for module/Application/config/administration.config.php: 13 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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,
            ],
        ],
    ],

@@ -43,7 +54,7 @@ return [
            PrivilegeController::class => [
                [
                    'controller' => 'Application\Controller\Administration',
                    'action'     => ['index'],
                    'action'     => ['index', 'administration-types'],
                    'privileges' => [
                        Privileges::IMPORT_ECARTS,
                        Privileges::IMPORT_MAJ,
@@ -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,
+10
Changes for module/Application/config/type-intervention.config.php: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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',
@@ -148,6 +156,8 @@ return [
                    ],
                ],
            ],
        ],
    ],
    'bjyauthorize'    => [
        'resource_providers' => [
            'BjyAuthorize\Provider\Resource\Config' => [
+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
@@ -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',
@@ -63,6 +72,9 @@ return [
                                        'order'        => 60,
                                        'border-color' => '#71DFD7',
                                    ],

                                ],
                            ],
                        ],
                    ],
                ],
@@ -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,
    ],
    ],*/
];
+6
Changes for module/Application/src/Application/Controller/AdministrationController.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,4 +17,10 @@ class AdministrationController extends AbstractController
        return [];
    }

    public function administrationTypesAction()
    {
        return [];
    }


}
 No newline at end of file
+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
@@ -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
{
@@ -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 {
@@ -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