Loading code/formules/testArrondisseurFromService.php +52 −8 Changes for code/formules/testArrondisseurFromService.php: 52 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,56 @@ * @var $container \Psr\Container\ContainerInterface */ use Formule\Entity\FormuleIntervenant; $bdd = $container->get(\Unicaen\BddAdmin\Bdd::class); $tvhs = $bdd->select('SELECT id "id", libelle "libelle" FROM type_volume_horaire'); $typesVolumesHoraires = []; foreach ($tvhs as $tvh) { $typesVolumesHoraires[$tvh['id']] = $tvh['libelle']; } $evhs = $bdd->select('SELECT id "id", libelle "libelle" FROM etat_volume_horaire'); $etatsVolumesHoraires = []; foreach ($evhs as $evh) { $etatsVolumesHoraires[$evh['id']] = $evh['libelle']; } // récup intervenantId $pdata = [ 'intervenantId' => [ 'type' => 'text', 'label' => 'ID de l\'intervenant', ], 'typeVolumeHoraireId' => [ 'type' => 'select', 'options' => $typesVolumesHoraires, 'label' => 'Type de volume horaire', ], 'etatVolumeHoraireId' => [ 'type' => 'select', 'options' => $etatsVolumesHoraires, 'label' => 'État de volume horaire', ], 'arrondir' => [ 'type' => 'select', 'options' => [ FormuleIntervenant::ARRONDISSEUR_NO => 'Désactivé', FormuleIntervenant::ARRONDISSEUR_MINIMAL => 'Minimal', FormuleIntervenant::ARRONDISSEUR_FULL => 'Full', FormuleIntervenant::ARRONDISSEUR_CUSTOM => 'Custom (pour développer)', ], 'label' => 'Mode de fonctionnement de l\'arrondisseur', ], ]; $params = \UnicaenCode\Util::codeGenerator()->generer($pdata); if (!$params['intervenantId']) { return; } /** @var \Formule\Service\FormuleService $fs */ $fs = $container->get(\Formule\Service\FormuleService::class); Loading @@ -12,14 +62,8 @@ $fs = $container->get(\Formule\Service\FormuleService::class); $ts = $container->get(\Formule\Service\TestService::class); $intervenantId = 201; //$intervenantId = 2032; $typeVolumeHoraireId = 1; $etatVolumeHoraireId = 2; $arrondir = \Formule\Entity\FormuleIntervenant::ARRONDISSEUR_MINIMAL; $fi = $fs->getFormuleServiceIntervenant($intervenantId, $typeVolumeHoraireId, $etatVolumeHoraireId); $fi->setArrondisseur($arrondir); $fi = $fs->getFormuleServiceIntervenant((int)$params['intervenantId'], (int)$params['typeVolumeHoraireId'], (int)$params['etatVolumeHoraireId']); $fi->setArrondisseur((int)$params['arrondir']); /* Calcul & affichage des résultats d'arrondissage */ if (isset($fi)) { Loading module/Formule/src/Entity/FormuleIntervenant.php +1 −0 Changes for module/Formule/src/Entity/FormuleIntervenant.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ class FormuleIntervenant const ARRONDISSEUR_NO = 0; const ARRONDISSEUR_MINIMAL = 1; const ARRONDISSEUR_FULL = 2; const ARRONDISSEUR_CUSTOM = 3; // Identifiants protected ?int $id = null; Loading module/Formule/src/Model/Arrondisseur/Arrondisseur.php +10 −0 Changes for module/Formule/src/Model/Arrondisseur/Arrondisseur.php: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ class Arrondisseur case $fi::ARRONDISSEUR_MINIMAL: $this->preparerCalculsMinimaux($data); break; case $fi::ARRONDISSEUR_CUSTOM: $this->preparerCalculsCustom($data); break; } foreach ($this->calculs as $ci => $calcul) { Loading Loading @@ -79,6 +82,13 @@ class Arrondisseur protected function preparerCalculsCustom(Ligne $data): void { } protected function preparationHorizontale(Ligne $data): void { // Sous-total par catégorie Loading Loading
code/formules/testArrondisseurFromService.php +52 −8 Changes for code/formules/testArrondisseurFromService.php: 52 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -5,6 +5,56 @@ * @var $container \Psr\Container\ContainerInterface */ use Formule\Entity\FormuleIntervenant; $bdd = $container->get(\Unicaen\BddAdmin\Bdd::class); $tvhs = $bdd->select('SELECT id "id", libelle "libelle" FROM type_volume_horaire'); $typesVolumesHoraires = []; foreach ($tvhs as $tvh) { $typesVolumesHoraires[$tvh['id']] = $tvh['libelle']; } $evhs = $bdd->select('SELECT id "id", libelle "libelle" FROM etat_volume_horaire'); $etatsVolumesHoraires = []; foreach ($evhs as $evh) { $etatsVolumesHoraires[$evh['id']] = $evh['libelle']; } // récup intervenantId $pdata = [ 'intervenantId' => [ 'type' => 'text', 'label' => 'ID de l\'intervenant', ], 'typeVolumeHoraireId' => [ 'type' => 'select', 'options' => $typesVolumesHoraires, 'label' => 'Type de volume horaire', ], 'etatVolumeHoraireId' => [ 'type' => 'select', 'options' => $etatsVolumesHoraires, 'label' => 'État de volume horaire', ], 'arrondir' => [ 'type' => 'select', 'options' => [ FormuleIntervenant::ARRONDISSEUR_NO => 'Désactivé', FormuleIntervenant::ARRONDISSEUR_MINIMAL => 'Minimal', FormuleIntervenant::ARRONDISSEUR_FULL => 'Full', FormuleIntervenant::ARRONDISSEUR_CUSTOM => 'Custom (pour développer)', ], 'label' => 'Mode de fonctionnement de l\'arrondisseur', ], ]; $params = \UnicaenCode\Util::codeGenerator()->generer($pdata); if (!$params['intervenantId']) { return; } /** @var \Formule\Service\FormuleService $fs */ $fs = $container->get(\Formule\Service\FormuleService::class); Loading @@ -12,14 +62,8 @@ $fs = $container->get(\Formule\Service\FormuleService::class); $ts = $container->get(\Formule\Service\TestService::class); $intervenantId = 201; //$intervenantId = 2032; $typeVolumeHoraireId = 1; $etatVolumeHoraireId = 2; $arrondir = \Formule\Entity\FormuleIntervenant::ARRONDISSEUR_MINIMAL; $fi = $fs->getFormuleServiceIntervenant($intervenantId, $typeVolumeHoraireId, $etatVolumeHoraireId); $fi->setArrondisseur($arrondir); $fi = $fs->getFormuleServiceIntervenant((int)$params['intervenantId'], (int)$params['typeVolumeHoraireId'], (int)$params['etatVolumeHoraireId']); $fi->setArrondisseur((int)$params['arrondir']); /* Calcul & affichage des résultats d'arrondissage */ if (isset($fi)) { Loading
module/Formule/src/Entity/FormuleIntervenant.php +1 −0 Changes for module/Formule/src/Entity/FormuleIntervenant.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ class FormuleIntervenant const ARRONDISSEUR_NO = 0; const ARRONDISSEUR_MINIMAL = 1; const ARRONDISSEUR_FULL = 2; const ARRONDISSEUR_CUSTOM = 3; // Identifiants protected ?int $id = null; Loading
module/Formule/src/Model/Arrondisseur/Arrondisseur.php +10 −0 Changes for module/Formule/src/Model/Arrondisseur/Arrondisseur.php: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ class Arrondisseur case $fi::ARRONDISSEUR_MINIMAL: $this->preparerCalculsMinimaux($data); break; case $fi::ARRONDISSEUR_CUSTOM: $this->preparerCalculsCustom($data); break; } foreach ($this->calculs as $ci => $calcul) { Loading Loading @@ -79,6 +82,13 @@ class Arrondisseur protected function preparerCalculsCustom(Ligne $data): void { } protected function preparationHorizontale(Ligne $data): void { // Sous-total par catégorie Loading