Skip to content
Snippets Groups Projects
Commit 266922ac authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

deplacement candidature dans le module mission

parent bc1561c7
No related branches found
No related tags found
No related merge requests found
......@@ -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,
],
],
],
],
......
......@@ -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');
......
......@@ -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' => [
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment