Commit f77dac4c authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Mise à jour temporaire assertion offre emploi

parent 4b129276
Loading
Loading
Loading
Loading
Loading
+9 −12
Changes for module/Mission/src/Assertion/OffreEmploiAssertion.php: 9 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -39,8 +39,7 @@ class OffreEmploiAssertion extends AbstractAssertion implements EntityManagerAwa
            case 'offre-emploi':
            case 'candidature':
                //Si il n'y a pas d'offre d'emploi alors il ne peut pas y avoir des candidatures
                if(!$this->canHaveCandidature())
                {
                if (!$this->canHaveCandidature()) {
                    return false;
                }

@@ -103,18 +102,9 @@ class OffreEmploiAssertion extends AbstractAssertion implements EntityManagerAwa
        if (!$entity) {
            $entity = $this->getParam(Intervenant::class);
        }
        if (!$entity) {
            $entity = $this->getParam(Mission::class);
        }
        if (!$entity) {
            $entity = $this->getParam(VolumeHoraireMission::class);
        }
        if (!$entity) {
            $entity = $this->getParam(Candidature::class);
        }
        if (!$entity) {
            return false;
        }

        switch ($action) {
            case 'accepterCandidature':
@@ -127,8 +117,13 @@ class OffreEmploiAssertion extends AbstractAssertion implements EntityManagerAwa
            case 'candidature':
                return $this->canHaveCandidature();
                break;
        }
            case 'get':
            case 'liste':
            case 'index':
                return true;

        }
        return false;
    }


@@ -223,6 +218,8 @@ class OffreEmploiAssertion extends AbstractAssertion implements EntityManagerAwa
                              ]);
    }



    protected function canHaveCandidature(): bool
    {
        $query = 'SELECT id FROM offre_emploi WHERE histo_destruction IS NULL AND validation_id IS NOT NULL';