Commit 95666bd3 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Correction de bug de sélection de structure si on est composante

parent 77025748
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ author: Laurent Lécluse - DSI - Unicaen
## Corrections de bugs

* Dans l'onglet Services, le filtre par intervenant fonctionne à nouveau
* Dans la page des mises en paiement (menu gestion), si on a un rôle de périmètre composante, le bug n'affichant plus la structure est résolu


#OSE 8.0.1
+495 B (187 KiB)

File changed.

No diff preview for this file type.

+14 −7
Original line number Diff line number Diff line
@@ -323,17 +323,23 @@ class PaiementController extends AbstractController
        $rechercheForm = $this->getFormPaiementMiseEnPaiementRecherche();
        $rechercheForm->bind($recherche);

        $recherche->setStructure($role->getStructure());
        if (!$recherche->getStructure()) {
        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);

        if (!$recherche->getStructure()) {
            if (count($structures) == 1) {
                $recherche->setStructure(current($structures));
                $rechercheForm->get('structure')->setValue($recherche->getStructure()->getId());
                $structure = current($structures);
                $recherche->setStructure($structure);
                $rechercheForm->get('structure')->setValue($structure->getId());
                $noData = false;
            } elseif (count($structures) == 0) {
                $noData = true;
@@ -350,7 +356,6 @@ class PaiementController extends AbstractController
            $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb);
            $periodes = $this->getServicePeriode()->getList($qb);
            $rechercheForm->populatePeriodes($periodes);

            if (count($periodes) == 1) {
                $recherche->setPeriode( current($periodes));
                $rechercheForm->get('periode')->setValue($recherche->getPeriode()->getId());
@@ -362,7 +367,9 @@ class PaiementController extends AbstractController
            $this->getServiceIntervenant()->finderByAnnee($recherche->getAnnee(), $qb);
            $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb);
            $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb);
            $rechercheForm->populateIntervenants($this->getServiceIntervenant()->getList($qb));
            $intervenants = $this->getServiceIntervenant()->getList($qb);
            $rechercheForm->populateIntervenants($intervenants);
            $noData = count($intervenants) == 0;
        }

        $request = $this->getRequest();