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

Suppression de fichiers oubliés

parent a62e8b54
Loading
Loading
Loading
Loading
+0 −96
Original line number Diff line number Diff line
<?php

namespace Application\Entity\Db;

use Application\Entity\HasAgentInterface;
use DateTime;
use Formation\Entity\Db\Formation;
use UnicaenUtilisateur\Entity\HistoriqueAwareInterface;
use UnicaenUtilisateur\Entity\HistoriqueAwareTrait;
use UnicaenValidation\Entity\ValidableAwareTrait;
use UnicaenValidation\Entity\ValidableInterface;

class AgentFormation implements ValidableInterface, HistoriqueAwareInterface, HasAgentInterface {
    use HistoriqueAwareTrait;
    use ValidableAwareTrait;

    /** @var integer */
    private $id;
    /** @var Agent */
    private $agent;
    /** @var Formation */
    private $formation;
    /** @var DateTime */
    private $date;

    /**
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @return Agent|null
     */
    public function getAgent() : ?Agent
    {
        return $this->agent;
    }

    /**
     * @param Agent|null $agent
     * @return AgentFormation
     */
    public function setAgent(?Agent $agent) : AgentFormation
    {
        $this->agent = $agent;
        return $this;
    }

    /**
     * @return Formation
     */
    public function getFormation()
    {
        return $this->formation;
    }

    /**
     * @param Formation $formation
     * @return AgentFormation
     */
    public function setFormation($formation)
    {
        $this->formation = $formation;
        return $this;
    }

    /**
     * @return DateTime
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * @param DateTime $date
     * @return AgentFormation
     */
    public function setDate($date)
    {
        $this->date = $date;
        return $this;
    }

    public function estValide()
    {
        $validation = $this->getValidation();
        if ($validation === null) return false;
        if ($validation->getValeur() !== null) return false;
        return true;
    }

}
 No newline at end of file
+0 −35
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <entity name="Application\Entity\Db\AgentFormation" table="agent_formation">

        <id name="id" type="integer" column="id">
            <generator strategy="IDENTITY"/>
        </id>

        <many-to-one target-entity="Application\Entity\Db\Agent"  field="agent">
            <join-column name="agent_id" referenced-column-name="c_individu"/>
        </many-to-one>
        <many-to-one target-entity="Formation\Entity\Db\Formation"  field="formation">
            <join-column name="formation_id" referenced-column-name="id"/>
        </many-to-one>
        <field name="date"                    column="date"             type="datetime" />

        <one-to-one target-entity="UnicaenValidation\Entity\Db\ValidationInstance" field="validation">
            <join-column name="validation_id" referenced-column-name="id" />
        </one-to-one>

        <!-- HISTORISATION  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
        <field name="histoCreation"     type="datetime"                 column="histo_creation"     nullable="false"/>
        <field name="histoModification" type="datetime"                 column="histo_modification" nullable="false"/>
        <field name="histoDestruction"  type="datetime"                 column="histo_destruction"  nullable="true"/>
        <many-to-one target-entity="UnicaenUtilisateur\Entity\Db\User"  field="histoCreateur">
            <join-column name="histo_createur_id" referenced-column-name="id"/>
        </many-to-one>
        <many-to-one target-entity="UnicaenUtilisateur\Entity\Db\User"  field="histoModificateur">
            <join-column name="histo_modificateur_id" referenced-column-name="id"/>
        </many-to-one>
        <many-to-one target-entity="UnicaenUtilisateur\Entity\Db\User"  field="histoDestructeur">
            <join-column name="histo_destructeur_id" referenced-column-name="id"/>
        </many-to-one>
    </entity>
</doctrine-mapping>
+2 −3
Original line number Diff line number Diff line
@@ -2,10 +2,9 @@

/**
 * @var EntretienProfessionnel $entretien
 * @var AgentFormation[] $formations
 * @var FormationElement[] $formations
 */

use Application\Entity\Db\AgentFormation;
use Application\Entity\Db\EntretienProfessionnel;
use Autoform\Entity\Db\Categorie;
use Autoform\Entity\Db\Champ;
@@ -181,7 +180,7 @@ foreach ($responses as $response) {
<ul>
    <?php /** @var FormationElement $formation */ ?>
    <?php foreach ($formations as $formation) : ?>
        <li><?php echo $formation->getFormation()->getLibelle(); ?> -  <?php echo $formation->getDate()->format('d/m/Y'); ?></li>
        <li><?php echo $formation->getFormation()->getLibelle(); ?> -  <?php echo $formation->getCommentaire(); ?></li>
    <?php endforeach; ?>
</ul>
<?php else :  ?>
+0 −66
Original line number Diff line number Diff line
<?php

/**
 * @see AgentController::afficherAgentFormationAction()
 * @var AgentFormation $agentFormation
 */

use Application\Entity\Db\AgentFormation;

?>

<div class="row">
    <div class="col-md-6">
        <dl>
            <dt> Agent </dt>
            <dd> <?php echo $agentFormation->getAgent()->getDenomination(); ?></dd>
            <dt> Application </dt>
            <dd> <?php echo $agentFormation->getFormation()->getLibelle(); ?></dd>
            <dt> Date de la formation </dt>
            <dd> <?php echo $agentFormation->getDate()->format('d/m/Y à H:i:s'); ?></dd>
            <dt> Validation </dt>
            <dd>
                <?php if ($agentFormation->getValidation() === null) : ?>
                    Aucune validation
                <?php else: ?>
                    <?php $validation = $agentFormation->getValidation(); ?>
                    <?php if ($validation->getValeur() === null) : ?>
                        <span
                            style="color:darkgreen;"
                            title=" Par <?php echo $validation->getHistoModificateur()->getDisplayName(); ?> le <?php echo $validation->getHistoModification()->format("d/m/Y"); ?>">
                                    <span class="icon ok"></span>
                                    Validée
                                </span>
                    <?php else: ?>
                    <span
                        style="color:darkred;"
                        title=" Par <?php echo $validation->getHistoModificateur()->getDisplayName(); ?> le <?php echo $validation->getHistoModification()->format("d/m/Y"); ?>">
                                    <span class="icon ko"></span>
                                Refusée
                    <?php endif; ?>
                <?php endif; ?>
            </dd>
        </dl>
    </div>
    <div class="col-md-6">
        <dl>
            <dt> Dernière modification </dt>
            <dd>
                <?php echo $agentFormation->getHistoModification()->format('d/m/Y à H:i:s'); ?>
                <br/>
                <?php echo $agentFormation->getHistoModificateur()->getDisplayName(); ?>
            </dd>
        </dl>

        <?php if ($agentFormation->estHistorise()) : ?>
            <dl>
                <dt> Historisée </dt>
                <dd>
                    <?php echo $agentFormation->getHistoDestruction()->format('d/m/Y à H:i:s'); ?>
                    <br/>
                    <?php echo $agentFormation->getHistoDestructeur()->getDisplayName(); ?>
                </dd>
            </dl>
        <?php endif; ?>
    </div>
</div>