Commit e00638b0 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout des 'vancance d'emploi' dans les profils de recrutement

parent bb75fe77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ class FicheProfilController extends AbstractActionController {
        $fichespostes = $this->getFichePosteService()->getFichesPostesByStructures([$structure], true);

        $ficheprofil = new FicheProfil();
        $ficheprofil->setVancanceEmploi(false);
        $ficheprofil->setStructure($structure);

        $form = $this->getFicheProfilForm();
+31 −2
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@ class FicheProfil implements HistoriqueAwareInterface {

    /** @var int */
    private $id;
    /** @var boolean */
    private $vancanceEmploi;
    /** @var FichePoste */
    private $ficheposte;
    /** @var Structure */
@@ -42,6 +44,26 @@ class FicheProfil implements HistoriqueAwareInterface {
        return $this->id;
    }

    /**
     * @return bool
     */
    public function isVacanceEmploi(): bool
    {
        return $this->vancanceEmploi;
    }

    /**
     * @param bool $vancanceEmploi
     * @return FicheProfil
     */
    public function setVancanceEmploi(bool $vancanceEmploi): FicheProfil
    {
        $this->vancanceEmploi = $vancanceEmploi;
        return $this;
    }



    /**
     * @return FichePoste|null
     */
@@ -276,9 +298,16 @@ class FicheProfil implements HistoriqueAwareInterface {
        return $texte;
    }

    public function getVacanceEmploiAffichage()
    {
        if (!$this->isVacanceEmploi()) return null;
        $texte  = "<h2> Vacance d'emploi </h2>";
        return $texte;
    }

    public function getContratAffichage()
    {
        if ($this->contrat === null) return null;
        if ($this->isVacanceEmploi() OR $this->contrat === null) return null;
        $texte  = '<h2> Contrat </h2>';
        $texte .= $this->contrat;
        return $texte;
@@ -286,7 +315,7 @@ class FicheProfil implements HistoriqueAwareInterface {

    public function getRenumerationAffichage()
    {
        if ($this->renumeration === null) return null;
        if ($this->isVacanceEmploi() OR $this->renumeration === null) return null;
        $texte  = '<h2> Rénumération </h2>';
        $texte .= $this->renumeration;
        return $texte;
+1 −6
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@

namespace Application\Entity\Db\MacroContent;

use Application\Entity\Db\Competence;
use Application\Entity\Db\CompetenceElement;
use Application\Entity\Db\CompetenceType;
use Application\Entity\Db\FichePoste;
use Application\Entity\Db\ParcoursDeFormation;
@@ -25,7 +23,6 @@ trait FichePosteMacroTrait {
        return $texte;
    }


    /**
     * @return string
     */
@@ -257,7 +254,7 @@ trait FichePosteMacroTrait {
        /** @var FichePoste $ficheposte */
        $ficheposte = $this;
        $parcours = $ficheposte->getDictionnaire('parcours');

        ksort($parcours);
        $texte = "";

        foreach ($parcours as $clef => $parcoursArray) {
@@ -298,7 +295,6 @@ trait FichePosteMacroTrait {
                }
            }
        }

        return $texte;
    }

@@ -347,7 +343,6 @@ trait FichePosteMacroTrait {
                }
            }
        }

        return $texte;
    }
}
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@
            <generator strategy="IDENTITY"/>
        </id>

        <field name="vancanceEmploi"        column="vacance_emploi"         type="boolean"                  nullable="false"/>

        <many-to-one field="ficheposte" target-entity="Application\Entity\Db\FichePoste">
            <join-column name="ficheposte_id" referenced-column-name="id" />
        </many-to-one>
+13 −1
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Application\Service\FichePoste\FichePosteServiceAwareTrait;
use Application\Service\Structure\StructureServiceAwareTrait;
use UnicaenUtilisateur\Entity\DateTimeAwareTrait;
use Zend\Form\Element\Button;
use Zend\Form\Element\Checkbox;
use Zend\Form\Element\Date;
use Zend\Form\Element\Hidden;
use Zend\Form\Element\Select;
@@ -30,6 +31,16 @@ class FicheProfilForm extends Form {

    public function init()
    {
        $this->add([
            'type' => Checkbox::class,
            'name' => 'vacance_emploi',
            'options' => [
                'label' => "Il s'agit d'une vacance d'emploi",
            ],
            'attributes' => [
                'id' => 'vacance_emploi',
            ],
        ]);
        //structure (non editable)
        $this->add([
            'type' => Text::class,
@@ -171,12 +182,13 @@ class FicheProfilForm extends Form {
            ],
            'attributes' => [
                'type' => 'submit',
                'class' => 'btn btn-primary',
                'class' => 'btn btn-primary action',
            ],
        ]);

        //inputfilter
        $this->setInputFilter((new Factory())->createInputFilter([
            'vacance_emploi'          => [ 'required' => true,  ],
            'structure'               => [ 'required' => true,  ],
            'ficheposte'              => [ 'required' => true,  ],
            'date'                    => [ 'required' => true,  ],
Loading