diff --git a/cis/private/tools/ampelleiteruebersicht.php b/cis/private/tools/ampelleiteruebersicht.php
index 8418d18c8..97e64e404 100755
--- a/cis/private/tools/ampelleiteruebersicht.php
+++ b/cis/private/tools/ampelleiteruebersicht.php
@@ -136,7 +136,7 @@ echo '
| '.$p->t('tools/ampelStatus').' |
'.$p->t('tools/ampelBeschreibung').' |
- '.$p->t('global/institut').' |
+ '.$p->t('global/organisationseinheit').' |
'.$p->t('tools/ampelMitarbeiter').' |
'.$p->t('tools/ampelBestaetigtAm').' |
'.$p->t('tools/ampelRestdauer').' |
diff --git a/include/ampel.class.php b/include/ampel.class.php
index bfe936c61..1f7cf051d 100755
--- a/include/ampel.class.php
+++ b/include/ampel.class.php
@@ -449,20 +449,28 @@ class ampel extends basis_db
{
while($row = $this->db_fetch_object($result))
{
- // Alle Mitarbeiter dazu holen
+ // Alle Mitarbeiter/Studenten dazu holen
$qry = "SELECT
distinct on (tbl_ampel_benutzer_bestaetigt.ampel_benutzer_bestaetigt_id, a.uid) *,
tbl_ampel_benutzer_bestaetigt.insertamum,tbl_ampel_benutzer_bestaetigt.insertvon
FROM
(".$row->benutzer_select.") a
- JOIN public.tbl_benutzerfunktion USING(uid)
JOIN campus.vw_benutzer USING(uid)
+ LEFT JOIN public.tbl_benutzerfunktion USING(uid)
LEFT JOIN public.tbl_ampel_benutzer_bestaetigt on(public.tbl_ampel_benutzer_bestaetigt.uid=a.uid AND ampel_id='".$row->ampel_id."')
WHERE
(tbl_ampel_benutzer_bestaetigt.ampel_id is null OR tbl_ampel_benutzer_bestaetigt.ampel_id='".$row->ampel_id."')
AND
- (funktion_kurzbz='oezuordnung' AND oe_kurzbz in(".$this->implode4SQL($oe_arr)."))
-
+ (
+ (funktion_kurzbz='oezuordnung' AND oe_kurzbz in(".$this->implode4SQL($oe_arr)."))
+ OR
+ (funktion_kurzbz is null
+ AND (SELECT oe_kurzbz FROM
+ public.tbl_studiengang JOIN public.tbl_student USING(studiengang_kz)
+ WHERE vw_benutzer.uid=tbl_student.student_uid)
+ in(".$this->implode4SQL($oe_arr).")
+ )
+ )
";
if($result_ma = $this->db_query($qry))