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

Uniformisation interface parcours

parent b2cb5d02
Loading
Loading
Loading
Loading
+16
Changes for module/Application/src/Application/Controller/AgentController.php: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -415,15 +415,23 @@ class AgentController extends AbstractActionController

    public function historiserAgentCompetenceAction()
    {
        $retour = $this->params()->fromQuery('retour');

        $competence = $this->getAgentService()->getRequestedAgentCompetence($this);
        $this->getAgentService()->historiserAgentCompetence($competence);

        if ($retour !== null) return $this->redirect()->toUrl($retour);
        return $this->redirect()->toRoute('agent/afficher', ['agent' => $competence->getAgent()->getId()], [], true);
    }

    public function restaurerAgentCompetenceAction()
    {
        $retour = $this->params()->fromQuery('retour');

        $competence = $this->getAgentService()->getRequestedAgentCompetence($this);
        $this->getAgentService()->restoreAgentCompetence($competence);

        if ($retour !== null) return $this->redirect()->toUrl($retour);
        return $this->redirect()->toRoute('agent/afficher', ['agent' => $competence->getAgent()->getId()], [], true);
    }

@@ -522,15 +530,23 @@ class AgentController extends AbstractActionController

    public function historiserAgentFormationAction()
    {
        $retour = $this->params()->fromQuery('retour');

        $agentFormation = $this->getAgentService()->getRequestedAgentFormation($this);
        $this->getAgentService()->historiserAgentFormation($agentFormation);

        if ($retour !== null) return $this->redirect()->toUrl($retour);
        return $this->redirect()->toRoute('agent/afficher', ['agent' => $agentFormation->getAgent()->getId()], [], true);
    }

    public function restaurerAgentFormationAction()
    {
        $retour = $this->params()->fromQuery('retour');

        $agentFormation = $this->getAgentService()->getRequestedAgentFormation($this);
        $this->getAgentService()->restoreAgentFormation($agentFormation);

        if ($retour !== null) return $this->redirect()->toUrl($retour);
        return $this->redirect()->toRoute('agent/afficher', ['agent' => $agentFormation->getAgent()->getId()], [], true);
    }

+12 −6
Changes for module/Application/src/Application/Entity/Db/Agent.php: 12 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -345,24 +345,30 @@ class Agent implements ResourceInterface
        return $applications;
    }

    /** @return AgentCompetence[] */
    public function getCompetences()
    /**
     * @param bool $include_historisees
     * @return AgentCompetence[]
     */
    public function getCompetences($include_historisees = false)
    {
        $competences = [];
        /** @var AgentCompetence $competence */
        foreach ($this->competences as $competence) {
            if ($competence->estNonHistorise()) $competences[] = $competence;
            if ($include_historisees OR $competence->estNonHistorise()) $competences[] = $competence;
        }
        return $competences;
    }

    /** @return AgentFormation[] */
    public function getFormations()
    /**
     * @param bool $include_historisees
     * @return AgentFormation[]
     */
    public function getFormations($include_historisees = false)
    {
        $formations = [];
        /** @var AgentCompetence $formation */
        foreach ($this->formations as $formation) {
            if ($formation->estNonHistorise()) $formations[] = $formation;
            if ($include_historisees OR $formation->estNonHistorise()) $formations[] = $formation;
        }
        return $formations;
    }
+20
Changes for module/Application/src/Application/Entity/Db/CompetenceType.php: 20 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ class CompetenceType implements HistoriqueAwareInterface {
    private $competences;
    /** @var integer */
    private $ordre;
    /** @var string */
    private $couleur;

    public function __construct()
    {
@@ -109,4 +111,22 @@ class CompetenceType implements HistoriqueAwareInterface {
        return $this;
    }

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

    /**
     * @param string $couleur
     * @return CompetenceType
     */
    public function setCouleur($couleur)
    {
        $this->couleur = $couleur;
        return $this;
    }

}
 No newline at end of file
+1
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.CompetenceType.dcm.xml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
        </id>

        <field name="libelle"           type="string" length="255"      column="libelle"                nullable="false"/>
        <field name="couleur"           type="string" length="255"      column="couleur"                nullable="false"/>
        <field name="ordre"             type="integer"                  column="ordre"                  nullable="false"/>
        <one-to-many target-entity="Application\Entity\Db\Competence" mapped-by="type" field="competences"/>

+200 −114

File changed.

Preview size limit exceeded, changes collapsed.