Commit 266922ac authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

deplacement candidature dans le module mission

parent bc1561c7
Loading
Loading
Loading
Loading
+20 −58
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use Contrat\Controller\ContratController;
use Dossier\Assertion\IntervenantDossierAssertion;
use Dossier\Controller\IntervenantDossierController;
use Mission\Assertion\OffreEmploiAssertion;
use Mission\Controller\OffreEmploiController;
use Paiement\Controller\PaiementController;
use UnicaenPrivilege\Guard\PrivilegeController;
use UnicaenPrivilege\Provider\Rule\PrivilegeRuleProvider;
@@ -64,24 +65,7 @@ return [
                            ],
                        ],
                    ],
                    'candidature'           => [
                        'type'    => 'Segment',
                        'options' => [
                            'route'    => '/:intervenant/candidature',
                            'defaults' => [
                                'action' => 'candidature',
                            ],
                        ],
                    ],
                    'get-candidatures'      => [
                        'type'    => 'Segment',
                        'options' => [
                            'route'    => '/:intervenant/get-candidatures',
                            'defaults' => [
                                'action' => 'get-candidatures',
                            ],
                        ],
                    ],

                    'voir'                => [
                        'type'    => 'Segment',
                        'options' => [
@@ -279,17 +263,6 @@ return [
                        'resource' => PrivilegeController::getResourceId('Application\Controller\Intervenant', 'index'),
                        'order'    => 1,
                        'pages'    => [
                            'candidature'      => [
                                'label'        => "Candidatures",
                                'title'        => "Liste de vos candidatures en cours",
                                'route'        => 'intervenant/candidature',
                                'paramsInject' => [
                                    'intervenant',
                                ],
                                'withtarget'   => true,
                                'resource'     => PrivilegeController::getResourceId('Application\Controller\Intervenant', 'candidature'),
                                'order'        => 5,
                            ],
                            'rechercher'       => [
                                'label'        => " Rechercher",
                                'title'        => "Rechercher un intervenant",
@@ -348,12 +321,6 @@ return [
                        Privileges::INTERVENANT_FICHE,
                    ],
                ],
                [
                    'controller' => 'Application\Controller\Intervenant',
                    'action'     => ['candidature', 'get-candidatures'],
                    'privileges' => [Privileges::MISSION_CANDIDATURE_VISUALISATION],
                    'assertion'  => OffreEmploiAssertion::class,
                ],
                [
                    'controller' => 'Application\Controller\Intervenant',
                    'action'     => ['saisir', 'definir-par-defaut', 'synchronisation', 'synchroniser'],
@@ -393,6 +360,8 @@ return [
                        Privileges::REFERENTIEL_REALISE_VISUALISATION,
                    ],
                ],


            ],
        ],

@@ -408,13 +377,6 @@ return [
                        'resources'  => ['Intervenant'],
                        'assertion'  => Assertion\IntervenantAssertion::class,
                    ],
                    [
                        'privileges' => [
                            Privileges::MISSION_CANDIDATURE_VALIDER,
                        ],
                        'resources'  => ['Intervenant'],
                        'assertion'  => OffreEmploiAssertion::class,
                    ],
                ],
            ],
        ],
+0 −32
Original line number Diff line number Diff line
@@ -228,38 +228,6 @@ class IntervenantController extends AbstractController



    public function candidatureAction ()
    {
        $intervenant           = $this->getEvent()->getParam('intervenant');
        $canValiderCandidature = $this->isAllowed($intervenant, Privileges::MISSION_CANDIDATURE_VALIDER);

        if (!$intervenant) {
            throw new \LogicException('Intervenant introuvable');
        }


        return compact('intervenant', 'canValiderCandidature');
    }



    public function getCandidaturesAction ()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
        if (!$intervenant) {
            throw new \LogicException('Intervenant introuvable');
        }
        /**
         * @var Intervenant $intervenant
         */
        $candidatures = $this->getServiceCandidature()->data(['intervenant' => $intervenant]);


        return $candidatures;
    }



    public function definirParDefautAction ()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
+48 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Mission;


use Application\Provider\Privilege\Privileges;
use Mission\Assertion\OffreEmploiAssertion;
use Mission\Controller\OffreEmploiController;
use Mission\Controller\OffreEmploiControllerFactory;
use Mission\Service\CandidatureService;
@@ -16,6 +17,22 @@ use Mission\Service\OffreEmploiServiceFactory;

return [
    'routes' => [
        'intervenant' => [
            'child_routes' => [
                'candidature'      => [
                    'route'      => '/:intervenant/candidature',
                    'controller' => OffreEmploiController::class,
                    'action'     => 'candidature',

                ],
                'get-candidatures' => [
                    'route'      => '/:intervenant/get-candidatures',
                    'controller' => OffreEmploiController::class,
                    'action'     => 'get-candidatures',
                ],
            ],
        ],

        'offre-emploi' => [
            'route'         => '/offre-emploi',
            'controller'    => OffreEmploiController::class,
@@ -92,6 +109,21 @@ return [


    'navigation' => [
        'intervenant'   => [
            'pages' => [
                'candidature' => [
                    'label'        => "Candidatures",
                    'title'        => "Liste de vos candidatures en cours",
                    'route'        => 'intervenant/candidature',
                    'paramsInject' => [
                        'intervenant',
                    ],
                    'withtarget'   => true,
                    'resource'     => PrivilegeController::getResourceId(OffreEmploiController::class, 'candidature'),
                    'order'        => 5,
                ],
            ],
        ],
        'gestion'       => [
            'pages' => [
                'offres-emploi' => [
@@ -142,6 +174,13 @@ return [
            'resources'  => 'OffreEmploi',
            'assertion'  => Assertion\OffreEmploiAssertion::class,
        ],
        [
            'privileges' => [
                Privileges::MISSION_CANDIDATURE_VALIDER,
            ],
            'resources'  => ['Intervenant'],
            'assertion'  => Assertion\OffreEmploiAssertion::class,
        ],

    ],

@@ -188,6 +227,14 @@ return [
            'roles'      => ['guest'],

        ],
        [
            'controller' => OffreEmploiController::class,
            'action'     => ['candidature', 'get-candidatures'],
            'privileges' => [Privileges::MISSION_CANDIDATURE_VISUALISATION],
            'assertion'  => Assertion\OffreEmploiAssertion::class,
        ],


    ],

    'controllers' => [
+32 −0
Original line number Diff line number Diff line
@@ -272,4 +272,36 @@ class OffreEmploiController extends AbstractController
        return compact('offreEmploi', 'utilisateur', 'canPostuler');
    }



    public function candidatureAction ()
    {
        $intervenant           = $this->getEvent()->getParam('intervenant');
        $canValiderCandidature = $this->isAllowed($intervenant, Privileges::MISSION_CANDIDATURE_VALIDER);

        if (!$intervenant) {
            throw new \LogicException('Intervenant introuvable');
        }


        return compact('intervenant', 'canValiderCandidature');
    }



    public function getCandidaturesAction ()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
        if (!$intervenant) {
            throw new \LogicException('Intervenant introuvable');
        }
        /**
         * @var Intervenant $intervenant
         */
        $candidatures = $this->getServiceCandidature()->data(['intervenant' => $intervenant]);


        return $candidatures;
    }

}
 No newline at end of file