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

Factorisation de la partie Affichage des *Element

parent 070ea176
Loading
Loading
Loading
Loading
+0 −12
Changes for module/Application/config/merged/application.config.php: 0 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ return [
                    'action' => [
                        'afficher',
                        'afficher-groupe',
                        'afficher-application-element',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_AFFICHER,
@@ -222,17 +221,6 @@ return [
                            ],
                        ],
                    ],
                    'afficher-application-element' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/afficher-application-element/:application-element',
                            'defaults' => [
                                'controller' => ApplicationController::class,
                                'action'     => 'afficher-application-element',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'ajouter-application-element' => [
                        'type'  => Segment::class,
                        'options' => [
+0 −12
Changes for module/Application/config/merged/competence.config.php: 0 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ return [
                        'afficher',
                        'afficher-competence-type',
                        'afficher-competence-theme',
                        'afficher-competence-element',
                    ],
                    'privileges' => [
                        CompetencePrivileges::COMPETENCE_AFFICHER,
@@ -235,17 +234,6 @@ return [
                        ],
                        'may_terminate' => true,
                    ],
                    'afficher-competence-element' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/afficher-competence-element/:competence-element',
                            'defaults' => [
                                'controller' => CompetenceController::class,
                                'action'     => 'afficher-competence-element',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'ajouter-competence-element' => [
                        'type'  => Segment::class,
                        'options' => [
+77 −0
Changes for module/Application/config/merged/element.config.php: 77 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Application;

use Application\Controller\ElementController;
use Application\Controller\ElementControllerFactory;
use Application\Provider\Privilege\ApplicationPrivileges;
use Application\Provider\Privilege\CompetencePrivileges;
use Formation\Provider\Privilege\FormationPrivileges;
use UnicaenPrivilege\Guard\PrivilegeController;
use Zend\Router\Http\Literal;
use Zend\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => ElementController::class,
                    'action' => [
                        'afficher',
                    ],
                    'privileges' => [
                        ApplicationPrivileges::APPLICATION_AFFICHER,
                        CompetencePrivileges::COMPETENCE_AFFICHER,
                        FormationPrivileges::FORMATION_AFFICHER,
                    ],
                ],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
            'element' => [
                'type'  => Literal::class,
                'options' => [
                    'route'    => '/element',
                    'defaults' => [
                        'controller' => ElementController::class,
                    ],
                ],
                'may_terminate' => false,
                'child_routes' => [
                    'afficher' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/afficher/:type/:id',
                            'defaults' => [
                                'controller' => ElementController::class,
                                'action'     => 'afficher',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [],
    ],
    'controllers'     => [
        'factories' => [
            ElementController::class => ElementControllerFactory::class,
        ],
    ],
    'form_elements' => [
        'factories' => [
        ],
    ],
    'hydrators' => [
        'factories' => [],
    ]

];
 No newline at end of file
+0 −2
Changes for module/Application/src/Application/Controller/AgentController.php: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4,10 +4,8 @@ namespace Application\Controller;

use Application\Constant\RoleConstant;
use Application\Entity\Db\ApplicationElement;
use Application\Entity\Db\CompetenceElement;
use Application\Form\ApplicationElement\ApplicationElementForm;
use Application\Form\ApplicationElement\ApplicationElementFormAwareTrait;
use Application\Form\CompetenceElement\CompetenceElementForm;
use Application\Form\CompetenceElement\CompetenceElementFormAwareTrait;
use Application\Form\SelectionApplication\SelectionApplicationFormAwareTrait;
use Application\Service\Agent\AgentServiceAwareTrait;
+0 −9
Changes for module/Application/src/Application/Controller/ApplicationController.php: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -272,15 +272,6 @@ class ApplicationController extends AbstractActionController {

    /** GESTION DES COMPETENCES ELEMENTS ==> Faire CONTROLLER ? *******************************************************/

    public function afficherApplicationElementAction()
    {
        $element = $this->getApplicationElementService()->getRequestedApplicationElement($this);
        return new ViewModel([
            'title' => "Affichage de l'application [".$element->getApplication()->getLibelle()."]",
            'applicationElement' => $element,
        ]);
    }

    public function ajouterApplicationElementAction()
    {
        $type = $this->params()->fromRoute('type');
Loading