Commit 28a1559e authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Mise en place du routing vers mes-formations

parent bdc50104
Loading
Loading
Loading
Loading
+1
Changes for documentation/release/3.1.4.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@

* Retrait de mention UniCaen dans la fiche de poste pour des termes plus généraux


**Modifications de la base de donnée**

```sql
+3 −1
Changes for module/Carriere/src/Carriere/Service/Correspondance/CorrespondanceService.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ class CorrespondanceService {
     * @param bool $avecAgent
     * @return Correspondance[]
     */
    public function getCorrespondances(string $champ = 'categorie', string $ordre = 'ASC', bool $avecAgent=true) {
    public function getCorrespondances(string $champ = 'categorie', string $ordre = 'ASC', bool $avecAgent=true) : array
    {
        $qb = $this->createQueryBuilder()
            ->orderBy('correspondance.' . $champ, $ordre)
        ;
@@ -46,6 +47,7 @@ class CorrespondanceService {
                ->addSelect('agent')->join('agentGrade.agent','agent')
                ->andWhere('agent.deleted_on IS NULL')
                ->andWhere('agentGrade.deleted_on IS NULL')

            ;
        }

+58
Changes for module/Formation/config/module.config.php: 58 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ namespace Formation;

use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Formation\Controller\FormationController;
use Formation\Controller\IndexController;
use Formation\Controller\IndexControllerFactory;
use Formation\Event\Convocation\ConvocationEvent;
use Formation\Event\Convocation\ConvocationEventFactory;
use Formation\Event\DemandeRetour\DemandeRetourEvent;
@@ -21,12 +24,36 @@ use Formation\Service\Notification\NotificationService;
use Formation\Service\Notification\NotificationServiceFactory;
use Formation\Service\Url\UrlService;
use Formation\Service\Url\UrlServiceFactory;
use Laminas\Console\Console;
use Laminas\Router\Http\Literal;
use UnicaenPrivilege\Guard\PrivilegeController;


switch(getenv('APPLICATION_ENV')) {
    case 'development':
        $hostname = 'mes-formations.n302z-dsi008.png.unicaen.fr:8443';
        break;
    case 'test':
        $hostname = 'mes-formations-pp.unicaen.fr';
        break;
    case 'production':
    default:
        $hostname = 'mes-formations.unicaen.fr';
        break;
}


return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => IndexController::class,
                    'action' => [
                        'index',
                    ],
                    'roles' => [],
                ],
            ],
        ],
    ],
@@ -55,6 +82,36 @@ return [
    ],


    'router' => [
        'routes' => [
            'mes-formations' => [
                'type' => 'Hostname',
                'options' => [
                    'route' => ':hostname',
                    'constraints' => [
                        'hostname' => 'mes-formations(-pp)?(.n302z-dsi008)?.unicaen.fr',
                    ],
                    'defaults' => [
                        'hostname' => !Console::isConsole() ? $hostname : '',
                    ],
                ],
                'may_terminate' => true,
                'child_routes' => [
                    'home' => [
                        'type'  => Literal::class,
                        'options' => [
                            'route'    => '/',
                            'defaults' => [
                                'controller' => IndexController::class,
                                'action'     => 'index',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'navigation'      => [
        'default' => [
            'home' => [
@@ -91,6 +148,7 @@ return [
    ],
    'controllers'     => [
        'factories' => [
            IndexController::class => IndexControllerFactory::class,
        ]
    ],
    'form_elements' => [
+14
Changes for module/Formation/src/Formation/Controller/IndexController.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Formation\Controller;

use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;

class IndexController extends AbstractActionController {

    public function indexAction() : ViewModel
    {
        return new ViewModel([]);
    }
}
 No newline at end of file
+14
Changes for module/Formation/src/Formation/Controller/IndexControllerFactory.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Formation\Controller;

use Psr\Container\ContainerInterface;

class IndexControllerFactory {

    public function __invoke(ContainerInterface $container) : IndexController
    {
        $controller = new IndexController();
        return $controller;
    }
}
 No newline at end of file
Loading