From b54aee666e3b55a998e7b1b2ab12671e58b77198 Mon Sep 17 00:00:00 2001 From: oesi Date: Fri, 13 Mar 2015 16:52:05 +0100 Subject: [PATCH] =?UTF-8?q?Fehler=20beim=20Raumvorschlag=20behoben=20wenn?= =?UTF-8?q?=20in=20den=20Raumtypen=20keine=20R=C3=A4ume=20vorhanden=20sind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/wochenplan.class.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/include/wochenplan.class.php b/include/wochenplan.class.php index a716fbdbd..76e497230 100644 --- a/include/wochenplan.class.php +++ b/include/wochenplan.class.php @@ -1967,6 +1967,7 @@ class wochenplan extends basis_db return false; } $num_orte=$this->db_num_rows(); + $orte = array(); for ($i=0;$i<$num_orte;$i++) { $row = $this->db_fetch_object(null, $i); @@ -2083,10 +2084,13 @@ class wochenplan extends basis_db //Kollision mit Gruppe if($raster[$t][$s]->kollision) { - foreach ($this->std_plan[$t][$s][0]->frei_orte as $ort=>$value) + if(isset($this->std_plan[$t][$s][0]->frei_orte)) { - if(in_array($ort, $orte)) - $this->std_plan[$t][$s][0]->frei_orte[$ort]=(isset($this->std_plan[$t][$s][0]->frei_orte[$ort])?$this->std_plan[$t][$s][0]->frei_orte[$ort]+1:1); + foreach ($this->std_plan[$t][$s][0]->frei_orte as $ort=>$value) + { + if(in_array($ort, $orte)) + $this->std_plan[$t][$s][0]->frei_orte[$ort]=(isset($this->std_plan[$t][$s][0]->frei_orte[$ort])?$this->std_plan[$t][$s][0]->frei_orte[$ort]+1:1); + } } } @@ -2104,9 +2108,12 @@ class wochenplan extends basis_db } else { - // Bei Gruppenkollision den Wert bei allen Raumen erhoehen - foreach ($this->std_plan[$t][$s][0]->frei_orte as $ort=>$value) - $this->std_plan[$t][$s][0]->frei_orte[$ort]=(isset($this->std_plan[$t][$s][0]->frei_orte[$ort])?$this->std_plan[$t][$s][0]->frei_orte[$ort]+1:1); + if(isset($this->std_plan[$t][$s][0]->frei_orte)) + { + // Bei Gruppenkollision den Wert bei allen Raumen erhoehen + foreach ($this->std_plan[$t][$s][0]->frei_orte as $ort=>$value) + $this->std_plan[$t][$s][0]->frei_orte[$ort]=(isset($this->std_plan[$t][$s][0]->frei_orte[$ort])?$this->std_plan[$t][$s][0]->frei_orte[$ort]+1:1); + } } } }