Commit 45e1e0c8 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Intégration d'une étape Candidature dans le menu dreoite de la fiche intervenant.

parent 80e2e9dc
Loading
Loading
Loading
Loading
+74 −0
Original line number Diff line number Diff line
<template>
    <div>
        <table class="table table-bordered ">
            <thead>
            <tr>
                <th>Offre d'emploi</th>
                <th>Composante</th>
                <th>Etat</th>
                <th v-if="canValiderCandidature">Action</th>
            </tr>
            </thead>
            <tbody>
            <tr v-if="candidatures.length == 0">
                <td v-if="canValiderCandidature" colspan="4" style="text-align:center;">Aucune candidature</td>
                <td v-if="!canValiderCandidature" colspan="3" style="text-align:center;">Aucune candidature</td>
            </tr>
            <tr v-for="candidature in candidatures" :key="candidature.id">
                <td style="text-align:center;">{{ candidature.offre.titre }}</td>
                <td style="text-align:center;">{{ candidature.offre.structure.libelleLong }}</td>
                <td style="text-align:center;">Computed à faire</td>
                <td style="text-align:center;">Action à définir</td>
            </tr>

            </tbody>

        </table>
    </div>

</template>

<script>

import offreEmploi from "@/Mission/OffreEmploi.vue";

export default {
    name: "ListeCandidatures.vue",
    components: {offreEmploi},
    props: {
        intervenant: {required: true},
    },
    data()
    {

        return {
            candidatures: []
        }

    },
    mounted()
    {
        this.reload();
        console.log(this.candidatures);

    },
    methods: {
        reload()
        {
            unicaenVue.axios.get(
                unicaenVue.url("intervenant/:intervenant/get-candidatures", {intervenant: this.intervenant})
            ).then(response => {
                this.candidatures = response.data;

            });

        }
    }

}

</script>

<style scoped>

</style>
 No newline at end of file
+40 −0
Original line number Diff line number Diff line
@@ -2,9 +2,13 @@

namespace Application;

use Application\Assertion\IntervenantAssertion;
use Application\Controller\IntervenantController;
use Application\Entity\Db\WfEtape;
use Application\Provider\Privilege\Privileges;
use Contrat\Controller\ContratController;
use Dossier\Assertion\IntervenantDossierAssertion;
use Dossier\Controller\IntervenantDossierController;
use Paiement\Controller\PaiementController;
use UnicaenPrivilege\Guard\PrivilegeController;
use UnicaenPrivilege\Provider\Rule\PrivilegeRuleProvider;
@@ -59,6 +63,24 @@ 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' => [
@@ -256,6 +278,17 @@ 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",
@@ -314,6 +347,12 @@ return [
                        Privileges::INTERVENANT_FICHE,
                    ],
                ],
                [
                    'controller' => 'Application\Controller\Intervenant',
                    'action'     => ['candidature', 'get-candidatures'],
                    'privileges' => [Privileges::MISSION_OFFRE_EMPLOI_POSTULER],
                    'assertion'  => IntervenantAssertion::class,
                ],
                [
                    'controller' => 'Application\Controller\Intervenant',
                    'action'     => ['saisir', 'definir-par-defaut', 'synchronisation', 'synchroniser'],
@@ -363,6 +402,7 @@ return [
                        'privileges' => [
                            Privileges::INTERVENANT_EDITION,
                            Privileges::INTERVENANT_EDITION_AVANCEE,
                            Privileges::MISSION_OFFRE_EMPLOI_POSTULER,
                        ],
                        'resources'  => ['Intervenant'],
                        'assertion'  => Assertion\IntervenantAssertion::class,
+34 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ use Intervenant\Service\NoteServiceAwareTrait;
use Intervenant\Service\StatutServiceAwareTrait;
use Laminas\View\Model\ViewModel;
use LogicException;
use Mission\Entity\Db\Candidature;
use Mission\Service\CandidatureServiceAwareTrait;
use Plafond\Processus\PlafondProcessusAwareTrait;
use Referentiel\Processus\ServiceReferentielProcessusAwareTrait;
use Service\Entity\Db\TypeVolumeHoraire;
@@ -60,6 +62,7 @@ class IntervenantController extends AbstractController
    use DifferentielServiceAwareTrait;
    use NoteServiceAwareTrait;
    use DossierServiceAwareTrait;
    use CandidatureServiceAwareTrait;


    public function indexAction()
@@ -134,6 +137,37 @@ class IntervenantController extends AbstractController



    public function candidatureAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');

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


        return compact('intervenant');
    }



    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');
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@
        <many-to-one field="histoDestructeur" target-entity="Application\Entity\Db\Utilisateur">
            <join-column name="HISTO_DESTRUCTEUR_ID" referenced-column-name="ID"/>
        </many-to-one>
        <one-to-many field="candidatures" target-entity="Mission\Entity\Db\Candidature" mapped-by="offre" fetch="EXTRA_LAZY"/>
        <one-to-many field="candidatures" target-entity="Mission\Entity\Db\Candidature" mapped-by="offre" fetch="LAZY"/>
        <one-to-many field="affectation" target-entity="Application\Entity\Db\AffectationRecherche" mapped-by="intervenant"/>
        <one-to-many field="agrement" target-entity="Agrement\Entity\Db\Agrement" mapped-by="intervenant"/>
        <one-to-many field="contrat" target-entity="Contrat\Entity\Db\Contrat" mapped-by="intervenant"/>
+8 −0
Original line number Diff line number Diff line
<?= $this->intervenant($intervenant)->renderTitle('Candidature'); ?>



<?= $this->vue('mission/liste-candidatures', [
    'intervenant' => $intervenant->getId(),
]); ?>
Loading