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

Ajout de la nouvelle catégories dans spécificité de postes

parent 32858d5d
Loading
Loading
Loading
Loading
+1
Changes for module/Application/src/Application/Entity/Db/Mapping/Application.Entity.Db.SpecificitePoste.dcm.xml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
        <field name="relationsExternes" type="string" length="2048"     column="relations_externes"     nullable="true"/>
        <field name="contraintes"       type="string" length="2048"     column="contraintes"            nullable="true"/>
        <field name="moyens"            type="string" length="2048"     column="moyens"                 nullable="true"/>
        <field name="formations"        type="string" length="2048"     column="formations"             nullable="true"/>


    </entity>
+22
Changes for module/Application/src/Application/Entity/Db/SpecificitePoste.php: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ class SpecificitePoste {
    private $contraintes;
    /** @var string */
    private $moyens;
    /** @var string */
    private $formations;

    /**
     * @return int
@@ -156,6 +158,25 @@ class SpecificitePoste {
        return $this;
    }

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

    /**
     * @param string $formations
     * @return SpecificitePoste
     */
    public function setFormations($formations)
    {
        $this->formations = $formations;
        return $this;
    }


    /** @return SpecificitePoste */
    public function clone_it()
    {
@@ -166,6 +187,7 @@ class SpecificitePoste {
        $result->setRelationsExternes($this->getRelationsExternes());
        $result->setContraintes($this->getContraintes());
        $result->setMoyens($this->getMoyens());
        $result->setFormations($this->getFormations());
        return $result;
    }

+15 −7
Changes for module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelForm.php: 15 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Application\Form\EntretienProfessionnel;

use Application\Service\EntretienProfessionnel\EntretienProfessionnelCampagneServiceAwareTrait;
use DateTime;
use UnicaenApp\Form\Element\Date;
use UnicaenApp\Form\Element\SearchAndSelect;
@@ -11,6 +12,7 @@ use Zend\Form\Form;
use Zend\InputFilter\Factory;

class EntretienProfessionnelForm extends Form {
    use EntretienProfessionnelCampagneServiceAwareTrait;

    private $urlAgent;
    private $urlResponsable;
@@ -66,17 +68,23 @@ class EntretienProfessionnelForm extends Form {
                'placeholder' => "Nom de l'agent ...",
            ]);
        $this->add($agent);
        //Annee       (initialisée à l'annee scolaire en cours)
        //CAMPAGNE (SELECT)
        $this->add([
            'name' => 'campagne',
            'type' => Select::class,
            'name' => 'annee',
            'options' => [
                'label' => "Année scolaire de l'entretien* :",
                'value_options' => $anneeOpt,
                'label' => 'Campagne * : ',
                'label_attributes' => [
                    'class' => 'control-label',
                ],
            'attributes' => [
                'id' => 'annee',
                'empty_option' => "Sélectionner une campagne ... ",
                'value_options' => $this->getEntretienProfessionnelCampagneService()->getEntretiensProfessionnelsCampagnesAsOptions(),
            ],
            'attributes' => [
                'id'                => 'campagne',
                'class'             => 'bootstrap-selectpicker show-tick',
                'data-live-search'  => 'true',
            ]
        ]);

        //Date        (initialisée à la date du jour)
@@ -110,7 +118,7 @@ class EntretienProfessionnelForm extends Form {
        $this->setInputFilter((new Factory())->createInputFilter([
            'responsable'       => [ 'required' => true,  ],
            'agent'             => [ 'required' => true,  ],
            'annee'             => [ 'required' => true,  ],
            'campagne'          => [ 'required' => true,  ],
            'date_entretien'    => [ 'required' => true,  ],
        ]));
    }
+6 −10
Changes for module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelFormFactory.php: 6 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -3,10 +3,9 @@
namespace Application\Form\EntretienProfessionnel;

use Application\Controller\AgentController;
use Application\Service\Agent\AgentService;
use Application\Service\EntretienProfessionnel\EntretienProfessionnelCampagneService;
use Interop\Container\ContainerInterface;
use UnicaenUtilisateur\Service\Role\RoleService;
use UnicaenUtilisateur\Service\User\UserService;
use Zend\View\Helper\Url;
use Zend\View\HelperPluginManager;

class EntretienProfessionnelFormFactory {
@@ -14,13 +13,9 @@ class EntretienProfessionnelFormFactory {
    public function __invoke(ContainerInterface $container)
    {
        /**
         * @var AgentService $agentService
         * @var RoleService $roleService
         * @var UserService $userService
         * @var EntretienProfessionnelCampagneService $campagneService
         */
        $agentService = $container->get(AgentService::class);
        $roleService = $container->get(RoleService::class);
        $userService = $container->get(UserService::class);
        $campagneService = $container->get(EntretienProfessionnelCampagneService::class);

        /**
         * @var EntretienProfessionnelHydrator $hydrator
@@ -29,7 +24,7 @@ class EntretienProfessionnelFormFactory {

        /** @var HelperPluginManager $pluginManager */
        $pluginManager = $container->get('ViewHelperManager');
        /** @var \Zend\View\Helper\Url $urlManager */
        /** @var Url $urlManager */
        $urlManager = $pluginManager->get('Url');
        /** @see AgentController::rechercherAction() */
        $urlAgent       =  $urlManager->__invoke('agent/rechercher', [], [], true);
@@ -40,6 +35,7 @@ class EntretienProfessionnelFormFactory {
         * @var EntretienProfessionnelForm $form
         */
        $form = new EntretienProfessionnelForm();
        $form->setEntretienProfessionnelCampagneService($campagneService);
        $form->setUrlAgent($urlAgent);
        $form->setUrlResponsable($urlReponsable);
        $form->setHydrator($hydrator);
+5
Changes for module/Application/src/Application/Form/EntretienProfessionnel/EntretienProfessionnelHydrator.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Application\Form\EntretienProfessionnel;

use Application\Entity\Db\EntretienProfessionnel;
use Application\Service\Agent\AgentServiceAwareTrait;
use Application\Service\EntretienProfessionnel\EntretienProfessionnelCampagneServiceAwareTrait;
use UnicaenUtilisateur\Service\User\UserServiceAwareTrait;
use DateTime;
use Zend\Hydrator\HydratorInterface;
@@ -11,6 +12,7 @@ use Zend\Hydrator\HydratorInterface;
class EntretienProfessionnelHydrator implements HydratorInterface {
    use AgentServiceAwareTrait;
    use UserServiceAwareTrait;
    use EntretienProfessionnelCampagneServiceAwareTrait;

    /**
     * @param EntretienProfessionnel $object
@@ -22,6 +24,7 @@ class EntretienProfessionnelHydrator implements HydratorInterface {
            'responsable' => $object->getResponsable(),
            'agent' => ($object->getAgent())?['id' => $object->getAgent()->getId(), 'label' => $object->getAgent()->getDenomination()]:null,
            'date_entretien' => $object->getDateEntretien(),
            'campagne' => ($object->getCampagne())?$object->getCampagne()->getId():null,
        ];
        return $data;
    }
@@ -36,10 +39,12 @@ class EntretienProfessionnelHydrator implements HydratorInterface {
        $reponsable = $this->getUserService()->getUtilisateur($data['responsable']['id']);
        $agent      = $this->getAgentService()->getAgent($data['agent']['id']);
        $date       = DateTime::createFromFormat('d/m/Y', $data['date_entretien']);
        $campagne   = $this->getEntretienProfessionnelCampagneService()->getEntretienProfessionnelCampagne($data['campagne']);

        $object->setResponsable($reponsable);
        $object->setAgent($agent);
        $object->setDateEntretien($date);
        $object->setCampagne($campagne);

        return $object;
    }
Loading