diff --git a/include/lehrstunde.class.php b/include/lehrstunde.class.php index 34ce7003a..54f8e4e1f 100644 --- a/include/lehrstunde.class.php +++ b/include/lehrstunde.class.php @@ -400,7 +400,7 @@ class lehrstunde extends basis_db $sql_query_stdplan ) SELECT - $stpl_view_ohneschema.* + distinct $stpl_view_ohneschema.* FROM ".$stpl_view.", lvplan WHERE diff --git a/include/wochenplan.class.php b/include/wochenplan.class.php index e13271d9c..bbd8ed592 100644 --- a/include/wochenplan.class.php +++ b/include/wochenplan.class.php @@ -1416,8 +1416,11 @@ class wochenplan extends basis_db } else { - $paramList.='&stundenplan_id'.$z++.'='.$lehrstunde->stundenplan_id; - $stundenplan_ids[]=$lehrstunde->stundenplan_id; + if(!in_array($lehrstunde->stundenplan_id, $stundenplan_ids)) + { + $paramList.='&stundenplan_id'.$z++.'='.$lehrstunde->stundenplan_id; + $stundenplan_ids[]=$lehrstunde->stundenplan_id; + } } if(isset($lehrstunde->farbe) && $farbe=='') $farbe=$lehrstunde->farbe;