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

Changement des fonctions et des liens par domaine

parent c13bcbca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ return [
            'activite' => [
                'type'  => Literal::class,
                'options' => [
                    'route'    => '/activite',
                    'route'    => '/mission-principale',
                    'defaults' => [
                        'controller' => ActiviteController::class,
                        'action'     => 'index',
+9 −9
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ return [
                            ],
                            [
                                'order' => 4,
                                'label' => 'Familles, domaines, fonctions et métiers',
                                'label' => 'Familles, domaines et métiers',
                                'route' => 'ressource-rh/index-metier-famille-domaine',
                                'resource' =>  RessourceRhPrivileges::getResourceId(RessourceRhPrivileges::AFFICHER) ,
                                'dropdown-header' => true,
@@ -224,14 +224,14 @@ return [
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],
                            [
                                'order' => 4,
                                'label' => 'Les formations',
                                'route' => 'application',
                                'privileges' => ApplicationPrivileges::AFFICHER,
                                'dropdown-header' => true,
                                'icon' => 'fas fa-angle-right'
                            ],
//                            [
//                                'order' => 4,
//                                'label' => 'Les formations',
//                                'route' => 'application',
//                                'privileges' => ApplicationPrivileges::AFFICHER,
//                                'dropdown-header' => true,
//                                'icon' => 'fas fa-angle-right'
//                            ],
                            [
                                'order' => 7,
                                'label' => 'Les fiches de poste',
+1 −2
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ return [
        'factories' => [
            MetierForm::class => MetierFormFactory::class,
            FamilleProfessionnelleForm::class => FamilleProfessionnelleFormFactory::class,
            FonctionForm::class => FonctionFormFactory::class,
//            FonctionForm::class => FonctionFormFactory::class,
            DomaineForm::class => DomaineFormFactory::class,
            MissionSpecifiqueForm::class => MissionSpecifiqueFormFactory::class,
        ],
@@ -445,7 +445,6 @@ return [
    'hydrators' => [
        'invokables' => [
            FamilleProfessionnelleHydrator::class => FamilleProfessionnelleHydrator::class,
//            MissionSpecifiqueHydrator::class => MissionSpecifiqueHydrator::class,
        ],
        'factories' => [
            MetierHydrator::class => MetierHydratorFactory::class,
+3 −3
Original line number Diff line number Diff line
@@ -424,12 +424,12 @@ class RessourceRhController extends AbstractActionController {
        $results = [];
        foreach($metiers as $metier) {
            $fonction = $metier->getFonction();
            $domaine = ($fonction)?$fonction->getDomaine():null;
            $domaine =  $metier->getDomaine();
            $famille = ($domaine)?$domaine->getFamille():null;
            $entry = [
                'famille'  => ($famille)?$famille->__toString():"---",
                'fonction' => ($fonction)?$fonction:"---",
                'domaine'  => ($domaine)?$domaine->__toString():"---",
                'fonction' => ($fonction)?$fonction->__toString():"---",
                'metier'   => ($metier)?$metier->__toString():"---",
                'nbFiche'   => count($metier->getFichesMetiers()),
            ];
@@ -438,8 +438,8 @@ class RessourceRhController extends AbstractActionController {

        usort($results, function($a, $b) {
            if ($a['famille'] !== $b['famille'])     return $a['famille'] < $b['famille'];
            if ($a['domaine'] !== $b['domaine'])     return $a['domaine'] < $b['domaine'];
            if ($a['fonction'] !== $b['fonction'])   return $a['fonction'] < $b['fonction'];
            if ($a['domaine'] !== $b['domaine'])     return $a['domaine'] < $b['domaine'];
            return $a['metier'] < $b['metier'];
        });

+11 −11
Original line number Diff line number Diff line
@@ -14,11 +14,11 @@ class Domaine {
    /** @var FamilleProfessionnelle */
    private $famille;
    /** @var ArrayCollection */
    private $fonctions;
    private $metiers;

    public function __construct()
    {
        $this->fonctions = new ArrayCollection();
        $this->metiers = new ArrayCollection();
    }

    /**
@@ -66,30 +66,30 @@ class Domaine {
    }

    /**
     * @return Fonction[]
     * @return Metier[]
     */
    public function getFonctions()
    public function getMetiers()
    {
        return $this->fonctions->toArray();
        return $this->metiers->toArray();
    }

    /**
     * @param Fonction $fonction
     * @param Metier $metier
     * @return Domaine
     */
    public function addFonction($fonction)
    public function addMetier($metier)
    {
        $this->fonctions->add($fonction);
        $this->metiers->add($metier);
        return $this;
    }

    /**
     * @param Fonction $fonction
     * @param Metier $metier
     * @return Domaine
     */
    public function removeFonction($fonction)
    public function removeMetier($metier)
    {
        $this->fonctions->removeElement($fonction);
        $this->metiers->removeElement($metier);
        return $this;
    }

Loading