Loading module/Paiement/src/Controller/PaiementController.php +33 −24 Changes for module/Paiement/src/Controller/PaiementController.php: 33 added lines, 24 removed lines. Original line number Diff line number Diff line Loading @@ -70,12 +70,14 @@ class PaiementController extends AbstractController } public function indexAction() { return []; } /** * @return int */ Loading @@ -90,6 +92,7 @@ class PaiementController extends AbstractController } protected function isChangeIndexSaved($changeIndex) { $session = $this->getSessionContainer(); Loading @@ -99,6 +102,7 @@ class PaiementController extends AbstractController } protected function setChangeIndexSaved($changeIndex) { $session = $this->getSessionContainer(); Loading @@ -109,6 +113,7 @@ class PaiementController extends AbstractController } public function demandeMiseEnPaiementAction() { $role = $this->getServiceContext()->getSelectedIdentityRole(); Loading Loading @@ -204,6 +209,7 @@ class PaiementController extends AbstractController } public function visualisationMiseEnPaiementAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading @@ -227,6 +233,7 @@ class PaiementController extends AbstractController } public function editionMiseEnPaiementAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading Loading @@ -329,6 +336,7 @@ class PaiementController extends AbstractController } public function etatPaiementAction() { $this->initFilters(); Loading @@ -346,36 +354,30 @@ class PaiementController extends AbstractController $rechercheForm = $this->getFormPaiementMiseEnPaiementRecherche(); $rechercheForm->bind($recherche); //@todo à revoir... // if ($role->getStructure()) { // $structures = [$role->getStructure()->getId() => $role->getStructure()]; // } else { // $qb = $this->getServiceStructure()->finderByMiseEnPaiement(); // $this->getServiceStructure()->finderByRole($role, $qb); // $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); // $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); // $structures = $this->getServiceStructure()->getList($qb); // } // // $rechercheForm->populateStructures($structures); $qb = $this->getServiceStructure()->finderByMiseEnPaiement(); $this->getServiceStructure()->finderByRole($role, $qb); $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); $structures = $this->getServiceStructure()->getList($qb); $rechercheForm->populateStructures($structures); if (!$recherche->getStructure()) { // if (count($structures) == 1) { // $structure = current($structures); // $recherche->setStructure($structure); // $rechercheForm->get('structure')->setValue($structure->getId()); // $noData = false; // } elseif (count($structures) == 0) { // $structure = $this->getServiceStructure()->get((int)$this->params()->fromPost('structure')); // // $noData = true; // $recherche->setStructure($structure); // } else { if (count($structures) == 1) { $structure = current($structures); $recherche->setStructure($structure); $rechercheForm->get('structure')->setValue($structure->getId()); $noData = false; } elseif (count($structures) == 0) { $structure = $this->getServiceStructure()->get((int)$this->params()->fromPost('structure')); $noData = true; $recherche->setStructure($structure); } else { $structure = $this->getServiceStructure()->get((int)$this->params()->fromPost('structure')); $noData = false; $recherche->setStructure($structure); // } } } if ($recherche->getStructure()) { Loading Loading @@ -428,6 +430,7 @@ class PaiementController extends AbstractController } private function makeFilenameFromRecherche(MiseEnPaiementRecherche $recherche) { if ($recherche->getEtat() == MiseEnPaiement::A_METTRE_EN_PAIEMENT) { Loading @@ -444,6 +447,7 @@ class PaiementController extends AbstractController } public function misesEnPaiementCsvAction() { $this->initFilters(); Loading @@ -464,6 +468,7 @@ class PaiementController extends AbstractController } public function extractionPaieAction() { $this->initFilters(); Loading Loading @@ -502,6 +507,7 @@ class PaiementController extends AbstractController } public function extractionPaiePrimeAction() { $this->initFilters(); Loading @@ -528,6 +534,7 @@ class PaiementController extends AbstractController } public function imputationSihamAction() { $title = 'Export des données pour le chargement en masse des imputations budgétaires dans SIHAM'; Loading Loading @@ -594,6 +601,7 @@ class PaiementController extends AbstractController } public function miseEnPaiementAction() { $this->initFilters(); Loading Loading @@ -634,6 +642,7 @@ class PaiementController extends AbstractController } public function pilotageAction() { return []; Loading module/Paiement/src/Form/Paiement/MiseEnPaiementRechercheForm.php +11 Changes for module/Paiement/src/Form/Paiement/MiseEnPaiementRechercheForm.php: 11 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -144,6 +144,17 @@ class MiseEnPaiementRechercheForm extends AbstractForm /** * * @param array $structures */ public function populateStructures($structures) { $this->get('structure')->setValueOptions(\UnicaenApp\Util::collectionAsOptions($structures)); } /** * * @param array $periodes Loading Loading
module/Paiement/src/Controller/PaiementController.php +33 −24 Changes for module/Paiement/src/Controller/PaiementController.php: 33 added lines, 24 removed lines. Original line number Diff line number Diff line Loading @@ -70,12 +70,14 @@ class PaiementController extends AbstractController } public function indexAction() { return []; } /** * @return int */ Loading @@ -90,6 +92,7 @@ class PaiementController extends AbstractController } protected function isChangeIndexSaved($changeIndex) { $session = $this->getSessionContainer(); Loading @@ -99,6 +102,7 @@ class PaiementController extends AbstractController } protected function setChangeIndexSaved($changeIndex) { $session = $this->getSessionContainer(); Loading @@ -109,6 +113,7 @@ class PaiementController extends AbstractController } public function demandeMiseEnPaiementAction() { $role = $this->getServiceContext()->getSelectedIdentityRole(); Loading Loading @@ -204,6 +209,7 @@ class PaiementController extends AbstractController } public function visualisationMiseEnPaiementAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading @@ -227,6 +233,7 @@ class PaiementController extends AbstractController } public function editionMiseEnPaiementAction() { $intervenant = $this->getEvent()->getParam('intervenant'); Loading Loading @@ -329,6 +336,7 @@ class PaiementController extends AbstractController } public function etatPaiementAction() { $this->initFilters(); Loading @@ -346,36 +354,30 @@ class PaiementController extends AbstractController $rechercheForm = $this->getFormPaiementMiseEnPaiementRecherche(); $rechercheForm->bind($recherche); //@todo à revoir... // if ($role->getStructure()) { // $structures = [$role->getStructure()->getId() => $role->getStructure()]; // } else { // $qb = $this->getServiceStructure()->finderByMiseEnPaiement(); // $this->getServiceStructure()->finderByRole($role, $qb); // $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); // $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); // $structures = $this->getServiceStructure()->getList($qb); // } // // $rechercheForm->populateStructures($structures); $qb = $this->getServiceStructure()->finderByMiseEnPaiement(); $this->getServiceStructure()->finderByRole($role, $qb); $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); $structures = $this->getServiceStructure()->getList($qb); $rechercheForm->populateStructures($structures); if (!$recherche->getStructure()) { // if (count($structures) == 1) { // $structure = current($structures); // $recherche->setStructure($structure); // $rechercheForm->get('structure')->setValue($structure->getId()); // $noData = false; // } elseif (count($structures) == 0) { // $structure = $this->getServiceStructure()->get((int)$this->params()->fromPost('structure')); // // $noData = true; // $recherche->setStructure($structure); // } else { if (count($structures) == 1) { $structure = current($structures); $recherche->setStructure($structure); $rechercheForm->get('structure')->setValue($structure->getId()); $noData = false; } elseif (count($structures) == 0) { $structure = $this->getServiceStructure()->get((int)$this->params()->fromPost('structure')); $noData = true; $recherche->setStructure($structure); } else { $structure = $this->getServiceStructure()->get((int)$this->params()->fromPost('structure')); $noData = false; $recherche->setStructure($structure); // } } } if ($recherche->getStructure()) { Loading Loading @@ -428,6 +430,7 @@ class PaiementController extends AbstractController } private function makeFilenameFromRecherche(MiseEnPaiementRecherche $recherche) { if ($recherche->getEtat() == MiseEnPaiement::A_METTRE_EN_PAIEMENT) { Loading @@ -444,6 +447,7 @@ class PaiementController extends AbstractController } public function misesEnPaiementCsvAction() { $this->initFilters(); Loading @@ -464,6 +468,7 @@ class PaiementController extends AbstractController } public function extractionPaieAction() { $this->initFilters(); Loading Loading @@ -502,6 +507,7 @@ class PaiementController extends AbstractController } public function extractionPaiePrimeAction() { $this->initFilters(); Loading @@ -528,6 +534,7 @@ class PaiementController extends AbstractController } public function imputationSihamAction() { $title = 'Export des données pour le chargement en masse des imputations budgétaires dans SIHAM'; Loading Loading @@ -594,6 +601,7 @@ class PaiementController extends AbstractController } public function miseEnPaiementAction() { $this->initFilters(); Loading Loading @@ -634,6 +642,7 @@ class PaiementController extends AbstractController } public function pilotageAction() { return []; Loading
module/Paiement/src/Form/Paiement/MiseEnPaiementRechercheForm.php +11 Changes for module/Paiement/src/Form/Paiement/MiseEnPaiementRechercheForm.php: 11 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -144,6 +144,17 @@ class MiseEnPaiementRechercheForm extends AbstractForm /** * * @param array $structures */ public function populateStructures($structures) { $this->get('structure')->setValueOptions(\UnicaenApp\Util::collectionAsOptions($structures)); } /** * * @param array $periodes Loading