diff --git a/module/Application/config/intervenant.config.php b/module/Application/config/intervenant.config.php index ec3dbeca415f540d4a017832f2c0cb2799b0a461..a36513c89c9b7df22330c1e4eff05399911184ee 100755 --- a/module/Application/config/intervenant.config.php +++ b/module/Application/config/intervenant.config.php @@ -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,25 +65,8 @@ 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' => [ + + 'voir' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/voir', @@ -91,7 +75,7 @@ return [ ], ], ], - 'fiche' => [ + 'fiche' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/fiche', @@ -100,7 +84,7 @@ return [ ], ], ], - 'creer' => [ + 'creer' => [ 'type' => 'Segment', 'options' => [ 'route' => '/creer', @@ -110,7 +94,7 @@ return [ ], ], ], - 'saisir' => [ + 'saisir' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/saisir', @@ -120,7 +104,7 @@ return [ ], ], ], - 'dupliquer' => [ + 'dupliquer' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/dupliquer', @@ -130,7 +114,7 @@ return [ ], ], ], - 'synchronisation' => [ + 'synchronisation' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/synchronisation', @@ -139,7 +123,7 @@ return [ ], ], ], - 'synchroniser' => [ + 'synchroniser' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/synchroniser', @@ -148,7 +132,7 @@ return [ ], ], ], - 'supprimer' => [ + 'supprimer' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/supprimer', @@ -157,7 +141,7 @@ return [ ], ], ], - 'historiser' => [ + 'historiser' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/historiser', @@ -166,7 +150,7 @@ return [ ], ], ], - 'restaurer' => [ + 'restaurer' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/restaurer', @@ -175,7 +159,7 @@ return [ ], ], ], - 'definir-par-defaut' => [ + 'definir-par-defaut' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/definir-par-defaut', @@ -184,7 +168,7 @@ return [ ], ], ], - 'voir-heures-comp' => [ + 'voir-heures-comp' => [ 'type' => 'Segment', 'options' => [ 'route' => '/voir-heures-comp/:intervenant', @@ -193,7 +177,7 @@ return [ ], ], ], - 'formule-totaux-hetd' => [ + 'formule-totaux-hetd' => [ 'type' => 'Segment', 'options' => [ 'route' => '/formule-totaux-hetd/:intervenant/:typeVolumeHoraire/:etatVolumeHoraire', @@ -206,7 +190,7 @@ return [ ], ], ], - 'feuille-de-route' => [ + 'feuille-de-route' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/feuille-de-route', @@ -215,7 +199,7 @@ return [ ], ], ], - 'mise-en-paiement' => [ + 'mise-en-paiement' => [ 'type' => 'Segment', 'may_terminate' => false, 'options' => [ @@ -254,7 +238,7 @@ return [ ], ], ], - 'contrat' => [ + 'contrat' => [ 'type' => 'Segment', 'options' => [ 'route' => '/:intervenant/contrat', @@ -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, - ], ], ], ], diff --git a/module/Application/src/Controller/IntervenantController.php b/module/Application/src/Controller/IntervenantController.php index 71116c28399ac62cdc5c793a911b9e2daada17f9..4f568d4d8509acb1ba57eda396e3c114fe08a6bb 100755 --- a/module/Application/src/Controller/IntervenantController.php +++ b/module/Application/src/Controller/IntervenantController.php @@ -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'); diff --git a/module/Mission/config/offre-emploi.config.php b/module/Mission/config/offre-emploi.config.php index d910e8668414b2a7e2428058659646e694367b88..997d90f40748482295b62998e5f96dc55931e50e 100644 --- a/module/Mission/config/offre-emploi.config.php +++ b/module/Mission/config/offre-emploi.config.php @@ -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,11 +17,27 @@ 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, 'action' => 'index', - // 'privileges' => Privileges::MISSION_OFFRE_EMPLOI_VISUALISATION, + //'privileges' => Privileges::MISSION_OFFRE_EMPLOI_VISUALISATION, 'may_terminate' => true, 'child_routes' => [ 'saisir' => [ @@ -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' => [ diff --git a/module/Mission/src/Controller/OffreEmploiController.php b/module/Mission/src/Controller/OffreEmploiController.php index ccfac8dbe7a5623f55df1d311658f12721c8f4c5..22065856b792412444aba13e5fc22541c7f3fe47 100755 --- a/module/Mission/src/Controller/OffreEmploiController.php +++ b/module/Mission/src/Controller/OffreEmploiController.php @@ -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 diff --git a/module/Application/view/application/intervenant/candidature.phtml b/module/Mission/view/mission/offre-emploi/candidature.phtml similarity index 100% rename from module/Application/view/application/intervenant/candidature.phtml rename to module/Mission/view/mission/offre-emploi/candidature.phtml