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

Ajout d'un champ lien dans les postes

parent 28db07f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

        <field name="numeroPoste"       type="string" length="128"      column="numero_poste"             nullable="true"/>
        <field name="localisation"      type="string" length="128"      column="localisation"             nullable="true"/>
        <field name="lien"              type="string" length="256"      column="lien"                     nullable="true"/>

        <many-to-one target-entity="Application\Entity\Db\Agent" field="rattachementHierarchique">
            <join-column name="rattachement_hierarchique" referenced-column-name="id" />
+18 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ class Poste {
    private $rattachementHierarchique;
    /** @var Domaine */
    private $domaine;
    /** @var string */
    private $lien;

    /**
     * @return int
@@ -135,5 +137,21 @@ class Poste {
        return $this;
    }

    /**
     * @return string
     */
    public function getLien()
    {
        return $this->lien;
    }

    /**
     * @param string $lien
     * @return Poste
     */
    public function setLien($lien)
    {
        $this->lien = $lien;
        return $this;
    }
}
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
@@ -115,6 +115,17 @@ class PosteForm extends Form {
                'id' => 'domaine',
            ],
        ]);
        // liens exterieur vers fiche de poste
        $this->add([
            'type' => Text::class,
            'name' => 'lien',
            'options' => [
                'label' => "Lien externe ver la fiche de poste :",
            ],
            'attributes' => [
                'id' => 'lien',
            ],
        ]);

        // button
        $this->add([
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ class PosteHydrator implements HydratorInterface {
            'correspondance'    => ($object->getCorrespondance())?$object->getCorrespondance()->getId():null,
            'rattachement'      => ($object->getRattachementHierarchique())?$object->getRattachementHierarchique()->getId():null,
            'domaine'           => ($object->getDomaine())?$object->getDomaine()->getId():null,
            'lien'              => $object->getLien(),
        ];
        return $data;
    }
@@ -48,6 +49,7 @@ class PosteHydrator implements HydratorInterface {
        $object->setCorrespondance($correspondance);
        $object->setRattachementHierarchique($rattachement);
        $object->setDomaine($domaine);
        $object->setLien($data['lien']);

        return $object;
    }
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@ class PosteViewHelper extends AbstractHelper
        $texte .= '<dd class="siham">'.$poste->getCorrespondance().'</dd>';
        $texte .= '<dt> Domaine UNICAEN </dt>';
        $texte .= '<dd class="gpeec">'.(($poste->getDomaine())?$poste->getDomaine()->getLibelle():"---").'</dd>';
        if ($poste->getLien()) {
            $texte .= '<dt> Lien externe </dt>';
            $texte .= '<dd class="gpeec"><a href="'.$poste->getLien().'">'.$poste->getLien().'</a></dd>';
        }
        $texte .= '</dl>';

        return $texte;