diff --git a/include/organisationseinheit.class.php b/include/organisationseinheit.class.php index 2364c28bd..a82754d48 100644 --- a/include/organisationseinheit.class.php +++ b/include/organisationseinheit.class.php @@ -691,5 +691,38 @@ class organisationseinheit extends basis_db return false; } } + + /** + * Gibt alle Standorte zurück + * @param $aktiv + * @param $lehre + * @return boolean|array false im Fehlerfall, ansonsten ein Array + */ + public function getAllStandorte($aktiv=null, $lehre=null) + { + $result = array(); + $qry = "SELECT DISTINCT standort FROM public.tbl_organisationseinheit WHERE standort IS NOT NULL"; + + if(!is_null($aktiv)) + $qry.=" AND aktiv=".$this->db_add_param($aktiv, FHC_BOOLEAN); + + if(!is_null($lehre)) + $qry.=" AND lehre=".$this->db_add_param($lehre, FHC_BOOLEAN); + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $result[] = $row->standort; + } + + return $result; + } + else + { + $this->errormsg = 'Fehler beim Laden der Standorte'; + return false; + } + } } ?> diff --git a/include/studiengang.class.php b/include/studiengang.class.php index 69f2e8ae2..1dca2253b 100644 --- a/include/studiengang.class.php +++ b/include/studiengang.class.php @@ -237,7 +237,7 @@ class studiengang extends basis_db */ public function getAllForBewerbung() { - $qry = 'SELECT DISTINCT studiengang_kz, typ, organisationseinheittyp_kurzbz, studiengangbezeichnung ' + $qry = 'SELECT DISTINCT studiengang_kz, typ, organisationseinheittyp_kurzbz, studiengangbezeichnung, standort ' . 'FROM lehre.vw_studienplan ' . 'WHERE onlinebewerbung IS TRUE ' . 'ORDER BY studiengangbezeichnung ASC';