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

Amélioration affichage etat + affichage etat index Epro

parent ee6e8b44
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -171,4 +171,16 @@ class Metier implements HistoriqueAwareInterface {
        }
        return $texte;
    }

    public function getDomaineAndFamille()
    {
        $texte = "";
        /** @var Domaine $domaine */
        $texte .= "<ul>";
        foreach ($this->domaines as $domaine) {
            $texte .= "<li>" . $domaine->getLibelle() . " / " . $domaine->getFamille()->getLibelle() . "</li>";
        }
        $texte .= "</ul>";
        return $texte;
    }
}
 No newline at end of file
+4 −23
Original line number Diff line number Diff line
@@ -8,15 +8,17 @@ use Autoform\Entity\Db\FormulaireInstance;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use UnicaenApp\Exception\RuntimeException;
use UnicaenEtat\Entity\Db\Etat;
use UnicaenEtat\Entity\Db\HasEtatInterface;
use UnicaenEtat\Entity\Db\HasEtatTrait;
use UnicaenUtilisateur\Entity\Db\User;
use UnicaenUtilisateur\Entity\HistoriqueAwareInterface;
use UnicaenUtilisateur\Entity\HistoriqueAwareTrait;
use UnicaenValidation\Entity\Db\ValidationInstance;
use Zend\Permissions\Acl\Resource\ResourceInterface;

class EntretienProfessionnel implements HistoriqueAwareInterface, ResourceInterface, HasAgentInterface {
class EntretienProfessionnel implements HistoriqueAwareInterface, ResourceInterface, HasAgentInterface, HasEtatInterface {
    use HistoriqueAwareTrait;
    use HasEtatTrait;

    const ETAT_ACCEPTATION                  = 'ENTRETIEN_ACCEPTATION';
    const ETAT_ACCEPTER                     = 'ENTRETIEN_ACCEPTER';
@@ -61,8 +63,6 @@ class EntretienProfessionnel implements HistoriqueAwareInterface, ResourceInterf
    private $token;
    /** @var DateTime */
    private $acceptation;
    /** @var Etat */
    private $etat;

    /**
     * @return int
@@ -171,25 +171,6 @@ class EntretienProfessionnel implements HistoriqueAwareInterface, ResourceInterf
        return $this;
    }

    /**
     * @return Etat|null
     */
    public function getEtat(): ?Etat
    {
        return $this->etat;
    }

    /**
     * @param Etat|null $etat
     * @return EntretienProfessionnel
     */
    public function setEtat(?Etat $etat): EntretienProfessionnel
    {
        $this->etat = $etat;
        return $this;
    }


    /**
     * @return FormulaireInstance
     */
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
        <field name="lieu"              type="string" length="4096"     column="lieu"               nullable="false"/>
        <field name="token"             type="string" length="255"      column="token"              nullable="true"/>
        <field name="acceptation"       type="datetime"                 column="acceptation"        nullable="true"/>

        <many-to-one target-entity="UnicaenEtat\Entity\Db\Etat"  field="etat">
            <join-column name="etat_id" referenced-column-name="id"/>
        </many-to-one>
+2 −2
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ $canDetruire = $this->isAllowed(EntretienproPrivileges::getResourceId(Entreti
        <th> Agent </th>
        <th> Responsable </th>
        <th> Date </th>
        <th> Modifée </th>
        <th> État </th>
        <th> Action </th>
    </tr>
    </thead>
@@ -48,7 +48,7 @@ $canDetruire = $this->isAllowed(EntretienproPrivileges::getResourceId(Entreti
            </td>
            <td> <?php echo $entretien->getResponsable()->getDisplayName(); ?> </td>
            <td> <?php echo $entretien->getDateEntretien()->format('d/m/Y'); ?> </td>
            <td> <?php echo $entretien->getHistoModification()->format('d/m/Y'); ?> </td>
            <td> <?php echo $this->etatbadge($entretien->getEtat()); ?> </td>
            <td>
                <?php if ($canVoir) : ?>
                    <a
+13 −0
Original line number Diff line number Diff line
<?php

namespace UnicaenEtat\Entity\Db;

interface HasEtatsInterface {

    public function getEtats();
    public function getEtatActif();
    public function addEtat(Etat $etat);
    public function removeEtat(Etat $etat);
    public function clearEtats();

}
 No newline at end of file
Loading