Commit 6a9a34d1 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Les statuts sont de nouveau filtrés correctement dans l'interface...

Les statuts sont de nouveau filtrés correctement dans l'interface d'administration des types d'intervention (#45141)

(cherry picked from commit f82039d1)
parent 80a1725b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@
* Ajout de date de dernière modification des données dans les indicateurs notifiant d'une validation en attente
* Nouvel état de sortie pour l'extraction des paiements dans le cadre de la pré-liquidation SIHAM



# OSE 18.2 (A venir)

## Corrections de bugs
@@ -20,6 +22,8 @@
* Correction du bouton reporter les données de cet intervenant dans l'interface de test de formule (#45140)
* Les demandes de mise en paiement faites pour des services historisés s'affichent en rouge plutôt que de provoquer une erreur
* Les modifications sur les types d'intervention ne recalculent plus automatiquement toutes les formules, ce qui bloquait l'application
* Les statuts sont de nouveau filtrés correctement dans l'interface d'administration des types d'intervention (#45141)


# OSE 18.1 (31/05/2022)

+3 −2
Original line number Diff line number Diff line
@@ -50,8 +50,9 @@ class TypeInterventionController extends AbstractController

    public function statutAction()
    {
        /** @var TypeIntervention $typeIntervention */
        $typeIntervention        = $typeIntervention = $this->getEvent()->getParam('typeIntervention');
        $typeInterventionStatuts = $typeIntervention->getTypeInterventionStatut();
        $typeInterventionStatuts = $typeIntervention->getTypeInterventionStatut($this->getServiceContext()->getAnnee());
        $title                   = "Statuts spécifique pour " . $typeIntervention;

        return compact('typeIntervention', 'typeInterventionStatuts', 'title');
@@ -189,7 +190,7 @@ class TypeInterventionController extends AbstractController

        $typeIntervention       = $this->getEvent()->getParam('typeIntervention');
        $typeInterventionStatut = $this->getEvent()->getParam('typeInterventionStatut');
        $form                   = $this->getFormTypeInterventionStatutSaisie();
        $form                   = $this->getFormTypeInterventionTypeInterventionStatutSaisie();
        if (empty($typeInterventionStatut)) {
            $title                  = 'Ajout d\'un statut spécifique pour un nouveau type d\'intervention';
            $typeInterventionStatut = $this->getServiceTypeInterventionStatut()->newEntity()
+8 −2
Original line number Diff line number Diff line
@@ -507,8 +507,14 @@ class TypeIntervention implements HistoriqueAwareInterface, ResourceInterface
     *
     * @return \Doctrine\Common\Collections\Collection|TypeInterventionStatut
     */
    public function getTypeInterventionStatut()
    public function getTypeInterventionStatut(?Annee $annee = null)
    {
        if ($annee) {
            return $this->typeInterventionStatut->filter(function (TypeInterventionStatut $tis) use ($annee) {
                return $tis->getAnnee() == $annee;
            });
        } else {
            return $this->typeInterventionStatut;
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class TypeInterventionStatutSaisieForm extends AbstractForm
            ],
        ]);
        $this->get('statut')
            ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceStatut()->getList($this->getServiceStatut()->finderByHistorique())));
            ->setValueOptions(\UnicaenApp\Util::collectionAsOptions($this->getServiceStatut()->getStatuts()));

        return $this;
    }
+3 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ namespace Application\View\Helper;

use Application\Entity\Db\TypeIntervention;
use Application\Filter\StringFromFloat;
use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\TypeInterventionServiceAwareTrait;

/**
@@ -12,6 +13,7 @@ use Application\Service\Traits\TypeInterventionServiceAwareTrait;
class TypeInterventionAdminViewHelper extends AbstractViewHelper
{
    use TypeInterventionServiceAwareTrait;
    use ContextServiceAwareTrait;

    /**
     *
@@ -90,7 +92,7 @@ class TypeInterventionAdminViewHelper extends AbstractViewHelper
        $ti = $this->getTypeIntervention();

        $title   = '';
        $statuts = $ti->getTypeInterventionStatut();
        $statuts = $ti->getTypeInterventionStatut($this->getServiceContext()->getAnnee());
        foreach ($statuts as $tis) {
            if ($title) $title .= ' - ';
            $title .= $tis->getStatut()->getLibelle();