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

Version naze du tableau de la fiche de metier type

parent 1bfb002c
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
@@ -26,6 +26,15 @@ use Application\Form\FicheMetier\SpecificitePosteForm;
use Application\Form\FicheMetier\SpecificitePosteFormFactory;
use Application\Form\FicheMetierType\ActiviteExistanteForm;
use Application\Form\FicheMetierType\ActiviteExistanteFormFactory;
use Application\Form\FicheMetierType\FormationBaseForm;
use Application\Form\FicheMetierType\FormationBaseFormFactory;
use Application\Form\FicheMetierType\FormationBaseHydrator;
use Application\Form\FicheMetierType\FormationComportementaleForm;
use Application\Form\FicheMetierType\FormationComportementaleFormFactory;
use Application\Form\FicheMetierType\FormationComportementaleHydrator;
use Application\Form\FicheMetierType\FormationOperationnelleForm;
use Application\Form\FicheMetierType\FormationOperationnelleFormFactory;
use Application\Form\FicheMetierType\FormationOperationnelleHydrator;
use Application\Form\FicheMetierType\LibelleForm;
use Application\Form\FicheMetierType\LibelleFormFactory;
use Application\Form\FicheMetierType\LibelleHydrator;
@@ -101,6 +110,10 @@ return [
                        'deplacer-activite',
                        'ajouter-nouvelle-activite',
                        'ajouter-activite-existante',

                        'modifier-connaissances',
                        'modifier-operationnelle',
                        'modifier-comportementale',
                    ],
                    'privileges' => [
                        FicheMetierPrivileges::AFFICHER,
@@ -308,6 +321,39 @@ return [
                        ],
                        'may_terminate' => true,
                    ],
                    'modifier-connaissances' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/modifier-connaissances/:id',
                            'defaults' => [
                                'controller' => FicheMetierTypeController::class,
                                'action'     => 'modifier-connaissances',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'modifier-operationnelle' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/modifier-operationnelle/:id',
                            'defaults' => [
                                'controller' => FicheMetierTypeController::class,
                                'action'     => 'modifier-operationnelle',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                    'modifier-comportementale' => [
                        'type'  => Segment::class,
                        'options' => [
                            'route'    => '/modifier-comportementale/:id',
                            'defaults' => [
                                'controller' => FicheMetierTypeController::class,
                                'action'     => 'modifier-comportementale',
                            ],
                        ],
                        'may_terminate' => true,
                    ],
                ],
            ],
        ],
@@ -338,9 +384,18 @@ return [
            AssocierMetierTypeForm::class => AssocierMetierTypeFormFactory::class,
            AssocierAgentForm::class => AssocierAgentFormFactory::class,
            AssocierPosteForm::class => AssocierPosteFormFactory::class,

            FormationBaseForm::class => FormationBaseFormFactory::class,
            FormationOperationnelleForm::class => FormationOperationnelleFormFactory::class,
            FormationComportementaleForm::class => FormationComportementaleFormFactory::class,
        ],
    ],
    'hydrators' => [
        'invokables' => [
            FormationBaseHydrator::class => FormationBaseHydrator::class,
            FormationOperationnelleHydrator::class => FormationOperationnelleHydrator::class,
            FormationComportementaleHydrator::class => FormationComportementaleHydrator::class,
        ],
        'factories' => [
            FicheMetierCreationHydrator::class => FicheMetierCreationHydratorFactory::class,
            LibelleHydrator::class => LibelleHydratorFactory::class,
+87 −0
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ namespace Application\Controller\FicheMetier;
use Application\Entity\Db\Activite;
use Application\Form\Activite\ActiviteForm;
use Application\Form\FicheMetierType\ActiviteExistanteForm;
use Application\Form\FicheMetierType\FormationBaseForm;
use Application\Form\FicheMetierType\FormationComportementaleForm;
use Application\Form\FicheMetierType\FormationOperationnelleForm;
use Application\Form\FicheMetierType\LibelleForm;
use Application\Form\FicheMetierType\MissionsPrincipalesForm;
use Application\Service\Activite\ActiviteServiceAwareTrait;
@@ -189,4 +192,88 @@ class FicheMetierTypeController extends AbstractActionController{

        $this->redirect()->toRoute('fiche-metier-type/afficher', ['id' => $couple->getFiche()->getId()], [], true);
    }

    public function modifierConnaissancesAction() {

        $ficheId = $this->params()->fromRoute('id');
        $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId);

        /** @var FormationBaseForm $form */
        $form = $this->getServiceLocator()->get('FormElementManager')->get(FormationBaseForm::class);
        $form->setAttribute('action', $this->url()->fromRoute('fiche-metier-type/modifier-connaissances', ['id' => $fiche->getId()], [], true));
        $form->bind($fiche);

        /** @var Request $request */
        $request = $this->getRequest();
        if ($request->isPost()) {
            $data = $request->getPost();
            $form->setData($data);
            if ($form->isValid()) {
                $this->getFicheMetierService()->updateFicheMetierType($fiche);
//                $this->redirect()->toRoute('fiche-metier-type/afficher', ['id' => $fiche->getId()]);
            }
        }

        return new ViewModel([
           'type' => 'connaissances',
            'title' => 'Modification des connaissances',
           'form' => $form,
        ]);
    }

    public function modifierOperationnelleAction() {

        $ficheId = $this->params()->fromRoute('id');
        $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId);

        /** @var FormationOperationnelleForm $form */
        $form = $this->getServiceLocator()->get('FormElementManager')->get(FormationOperationnelleForm::class);
        $form->setAttribute('action', $this->url()->fromRoute('fiche-metier-type/modifier-operationnelle', ['id' => $fiche->getId()], [], true));
        $form->bind($fiche);

        /** @var Request $request */
        $request = $this->getRequest();
        if ($request->isPost()) {
            $data = $request->getPost();
            $form->setData($data);
            if ($form->isValid()) {
                $this->getFicheMetierService()->updateFicheMetierType($fiche);
//                $this->redirect()->toRoute('fiche-metier-type/afficher', ['id' => $fiche->getId()]);
            }
        }

        return new ViewModel([
            'type' => 'operationnelle',
            'title' => 'Modification des compétences opérationnelles',
            'form' => $form,
        ]);
    }

    public function modifierComportementaleAction() {

        $ficheId = $this->params()->fromRoute('id');
        $fiche = $this->getFicheMetierService()->getFicheMetierType($ficheId);

        /** @var FormationComportementaleForm $form */
        $form = $this->getServiceLocator()->get('FormElementManager')->get(FormationComportementaleForm::class);
        $form->setAttribute('action', $this->url()->fromRoute('fiche-metier-type/modifier-comportementale', ['id' => $fiche->getId()], [], true));
        $form->bind($fiche);

        /** @var Request $request */
        $request = $this->getRequest();
        if ($request->isPost()) {
            $data = $request->getPost();
            $form->setData($data);
            if ($form->isValid()) {
                $this->getFicheMetierService()->updateFicheMetierType($fiche);
//                $this->redirect()->toRoute('fiche-metier-type/afficher', ['id' => $fiche->getId()]);
            }
        }

        return new ViewModel([
            'type' => 'comportementale',
            'title' => 'Modification des compétences comportementales',
            'form' => $form,
        ]);
    }
}
 No newline at end of file
