diff --git a/include/ort.class.php b/include/ort.class.php
index 7b95c2de2..9c7dfa6a3 100644
--- a/include/ort.class.php
+++ b/include/ort.class.php
@@ -32,29 +32,28 @@ class ort extends basis_db
//Tabellenspalten
public $ort_kurzbz; // string
- public $bezeichnung; // string
- public $planbezeichnung; // string
+ public $bezeichnung; // string
+ public $planbezeichnung;// string
public $max_person; // integer
- public $lehre; // boolean
- public $reservieren; // boolean
- public $aktiv; // boolean
- public $lageplan; // oid
- public $dislozierung; // smallint
+ public $lehre; // boolean
+ public $reservieren; // boolean
+ public $aktiv; // boolean
+ public $lageplan; // text
+ public $dislozierung; // smallint
public $kosten; // numeric(8,2)
- public $ausstattung;
- public $stockwerk; // integer
+ public $ausstattung; // text
+ public $stockwerk; // integer
public $standort_id; // varchar(16)
- public $telefonklappe; // varchar(8)
+ public $telefonklappe; // varchar(8)
public $updateamum; // timestamp without timezone
public $updatevon; // varchar(32)
public $insertamum; // timestamp without timezone
public $insertvon; // varchar(32)
- public $content_id;
+ public $content_id; // integer
/**
* Konstruktor
- * @param $conn Connection zur DB
- * $ort_kurzbz Kurzbz des zu ladenden Ortes
+ * @param $ort_kurzbz Kurzbz des zu ladenden Ortes
*/
public function __construct($ort_kurzbz=null)
{
@@ -207,7 +206,7 @@ class ort extends basis_db
{
//Neuen Datensatz anlegen
$qry = 'INSERT INTO public.tbl_ort (ort_kurzbz, bezeichnung, planbezeichnung, max_person, aktiv, lehre, reservieren, lageplan,
- dislozierung, kosten, stockwerk, standort_id, telefonklappe, insertamum, insertvon, updateamum, updatevon, content_id) VALUES ('.
+ dislozierung, kosten, stockwerk, standort_id, telefonklappe, insertamum, insertvon, updateamum, updatevon, content_id,ausstattung) VALUES ('.
$this->db_add_param($this->ort_kurzbz).', '.
$this->db_add_param($this->bezeichnung).', '.
$this->db_add_param($this->planbezeichnung).', '.
@@ -225,7 +224,8 @@ class ort extends basis_db
$this->db_add_param($this->insertvon).','.
$this->db_add_param($this->updateamum).','.
$this->db_add_param($this->updatevon).','.
- $this->db_add_param($this->content_id).');';
+ $this->db_add_param($this->content_id).','.
+ $this->db_add_param($this->ausstattung).');';
}
else
{
@@ -235,6 +235,7 @@ class ort extends basis_db
'bezeichnung='.$this->db_add_param($this->bezeichnung).', '.
'planbezeichnung='.$this->db_add_param($this->planbezeichnung).', '.
'max_person='.$this->db_add_param($this->max_person).', '.
+ 'ausstattung='.$this->db_add_param($this->ausstattung).','.
'aktiv='.$this->db_add_param($this->aktiv, FHC_BOOLEAN) .', '.
'lehre='.$this->db_add_param($this->lehre, FHC_BOOLEAN) .', '.
'reservieren='.$this->db_add_param($this->reservieren, FHC_BOOLEAN) .', '.
@@ -426,4 +427,4 @@ class ort extends basis_db
return true;
}
}
-?>
\ No newline at end of file
+?>
diff --git a/include/ortraumtyp.class.php b/include/ortraumtyp.class.php
index e6a889ebb..1b1cf3fb7 100644
--- a/include/ortraumtyp.class.php
+++ b/include/ortraumtyp.class.php
@@ -27,8 +27,8 @@ require_once(dirname(__FILE__).'/basis_db.class.php');
class ortraumtyp extends basis_db
{
- public $new; // boolean
- public $result = array(); // fachbereich Objekt
+ public $new; // boolean
+ public $result = array();
//Tabellenspalten
public $ort_kurzbz; // string
@@ -37,8 +37,8 @@ class ortraumtyp extends basis_db
/**
* Konstruktor
- * @param $conn Connection zur DB
- * $ort_kurzbz und hierarchie ID des zu ladenden OrtRaumtyps
+ * @param $ort_kurzbz
+ * @param $hierarchie
*/
public function __construct($ort_kurzbz=null, $hierarchie=0)
{
@@ -77,7 +77,8 @@ class ortraumtyp extends basis_db
/**
* Laedt einen OrtRaumtyp
- * @param $ortraumtyp, hierarchie ID des zu ladenden OrtRaumtyps
+ * @param $ortraumtyp
+ * @param $hierarchie
* @return true wenn ok, false im Fehlerfall
*/
public function load($ort_kurzbz, $hierarchie)
@@ -88,7 +89,13 @@ class ortraumtyp extends basis_db
return false;
}
- $qry = "SELECT * FROM public.tbl_ortraumtyp WHERE ort_kurzbz = '".addslashes($ort_kurzbz)."' AND hierarchie = '".addslashes($hierarchie)."';";
+ $qry = "SELECT
+ *
+ FROM
+ public.tbl_ortraumtyp
+ WHERE
+ ort_kurzbz = ".$this->db_add_param($ort_kurzbz)."
+ AND hierarchie = ".$this->db_add_param($hierarchie).";";
if(!$this->db_query($qry))
{
@@ -152,9 +159,9 @@ class ortraumtyp extends basis_db
}
//Neuen Datensatz anlegen
$qry = 'INSERT INTO public.tbl_ortraumtyp (ort_kurzbz, hierarchie, raumtyp_kurzbz) VALUES ('.
- $this->addslashes($this->ort_kurzbz).', '.
- $this->addslashes($this->hierarchie).', '.
- $this->addslashes($this->raumtyp_kurzbz).');';
+ $this->db_add_param($this->ort_kurzbz).', '.
+ $this->db_add_param($this->hierarchie).', '.
+ $this->db_add_param($this->raumtyp_kurzbz).');';
}
else
@@ -169,8 +176,8 @@ class ortraumtyp extends basis_db
}
$qry = 'UPDATE public.tbl_ortraumtyp SET '.
- 'raumtyp_kurzbz='.$this->addslashes($this->raumtyp_kurzbz).' '.
- 'WHERE ort_kurzbz = '.$this->addslashes($this->ort_kurzbz).' AND hierarchie = '.$this->addslashes($this->hierarchie).';';
+ 'raumtyp_kurzbz='.$this->db_add_param($this->raumtyp_kurzbz).' '.
+ 'WHERE ort_kurzbz = '.$this->db_add_param($this->ort_kurzbz).' AND hierarchie = '.$this->db_add_param($this->hierarchie).';';
}
if($this->db_query($qry))
@@ -229,5 +236,26 @@ class ortraumtyp extends basis_db
return true;
}
+
+ /**
+ * Loescht eine Zuordnung
+ * @param $ort_kurzbz
+ * @param $raumtyp_kurzbz
+ */
+ public function delete($ort_kurzbz, $raumtyp_kurzbz)
+ {
+ $qry = "DELETE FROM public.tbl_ortraumtyp
+ WHERE ort_kurzbz=".$this->db_add_param($ort_kurzbz)."
+ AND raumtyp_kurzbz=".$this->db_add_param($raumtyp_kurzbz).";";
+ if($this->db_query($qry))
+ {
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Löschen';
+ return false;
+ }
+ }
}
-?>
\ No newline at end of file
+?>
diff --git a/include/raumtyp.class.php b/include/raumtyp.class.php
index fc36145c3..7cbe7a20a 100644
--- a/include/raumtyp.class.php
+++ b/include/raumtyp.class.php
@@ -28,7 +28,7 @@ require_once(dirname(__FILE__).'/basis_db.class.php');
class raumtyp extends basis_db
{
public $new; // boolean
- public $result = array(); // fachbereich Objekt
+ public $result = array(); // raumtyp Objekt
//Tabellenspalten
public $beschreibung; // string
@@ -37,7 +37,7 @@ class raumtyp extends basis_db
/**
* Konstruktor
- * @param $ort_kurzbz und hierarchie ID des zu ladenden Raumtyps
+ * @param $raumtyp_kurzbz des zu ladenden Raumtyps
*/
public function __construct($raumtyp_kurzbz=null)
{
@@ -87,7 +87,7 @@ class raumtyp extends basis_db
return false;
}
- $qry = "SELECT * FROM public.tbl_raumtyp WHERE raumtyp_kurzbz = '".addslashes($raumtyp_kurzbz)."';";
+ $qry = "SELECT * FROM public.tbl_raumtyp WHERE raumtyp_kurzbz=".$this->db_add_param($raumtyp_kurzbz).";";
if(!$this->db_query($qry))
{
@@ -156,16 +156,16 @@ class raumtyp extends basis_db
}
//Neuen Datensatz anlegen
$qry = 'INSERT INTO public.tbl_raumtyp (beschreibung, raumtyp_kurzbz) VALUES ('.
- $this->addslashes($this->beschreibung).', '.
- $this->addslashes($this->raumtyp_kurzbz).');';
+ $this->db_add_param($this->beschreibung).', '.
+ $this->db_add_param($this->raumtyp_kurzbz).');';
}
else
{
//bestehenden Datensatz akualisieren
$qry = 'UPDATE public.tbl_raumtyp SET '.
- 'beschreibung='.$this->addslashes($this->beschreibung).' '.
- 'WHERE raumtyp_kurzbz = '.$this->addslashes($this->ort_kurzbz).';';
+ 'beschreibung='.$this->db_add_param($this->beschreibung).' '.
+ 'WHERE raumtyp_kurzbz = '.$this->db_add_param($this->ort_kurzbz).';';
}
if($this->db_query($qry))
@@ -179,4 +179,4 @@ class raumtyp extends basis_db
}
}
}
-?>
\ No newline at end of file
+?>
diff --git a/skin/images/entitlement-pot.png b/skin/images/entitlement-pot.png
new file mode 100644
index 000000000..40df1fb74
Binary files /dev/null and b/skin/images/entitlement-pot.png differ
diff --git a/vilesci/stammdaten/raum_details.php b/vilesci/stammdaten/raum_details.php
index 4a325fc92..36f71ecbb 100644
--- a/vilesci/stammdaten/raum_details.php
+++ b/vilesci/stammdaten/raum_details.php
@@ -25,6 +25,9 @@
require_once('../../include/functions.inc.php');
require_once('../../include/ort.class.php');
require_once('../../include/benutzerberechtigung.class.php');
+ require_once('../../include/ortraumtyp.class.php');
+ require_once('../../include/raumtyp.class.php');
+ require_once('../../include/standort.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
@@ -33,7 +36,7 @@
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
- if(!$rechte->isBerechtigt('basis/ort'))
+ if(!$rechte->isBerechtigt('basis/ort',null,'suid'))
die('Sie haben keine Berechtigung fuer diese Seite');
$reloadstr = ''; // neuladen der liste im oberen frame
@@ -136,130 +139,234 @@
$content_id = $sg->content_id;
$neu = "false";
}
-
- if($ort_kurzbz != '')
- $htmlstr .= "