Commit 62545881 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Merge remote-tracking branch 'origin/master'

parents 6e565215 81b0c691
Loading
Loading
Loading
Loading
+1 −1
Changes for composer.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
        "datatables.net/datatables.net-bs5": "2.1.8",

        "unicaen/app"                      : "7.0.0",
        "unicaen/authentification"         : "6.3.2",
        "unicaen/authentification"         : "6.4.0",
        "unicaen/privilege"                : "6.2.1",
        "unicaen/utilisateur"              : "7.0.0",
        "unicaen/code"                     : "6.2.3",
+21 −18
Changes for composer.lock: 21 added lines, 18 removed lines.
Original line number Diff line number Diff line
@@ -4,20 +4,20 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "259c9b9a94554744da2976738a6ba6d3",
    "content-hash": "115c110416ff71cdaf751f8351d28c1d",
    "packages": [
        {
            "name": "apereo/phpcas",
            "version": "1.5.0",
            "version": "1.6.1",
            "source": {
                "type": "git",
                "url": "https://github.com/apereo/phpCAS.git",
                "reference": "d6f5797fb568726f34c8e48741776d81e4a2646b"
                "reference": "c129708154852656aabb13d8606cd5b12dbbabac"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/apereo/phpCAS/zipball/d6f5797fb568726f34c8e48741776d81e4a2646b",
                "reference": "d6f5797fb568726f34c8e48741776d81e4a2646b",
                "url": "https://api.github.com/repos/apereo/phpCAS/zipball/c129708154852656aabb13d8606cd5b12dbbabac",
                "reference": "c129708154852656aabb13d8606cd5b12dbbabac",
                "shasum": ""
            },
            "require": {
@@ -38,6 +38,9 @@
                }
            },
            "autoload": {
                "files": [
                    "source/CAS.php"
                ],
                "classmap": [
                    "source/"
                ]
@@ -70,9 +73,9 @@
            ],
            "support": {
                "issues": "https://github.com/apereo/phpCAS/issues",
                "source": "https://github.com/apereo/phpCAS/tree/1.5.0"
                "source": "https://github.com/apereo/phpCAS/tree/1.6.1"
            },
            "time": "2022-05-03T21:12:54+00:00"
            "time": "2023-02-19T19:52:35+00:00"
        },
        {
            "name": "beberlei/assert",
@@ -314,16 +317,16 @@
        },
        {
            "name": "datatables.net/datatables.net",
            "version": "2.2.0",
            "version": "2.2.1",
            "source": {
                "type": "git",
                "url": "https://github.com/DataTables/Dist-DataTables.git",
                "reference": "fb1c55771232d22b1b41244066bbbbbc559654b9"
                "reference": "33f552b5d2829e5768eaeed1e79714dd5c7be6ac"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/DataTables/Dist-DataTables/zipball/fb1c55771232d22b1b41244066bbbbbc559654b9",
                "reference": "fb1c55771232d22b1b41244066bbbbbc559654b9",
                "url": "https://api.github.com/repos/DataTables/Dist-DataTables/zipball/33f552b5d2829e5768eaeed1e79714dd5c7be6ac",
                "reference": "33f552b5d2829e5768eaeed1e79714dd5c7be6ac",
                "shasum": ""
            },
            "require": {
@@ -351,7 +354,7 @@
                "forum": "https://datatables.net/forums",
                "source": "https://github.com/DataTables/Dist-DataTables"
            },
            "time": "2025-01-06T16:00:23+00:00"
            "time": "2025-01-09T17:20:45+00:00"
        },
        {
            "name": "datatables.net/datatables.net-bs5",
@@ -7725,16 +7728,16 @@
        },
        {
            "name": "unicaen/authentification",
            "version": "6.3.2",
            "version": "6.4.0",
            "source": {
                "type": "git",
                "url": "https://git.unicaen.fr/lib/unicaen/authentification.git",
                "reference": "9b77c07ef766f72678a0209765a69653c47d3be9"
                "reference": "8e518af2342ff23efa344aa4c807e8f031045b25"
            },
            "require": {
                "apereo/phpcas": "1.5.*",
                "apereo/phpcas": "1.6.*",
                "ramsey/uuid": "^3.7",
                "unicaen/app": ">=6.2",
                "unicaen/app": "^6.0|^7.0",
                "unicaen/bjy-authorize": "^6.0",
                "unicaen/utilisateur": "^6.3|^7.0"
            },
@@ -7751,7 +7754,7 @@
                ]
            },
            "description": "Module d'authentification pour les applications Unicaen - Version Laminas",
            "time": "2025-01-09T13:14:37+00:00"
            "time": "2025-01-10T09:05:20+00:00"
        },
        {
            "name": "unicaen/bddadmin",
@@ -11178,6 +11181,6 @@
    "platform": {
        "php": ">=8.2"
    },
    "platform-dev": [],
    "platform-dev": {},
    "plugin-api-version": "2.6.0"
}
+6 −6
Changes for docker-compose.yml: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
version: '3'