+124 −0
Original line number Diff line number Diff line
@@ -13,6 +13,19 @@ class FicheMetierType {
    /** @var string */
    private $missionsPrincipales;

    /** @var string */
    private $connaissances;
    /** @var string */
    private $connaissancesFormation;
    /** @var string */
    private $competencesOperationnelles;
    /** @var string */
    private $competencesOperationnellesFormation;
    /** @var string */
    private $competencesComportementales;
    /** @var string */
    private $competencesComportementalesFormation;

    /**
     * @return int
     */
@@ -56,4 +69,115 @@ class FicheMetierType {
        $this->missionsPrincipales = $missionsPrincipales;
        return $this;
    }

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

    /**
     * @param string $connaissances
     * @return FicheMetierType
     */
    public function setConnaissances($connaissances)
    {
        $this->connaissances = $connaissances;
        return $this;
    }

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

    /**
     * @param string $connaissancesFormation
     * @return FicheMetierType
     */
    public function setConnaissancesFormation($connaissancesFormation)
    {
        $this->connaissancesFormation = $connaissancesFormation;
        return $this;
    }

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

    /**
     * @param string $competencesOperationnelles
     * @return FicheMetierType
     */
    public function setCompetencesOperationnelles($competencesOperationnelles)
    {
        $this->competencesOperationnelles = $competencesOperationnelles;
        return $this;
    }

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

    /**
     * @param string $competencesOperationnellesFormation
     * @return FicheMetierType
     */
    public function setCompetencesOperationnellesFormation($competencesOperationnellesFormation)
    {
        $this->competencesOperationnellesFormation = $competencesOperationnellesFormation;
        return $this;
    }

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

    /**
     * @param string $competencesComportementales
     * @return FicheMetierType
     */
    public function setCompetencesComportementales($competencesComportementales)
    {
        $this->competencesComportementales = $competencesComportementales;
        return $this;
    }

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

    /**
     * @param string $competencesComportementalesFormation
     * @return FicheMetierType
     */
    public function setCompetencesComportementalesFormation($competencesComportementalesFormation)
    {
        $this->competencesComportementalesFormation = $competencesComportementalesFormation;
        return $this;
    }



}
 No newline at end of file
+9 −0
Original line number Diff line number Diff line
@@ -12,6 +12,15 @@
        </many-to-one>
        <field name="missionsPrincipales"   type="string" length="2047"     column="missions_principales"               nullable="false"/>

        <field name="connaissances"             type="string" length="1024"     column="connaissances"                         nullable="true"/>
        <field name="connaissancesFormation"    type="string" length="1024"     column="connaissances_formation"               nullable="true"/>

        <field name="competencesOperationnelles"             type="string" length="1024"     column="competences_operationnelles"                         nullable="true"/>
        <field name="competencesOperationnellesFormation"    type="string" length="1024"     column="competences_operationnelles_formation"               nullable="true"/>

        <field name="competencesComportementales"             type="string" length="1024"     column="competences_comportementales"                         nullable="true"/>
        <field name="competencesComportementalesFormation"    type="string" length="1024"     column="competences_comportementales_formation"               nullable="true"/>




+0 −22
Original line number Diff line number Diff line
<?php

namespace Application\Form\Agent;

use Application\Service\Agent\AgentService;
use Zend\ServiceManager\ServiceLocatorInterface;

class MissionComplementaireHydratorFactory {

    public function __invoke(ServiceLocatorInterface $serviceLocator)
    {
        /** @var ServiceLocatorInterface $parentLocator */
        $parentLocator = $serviceLocator->getServiceLocator();
        /** @var AgentService $agentService */
        $agentService = $parentLocator->get(AgentService::class);

        $hydrator = new MissionComplementaireHydrator();
        $hydrator->setAgentService($agentService);

        return $hydrator;
    }
}
 No newline at end of file
Loading