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

Modification de la cartographie pour tenir compte du change sur les type de fonction

parent db22a24c
Loading
Loading
Loading
Loading
+30 −22
Changes for module/Application/src/Application/Controller/MetierController.php: 30 added lines, 22 removed lines.
Original line number Diff line number Diff line
@@ -572,30 +572,34 @@ class MetierController extends AbstractActionController {

        $results = [];
        foreach($metiers as $metier) {
            $fonction = null; //$metier->getDgetFonction();
            $domaine =  null; //$metier->getDomaine();
            $famille = ($domaine)?$domaine->getFamille():null;

            $references = [];
            foreach ($metier->getReferences() as $reference) {
                $references[] = $reference->getTitre();
            };

            $domaines = $metier->getDomaines();
            if (empty($domaines)) $domaines[] = null;

            foreach ($domaines as $domaine) {
                $famille = ($domaine) ? $domaine->getFamille() : null;
                $fonction =  ($domaine) ? $domaine->getTypeFonction() : null;

                $entry = [
                'famille'  => ($famille)?$famille->__toString():"---",
                'fonction' => ($fonction)?$fonction:"---",
                'domaine'  => ($domaine)?$domaine->__toString():"---",
                    'metier'     => ($metier) ? $metier->__toString() : "---",
                    'références' => implode("<br/>", $references),
                    'domaine'    => ($domaine) ? $domaine->__toString() : "---",
                    'fonction'   => ($fonction) ? $fonction : "---",
                    'famille'    => ($famille) ? $famille->__toString() : "---",
                    'nbFiche'    => count($metier->getFichesMetiers()),
                ];
                $results[] = $entry;
            }
        }

        usort($results, function($a, $b) {
            if ($a['famille'] !== $b['famille'])     return $a['famille'] < $b['famille'];
            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'];
            if ($a['metier'] !== $b['metier'])  return $a['metier'] > $b['metier'];
            return $a['domaine'] > $b['domaine'];
        });

        return new ViewModel([
@@ -608,33 +612,37 @@ class MetierController extends AbstractActionController {

        $results = [];
        foreach($metiers as $metier) {
            $fonction = null; //$metier->getFonction();
            $domaine = null; // ($metier)?$metier->getDomaine():null;
            $famille = ($domaine)?$domaine->getFamille():null;

            $references = [];
            foreach ($metier->getReferences() as $reference) {
                $references[] = $reference->getTitre();
            };

            $domaines = $metier->getDomaines();
            if (empty($domaines)) $domaines[] = null;

            foreach ($domaines as $domaine) {
                $famille = ($domaine) ? $domaine->getFamille() : null;
                $fonction =  ($domaine) ? $domaine->getTypeFonction() : null;

                $entry = [
                'famille'  => ($famille)?$famille->__toString():"---",
                'domaine'  => ($domaine)?$domaine->__toString():"---",
                'fonction' => ($fonction)?:"---",
                    'metier'     => ($metier) ? $metier->__toString() : "---",
                'références'   => implode("\n", $references),
                    'références' => implode("<br/>", $references),
                    'domaine'    => ($domaine) ? $domaine->__toString() : "---",
                    'fonction'   => ($fonction) ? $fonction : "---",
                    'famille'    => ($famille) ? $famille->__toString() : "---",
                    'nbFiche'    => count($metier->getFichesMetiers()),
                ];
                $results[] = $entry;
            }
        }

        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'];
            return $a['metier'] < $b['metier'];
            if ($a['metier'] !== $b['metier'])  return $a['metier'] > $b['metier'];
            return $a['domaine'] > $b['domaine'];
        });

        $headers = ['Famille', 'Domaine', 'Fonction', 'Metier', 'Références', '#Fiche'];
        $headers = [ 'Metier', 'Références', 'Domaine', 'Fonction', 'Famille', '#Fiche'];

        $today = new DateTime();

+6 −6
Changes for module/Application/view/application/metier/cartographie.phtml: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -40,11 +40,11 @@ $this->headTitle('Cartographie des métiers');
    <table class="table table-condensed">
        <thead>
            <tr>
                <th> Famille professionnelle </th>
                <th> Fonction </th>
                <th> Domaine </th>
                <th> Métier </th>
                <th> Références </th>
                <th> Domaine </th>
                <th> Fonction </th>
                <th> Famille professionnelle </th>
                <th> #Fiche métier</th>
<!--                <th> #Fiche poste </th>-->
            </tr>
@@ -54,11 +54,11 @@ $this->headTitle('Cartographie des métiers');


            <tr>
                <td> <?php echo $result['famille']; ?> </td>
                <td> <?php echo $result['fonction']; ?> </td>
                <td> <?php echo $result['domaine']; ?> </td>
                <td> <?php echo $result['metier']; ?> </td>
                <td> <?php echo $result['références']; ?> </td>
                <td> <?php echo $result['domaine']; ?> </td>
                <td> <?php echo $result['fonction']; ?> </td>
                <td> <?php echo $result['famille']; ?> </td>
                <td> <?php echo $result['nbFiche']; ?> </td>
            </tr>
            <?php endforeach; ?>