diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index beca444ec..fb4a7fe6d 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -46,7 +46,7 @@ require_once ('../../../../include/notenschluessel.class.php'); require_once ('../../../../include/studienplan.class.php'); require_once ('../../../../include/addon.class.php'); require_once ('../../../../include/mobilitaet.class.php'); -require_once ('../../../../include/prestudent.class.php'); +require_once ('../../../../include/student.class.php'); $summe_stud = 0; $summe_t2 = 0; @@ -1133,8 +1133,8 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG $grades[$row_stud->uid]['vorname'] = $row_stud->vorname; $grades[$row_stud->uid]['nachname'] = $row_stud->nachname; - $ps = new prestudent(); - $prestudent_id = $ps->getPrestudentFromBenutzer($row_stud->uid, $stg_obj->studiengang_kz, $stsem); + $ps = new student(); + $prestudent_id = $ps->getPrestudentIdFromBenutzerId($row_stud->uid, $stg_obj->studiengang_kz); $mobility = new mobilitaet(); $mobility->loadPrestudent($prestudent_id); $output = $mobility->result; diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 1b009a18f..ab1e329dd 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2463,38 +2463,4 @@ class prestudent extends person return false; } } - - /** - * Ermittelt den Prestudenten mithilfe der UID, des Studiengangs und des Semesters - * @param string $uid UID des Benutzers (zum Beispiel se15m007). - * @param int $stg_kz Kennzeichen Studiengang (zum Beispiel 299). - * @return int prestudent_id - */ - public function getPrestudentFromBenutzer($uid, $stg_kz) - { - $qry = "SELECT - prestudent_id - FROM public.tbl_student - WHERE student_uid = ".$this->db_add_param($uid)." - AND studiengang_kz = ".$this->db_add_param($stg_kz, FHC_INTEGER).";"; - - if ($this->db_query($qry)) - { - if ($row = $this->db_fetch_object()) - { - $prestudent_id = $row->prestudent_id; - return $prestudent_id; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } } diff --git a/include/student.class.php b/include/student.class.php index 4618ddbcd..8480ce2d3 100644 --- a/include/student.class.php +++ b/include/student.class.php @@ -571,7 +571,7 @@ class student extends benutzer { $qry = "SELECT tbl_student.* FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE person_id=".$this->db_add_param($person_id, FHC_INTEGER); - + if($studiengang_kz != '') { $qry .= " AND studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER); @@ -896,4 +896,38 @@ class student extends benutzer return null; } } + + /** + * Ermittelt den Prestudenten mithilfe der UID, des Studiengangs und des Semesters + * @param string $uid UID des Benutzers (zum Beispiel se15m007). + * @param int $stg_kz Kennzeichen Studiengang (zum Beispiel 299). + * @return int prestudent_id + */ + public function getPrestudentIdFromBenutzerId($uid, $stg_kz) + { + $qry = "SELECT + prestudent_id + FROM public.tbl_student + WHERE student_uid = ".$this->db_add_param($uid)." + AND studiengang_kz = ".$this->db_add_param($stg_kz, FHC_INTEGER).";"; + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + $prestudent_id = $row->prestudent_id; + return $prestudent_id; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } }