diff --git a/CHANGELOG.md b/CHANGELOG.md index 18a8128ba6d57f110651ad2b8d0c62d7f58eb366..a8cfe92cab3bdbd316b4f70380c8c20175ea11fd 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ author: Laurent Lécluse - DSI - Unicaen * Dans l'onglet Suppression de la fiche intervenant, l'arborescence s'affiche correctement. La suppression partielle ou complète d'un intervenant fonctionne donc de nouveau. * Un bug se produisait dans l'arborescence de suppression de fiche intervenant : s'il n'y avait qu'un seul service ou qu'un seul référentiel alors rien n'était affiché. C'est corrigé. +## Nouveautés + +* Possibilité de récupérer des attributs multivalués pour faire la correspondance d'identifiant entre le LDAP et le code utilisateur indiqué dans la fiche Intervenant + ## Notes de mise à jour * Attention : Le répertoire public/modeles de OSE était propre à l'Université de Caen et il a été supprimé. diff --git a/code/FormuleTestColleurRequeteServices.php b/code/FormuleTestColleurRequeteServices.php new file mode 100644 index 0000000000000000000000000000000000000000..16ff73c2ac99527afd7f2f235f3f66b327375694 --- /dev/null +++ b/code/FormuleTestColleurRequeteServices.php @@ -0,0 +1,226 @@ +<?php + +/** + * @var $this \Application\View\Renderer\PhpRenderer + * @var $controller \Zend\Mvc\Controller\AbstractController + * @var $viewName string + * @var $sl \Zend\ServiceManager\ServiceLocatorInterface + */ + +$data = "2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 -2 -2 0 0 0 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 2 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 2 0 0 0 2 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 4 0 0 0 4 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 40 0 0 0 40 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 20 0 0 0 20 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 -40 -40 0 0 0 0 0 0 +2018 Derivery Francois Université Le Havre Normandie Vacataire 0 0 0 0 Réalisé Validé 1 0 1 0 TD 1 1 1 0 0 1 1 -20 -20 0 0 0 0 0 0 +"; + +$debug = false; +//$debug = true; + +/* +Structures : +1 Droit +2 Histoire +3 IAE +4 IUT +5 Lettres +6 Santé +7 Sciences +8 SUAPS +9 Université +*/ +$data = explode("\n", $data); +?> +<style> + table { + font-size: 8pt; + } +</style> +<table class="table table-bordered table-condensed table-extra-condensed table-hover"> + <tr> + <th>Structure</th> + <th>ServiceStatutaire</th> + <th>Référentiel</th> + <th>Type d'intervention</th> + <th>Taux FI</th> + <th>Taux FA</th> + <th>Taux FC</th> + <th>Modulateur HC</th> + <th>Heures</th> + <th>P1</th> + <th>P2</th> + <th>P3</th> + <th>P4</th> + <th>P5</th> + <th>SFi</th> + <th>SFa</th> + <th>SFc</th> + <th>SRef</th> + <th>HCFi</th> + <th>HCFa</th> + <th>HCFc</th> + <th>HCFcM</th> + <th>HCRef</th> + <th>Tableau</th> + </tr> + <?php + + /** @var \Doctrine\ORM\EntityManager $bdd */ + $bdd = $sl->get(\Application\Constants::BDD); + /** @var \Application\Service\FormuleTestIntervenantService $ftiService */ + $ftiService = $sl->get(\Application\Service\FormuleTestIntervenantService::class); + + $fti = null; + foreach ($data as $l) { + if (trim($l)) { + $c = explode("\t", trim($l)); + + if (!$fti) { + $fti = new \Application\Entity\Db\FormuleTestIntervenant(); + $fi = [ + 'annee' => $c[0], + 'nom' => $c[1], + 'prenom' => $c[2], + 'formule' => $c[3], + 'typeIntervenant' => $c[4], + 'heuresServiceStatutaire' => stringToFloat($c[5]), + 'depassementServiceDuSansHC' => stringToFloat($c[6]), + 'heuresServiceModifie' => stringToFloat($c[7]), + 'heuresDecharge' => stringToFloat($c[8]), + 'typeVolumeHoraire' => $c[9], + 'etatVolumeHoraire' => $c[10], + ]; + if ($debug) { + var_dump($fi); + } else { + $fti->setLibelle($fi['prenom'] . ' ' . $fi['nom']); + $fti->setFormule($bdd->getRepository(\Application\Entity\Db\Formule::class)->findOneBy(['libelle' => $fi['formule']])); + $fti->setAnnee($bdd->getRepository(\Application\Entity\Db\Annee::class)->find($fi['annee'])); + $fti->setTypeIntervenant($bdd->getRepository(\Application\Entity\Db\TypeIntervenant::class)->findOneBy(['libelle' => $fi['typeIntervenant']])); + $fti->setStructureTest($bdd->getRepository(\Application\Entity\Db\FormuleTestStructure::class)->find(1)); + $fti->setTypeVolumeHoraire($bdd->getRepository(\Application\Entity\Db\TypeVolumeHoraire::class)->findOneBy(['libelle' => $fi['typeVolumeHoraire']])); + $fti->setEtatVolumeHoraire($bdd->getRepository(\Application\Entity\Db\EtatVolumeHoraire::class)->findOneBy(['libelle' => $fi['etatVolumeHoraire']])); + $fti->setHeuresDecharge($fi['heuresDecharge']); + $fti->setHeuresServiceStatutaire($fi['heuresServiceStatutaire']); + $fti->setHeuresServiceModifie($fi['heuresServiceModifie']); + $fti->setDepassementServiceDuSansHC($fi['depassementServiceDuSansHC'] == '1'); + $bdd->persist($fti); + $bdd->flush($fti); + } + } + + $composante = $c[11] == '1' ? 1 : ($c[12] == '1' ? 9 : 2); + $serviceStatutaire = $c[13] == '1'; + $typeIntervention = $c[15]; + $referentiel = $c[14] == '1'; + $tauxFi = stringToFloat($c[18]); + $tauxFa = stringToFloat($c[19]); + $tauxFc = stringToFloat($c[20]); + $modulateurHC = stringToFloat($c[22]); + $heures = stringToFloat($c[23]); + $param1 = $c[24]; + $param2 = $c[25]; + $param3 = $c[26]; + $param4 = $c[27]; + $param5 = $c[28]; + $serviceFi = stringToFloat($c[29]); + $serviceFa = stringToFloat($c[30]); + $serviceFc = stringToFloat($c[31]); + $serviceReferentiel = stringToFloat($c[32]); + $heuresComplFi = stringToFloat($c[33]); + $heuresComplFa = stringToFloat($c[34]); + $heuresComplFc = stringToFloat($c[35]); + $heuresComplFcMaj = stringToFloat($c[36]); + $heuresComplReferentiel = isset($c[37]) ? stringToFloat($c[37]) : null; + + // Traitement et affichage + $composante = $sl->get(\Application\Constants::BDD)->getRepository(\Application\Entity\Db\FormuleTestStructure::class)->find($composante); + if ($debug) { + $c = '<pre>' . var_export($c, true) . '</pre>'; + } else { + $c = ''; + $vh = new \Application\Entity\Db\FormuleTestVolumeHoraire(); + $vh->setIntervenantTest($fti); + $vh->setStructureTest($composante); + $vh->setServiceStatutaire($serviceStatutaire); + $vh->setReferentiel($referentiel); + $vh->setTypeInterventionCode($typeIntervention); + $vh->setTauxFi($tauxFi); + $vh->setTauxFa($tauxFa); + $vh->setTauxFc($tauxFc); + $vh->setPonderationServiceCompl($modulateurHC); + $vh->setHeures($heures); + $vh->setAServiceFi($serviceFi); + $vh->setAServiceFa($serviceFa); + $vh->setAServiceFc($serviceFc); + $vh->setAServiceReferentiel($serviceReferentiel); + $vh->setAHeuresComplFi($heuresComplFi); + $vh->setAHeuresComplFa($heuresComplFa); + $vh->setAHeuresComplFc($heuresComplFc); + $vh->setAHeuresComplFcMajorees($heuresComplFcMaj); + $vh->setAHeuresComplReferentiel($heuresComplReferentiel); + $bdd->persist($vh); + $bdd->flush($vh); + } + + ?> + <tr> + <td><?= $composante ?></td> + <td><?= $serviceStatutaire ? 'Oui' : 'Non' ?></td> + <td><?= $referentiel ? 'Oui' : 'Non' ?></td> + <td><?= $typeIntervention ?></td> + <td><?= $tauxFi ?></td> + <td><?= $tauxFa ?></td> + <td><?= $tauxFc ?></td> + <td><?= $modulateurHC ?></td> + <td><?= $heures ?></td> + <td><?= $param1 ?></td> + <td><?= $param2 ?></td> + <td><?= $param3 ?></td> + <td><?= $param4 ?></td> + <td><?= $param5 ?></td> + <td><?= $serviceFi ?></td> + <td><?= $serviceFa ?></td> + <td><?= $serviceFc ?></td> + <td><?= $serviceReferentiel ?></td> + <td><?= $heuresComplFi ?></td> + <td><?= $heuresComplFa ?></td> + <td><?= $heuresComplFc ?></td> + <td><?= $heuresComplFcMaj ?></td> + <td><?= $heuresComplReferentiel ?></td> + + <td><?= $c ?></td> + </tr> + + <?php + } + } + ?> +</table> diff --git a/config.local.php.default b/config.local.php.default index 93613195d721aba0f2e2c9d951d3ae83dc9b26bf..fb221827593fc37b31d7790a95e1449a2c18b7a7 100755 --- a/config.local.php.default +++ b/config.local.php.default @@ -238,4 +238,4 @@ return [ 'debug' => false, ], -]; +]; \ No newline at end of file diff --git a/module/Application/src/Application/Connecteur/Factory/LdapConnecteurFactory.php b/module/Application/src/Application/Connecteur/Factory/LdapConnecteurFactory.php index 75584b5dc1b4bdbf1d79d89811696bda68cc03f9..64a6e894af3802b535d3a8ed6250f014c20260d5 100755 --- a/module/Application/src/Application/Connecteur/Factory/LdapConnecteurFactory.php +++ b/module/Application/src/Application/Connecteur/Factory/LdapConnecteurFactory.php @@ -63,4 +63,4 @@ class LdapConnecteurFactory return $service; } -} +} \ No newline at end of file diff --git a/module/Application/src/Application/Connecteur/LdapConnecteur.php b/module/Application/src/Application/Connecteur/LdapConnecteur.php index 6b8858f826c5883af59d321fe9198c90358829a8..89f4b54824b62cefe66c35f09a44e06d548f71f0 100755 --- a/module/Application/src/Application/Connecteur/LdapConnecteur.php +++ b/module/Application/src/Application/Connecteur/LdapConnecteur.php @@ -214,16 +214,16 @@ class LdapConnecteur extends AbstractService if ($ldapUser){ // si utilisateur_code_filtre présent : regexp pour recupérer une valeur précise d'un attribut multivalué, // par exemple l'attribut étiqueté supannRefId - $utilisateur_code_filtre = $this->getUtilisateurCodeFiltre(); + $utilisateurCodeFiltre = $this->getUtilisateurCodeFiltre(); - if ($utilisateur_code_filtre != '') { - $utilisateur_courant_code = $this->getPeopleAttribute($ldapUser,$this->getUtilisateurCode()); + if ($utilisateurCodeFiltre != '') { + $utilisateurCourantCode = $this->getPeopleAttribute($ldapUser,$this->getUtilisateurCode()); // si attribut multivalué, valeurs séparées par de virgules -> transformation en array - $utilisateur_courant_code_arr = explode(',', $utilisateur_courant_code); + $utilisateurCourantCodeArr = explode(',', $utilisateurCourantCode); - foreach ($utilisateur_courant_code_arr as $utilisateur_courant_code_elem) { - if (preg_match($utilisateur_code_filtre, $utilisateur_courant_code_elem, $matches)) { + foreach ($utilisateurCourantCodeArr as $utilisateurCourantCodeElem) { + if (preg_match($utilisateurCodeFiltre, $utilisateurCourantCodeElem, $matches)) { return $matches[1]; } }