# Ne pas oublier d'ajouter au fichier /etc/hosts :
# 172.21.0.10 ose-dev.pc-local
# 172.21.0.15 ose-test.pc-local
# 172.21.0.10 ose-dev.localhost.unicaen.fr
# 172.21.0.15 ose-test.localhost.unicaen.fr

services:
  ose-dev:
@@ -10,9 +10,9 @@ services:

    environment:
      APPLICATION_ENV: dev
      APPLICATION_HOSTNAME: ose-dev.pc-local
      APPLICATION_HOSTNAME: ose-dev.localhost.unicaen.fr
      XDEBUG_CONFIG: "remote_host=172.21.0.10"
      PHP_IDE_CONFIG: "serverName=ose-dev.pc-local"
      PHP_IDE_CONFIG: "serverName=ose-dev.localhost.unicaen.fr"
      IGNORE_MV_EXT_SERVICE: "true"

    build:
@@ -41,9 +41,9 @@ services:

    environment:
      APPLICATION_ENV: test
      APPLICATION_HOSTNAME: ose-test.pc-local
      APPLICATION_HOSTNAME: ose-test.localhost.unicaen.fr
      XDEBUG_CONFIG: "remote_host=172.21.0.15"
      PHP_IDE_CONFIG: "serverName=ose-test.pc-local"
      PHP_IDE_CONFIG: "serverName=ose-test.localhost.unicaen.fr"
      IGNORE_MV_EXT_SERVICE: "true"

    build:
+2 −1
Changes for module/Application/view/layout/layout.phtml: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -98,7 +98,8 @@ echo $this->doctype();
</nav>


<div id="contenu-principal" class="container intranavigator intranavigator-page">
    <div id="contenu-principal" class="container">
    <!--<div id="contenu-principal" class="container intranavigator intranavigator-page">-->
    <?php $pages->rewind();
    if ($menuSecondaire = $navigationHelper->menuSecondaire($pages)->render()): ?>
        <div class="row">
+191 −26
Changes for module/Formule/src/Model/FormuleDetailsExtractor.php: 191 added lines, 26 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Formule\Entity\FormuleServiceIntervenant;
use Formule\Model\Arrondisseur\Ligne;
use Formule\Model\Arrondisseur\Valeur;
use Formule\Service\FormuleServiceAwareTrait;
use Intervenant\Entity\Db\Intervenant;
use Laminas\Hydrator\ExtractionInterface;

class FormuleDetailsExtractor implements ExtractionInterface
@@ -16,6 +17,7 @@ class FormuleDetailsExtractor implements ExtractionInterface
    private FormuleServiceIntervenant $fres;
    private Formule                   $formule;
    private Ligne                     $trace;
    private Intervenant               $intervenantEntity;

    private array $iParams            = [];
    private array $vhParams           = [];
@@ -41,12 +43,15 @@ class FormuleDetailsExtractor implements ExtractionInterface
        }
        $this->trace = $this->fres->getArrondisseurTrace();

        $this->intervenantEntity = $this->getServiceFormule()->getEntityManager()->find(Intervenant::class, $this->fres->getIntervenantId());


        // Préparations
        $this->prepareTypesHetd();
        $this->prepareIntervenant();
        $this->prepareParams();
        $this->prepareServices();
        $this->prepareVolumesHoraires();


        // Forge du résultat et envoi
