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

Amélioration affichage

parent 64a55088
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -365,8 +365,6 @@ class FichePosteController extends AbstractActionController {
            } else {
                if ($form->isValid()) {
                    $this->getFichePosteService()->update($fiche);

                    //todo retirer des listes pour recrutement ...
                    $structure->removeFichePosteRecrutement($fiche);
                    $this->getStructureService()->update($structure);
                }
+5 −1
Original line number Diff line number Diff line
@@ -26,7 +26,11 @@ class FicheProfilController extends AbstractActionController {
        $structure = $this->getStructureService()->getRequestedStructure($this);
        $structures = $this->getStructureService()->getStructuresFilles($structure);
        $structures[] = $structure;
        $fichespostes = $this->getFichePosteService()->getFichesPostesByStructures($structures, true);

        $fichespostes = [];
        foreach ($structures as $structure) {
            foreach ($structure->getFichesPostesRecrutements() as $fichePoste) $fichespostes[$fichePoste->getId()] = $fichePoste;
        }

        $adresse = $this->getParametreService()->getParametreByCode('PROFIL_DE_RECRUTEMENT', 'ADRESSE_DEFAUT')->getValeur();

+2 −1
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ use Application\Form\AgentMissionSpecifique\AgentMissionSpecifiqueFormAwareTrait
use Application\Form\AjouterGestionnaire\AjouterGestionnaireForm;
use Application\Form\AjouterGestionnaire\AjouterGestionnaireFormAwareTrait;
use Application\Form\SelectionAgent\SelectionAgentFormAwareTrait;
use Application\Form\SpecificitePoste\SpecificitePosteFormAwareTrait;
use Application\Form\Structure\StructureFormAwareTrait;
use Application\Service\Agent\AgentServiceAwareTrait;
use Application\Service\FichePoste\FichePosteServiceAwareTrait;
@@ -109,6 +108,7 @@ class StructureController extends AbstractActionController {
                $fichesIncompletes[] = $fichePoste;
            }
        }
        $fichesRecrutements = $this->getStructureService()->getFichesPostesRecrutementsByStructures($structures);
        /** Récupération des agents et postes liés aux structures */
        $agents = $this->getAgentService()->getAgentsByStructures($structures);
        $agentsForces = array_map(function (StructureAgentForce $a) { return $a->getAgent(); }, $structure->getAgentsForces());
@@ -132,6 +132,7 @@ class StructureController extends AbstractActionController {
            'missions' => $missionsSpecifiques,
            'fichesCompletes' => $fichesCompletes,
            'fichesIncompletes' => $fichesIncompletes,
            'fichesRecrutements' => $fichesRecrutements,
            'profils' => $profils,
            'inscriptions' => $inscriptions,
            'agents' => $agents,
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class FicheProfilForm extends Form {
                    'class' => 'control-label',
                ],
                'empty_option' => "Sélectionner une fiche de poste ... ",
                'value_options' => ($this->structure AND $structures !== null)?$this->getFichePosteService()->getFichesPostesByStructuresAsOptions($structures, true):null,
                'value_options' => ($this->structure AND $structures !== null)?$this->getFichePosteService()->getFichesPostesRecrutementByStructuresAsOptions($structures, true):null,
            ],
            'attributes' => [
                'id'                => 'competence',
+18 −0
Original line number Diff line number Diff line
@@ -707,6 +707,24 @@ class FichePosteService {
    public function getFichesPostesByStructuresAsOptions(array $structures, bool $soustructure)
    {
        $fichespostes = $this->getFichesPostesByStructures($structures, $soustructure);
        $options = [];
        foreach ($fichespostes as $ficheposte) {
            $label = $ficheposte->getLibelleMetierPrincipal();
            if ($ficheposte->getAgent() !== null) $label .= " (".$ficheposte->getAgent()->getDenomination().")";
            $options[$ficheposte->getId()] = $label;
        }

        return $options;
    }

    /**
     * @param Structure[] $structures
     * @param bool $soustructure
     * @return array
     */
    public function getFichesPostesRecrutementByStructuresAsOptions(array $structures, bool $soustructure)
    {
        $fichespostes = [];
        foreach ($structures as $structure) {
            $fichespostes_tmp = $structure->getFichesPostesRecrutements();
            foreach ($fichespostes_tmp as $ficheposte) {
Loading