Commit 30aae63b authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Mise en place date de commission de recrutement pour l'acceptation d'une candidature.

parent bdd4b3c9
Loading
Loading
Loading
Loading
+12
Changes for data/ddl/table/CANDIDATURE.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -141,6 +141,18 @@ return [
            'position'    => 4,
            'commentaire' => NULL,
        ],
        'DATE_COMMISSION'              => [
            'name'        => 'DATE_COMMISSION',
            'type'        => 'date',
            'bdd-type'    => 'DATE',
            'length'      => 0,
            'scale'       => null,
            'precision'   => null,
            'nullable'    => true,
            'default'     => null,
            'position'    => 4,
            'commentaire' => null,
        ],
    ],
];

+10 −4
Changes for front/Mission/ListeCandidatures.vue: 10 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -6,17 +6,19 @@
                <th>Offre d'emploi</th>
                <th>Composante</th>
                <th>Etat</th>
                <th>Date commission</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>
                <td v-if="canValiderCandidature" colspan="5" style="text-align:center;">Aucune candidature</td>

            </tr>

            <tr v-for="candidature in candidatures" :key="candidature.id">
                <td style="text-align:center;"><a :href="urlOffre(candidature)">{{ candidature.offre.titre }}</a></td>
                <td style="text-align:center;">{{ candidature.offre.structure.libelleLong }}</td>
                <td style="text-align:center;">{{ candidature.offre.structure.libelleCourt }}</td>
                <td style="text-align:center;">
                    <span v-if="candidature.validation" class="badge rounded-pill bg-success">Acceptée par {{
                            candidature.validation.histoCreateur.displayName
@@ -24,6 +26,10 @@
                    <span v-if="!candidature.validation && candidature.motif !== null" class="badge rounded-pill bg-danger">{{ candidature.motif }}</span>
                    <span v-if="!candidature.validation && candidature.motif === null" class="badge rounded-pill bg-warning">En attente d'acceptation</span>
                </td>
                <td>
                    <u-date v-if="candidature.dateCommission" :value="candidature.dateCommission"/>
                </td>

                <td v-if="this.canValiderCandidature" style="text-align:center;">
                    <a v-if="!candidature.validation" :href="urlAccepterCandidature(candidature)"
                       class="btn btn-success"
@@ -97,7 +103,7 @@ export default {
        },
        validerCandidature(event)
        {
            popConfirm(event.target, (response) => {
            modAjax(event.currentTarget, (widget) => {
                this.reload();
            });
        },
+23 −4
Changes for module/Mission/src/Controller/OffreEmploiController.php: 23 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\ValidationServiceAwareTrait;
use Application\Service\Traits\WorkflowServiceAwareTrait;
use Doctrine\ORM\Query;
use Laminas\View\Model\ViewModel;
use Mission\Entity\Db\Candidature;
use Mission\Entity\Db\Mission;
use Mission\Entity\Db\OffreEmploi;
@@ -177,9 +178,17 @@ class OffreEmploiController extends AbstractController
        /** @var Candidature $candidature */
        $candidature = $this->getEvent()->getParam('candidature');

        if ($candidature->isValide()) {
            $this->flashMessenger()->addInfoMessage('La candidature est déjà acceptée');
        } else {
        $title = "Accepter candidature";

        $request = $this->getRequest();
        if ($request->isPost()) {

            $dateCommission = $this->getRequest()->getPost('date-commission');

            if (!empty($dateCommission)) {

                $dateCommission = new \DateTime($dateCommission);
                $candidature->setDateCommission($dateCommission);
                $this->getServiceValidation()->validerCandidature($candidature);
                $this->getServiceCandidature()->save($candidature);
                //Envoyer mail de confirmation d'acceptation de candidature
@@ -187,10 +196,19 @@ class OffreEmploiController extends AbstractController
                $this->flashMessenger()->addSuccessMessage("La candidature est bien acceptée");
                $mission = $this->getServiceMission()->createMissionFromCandidature($candidature);
                $this->getServiceWorkflow()->calculerTableauxBord([], $candidature->getIntervenant());
            } else {
                $this->flashMessenger()->addErrorMessage("Vous n'avez pas renseigné la date de commission de recurtement");
            }
            //On valide la candidature

        }

        $vm = new ViewModel();
        $vm->setTemplate('mission/offre-emploi/accepter-candidature');
        $vm->setVariables(compact('title', 'candidature'));

        return $vm;

        return $this->getAction($candidature->getOffre());
    }


@@ -211,6 +229,7 @@ class OffreEmploiController extends AbstractController
            if ($candidature->isValide()) {
                $validation = $candidature->getValidation();
                $candidature->setValidation(null);
                $candidature->setDateCommission(null);
                $this->getServiceValidation()->delete($validation);
            }

+14
Changes for module/Mission/src/Entity/Db/Candidature.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ class Candidature implements HistoriqueAwareInterface, ResourceInterface

    protected ?string     $motif      = null;

    protected ?\DateTime $dateCommission = null;


    public function getResourceId ()
    {
@@ -147,4 +149,16 @@ class Candidature implements HistoriqueAwareInterface, ResourceInterface
        return $this;
    }

    public function getDateCommission (): ?\DateTime
    {
        return $this->dateCommission;
    }

    public function setDateCommission (?\DateTime $dateCommission): self
    {
        $this->dateCommission = $dateCommission;

        return $this;
    }

}
+2
Changes for module/Mission/src/Entity/Db/Mapping/Mission.Entity.Db.Candidature.dcm.xml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@
            <join-column name="VALIDATION_ID" referenced-column-name="ID"/>
        </many-to-one>
        <field name="motif" type="string" column="MOTIF" length="4000" nullable="true"/>
        <field name="dateCommission" type="datetime" column="DATE_COMMISSION" nullable="true"/>

        <field name="histoCreation" type="datetime" column="HISTO_CREATION" nullable="false"/>
        <many-to-one field="histoCreateur" target-entity="Application\Entity\Db\Utilisateur">
            <join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/>
Loading