@@ -60,19 +65,6 @@ class FormuleDetailsExtractor implements ExtractionInterface
        ];

        return $result;


        /* Travail sur les volumes horaires */
        $vhs = $formuleServiceIntervenant->getVolumesHoraires();
        foreach ($vhs as $vh) {
            $serviceId                                                 = $vh->getService() ? 'e' . $vh->getService() : 'r' . $vh->getServiceReferentiel();
            $volumeHoraireId                                           = $vh->getVolumeHoraire() ? 'e' . $vh->getVolumeHoraire() : 'r' . $vh->getVolumeHoraireReferentiel();
            $services[$serviceId]['volumesHoraires'][$volumeHoraireId] = [
                'id' => $vh->getVolumeHoraire() ?? $vh->getVolumeHoraireReferentiel(),

            ];
        }

    }


@@ -107,6 +99,15 @@ class FormuleDetailsExtractor implements ExtractionInterface

    private function prepareIntervenant(): void
    {
        $structure = $this->intervenantEntity->getStructure();
        if ($structure) {
            $structure = [
                'id'      => $structure->getId(),
                'code'    => $structure->getCode(),
                'libelle' => $structure->getLibelleCourt(),
            ];
        }

        $this->intervenant = [
            'id'                         => $this->fres->getIntervenantId(),
            'anneeId'                    => $this->fres->getAnnee()->getId(),
@@ -117,7 +118,7 @@ class FormuleDetailsExtractor implements ExtractionInterface
                'code'    => $this->fres->getTypeIntervenant()->getCode(),
                'libelle' => $this->fres->getTypeIntervenant()->getLibelle(),
            ],
            // structure
            'structure'                  => $structure,
            'heuresServiceStatutaire'    => $this->fres->getHeuresServiceStatutaire(),
            'heuresServiceModifie'       => $this->fres->getHeuresServiceModifie(),
            'depassementServiceDuSansHC' => $this->fres->isDepassementServiceDuSansHC(),
@@ -160,9 +161,7 @@ class FormuleDetailsExtractor implements ExtractionInterface
            $this->services[$sname] = [
                'type'            => str_starts_with($sname, 'e') ? 'enseignement' : 'referentiel',
                'id'              => substr($sname, 1),
                'libelle'         => $sname,
                'volumesHoraires' => [],
                'heures'          => [],
                'hetd'            => [],
            ];
            foreach ($this->typesHetd as $typeHetd) {
@@ -173,29 +172,70 @@ class FormuleDetailsExtractor implements ExtractionInterface
        if (!empty($eIds)) {
            $sql   = "
            SELECT
              s.id,
              CASE WHEN ep.id IS NULL THEN
                etab.libelle || CASE WHEN s.description IS NULL THEN '' ELSE ' => ' || s.description END
              ELSE
                '[' || e.code || '] ' || e.libelle || ' => [' || ep.code || '] ' || ep.libelle 
              END libelle
              s.id              id,
              str.id            structure_id,
              str.libelle_court structure_libelle,
              etab.id           etablissement_id,
              etab.libelle      etablissement_libelle,
              s.description     description,
              e.id              etape_id,
              e.code            etape_code,
              e.libelle         etape_libelle,
              ep.id             ep_id,
              ep.code           ep_code,
              ep.libelle        ep_libelle,
              ep.taux_fi        taux_fi,
              ep.taux_fa        taux_fa,
              ep.taux_fc        taux_fc
            FROM
              service s
              JOIN etablissement etab ON etab.id = s.etablissement_id
              LEFT JOIN element_pedagogique ep ON ep.id = s.element_pedagogique_id
              LEFT JOIN etape e ON e.id = ep.etape_id
              LEFT JOIN structure str ON str.id = ep.structure_id
            WHERE
              s.id IN (" . implode(',', $eIds) . ")";
            $query = $this->getServiceFormule()->getEntityManager()->getConnection()->executeQuery($sql);
            while ($data = $query->fetchAssociative()) {
                $this->services['e' . $data['ID']]['libelle'] = $data['LIBELLE'];
                $sdata = [
                    'id'                 => (int)$data['ID'],
                    'structure'          => $data['STRUCTURE_ID'] ? [
                        'id'      => (int)$data['STRUCTURE_ID'],
                        'libelle' => $data['STRUCTURE_LIBELLE'],
                    ] : null,
                    'etablissement'      => [
                        'id'      => (int)$data['ETABLISSEMENT_ID'],
                        'libelle' => $data['ETABLISSEMENT_LIBELLE'],
                    ],
                    'description'        => $data['DESCRIPTION'],
                    'etape'              => $data['ETAPE_ID'] ? [
                        'id'      => (int)$data['ETAPE_ID'],
                        'code'    => $data['ETAPE_CODE'],
                        'libelle' => $data['ETAPE_LIBELLE'],
                    ] : null,
                    'elementPedagogique' => $data['EP_ID'] ? [
                        'id'      => (int)$data['EP_ID'],
                        'code'    => $data['EP_CODE'],
                        'libelle' => $data['EP_LIBELLE'],
                    ] : null,
                    'tauxFi'             => (float)$data['TAUX_FI'],
                    'tauxFa'             => (float)$data['TAUX_FI'],
                    'tauxFc'             => (float)$data['TAUX_FI'],
                ];

                $this->services['e' . $data['ID']] = array_merge($this->services['e' . $data['ID']], $sdata);
            }
        }
        if (!empty($rIds)) {
            $sql   = "
            SELECT
              sr.id,
              str.libelle_court || ' - ' || fr.libelle_court || CASE WHEN sr.commentaires IS NULL THEN '' ELSE ' ' || sr.commentaires END libelle
              sr.id             id,
              str.id            structure_id,
              str.libelle_court structure_libelle,
              fr.id             fonction_id,
              fr.code           fonction_code,
              fr.libelle_court  fonction_libelle,
              sr.commentaires   description
            FROM
              service_referentiel sr
              JOIN structure str ON str.id = sr.structure_id
@@ -204,7 +244,132 @@ class FormuleDetailsExtractor implements ExtractionInterface
              sr.id IN (" . implode(',', $rIds) . ")";
            $query = $this->getServiceFormule()->getEntityManager()->getConnection()->executeQuery($sql);
            while ($data = $query->fetchAssociative()) {
                $this->services['r' . $data['ID']]['libelle'] = $data['LIBELLE'];
                $sdata                             = [
                    'id'          => (int)$data['ID'],
                    'structure'   => [
                        'id'      => (int)$data['STRUCTURE_ID'],
                        'libelle' => $data['STRUCTURE_LIBELLE'],
                    ],
                    'fonction'    => [
                        'id'      => (int)$data['FONCTION_ID'],
                        'code'    => $data['FONCTION_CODE'],
                        'libelle' => $data['FONCTION_LIBELLE'],
                    ],
                    'description' => $data['DESCRIPTION'],
                ];
                $this->services['r' . $data['ID']] = array_merge($this->services['r' . $data['ID']], $sdata);
            }
        }
    }



    private function prepareVolumesHoraires(): void
    {
        $eIds = [];
        $rIds = [];
        foreach ($this->trace->getSubs() as $sname => $service) {
            foreach ($service->getSubs() as $vh) {
                if ($vh->getVolumeHoraire()->getVolumeHoraire()) {
                    $sId    = 'e' . $vh->getVolumeHoraire()->getService();
                    $vhId   = 'e' . $vh->getVolumeHoraire()->getVolumeHoraire();
                    $eIds[] = $vh->getVolumeHoraire()->getVolumeHoraire();
                } else {
                    $sId    = 'r' . $vh->getVolumeHoraire()->getServiceReferentiel();
                    $vhId   = 'r' . $vh->getVolumeHoraire()->getVolumeHoraireReferentiel();
                    $rIds[] = $vh->getVolumeHoraire()->getVolumeHoraireReferentiel();
                }
                $this->services[$sId]['volumesHoraires'][$vhId] = [
                    'type' => str_starts_with($vhId, 'e') ? 'enseignement' : 'referentiel',
                    'id'   => substr($vhId, 1),
                ];
                foreach ($this->typesHetd as $typeHetd) {
                    $valeur                                                            = $service->getValeur($typeHetd);
                    $this->services[$sId]['volumesHoraires'][$vhId]['hetd'][$typeHetd] = $this->valeurToJson($valeur);
                }
            }
        }
        if (!empty($eIds)) {
            $sql   = "
            SELECT
              vh.service_id     service_id,
              vh.id             id,
              vh.heures         heures,
              vh.horaire_debut  horaire_debut,
              vh.horaire_fin    horaire_fin,
              p.id              periode_id,
              p.code            periode_code,
              p.libelle_court   periode_libelle,
              ti.id             type_intervention_id,
              ti.code           type_intervention_id,
              ti.libelle        type_intervention_id,
              mnp.id            motif_non_paiement_id,
              mnp.code          motif_non_paiement_code,
              mnp.libelle_court motif_non_paiement_code
            FROM
              volume_horaire vh
              JOIN periode p ON p.id = vh.periode_id
              JOIN type_intervention ti ON ti.id = vh.type_intervention_id
              LEFT JOIN motif_non_paiement mnp ON mnp.id = vh.motif_non_paiement_id
            WHERE
              vh.id IN (" . implode(',', $eIds) . ")";
            $query = $this->getServiceFormule()->getEntityManager()->getConnection()->executeQuery($sql);
            while ($data = $query->fetchAssociative()) {
                $sdata                                          = [
                    'id'               => (int)$data['ID'],
                    'heures'           => (float)$data['HEURES'],
                    'horaireDebut'     => $data['HORAIRE_DEBUT'],
                    'horaireFin'       => $data['HORAIRE_FIN'],
                    'periode'          => [
                        'id'      => (int)$data['PERIODE_ID'],
                        'code'    => $data['PERIODE_CODE'],
                        'libelle' => $data['PERIODE_LIBELLE'],
                    ],
                    'typeIntervention' => [
                        'id'      => (int)$data['TYPE_INTERVENTION_ID'],
                        'code'    => $data['TYPE_INTERVENTION_CODE'],
                        'libelle' => $data['TYPE_INTERVENTION_LIBELLE'],
                    ],
                    'motifNonPaiement' => [
                        'id'      => (int)$data['MOTIF_NON_PAIEMENT_ID'],
                        'code'    => $data['MOTIF_NON_PAIEMENT_CODE'],
                        'libelle' => $data['MOTIF_NON_PAIEMENT_LIBELLE'],
                    ],
                ];
                $vhId                                           = 'e' . $data['ID'];
                $sId                                            = 'e' . $data['SERVICE_ID'];
                $this->services[$sId]['volumesHoraires'][$vhId] = array_merge($this->services[$sId]['volumesHoraires'][$vhId], $sdata);
            }
        }
        if (!empty($rIds)) {
            $sql   = "
            SELECT
              sr.id             service_referentiel_id,
              vhr.id            id,
              vhr.heures        heures,
              mnp.id            motif_non_paiement_id,
              mnp.code          motif_non_paiement_code,
              mnp.libelle_court motif_non_paiement_code
            FROM
              volume_horaire_ref vhr
              JOIN service_referentiel sr ON sr.id = vhr.service_referentiel_id
              LEFT JOIN motif_non_paiement mnp ON mnp.id = sr.motif_non_paiement_id
            WHERE
              vhr.id IN (" . implode(',', $rIds) . ")";
            $query = $this->getServiceFormule()->getEntityManager()->getConnection()->executeQuery($sql);
            while ($data = $query->fetchAssociative()) {
                $sdata                                          = [
                    'id'               => (int)$data['ID'],
                    'heures'           => (float)$data['HEURES'],
                    'motifNonPaiement' => [
                        'id'      => (int)$data['MOTIF_NON_PAIEMENT_ID'],
                        'code'    => $data['MOTIF_NON_PAIEMENT_CODE'],
                        'libelle' => $data['MOTIF_NON_PAIEMENT_LIBELLE'],
                    ],
                ];
                $vhId                                           = 'r' . $data['ID'];
                $sId                                            = 'r' . $data['SERVICE_REFERENTIEL_ID'];
                $this->services[$sId]['volumesHoraires'][$vhId] = array_merge($this->services[$sId]['volumesHoraires'][$vhId], $sdata);
            }
        }
    }