Commit 8d2d2b14 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

...

parent 5e3bdc8d
Loading
Loading
Loading
Loading
+34 −8
Changes for module/Formation/Module.php: 34 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

namespace Formation;

use Formation\Controller\AbstractController;
use Laminas\Loader\StandardAutoloader;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\Mvc\ModuleRouteListener;
use Laminas\Mvc\MvcEvent;
use Laminas\Stdlib\ArrayUtils;
@@ -12,10 +15,20 @@ class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $eventManager        = $e->getApplication()->getEventManager();
        $application = $e->getApplication();
        $eventManager = $application->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        $sharedEvents = $eventManager->getSharedManager();
        $sharedEvents->attach(AbstractActionController::class, 'dispatch', function($e) {
            /** @var $e MvcEvent */
            $controller = $e->getTarget();
            $hostname = $controller->getRequest()->getUri()->getHost();
            if(preg_match('/mes-formations.*/', $hostname)) {
                $controller->layout('layout/layout-formation');
            }
        }, 100);
    }

    public function getConfig()
@@ -31,14 +44,27 @@ class Module
        return ConfigFactory::fromFiles($configFiles);
    }

    public function getAutoloaderConfig()
//    public function getViewHelperConfig() {
//        return [
//            'factories' => [
//                'itemsInNavigation' => function($helpers) {
//                    $navigation = $helpers->get('Application')->getServiceManager()->get('Laminas\Navigation\Formation');
//                    return new ItemsInNavigation($navigation);
//                },
//
//            ]
//        ];
//    }

    public function getAutoloaderConfig(): array
    {
        return array(
            'Laminas\Loader\StandardAutoloader' => array(
                'namespaces' => array(
        return [
            StandardAutoloader::class => [
                'namespaces' => [
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
                ],
            ],
        ];
    }

}
+19 −19
Changes for module/Formation/config/merged/formation-groupe.config.php: 19 added lines, 19 removed lines.
Original line number Diff line number Diff line
@@ -81,25 +81,25 @@ return [
        ],
    ],

//    'navigation'      => [
//        'formation' => [
//            'home' => [
//                'pages' => [
//                    'ressource' => [
//                        'pages' => [
//                            'groupe_' => [
//                                'label'    => 'Thèmes de formation',
//                                'route'    => 'formation-groupe',
//                                'resource' => PrivilegeController::getResourceId(FormationGroupeController::class, 'index') ,
//                                'order'    => 320,
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                        ],
//                    ],
//                ],
//            ],
//        ],
//    ],
    'navigation'      => [
        'formation' => [
            'home' => [
                'pages' => [
                    'gestion-formation' => [
                        'pages' => [
                            'groupe_' => [
                                'label'    => 'Thèmes de formation',
                                'route'    => 'formation-groupe',
                                'resource' => PrivilegeController::getResourceId(FormationGroupeController::class, 'index') ,
                                'order'    => 320,
                                'icon' => 'fas fa-angle-right',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'router' => [
        'routes' => [
+71 −53
Changes for module/Formation/config/merged/formation-instance-inscrit.config.php: 71 added lines, 53 removed lines.
Original line number Diff line number Diff line
@@ -43,10 +43,12 @@ return [
                [
                    'controller' => FormationInstanceInscritController::class,
                    'action' => [
                        'liste-formations-instances',
                        'inscription-formation',
                        'inscription',
                        'desinscription',

                        'formations',
                        'inscriptions',
                    ],
                    'roles' => [
                        'Agent',
@@ -75,71 +77,87 @@ return [
            ],
        ],
    ],
//    'navigation' => [
//        'formation' => [
//            'home' => [
//                'pages' => [
//                    'formations' => [
//                        'order' => 1000,
//                        'label' => 'Formations',
//                        'title' => "Gestion des actions de formations et des inscriptions à celles-ci",
//                        'route' => 'liste-formations-instances',
//                        'resource' => PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'liste-formations-instances'),
//                        'pages' => [
//                            [
//                                'order' => 200,
//                                'label' => 'Plan de formation '. $annee,
//                                'route' => 'plan-formation',
//                                'resource' => PrivilegeController::getResourceId(PlanFormationController::class, 'afficher') ,
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                            [
//                                'order' => 405,
//                                'label' => "S'inscrire à une formation",
//                                'route' => 'inscription-formation',
//                                'resource' => PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'inscription-formation'),
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                            [
//                                'order' => 405,
//                                'label' => 'Mes formations',
//                                'route' => 'liste-formations-instances',
//                                'resource' => PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'liste-formations-instances'),
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                            [
//                                'order' => 410,
//                                'label' => 'Mon projet personnel',
//                                'route' => 'projet-personnel',
//                                'resource' => PrivilegeController::getResourceId(ProjetPersonnelController::class, 'index'),
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                        ],
//                    ],
//                ],
//            ],
//        ],
//    ],
    'navigation' => [
        'formation' => [
            'home' => [
                'pages' => [
                    [
                        'order' => 100,
                        'label' => "Plan de formation",
                        'route' => 'plan-formation',
                        'resource' => PrivilegeController::getResourceId(PlanFormationController::class, 'afficher') ,
                    ],
                    [
                        'order' => 200,
                        'label' => "M'inscrire",
                        'route' => 'inscription-formation',
                        'resource' => PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'inscription-formation'),
                    ],
                    [
                        'order' => 300,
                        'label' => 'Mes formations',
                        'title' => 'Mes formations choucroute',
                        'route' => 'inscriptions',
                        'resources' => [
                            PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'inscriptions'),
                            PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'formations'),
                        ],
                        'dropdown-header' => true,
                        'pages' => [
                            [
                                'order' => 310,
                                'label' => 'Mes inscriptions en cours',
                                'route' => 'inscriptions',
                                'resource' => PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'inscriptions'),
                            ],
                            [
                                'order' => 320,
                                'label' => 'Mes formations réalisées',
                                'route' => 'formations',
                                'resource' => PrivilegeController::getResourceId(FormationInstanceInscritController::class, 'formations'),
                            ],
                        ],
                    ],
                    [
                        'order' => 400,
                        'label' => 'Mon projet personnel',
                        'route' => 'projet-personnel',
                        'resource' => PrivilegeController::getResourceId(ProjetPersonnelController::class, 'index'),
                    ],
                ],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
            'inscription-formation' => [
                'type'  => Literal::class,
            'formations' => [
                'type'  => Segment::class,
                'options' => [
                    'route'    => '/inscription-formation',
                    'route'    => '/mes-formations[/:agent]',
                    'defaults' => [
                        'controller' => FormationInstanceInscritController::class,
                        'action'     => 'inscription-formation',
                        'action'     => 'formations',
                    ],
                ],
            ],
            'inscriptions' => [
                'type'  => Segment::class,
                'options' => [
                    'route'    => '/mes-inscriptions[/:agent]',
                    'defaults' => [
                        'controller' => FormationInstanceInscritController::class,
                        'action'     => 'inscriptions',
                    ],
                ],
            'liste-formations-instances' => [
            ],
            'inscription-formation' => [
                'type'  => Literal::class,
                'options' => [
                    'route'    => '/liste-formations-instances',
                    'route'    => '/inscription-formation',
                    'defaults' => [
                        'controller' => FormationInstanceInscritController::class,
                        'action'     => 'liste-formations-instances',
                        'action'     => 'inscription-formation',
                    ],
                ],
            ],
+19 −19
Changes for module/Formation/config/merged/formation-instance.config.php: 19 added lines, 19 removed lines.
Original line number Diff line number Diff line
@@ -124,25 +124,25 @@ return [
        ],
    ],

//    'navigation'      => [
//        'formation' => [
//            'home' => [
//                'pages' => [
//                    'ressource' => [
//                        'pages' => [
//                            'session_' => [
//                                'label'    => 'Session en cours',
//                                'route'    => 'formation-instance',
//                                'resource' => PrivilegeController::getResourceId(FormationInstanceController::class, 'index') ,
//                                'order'    => 330,
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                        ],
//                    ],
//                ],
//            ],
//        ],
//    ],
    'navigation'      => [
        'formation' => [
            'home' => [
                'pages' => [
                    'gestion-formation' => [
                        'pages' => [
                            'session_' => [
                                'label'    => 'Session en cours',
                                'route'    => 'formation-instance',
                                'resource' => PrivilegeController::getResourceId(FormationInstanceController::class, 'index') ,
                                'order'    => 330,
                                'icon' => 'fas fa-angle-right',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'router' => [
        'routes' => [
+17 −19
Changes for module/Formation/config/merged/formation.config.php: 17 added lines, 19 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Formation\Assertion\FormationInstanceInscritAssertion;
use Formation\Assertion\FormationInstanceInscritAssertionFactory;
use Formation\Controller\FormationController;
use Formation\Controller\FormationControllerFactory;
use Formation\Controller\IndexController;
use Formation\Form\Formation\FormationForm;
use Formation\Form\Formation\FormationFormFactory;
use Formation\Form\Formation\FormationHydrator;
@@ -117,25 +118,22 @@ return [
        ],
    ],

//    'navigation'      => [
//        'formation' => [
//            'home' => [
//                'pages' => [
//                    'ressource' => [
//                        'pages' => [
//                            'formation_' => [
//                                'label'    => 'Actions de formation',
//                                'route'    => 'formation',
//                                'resource' => PrivilegeController::getResourceId(FormationController::class, 'index') ,
//                                'order'    => 310,
//                                'icon' => 'fas fa-angle-right',
//                            ],
//                        ],
//                    ],
//                ],
//            ],
//        ],
//    ],
    'navigation'      => [
        'formation' => [
            'home' => [
                'pages' => [
                    'gestion-formation' => [
                        'order' => 1000,
                        'label' => 'Gestion des formations',
                        'title' => "Gestion des formations",
                        'route' => 'gestion',
                        'resource' => PrivilegeController::getResourceId(IndexController::class, 'index'),
                        'dropdown-header' => true,
                    ],
                ],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
Loading