From f88eb017ec2605603d0e423d80f64f90c1533723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 14 Dec 2010 14:27:58 +0000 Subject: [PATCH] =?UTF-8?q?Bugfix=20beim=20Reservieren=20von=20R=C3=A4umen?= =?UTF-8?q?=20die=20nicht=20vorhanden=20sind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/lvplan/stpl_week.php | 5 +++++ include/wochenplan.class.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/cis/private/lvplan/stpl_week.php b/cis/private/lvplan/stpl_week.php index 67abf3bd7..3ed878a62 100644 --- a/cis/private/lvplan/stpl_week.php +++ b/cis/private/lvplan/stpl_week.php @@ -68,6 +68,7 @@ require_once('../../../include/functions.inc.php'); require_once('../../../include/wochenplan.class.php'); require_once('../../../include/reservierung.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/ort.class.php'); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); @@ -186,6 +187,10 @@ else if (isset($_GET['reserve'])) // Reservieren if (isset($reserve) && $raumres) { + $ort_obj = new ort(); + if(!$ort_obj->load($ort_kurzbz)) + die('Dieser Ort existiert nicht'); + if(!$erg_std=$db->db_query("SELECT * FROM lehre.tbl_stunde ORDER BY stunde")) { die($db->db_last_error()); diff --git a/include/wochenplan.class.php b/include/wochenplan.class.php index 5debff557..ed1f9637f 100644 --- a/include/wochenplan.class.php +++ b/include/wochenplan.class.php @@ -235,7 +235,11 @@ class wochenplan extends basis_db $sql_query="SELECT bezeichnung, ort_kurzbz, planbezeichnung, ausstattung, max_person FROM public.tbl_ort WHERE ort_kurzbz='".addslashes($this->ort_kurzbz)."'"; //echo $sql_query; if (!$this->db_query($sql_query)) + { $this->errormsg=$this->db_last_error(); + return false; + } + if($row = $this->db_fetch_object()) { $this->ort_bezeichnung = $row->bezeichnung; @@ -245,6 +249,11 @@ class wochenplan extends basis_db $this->ort_max_person = $row->max_person; $this->link.='&ort_kurzbz='.$this->ort_kurzbz; //Link erweitern } + else + { + $this->errormsg="Dieser Ort existiert nicht"; + return false; + } } // Studiengangsdaten ermitteln