Fehler behoben wodurch die Lehrveranstaltungen nicht korrekt angezeigt wurden wenn der ganze Studiengang gewählt wird

This commit is contained in:
oesi
2016-03-17 17:05:05 +01:00
parent df52c64021
commit 5fa70908d8
+16 -7
View File
@@ -176,15 +176,18 @@ else
$stp_ids=array();
$stpl_main = new studienplan();
if($stpl_main->getStudienplaeneFromSem($stg_kz, $semester_aktuell, $sem))
$sto_obj = new studienordnung();
if($sto_obj->loadStudienordnungSTG($stg_kz, $semester_aktuell, $sem))
{
foreach($stpl_main->result as $row_sto)
foreach($sto_obj->result as $row_sto)
{
//echo "$row_sto->studienordnung_id $row_sto->semester\n";
$stp_obj = new studienplan();
if($stp_obj->loadStudienplanSTO($row_sto->studienordnung_id, $orgform))
{
foreach($stp_obj->result as $row_stp)
{
$stp_ids_arr[]=array('stpid'=>$row_stp->studienplan_id,'semester'=>$row_sto->semester);
$stp_ids[]=$row_stp->studienplan_id;
}
}
@@ -193,6 +196,7 @@ else
else
echo "FAILED:".$stpl_main->errormsg;
$qry='';
if(count($stp_ids)>0)
{
// Alle Lehrveranstaltungen die lt Studienplan zugeordnet sind
@@ -207,10 +211,15 @@ else
lehre.tbl_lehrveranstaltung
JOIN lehre.tbl_studienplan_lehrveranstaltung USING(lehrveranstaltung_id)
JOIN lehre.tbl_studienplan USING(studienplan_id)
WHERE studienplan_id in (".$db->db_implode4SQL($stp_ids).")
AND tbl_lehrveranstaltung.aktiv";
if($sem!='')
$qry.=" AND tbl_studienplan_lehrveranstaltung.semester=".$db->db_add_param($sem);
WHERE (1!=1 ";
foreach($stp_ids_arr as $elem)
{
$qry.= "OR (
studienplan_id=".$db->db_add_param($elem['stpid'])."
AND tbl_studienplan_lehrveranstaltung.semester=".$db->db_add_param($elem['semester'])." )";
}
$qry.=") AND tbl_lehrveranstaltung.aktiv";
$qry.=" UNION ";
}
@@ -240,7 +249,7 @@ else
}
//$qry = 'SELECT distinct on(lehrveranstaltung_id) * FROM ('.$qry.' ORDER BY studienplan_id DESC) a';
}
// die($qry);
//die($qry);
if(!$result = $db->db_query($qry))
die($db->db_last_error().'<BR>'.$qry);