Loading code/test6.php +19 −129 Changes for code/test6.php: 19 added lines, 129 removed lines. Original line number Diff line number Diff line Loading @@ -8,140 +8,30 @@ * @var $viewFile string */ $sap = new \Paiement\Tbl\Process\Sub\ServiceAPayer(); $sap->fromArray(getData1()); /** @var \Lieu\Service\StructureService $ss */ $ss = $container->get(\Lieu\Service\StructureService::class); $r = new \Paiement\Tbl\Process\Sub\Rapprocheur(); $r->setRegle('prorata'); //$r->setRegle('ordre-saisie'); $r->rapprocher($sap); arrayDump($sap->toArray()); $root = $ss->get(114); // DRH //$root = $ss->get(54); // Unicaen //$root = null; $s = []; $s=$ss->getTree($root); function getData1() { return [ 'key' => 'e-121007207-6', 'annee' => 2022, 'intervenant' => 667613, 'structure' => 385, 'service' => 222531, 'referentiel' => NULL, 'mission' => NULL, 'formuleResService' => 121007207, 'formuleResServiceRef' => NULL, 'typeHeures' => 6, 'defDomaineFonctionnel' => 14, 'defCentreCout' => 209, 'tauxCongesPayes' => 1.0, 'heures' => 4.75, 'lignesAPayer' => [ '1-42.86' => [ 'tauxRemu' => 1, 'tauxValeur' => 42.86, 'pourcAA' => 0.4, 'heures' => 4.75, 'heuresAA' => 1.9, 'heuresAC' => 2.85, 'misesEnPaiement' => [ ], ], ], 'misesEnPaiement' => [ 212277 => [ 'id' => 212277, 'heures' => 4.75, 'date' => '2022-12-31', 'periodePaiement' => 4, 'centreCout' => 209, 'domaineFonctionnel' => 14, ], ], ]; foreach($s as $str){ showStructure($str); } function getData2() { return [ 'key' => 'e-113957505-8', 'annee' => 2017, 'intervenant' => 20970, 'structure' => 229, 'service' => 89226, 'referentiel' => NULL, 'mission' => NULL, 'formuleResService' => 113957505, 'formuleResServiceRef' => NULL, 'typeHeures' => 8, 'defDomaineFonctionnel' => 1, 'defCentreCout' => 362, 'tauxCongesPayes' => 1.0, 'heures' => 10.37, 'lignesAPayer' => [ '1-41.41' => [ 'tauxRemu' => 1, 'tauxValeur' => 41.41, 'pourcAA' => 0.4, 'heures' => 0.0, 'heuresAA' => 2.14, 'heuresAC' => 3.23, 'misesEnPaiement' => [ ], ], '1-42.86' => [ 'tauxRemu' => 1, 'tauxValeur' => 42.86, 'pourcAA' => 0.4, 'heures' => 0.0, 'heuresAA' => 2.00, 'heuresAC' => 3.00, 'misesEnPaiement' => [ ], ], ], 'misesEnPaiement' => [ 76199 => [ 'id' => 76199, 'heures' => 1.62, 'date' => '2018-05-31', 'periodePaiement' => 8, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 77200 => [ 'id' => 77200, 'heures' => 1.07, 'date' => '2018-06-30', 'periodePaiement' => 9, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 78457 => [ 'id' => 78457, 'heures' => 2.69, 'date' => '2018-07-31', 'periodePaiement' => 10, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 80592 => [ 'id' => 80592, 'heures' => 2.29, 'date' => '2018-08-31', 'periodePaiement' => 11, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 93625 => [ 'id' => 93625, 'heures' => 2.7, 'date' => '2018-10-31', 'periodePaiement' => 18, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], ], ]; function showStructure(\Lieu\Entity\Db\Structure $s){ echo "<div style='padding-left:4em'>"; echo "<div>".$s->getLibelleCourt()."</div>"; foreach( $s->getStructures() as $sub){ showStructure($sub); } echo "</div>"; } No newline at end of file module/Application/src/Form/Droits/AffectationForm.php +2 −15 Changes for module/Application/src/Form/Droits/AffectationForm.php: 2 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\RoleServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Laminas\Hydrator\HydratorInterface; use Lieu\Form\Element\Structure; use Lieu\Service\StructureServiceAwareTrait; use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenApp\Util; Loading Loading @@ -54,12 +55,6 @@ class AffectationForm extends AbstractForm $this->setAttribute('data-roles-must-have-structure', json_encode($rolesMustHaveStructure)); $this->setAttribute('class', 'affectation-form'); $qb = $this->getServiceStructure()->finderByHistorique(); if ($structure) { $this->getServiceStructure()->finderById($structure->getId(), $qb); } $structures = $this->getServiceStructure()->getList($qb); $utilisateur = new SearchAndSelect('utilisateur'); $utilisateur->setRequired(true) ->setSelectionRequired(true) Loading @@ -80,16 +75,8 @@ class AffectationForm extends AbstractForm ]); $this->add([ 'type' => 'Select', 'type' => Structure::class, 'name' => 'structure', 'options' => [ 'label' => 'Structure', 'value_options' => Util::collectionAsOptions($structures), ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => true, ], ]); $this->add([ Loading module/Application/src/Form/Intervenant/EditionForm.php +1 −17 Changes for module/Application/src/Form/Intervenant/EditionForm.php: 1 added line, 17 removed lines. Original line number Diff line number Diff line Loading @@ -144,15 +144,9 @@ class EditionForm extends AbstractForm $this->add([ 'name' => 'structure', 'type' => 'Select', 'type' => \Lieu\Form\Element\Structure::class, 'options' => [ 'label' => 'Structure', 'empty_option' => '- Non renseignée -', 'value_options' => Util::collectionAsOptions($this->getStructures()), ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'true', ], ]); Loading Loading @@ -365,16 +359,6 @@ class EditionForm extends AbstractForm public function getStructures(): array { $serviceStructure = $this->getServiceStructure(); $qb = $serviceStructure->finderByHistorique(); return $serviceStructure->getList($qb); } public function getDisciplines(): array { return $this->getServiceDiscipline()->getList($this->getServiceDiscipline()->finderByHistorique()); Loading module/Application/src/Form/ParametresForm.php +2 −8 Changes for module/Application/src/Form/ParametresForm.php: 2 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Application\Service\Traits\ScenarioServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Application\Service\Traits\WfEtapeServiceAwareTrait; use Laminas\Form\Element; use Lieu\Form\Element\Structure; use Lieu\Service\PaysServiceAwareTrait; use Lieu\Service\StructureServiceAwareTrait; use OffreFormation\Service\Traits\DomaineFonctionnelServiceAwareTrait; Loading Loading @@ -82,18 +83,11 @@ class ParametresForm extends AbstractForm ]); $this->add([ 'type' => 'Select', 'type' => Structure::class, 'name' => 'structure_univ', 'options' => [ 'value_options' => Util::collectionAsOptions($this->getServiceStructure()->getList( $this->getServiceStructure()->finderByHistorique() )), 'label' => 'Composante représentant l\'université', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'true', ], ]); $this->add([ Loading module/OffreFormation/src/Controller/OffreFormationController.php +1 −19 Changes for module/OffreFormation/src/Controller/OffreFormationController.php: 1 added line, 19 removed lines. Original line number Diff line number Diff line Loading @@ -190,11 +190,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle //Get role of user $role = $this->getServiceContext()->getSelectedIdentityRole(); $qb = $this->getServiceStructure()->finderByHistorique(); $this->getServiceStructure()->finderByEnseignement($qb); $this->getServiceStructure()->finderByRole($role, $qb); $structures = $this->getServiceStructure()->getList($qb); $anneeEnCours = $this->getServiceContext()->getAnnee(); [$offresComplementaires, $mappingEtape, $reconductionTotale] = $this->getServiceOffreFormation()->getOffreComplementaire($structure, $niveau, $etape); Loading Loading @@ -231,7 +226,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle 'offresComplementaires' => $offresComplementaires, 'reconductionTotale' => $reconductionTotale, 'structure' => $structure, 'structures' => $structures, 'anneeEnCours' => $anneeEnCours, 'reconductionStep' => $reconductionStep, 'messageStep' => $messageStep, Loading @@ -249,11 +243,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle //Get role of user $role = $this->getServiceContext()->getSelectedIdentityRole(); $qb = $this->getServiceStructure()->finderByHistorique(); $this->getServiceStructure()->finderByEnseignement($qb); $this->getServiceStructure()->finderByRole($role, $qb); $structures = $this->getServiceStructure()->getList($qb); $request = $this->getRequest(); if ($request->isPost()) { Loading Loading @@ -284,7 +273,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle return [ 'structures' => $structures, 'structure' => $structure, 'etapesReconduites' => $etapesReconduites, ]; Loading @@ -300,12 +288,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle $etapesReconduites = []; $role = $this->getServiceContext()->getSelectedIdentityRole(); $qb = $this->getServiceStructure()->finderByHistorique(); $this->getServiceStructure()->finderByEnseignement($qb); $this->getServiceStructure()->finderByRole($role, $qb); $structures = $this->getServiceStructure()->getList($qb); $request = $this->getRequest(); if ($request->isPost()) { $datas = $request->getPost(); Loading Loading @@ -337,7 +319,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle return [ 'structures' => $structures, 'etapesReconduites' => $etapesReconduites, 'structure' => $structure, ]; Loading Loading @@ -393,6 +374,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle $etape = $this->context()->etapeFromQuery(); if ($etape) $etape = $this->getServiceEtape()->get($etape->getId()); // entité Niveau if ($niveau) $niveau = $this->getServiceNiveauEtape()->get($niveau); // entité Niveau if ($structure) $structure = $this->getServiceStructure()->get($structure); return [$structure, $niveau, $etape]; } Loading Loading
code/test6.php +19 −129 Changes for code/test6.php: 19 added lines, 129 removed lines. Original line number Diff line number Diff line Loading @@ -8,140 +8,30 @@ * @var $viewFile string */ $sap = new \Paiement\Tbl\Process\Sub\ServiceAPayer(); $sap->fromArray(getData1()); /** @var \Lieu\Service\StructureService $ss */ $ss = $container->get(\Lieu\Service\StructureService::class); $r = new \Paiement\Tbl\Process\Sub\Rapprocheur(); $r->setRegle('prorata'); //$r->setRegle('ordre-saisie'); $r->rapprocher($sap); arrayDump($sap->toArray()); $root = $ss->get(114); // DRH //$root = $ss->get(54); // Unicaen //$root = null; $s = []; $s=$ss->getTree($root); function getData1() { return [ 'key' => 'e-121007207-6', 'annee' => 2022, 'intervenant' => 667613, 'structure' => 385, 'service' => 222531, 'referentiel' => NULL, 'mission' => NULL, 'formuleResService' => 121007207, 'formuleResServiceRef' => NULL, 'typeHeures' => 6, 'defDomaineFonctionnel' => 14, 'defCentreCout' => 209, 'tauxCongesPayes' => 1.0, 'heures' => 4.75, 'lignesAPayer' => [ '1-42.86' => [ 'tauxRemu' => 1, 'tauxValeur' => 42.86, 'pourcAA' => 0.4, 'heures' => 4.75, 'heuresAA' => 1.9, 'heuresAC' => 2.85, 'misesEnPaiement' => [ ], ], ], 'misesEnPaiement' => [ 212277 => [ 'id' => 212277, 'heures' => 4.75, 'date' => '2022-12-31', 'periodePaiement' => 4, 'centreCout' => 209, 'domaineFonctionnel' => 14, ], ], ]; foreach($s as $str){ showStructure($str); } function getData2() { return [ 'key' => 'e-113957505-8', 'annee' => 2017, 'intervenant' => 20970, 'structure' => 229, 'service' => 89226, 'referentiel' => NULL, 'mission' => NULL, 'formuleResService' => 113957505, 'formuleResServiceRef' => NULL, 'typeHeures' => 8, 'defDomaineFonctionnel' => 1, 'defCentreCout' => 362, 'tauxCongesPayes' => 1.0, 'heures' => 10.37, 'lignesAPayer' => [ '1-41.41' => [ 'tauxRemu' => 1, 'tauxValeur' => 41.41, 'pourcAA' => 0.4, 'heures' => 0.0, 'heuresAA' => 2.14, 'heuresAC' => 3.23, 'misesEnPaiement' => [ ], ], '1-42.86' => [ 'tauxRemu' => 1, 'tauxValeur' => 42.86, 'pourcAA' => 0.4, 'heures' => 0.0, 'heuresAA' => 2.00, 'heuresAC' => 3.00, 'misesEnPaiement' => [ ], ], ], 'misesEnPaiement' => [ 76199 => [ 'id' => 76199, 'heures' => 1.62, 'date' => '2018-05-31', 'periodePaiement' => 8, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 77200 => [ 'id' => 77200, 'heures' => 1.07, 'date' => '2018-06-30', 'periodePaiement' => 9, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 78457 => [ 'id' => 78457, 'heures' => 2.69, 'date' => '2018-07-31', 'periodePaiement' => 10, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 80592 => [ 'id' => 80592, 'heures' => 2.29, 'date' => '2018-08-31', 'periodePaiement' => 11, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], 93625 => [ 'id' => 93625, 'heures' => 2.7, 'date' => '2018-10-31', 'periodePaiement' => 18, 'centreCout' => 362, 'domaineFonctionnel' => 1, ], ], ]; function showStructure(\Lieu\Entity\Db\Structure $s){ echo "<div style='padding-left:4em'>"; echo "<div>".$s->getLibelleCourt()."</div>"; foreach( $s->getStructures() as $sub){ showStructure($sub); } echo "</div>"; } No newline at end of file
module/Application/src/Form/Droits/AffectationForm.php +2 −15 Changes for module/Application/src/Form/Droits/AffectationForm.php: 2 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Application\Service\Traits\ContextServiceAwareTrait; use Application\Service\Traits\RoleServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Laminas\Hydrator\HydratorInterface; use Lieu\Form\Element\Structure; use Lieu\Service\StructureServiceAwareTrait; use UnicaenApp\Form\Element\SearchAndSelect; use UnicaenApp\Util; Loading Loading @@ -54,12 +55,6 @@ class AffectationForm extends AbstractForm $this->setAttribute('data-roles-must-have-structure', json_encode($rolesMustHaveStructure)); $this->setAttribute('class', 'affectation-form'); $qb = $this->getServiceStructure()->finderByHistorique(); if ($structure) { $this->getServiceStructure()->finderById($structure->getId(), $qb); } $structures = $this->getServiceStructure()->getList($qb); $utilisateur = new SearchAndSelect('utilisateur'); $utilisateur->setRequired(true) ->setSelectionRequired(true) Loading @@ -80,16 +75,8 @@ class AffectationForm extends AbstractForm ]); $this->add([ 'type' => 'Select', 'type' => Structure::class, 'name' => 'structure', 'options' => [ 'label' => 'Structure', 'value_options' => Util::collectionAsOptions($structures), ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => true, ], ]); $this->add([ Loading
module/Application/src/Form/Intervenant/EditionForm.php +1 −17 Changes for module/Application/src/Form/Intervenant/EditionForm.php: 1 added line, 17 removed lines. Original line number Diff line number Diff line Loading @@ -144,15 +144,9 @@ class EditionForm extends AbstractForm $this->add([ 'name' => 'structure', 'type' => 'Select', 'type' => \Lieu\Form\Element\Structure::class, 'options' => [ 'label' => 'Structure', 'empty_option' => '- Non renseignée -', 'value_options' => Util::collectionAsOptions($this->getStructures()), ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'true', ], ]); Loading Loading @@ -365,16 +359,6 @@ class EditionForm extends AbstractForm public function getStructures(): array { $serviceStructure = $this->getServiceStructure(); $qb = $serviceStructure->finderByHistorique(); return $serviceStructure->getList($qb); } public function getDisciplines(): array { return $this->getServiceDiscipline()->getList($this->getServiceDiscipline()->finderByHistorique()); Loading
module/Application/src/Form/ParametresForm.php +2 −8 Changes for module/Application/src/Form/ParametresForm.php: 2 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ use Application\Service\Traits\ScenarioServiceAwareTrait; use Application\Service\Traits\UtilisateurServiceAwareTrait; use Application\Service\Traits\WfEtapeServiceAwareTrait; use Laminas\Form\Element; use Lieu\Form\Element\Structure; use Lieu\Service\PaysServiceAwareTrait; use Lieu\Service\StructureServiceAwareTrait; use OffreFormation\Service\Traits\DomaineFonctionnelServiceAwareTrait; Loading Loading @@ -82,18 +83,11 @@ class ParametresForm extends AbstractForm ]); $this->add([ 'type' => 'Select', 'type' => Structure::class, 'name' => 'structure_univ', 'options' => [ 'value_options' => Util::collectionAsOptions($this->getServiceStructure()->getList( $this->getServiceStructure()->finderByHistorique() )), 'label' => 'Composante représentant l\'université', ], 'attributes' => [ 'class' => 'selectpicker', 'data-live-search' => 'true', ], ]); $this->add([ Loading
module/OffreFormation/src/Controller/OffreFormationController.php +1 −19 Changes for module/OffreFormation/src/Controller/OffreFormationController.php: 1 added line, 19 removed lines. Original line number Diff line number Diff line Loading @@ -190,11 +190,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle //Get role of user $role = $this->getServiceContext()->getSelectedIdentityRole(); $qb = $this->getServiceStructure()->finderByHistorique(); $this->getServiceStructure()->finderByEnseignement($qb); $this->getServiceStructure()->finderByRole($role, $qb); $structures = $this->getServiceStructure()->getList($qb); $anneeEnCours = $this->getServiceContext()->getAnnee(); [$offresComplementaires, $mappingEtape, $reconductionTotale] = $this->getServiceOffreFormation()->getOffreComplementaire($structure, $niveau, $etape); Loading Loading @@ -231,7 +226,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle 'offresComplementaires' => $offresComplementaires, 'reconductionTotale' => $reconductionTotale, 'structure' => $structure, 'structures' => $structures, 'anneeEnCours' => $anneeEnCours, 'reconductionStep' => $reconductionStep, 'messageStep' => $messageStep, Loading @@ -249,11 +243,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle //Get role of user $role = $this->getServiceContext()->getSelectedIdentityRole(); $qb = $this->getServiceStructure()->finderByHistorique(); $this->getServiceStructure()->finderByEnseignement($qb); $this->getServiceStructure()->finderByRole($role, $qb); $structures = $this->getServiceStructure()->getList($qb); $request = $this->getRequest(); if ($request->isPost()) { Loading Loading @@ -284,7 +273,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle return [ 'structures' => $structures, 'structure' => $structure, 'etapesReconduites' => $etapesReconduites, ]; Loading @@ -300,12 +288,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle $etapesReconduites = []; $role = $this->getServiceContext()->getSelectedIdentityRole(); $qb = $this->getServiceStructure()->finderByHistorique(); $this->getServiceStructure()->finderByEnseignement($qb); $this->getServiceStructure()->finderByRole($role, $qb); $structures = $this->getServiceStructure()->getList($qb); $request = $this->getRequest(); if ($request->isPost()) { $datas = $request->getPost(); Loading Loading @@ -337,7 +319,6 @@ class OffreFormationController extends \Application\Controller\AbstractControlle return [ 'structures' => $structures, 'etapesReconduites' => $etapesReconduites, 'structure' => $structure, ]; Loading Loading @@ -393,6 +374,7 @@ class OffreFormationController extends \Application\Controller\AbstractControlle $etape = $this->context()->etapeFromQuery(); if ($etape) $etape = $this->getServiceEtape()->get($etape->getId()); // entité Niveau if ($niveau) $niveau = $this->getServiceNiveauEtape()->get($niveau); // entité Niveau if ($structure) $structure = $this->getServiceStructure()->get($structure); return [$structure, $niveau, $etape]; } Loading