Commit a5e80f22 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Correction sur la saisie hors établissement en mode calendaire (#53694)

parent b0999cec
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -206,7 +206,11 @@ class VolumeHoraireSaisieCalendaireForm extends AbstractForm
     */
    protected function getValuesOptionsPeriodes (): array
    {
        $periodes = [];

        if ($this->elementPedagogique instanceof ElementPedagogique) {
            $periodes = $this->getServicePeriode()->findPeriodeByElementPedagogique($this->elementPedagogique);
        }

        if (empty($periodes)) {
            $qb = $this->getServicePeriode()->finderByHistorique();
@@ -225,7 +229,17 @@ class VolumeHoraireSaisieCalendaireForm extends AbstractForm
     */
    protected function getTypesIntervention (): array
    {
        $typeInterventions = [];

        if ($this->elementPedagogique instanceof ElementPedagogique) {
            $typeInterventions = $this->getServiceTypeIntervention()->findTypeInterventionByElementPedagogique($this->elementPedagogique);
        }

        if (empty($typeInterventions)) {
            $qb = $this->getServiceTypeIntervention()->finderByHistorique();
            $this->getServiceTypeIntervention()->finderByContext();
            $typeInterventions = Util::collectionAsOptions($this->getServiceTypeIntervention()->getList($qb));
        }

        return $typeInterventions;
    }
@@ -345,7 +359,7 @@ class VolumeHoraireSaisieCalendaireForm extends AbstractForm
     *
     * @return VolumeHoraireSaisieCalendaireForm
     */
    public function setElementPedagogique (ElementPedagogique $elementPedagogique): self
    public function setElementPedagogique(?ElementPedagogique $elementPedagogique): self
    {
        $this->elementPedagogique = $elementPedagogique;