Loading module/Application/config/formule.config.php +11 −1 Changes for module/Application/config/formule.config.php: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -62,6 +62,16 @@ return [ ], 'may_terminate' => true, ], 'import' => [ 'type' => 'Literal', 'options' => [ 'route' => '/import', 'defaults' => [ 'action' => 'test-import', ], ], 'may_terminate' => true, ], 'supprimer' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -138,7 +148,7 @@ return [ PrivilegeController::class => [ [ 'controller' => 'Application\Controller\Formule', 'action' => ['test', 'test-saisir', 'test-enregistrement', 'test-supprimer', 'test-creer-from-reel'], 'action' => ['test', 'test-saisir', 'test-enregistrement', 'test-supprimer', 'test-creer-from-reel', 'test-import'], 'privileges' => [Privileges::FORMULE_TESTS], ], ], Loading module/Application/src/Controller/FormuleController.php +27 −1 Changes for module/Application/src/Controller/FormuleController.php: 27 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Entity\Db\Annee; use Application\Entity\Db\EtatVolumeHoraire; use Application\Entity\Db\Formule; use Application\Entity\Db\FormuleTestIntervenant; use Application\Model\FormuleCalcul; use Intervenant\Entity\Db\TypeIntervenant; use Application\Entity\Db\TypeVolumeHoraire; use Application\Service\Traits\ContextServiceAwareTrait; Loading @@ -31,7 +32,9 @@ class FormuleController extends AbstractController { $fti = $this->getServiceFormuleTestIntervenant()->getList(); return compact('fti'); $formules = $this->em()->createQuery("SELECT f FROM " . Formule::class . " f ORDER BY f.id")->execute(); return compact('fti', 'formules'); } Loading Loading @@ -146,6 +149,29 @@ class FormuleController extends AbstractController public function testImportAction() { if (!isset($_FILES['fichier'])) { throw new \Exception('Fichier tableau non transmis'); } $file = $_FILES['fichier']['tmp_name']; $filename = $_FILES['fichier']['name']; $formuleId = $this->params()->fromPost('formule'); $formule = $this->em()->find(Formule::class, $formuleId); $fc = new FormuleCalcul($file); $fti = $this->getServiceFormuleTestIntervenant()->creerDepuisTableur($fc, $formule, $filename); $url = $this->url()->fromRoute('formule-calcul/test/saisir', ['formuleTestIntervenant' => $fti->getId()]); return $this->redirect()->toUrl($url); } public function testCreerFromReelAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading module/Application/src/Entity/Db/FormuleTestIntervenant.php +1 −1 Changes for module/Application/src/Entity/Db/FormuleTestIntervenant.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ class FormuleTestIntervenant $structures[$this->getStructureCode()] = $this->getStructureCode(); } foreach ($this->getVolumeHoraireTest() as $vht) { if ($vht->getStructureCode()) { if ($vht->getStructureCode() && $vht->getStructureCode() != '__EXTERIEUR__') { $structures[$vht->getStructureCode()] = $vht->getStructureCode(); } } Loading module/Application/src/Model/FormuleCalcul.php +12 −4 Changes for module/Application/src/Model/FormuleCalcul.php: 12 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -154,10 +154,10 @@ class FormuleCalcul 'vh.structure_is_affectation' => 'bool', 'vh.structure_is_univ' => 'bool', 'vh.structure_is_exterieur' => 'bool', 'vh.service_statutaire' => 'float', 'vh.taux_fi' => 'float', 'vh.taux_fa' => 'float', 'vh.taux_fc' => 'float', 'vh.service_statutaire' => 'bool', 'vh.taux_fi' => 'pourc', 'vh.taux_fa' => 'pourc', 'vh.taux_fc' => 'pourc', 'vh.type_intervention_code' => 'string', 'vh.taux_service_du' => 'float', 'vh.taux_service_compl' => 'float', Loading Loading @@ -201,6 +201,10 @@ class FormuleCalcul case 'float'; $val = (float)$val; break; case 'pourc'; $val = trim(str_replace('%', '', $val)); $val = (float)$val / 100; break; } $data[$variable] = $val; } Loading @@ -227,6 +231,10 @@ class FormuleCalcul case 'float'; $val = (float)$val; break; case 'pourc'; $val = trim(str_replace('%', '', $val)); $val = (float)$val / 100; break; } $data['volumes-horaires'][$line][$variable] = $val; } Loading module/Application/src/Service/FormuleTestIntervenantService.php +174 −0 Changes for module/Application/src/Service/FormuleTestIntervenantService.php: 174 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,12 +3,16 @@ namespace Application\Service; use Application\Entity\Db\EtatVolumeHoraire; use Application\Entity\Db\Formule; use Application\Entity\Db\FormuleTestIntervenant; use Application\Entity\Db\FormuleTestStructure; use Application\Entity\Db\FormuleTestVolumeHoraire; use Application\Entity\Db\Intervenant; use Application\Entity\Db\TypeVolumeHoraire; use Application\Model\FormuleCalcul; use Application\Service\Traits\FormuleServiceAwareTrait; use Intervenant\Entity\Db\TypeIntervenant; use UnicaenApp\Util; /** Loading Loading @@ -39,6 +43,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } /** * Retourne l'alias d'entité courante * Loading @@ -50,6 +55,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } /** * @param FormuleTestIntervenant $formuleTestIntervenant * Loading @@ -70,6 +76,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } /** * @return FormuleTestIntervenantService * @throws \Doctrine\DBAL\DBALException Loading @@ -83,6 +90,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } public function creerDepuisIntervenant(Intervenant $intervenant, TypeVolumeHoraire $typeVolumeHoraire, EtatVolumeHoraire $etatVolumeHoraire): FormuleTestIntervenant { $conn = $this->getEntityManager()->getConnection(); Loading Loading @@ -223,6 +231,172 @@ class FormuleTestIntervenantService extends AbstractEntityService } public function creerDepuisTableur(FormuleCalcul $formuleCalcul, Formule $formule, string $filename): FormuleTestIntervenant { $em = $this->getEntityManager(); $data = $formuleCalcul->getData(); $vhs = $data['volumes-horaires']; $typeInterveant = $em->getRepository(TypeIntervenant::class)->findOneBy(['code' => $data['i.type_intervenant_code'] ?? TypeIntervenant::CODE_PERMANENT]); $typeVolumeHoraire = $em->getRepository(TypeVolumeHoraire::class)->findOneBy(['code' => $data['i.type_volume_horaire_code'] ?? TypeVolumeHoraire::CODE_REALISE]); $etatVolumeHoraire = $em->getRepository(EtatVolumeHoraire::class)->findOneBy(['code' => EtatVolumeHoraire::CODE_SAISI]); $fti = new FormuleTestIntervenant(); $fti->setLibelle($filename); $fti->setFormule($formule); $fti->setAnnee($this->getServiceContext()->getAnnee()); $fti->setTypeIntervenant($typeInterveant); $fti->setTypeVolumeHoraire($typeVolumeHoraire); $fti->setEtatVolumeHoraire($etatVolumeHoraire); $fti->setHeuresServiceStatutaire($data['i.heures_service_statutaire'] ?? 0); $fti->setHeuresServiceModifie($data['i.heures_service_modifie'] ?? 0); $fti->setDepassementServiceDuSansHC($data['i.depassement_service_du_sans_hc'] ?? false); $fti->setParam1($data['i.param_1'] ?? null); $fti->setParam2($data['i.param_2'] ?? null); $fti->setParam3($data['i.param_3'] ?? null); $fti->setParam4($data['i.param_4'] ?? null); $fti->setParam5($data['i.param_5'] ?? null); $fti->setStructureCode($data['i.structure_code'] ?? ''); /* Réduction des types d'intervention de la fiche à CP/TD/TP/AUTRE */ $typesIntervention = [ 'CM' => [1.5, 1.5], 'TD' => [1, 1], 'TP' => [1, 2 / 3], ]; $nbAutres = 0; foreach ($vhs as $vh) { if ($vh['vh.type_intervention_code']) { $typesIntervention[$vh['vh.type_intervention_code']] = [ $vh['vh.taux_service_du'], $vh['vh.taux_service_compl'], ]; } } foreach ($typesIntervention as $tic => $tit) { if (!in_array($tic, ['CM', 'TD', 'TP'])) { $nbAutres++; } else { $typesIntervention[$tic][2] = $tic; } } if ($nbAutres == 1) { foreach ($typesIntervention as $tic => $tit) { if (!in_array($tic, ['CM', 'TD', 'TP'])) { $typesIntervention[$tic][2] = 'AUTRE'; $nbAutres--; } } } else { if ($nbAutres > 1) { foreach ($typesIntervention as $tic => $tit) { if (!in_array($tic, ['CM', 'TD', 'TP'])) { if ($tit[0] == $typesIntervention['CM'][0] && $tit[1] == $typesIntervention['CM'][1]) { $typesIntervention[$tic][2] = 'CM'; $nbAutres--; } if ($tit[0] == $typesIntervention['TD'][0] && $tit[1] == $typesIntervention['TD'][1]) { $typesIntervention[$tic][2] = 'TD'; $nbAutres--; } if ($tit[0] == $typesIntervention['TP'][0] && $tit[1] == $typesIntervention['TP'][1]) { $typesIntervention[$tic][2] = 'TP'; $nbAutres--; } } } } } if ($nbAutres == 1) { foreach ($typesIntervention as $tic => $tit) { if (!isset($tit[2])) { $typesIntervention[$tic][2] = 'AUTRE'; } } } if ($nbAutres > 1) { throw new \Exception('La fiche de service de cet intervenant ne peut pas être transformée en test de formule : elle comporte de trop nombreux types d\'intervention différents des CM/TP/TP'); } /* On applique les taux au test de formule */ foreach ($typesIntervention as $tic => $tit) { switch ($tit[2]) { case 'CM': $fti->setTauxCmServiceDu($tit[0]); $fti->setTauxCmServiceCompl($tit[1]); break; case 'TP': $fti->setTauxTpServiceDu($tit[0]); $fti->setTauxTpServiceCompl($tit[1]); break; case 'AUTRE': $fti->setTauxAutreServiceDu($tit[0]); $fti->setTauxAutreServiceCompl($tit[1]); break; } } foreach ($vhs as $vh) { $isReferentiel = Util::reduce($vh['vh.type_intervention_code'] ?? '') === 'referentiel'; if ($vh['vh.structure_is_exterieur'] ?? false) { $structureCode = '__EXTERIEUR__'; } elseif ($vh['vh.structure_is_univ'] ?? false) { $structureCode = '__UNIV__'; } elseif ($vh['vh.structure_is_affectation'] ?? false) { $structureCode = $fti->getStructureCode(); } else { $structureCode = $vh['vh.structure_code'] ?? null; } $typeInterventionCode = $vh['vh.type_intervention_code'] ?? null; if ($isReferentiel) { $typeInterventionCode = null; } elseif (!in_array($typeInterventionCode, ['CM', 'TD', 'TP'])) { $typeInterventionCode = 'AUTRE'; } $ftvh = new FormuleTestVolumeHoraire(); $ftvh->setFormuleTestIntervenant($fti); $ftvh->setReferentiel($isReferentiel); $ftvh->setServiceStatutaire($vh['vh.service_statutaire'] ?? true); $ftvh->setTypeInterventionCode($typeInterventionCode); $ftvh->setStructureCode($structureCode); $ftvh->setTauxFi((float)$vh['vh.taux_fi'] ?? 1); $ftvh->setTauxFa((float)$vh['vh.taux_fa'] ?? 0); $ftvh->setTauxFc((float)$vh['vh.taux_fc'] ?? 0); $ftvh->setPonderationServiceDu($vh['vh.ponderation_service_du'] ?? 1); $ftvh->setPonderationServiceCompl($vh['vh.ponderation_service_compl'] ?? 1); $ftvh->setParam1($vh['vh.param_1'] ?? null); $ftvh->setParam2($vh['vh.param_2'] ?? null); $ftvh->setParam3($vh['vh.param_3'] ?? null); $ftvh->setParam4($vh['vh.param_4'] ?? null); $ftvh->setParam5($vh['vh.param_5'] ?? null); $ftvh->setHeures($vh['vh.heures']); $ftvh->setAServiceFi($vh['vh.service_fi'] ?? null); $ftvh->setAServiceFa($vh['vh.service_fa'] ?? null); $ftvh->setAServiceFc($vh['vh.service_fc'] ?? null); $ftvh->setAServiceReferentiel($vh['vh.service_referentiel'] ?? null); $ftvh->setAHeuresComplFi($vh['vh.heures_compl_fi'] ?? null); $ftvh->setAHeuresComplFa($vh['vh.heures_compl_fa'] ?? null); $ftvh->setAHeuresComplFc($vh['vh.heures_compl_fc'] ?? null); $ftvh->setAHeuresComplFcMajorees($vh['vh.heures_compl_fc_majorees'] ?? null); $ftvh->setAHeuresComplReferentiel($vh['vh.heures_compl_referentiel'] ?? null); $fti->addVolumeHoraireTest($ftvh); } $this->save($fti); return $fti; } /** * Sauvegarde une entité * Loading Loading
module/Application/config/formule.config.php +11 −1 Changes for module/Application/config/formule.config.php: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -62,6 +62,16 @@ return [ ], 'may_terminate' => true, ], 'import' => [ 'type' => 'Literal', 'options' => [ 'route' => '/import', 'defaults' => [ 'action' => 'test-import', ], ], 'may_terminate' => true, ], 'supprimer' => [ 'type' => 'Segment', 'options' => [ Loading Loading @@ -138,7 +148,7 @@ return [ PrivilegeController::class => [ [ 'controller' => 'Application\Controller\Formule', 'action' => ['test', 'test-saisir', 'test-enregistrement', 'test-supprimer', 'test-creer-from-reel'], 'action' => ['test', 'test-saisir', 'test-enregistrement', 'test-supprimer', 'test-creer-from-reel', 'test-import'], 'privileges' => [Privileges::FORMULE_TESTS], ], ], Loading
module/Application/src/Controller/FormuleController.php +27 −1 Changes for module/Application/src/Controller/FormuleController.php: 27 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Application\Entity\Db\Annee; use Application\Entity\Db\EtatVolumeHoraire; use Application\Entity\Db\Formule; use Application\Entity\Db\FormuleTestIntervenant; use Application\Model\FormuleCalcul; use Intervenant\Entity\Db\TypeIntervenant; use Application\Entity\Db\TypeVolumeHoraire; use Application\Service\Traits\ContextServiceAwareTrait; Loading @@ -31,7 +32,9 @@ class FormuleController extends AbstractController { $fti = $this->getServiceFormuleTestIntervenant()->getList(); return compact('fti'); $formules = $this->em()->createQuery("SELECT f FROM " . Formule::class . " f ORDER BY f.id")->execute(); return compact('fti', 'formules'); } Loading Loading @@ -146,6 +149,29 @@ class FormuleController extends AbstractController public function testImportAction() { if (!isset($_FILES['fichier'])) { throw new \Exception('Fichier tableau non transmis'); } $file = $_FILES['fichier']['tmp_name']; $filename = $_FILES['fichier']['name']; $formuleId = $this->params()->fromPost('formule'); $formule = $this->em()->find(Formule::class, $formuleId); $fc = new FormuleCalcul($file); $fti = $this->getServiceFormuleTestIntervenant()->creerDepuisTableur($fc, $formule, $filename); $url = $this->url()->fromRoute('formule-calcul/test/saisir', ['formuleTestIntervenant' => $fti->getId()]); return $this->redirect()->toUrl($url); } public function testCreerFromReelAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading
module/Application/src/Entity/Db/FormuleTestIntervenant.php +1 −1 Changes for module/Application/src/Entity/Db/FormuleTestIntervenant.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -190,7 +190,7 @@ class FormuleTestIntervenant $structures[$this->getStructureCode()] = $this->getStructureCode(); } foreach ($this->getVolumeHoraireTest() as $vht) { if ($vht->getStructureCode()) { if ($vht->getStructureCode() && $vht->getStructureCode() != '__EXTERIEUR__') { $structures[$vht->getStructureCode()] = $vht->getStructureCode(); } } Loading
module/Application/src/Model/FormuleCalcul.php +12 −4 Changes for module/Application/src/Model/FormuleCalcul.php: 12 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -154,10 +154,10 @@ class FormuleCalcul 'vh.structure_is_affectation' => 'bool', 'vh.structure_is_univ' => 'bool', 'vh.structure_is_exterieur' => 'bool', 'vh.service_statutaire' => 'float', 'vh.taux_fi' => 'float', 'vh.taux_fa' => 'float', 'vh.taux_fc' => 'float', 'vh.service_statutaire' => 'bool', 'vh.taux_fi' => 'pourc', 'vh.taux_fa' => 'pourc', 'vh.taux_fc' => 'pourc', 'vh.type_intervention_code' => 'string', 'vh.taux_service_du' => 'float', 'vh.taux_service_compl' => 'float', Loading Loading @@ -201,6 +201,10 @@ class FormuleCalcul case 'float'; $val = (float)$val; break; case 'pourc'; $val = trim(str_replace('%', '', $val)); $val = (float)$val / 100; break; } $data[$variable] = $val; } Loading @@ -227,6 +231,10 @@ class FormuleCalcul case 'float'; $val = (float)$val; break; case 'pourc'; $val = trim(str_replace('%', '', $val)); $val = (float)$val / 100; break; } $data['volumes-horaires'][$line][$variable] = $val; } Loading
module/Application/src/Service/FormuleTestIntervenantService.php +174 −0 Changes for module/Application/src/Service/FormuleTestIntervenantService.php: 174 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,12 +3,16 @@ namespace Application\Service; use Application\Entity\Db\EtatVolumeHoraire; use Application\Entity\Db\Formule; use Application\Entity\Db\FormuleTestIntervenant; use Application\Entity\Db\FormuleTestStructure; use Application\Entity\Db\FormuleTestVolumeHoraire; use Application\Entity\Db\Intervenant; use Application\Entity\Db\TypeVolumeHoraire; use Application\Model\FormuleCalcul; use Application\Service\Traits\FormuleServiceAwareTrait; use Intervenant\Entity\Db\TypeIntervenant; use UnicaenApp\Util; /** Loading Loading @@ -39,6 +43,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } /** * Retourne l'alias d'entité courante * Loading @@ -50,6 +55,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } /** * @param FormuleTestIntervenant $formuleTestIntervenant * Loading @@ -70,6 +76,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } /** * @return FormuleTestIntervenantService * @throws \Doctrine\DBAL\DBALException Loading @@ -83,6 +90,7 @@ class FormuleTestIntervenantService extends AbstractEntityService } public function creerDepuisIntervenant(Intervenant $intervenant, TypeVolumeHoraire $typeVolumeHoraire, EtatVolumeHoraire $etatVolumeHoraire): FormuleTestIntervenant { $conn = $this->getEntityManager()->getConnection(); Loading Loading @@ -223,6 +231,172 @@ class FormuleTestIntervenantService extends AbstractEntityService } public function creerDepuisTableur(FormuleCalcul $formuleCalcul, Formule $formule, string $filename): FormuleTestIntervenant { $em = $this->getEntityManager(); $data = $formuleCalcul->getData(); $vhs = $data['volumes-horaires']; $typeInterveant = $em->getRepository(TypeIntervenant::class)->findOneBy(['code' => $data['i.type_intervenant_code'] ?? TypeIntervenant::CODE_PERMANENT]); $typeVolumeHoraire = $em->getRepository(TypeVolumeHoraire::class)->findOneBy(['code' => $data['i.type_volume_horaire_code'] ?? TypeVolumeHoraire::CODE_REALISE]); $etatVolumeHoraire = $em->getRepository(EtatVolumeHoraire::class)->findOneBy(['code' => EtatVolumeHoraire::CODE_SAISI]); $fti = new FormuleTestIntervenant(); $fti->setLibelle($filename); $fti->setFormule($formule); $fti->setAnnee($this->getServiceContext()->getAnnee()); $fti->setTypeIntervenant($typeInterveant); $fti->setTypeVolumeHoraire($typeVolumeHoraire); $fti->setEtatVolumeHoraire($etatVolumeHoraire); $fti->setHeuresServiceStatutaire($data['i.heures_service_statutaire'] ?? 0); $fti->setHeuresServiceModifie($data['i.heures_service_modifie'] ?? 0); $fti->setDepassementServiceDuSansHC($data['i.depassement_service_du_sans_hc'] ?? false); $fti->setParam1($data['i.param_1'] ?? null); $fti->setParam2($data['i.param_2'] ?? null); $fti->setParam3($data['i.param_3'] ?? null); $fti->setParam4($data['i.param_4'] ?? null); $fti->setParam5($data['i.param_5'] ?? null); $fti->setStructureCode($data['i.structure_code'] ?? ''); /* Réduction des types d'intervention de la fiche à CP/TD/TP/AUTRE */ $typesIntervention = [ 'CM' => [1.5, 1.5], 'TD' => [1, 1], 'TP' => [1, 2 / 3], ]; $nbAutres = 0; foreach ($vhs as $vh) { if ($vh['vh.type_intervention_code']) { $typesIntervention[$vh['vh.type_intervention_code']] = [ $vh['vh.taux_service_du'], $vh['vh.taux_service_compl'], ]; } } foreach ($typesIntervention as $tic => $tit) { if (!in_array($tic, ['CM', 'TD', 'TP'])) { $nbAutres++; } else { $typesIntervention[$tic][2] = $tic; } } if ($nbAutres == 1) { foreach ($typesIntervention as $tic => $tit) { if (!in_array($tic, ['CM', 'TD', 'TP'])) { $typesIntervention[$tic][2] = 'AUTRE'; $nbAutres--; } } } else { if ($nbAutres > 1) { foreach ($typesIntervention as $tic => $tit) { if (!in_array($tic, ['CM', 'TD', 'TP'])) { if ($tit[0] == $typesIntervention['CM'][0] && $tit[1] == $typesIntervention['CM'][1]) { $typesIntervention[$tic][2] = 'CM'; $nbAutres--; } if ($tit[0] == $typesIntervention['TD'][0] && $tit[1] == $typesIntervention['TD'][1]) { $typesIntervention[$tic][2] = 'TD'; $nbAutres--; } if ($tit[0] == $typesIntervention['TP'][0] && $tit[1] == $typesIntervention['TP'][1]) { $typesIntervention[$tic][2] = 'TP'; $nbAutres--; } } } } } if ($nbAutres == 1) { foreach ($typesIntervention as $tic => $tit) { if (!isset($tit[2])) { $typesIntervention[$tic][2] = 'AUTRE'; } } } if ($nbAutres > 1) { throw new \Exception('La fiche de service de cet intervenant ne peut pas être transformée en test de formule : elle comporte de trop nombreux types d\'intervention différents des CM/TP/TP'); } /* On applique les taux au test de formule */ foreach ($typesIntervention as $tic => $tit) { switch ($tit[2]) { case 'CM': $fti->setTauxCmServiceDu($tit[0]); $fti->setTauxCmServiceCompl($tit[1]); break; case 'TP': $fti->setTauxTpServiceDu($tit[0]); $fti->setTauxTpServiceCompl($tit[1]); break; case 'AUTRE': $fti->setTauxAutreServiceDu($tit[0]); $fti->setTauxAutreServiceCompl($tit[1]); break; } } foreach ($vhs as $vh) { $isReferentiel = Util::reduce($vh['vh.type_intervention_code'] ?? '') === 'referentiel'; if ($vh['vh.structure_is_exterieur'] ?? false) { $structureCode = '__EXTERIEUR__'; } elseif ($vh['vh.structure_is_univ'] ?? false) { $structureCode = '__UNIV__'; } elseif ($vh['vh.structure_is_affectation'] ?? false) { $structureCode = $fti->getStructureCode(); } else { $structureCode = $vh['vh.structure_code'] ?? null; } $typeInterventionCode = $vh['vh.type_intervention_code'] ?? null; if ($isReferentiel) { $typeInterventionCode = null; } elseif (!in_array($typeInterventionCode, ['CM', 'TD', 'TP'])) { $typeInterventionCode = 'AUTRE'; } $ftvh = new FormuleTestVolumeHoraire(); $ftvh->setFormuleTestIntervenant($fti); $ftvh->setReferentiel($isReferentiel); $ftvh->setServiceStatutaire($vh['vh.service_statutaire'] ?? true); $ftvh->setTypeInterventionCode($typeInterventionCode); $ftvh->setStructureCode($structureCode); $ftvh->setTauxFi((float)$vh['vh.taux_fi'] ?? 1); $ftvh->setTauxFa((float)$vh['vh.taux_fa'] ?? 0); $ftvh->setTauxFc((float)$vh['vh.taux_fc'] ?? 0); $ftvh->setPonderationServiceDu($vh['vh.ponderation_service_du'] ?? 1); $ftvh->setPonderationServiceCompl($vh['vh.ponderation_service_compl'] ?? 1); $ftvh->setParam1($vh['vh.param_1'] ?? null); $ftvh->setParam2($vh['vh.param_2'] ?? null); $ftvh->setParam3($vh['vh.param_3'] ?? null); $ftvh->setParam4($vh['vh.param_4'] ?? null); $ftvh->setParam5($vh['vh.param_5'] ?? null); $ftvh->setHeures($vh['vh.heures']); $ftvh->setAServiceFi($vh['vh.service_fi'] ?? null); $ftvh->setAServiceFa($vh['vh.service_fa'] ?? null); $ftvh->setAServiceFc($vh['vh.service_fc'] ?? null); $ftvh->setAServiceReferentiel($vh['vh.service_referentiel'] ?? null); $ftvh->setAHeuresComplFi($vh['vh.heures_compl_fi'] ?? null); $ftvh->setAHeuresComplFa($vh['vh.heures_compl_fa'] ?? null); $ftvh->setAHeuresComplFc($vh['vh.heures_compl_fc'] ?? null); $ftvh->setAHeuresComplFcMajorees($vh['vh.heures_compl_fc_majorees'] ?? null); $ftvh->setAHeuresComplReferentiel($vh['vh.heures_compl_referentiel'] ?? null); $fti->addVolumeHoraireTest($ftvh); } $this->save($fti); return $fti; } /** * Sauvegarde une entité * Loading