diff --git a/application/controllers/organisation/Studiensemester.php b/application/controllers/organisation/Studiensemester.php index 10fa5b3ad..685c8cd7c 100644 --- a/application/controllers/organisation/Studiensemester.php +++ b/application/controllers/organisation/Studiensemester.php @@ -138,7 +138,7 @@ class Studiensemester extends Auth_Controller $start = $this->input->post("semstart"); $ende = $this->input->post("semende"); $studienjahr_kurzbz = $this->input->post("studienjahrkurzbz"); - $beschreibung = $this->input->post("beschreibung"); + $beschreibung = isEmptyString($this->input->post("beschreibung")) ? null : $this->input->post("beschreibung"); $onlinebewerbung = $this->input->post("onlinebewerbung"); $onlinebewerbung = isset($onlinebewerbung); diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 42b9c3cfa..3bd08b7d1 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -423,7 +423,7 @@ class InfoCenter extends Auth_Controller if (hasData($akte)) { $akte = getData($akte); - if ($akte->person_id === $person_id) + if ($akte->person_id === (int)$person_id) { $result = $this->aktelib->remove($akte_id); diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index d9a3428a0..19cdec848 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -340,20 +340,25 @@ class FilterWidgetLib { $filterDefinition = $filters[$filtersCounter]; // definition of one filter - if ($filtersCounter > 0) - $where .= ' AND '; // if it's NOT the last one - - if (!isEmptyString($filterDefinition->name)) // if the name of the applied filter is valid + // If the name of the applied filter is valid + if (!isEmptyString($filterDefinition->name)) { - // ...build the condition - $where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition); + // Build the query conditions + $datasetQueryCondition = $this->_getDatasetQueryCondition($filterDefinition); + + // If the built condition is valid then add it to the query clause + if (!isEmptyString($datasetQueryCondition)) + { + // // If this is NOT the first one + if ($filtersCounter > 0) $where .= ' AND '; + + $where .= '"'.$filterDefinition->name.'"'.$datasetQueryCondition; + } } } - if ($where != '') // if the SQL where clause was built - { - $datasetQuery .= ' WHERE '.$where; - } + // If the SQL where clause was built + if ($where != '') $datasetQuery .= ' WHERE '.$where; } return $datasetQuery; diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index 4975af382..b987102dd 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -528,6 +528,13 @@ class Messages_model extends CI_Model */ public function sendReply($receiver_id, $subject, $body, $relationmessage_id, $token) { + // Checks that the receiver_id, relationmessage_id and token belongs to the same message + $crossedDataResult = $this->MessageTokenModel->crossClientData($token, $relationmessage_id, $receiver_id); + if (isError($crossedDataResult)) show_error(getError($crossedDataResult)); + if (!hasData($crossedDataResult)) show_error( + 'The parameters token, relationmessage_id and receiver_id do not belong to the same message' + ); + // Retrieves message sender information $senderResult = $this->MessageTokenModel->getSenderData($receiver_id); if (isError($senderResult)) show_error(getError($senderResult)); diff --git a/application/models/system/MessageToken_model.php b/application/models/system/MessageToken_model.php index cd3d8f7d9..af7794fdb 100644 --- a/application/models/system/MessageToken_model.php +++ b/application/models/system/MessageToken_model.php @@ -176,4 +176,20 @@ class MessageToken_model extends DB_Model return $this->execQuery($sql, array($oe_kurzbz)); } + + /** + * + */ + public function crossClientData($token, $relationmessage_id, $receiver_id) + { + $sql = 'SELECT mm.message_id + FROM public.tbl_msg_message mm + JOIN public.tbl_msg_recipient mr USING(message_id) + WHERE mr.token = ? + AND mm.message_id = ? + AND mm.person_id = ?'; + + return $this->execQuery($sql, array($token, $relationmessage_id, $receiver_id)); + } } + diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php b/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php index 3c9985a8b..73d0e6fca 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php @@ -233,12 +233,21 @@ if (isset($_REQUEST["submit"])) continue; } $punkte=str_replace(',','.', $punkte); - //UID ermitteln + + //check ob statt Matrikelnummer nicht bereits student_uid (Moodle Grade Import) vorliegt.. $student = new student(); - if(!$student_uid = $student->getUidFromMatrikelnummer($matrikelnummer)) + if (!$student->checkIfValidStudentUID($matrikelnummer)) { - $response.="\n".$p->t('benotungstool/studentMitMatrikelnummerExistiertNicht',array($matrikelnummer)); - continue; + //UID ermitteln + if(!$student_uid = $student->getUidFromMatrikelnummer($matrikelnummer)) + { + $response.="\n".$p->t('benotungstool/studentMitMatrikelnummerExistiertNicht',array($matrikelnummer)); + continue; + } + } + else + { + $student_uid = $matrikelnummer; } // Hole Zeugnisnote wenn schon eine eingetragen ist diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index 3ff1f4695..916f2b4e3 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -803,6 +803,7 @@ if (defined('CIS_ANWESENHEITSLISTE_NOTENLISTE_ANZEIGEN') && CIS_ANWESENHEITSLIST { $hrefpath = "../notenliste.xls.php?stg=$stg_obj->studiengang_kz&lvid=$lvid&stsem=$stsem"; echo "
" . $p->t('benotungstool/notenlisteImport') . ""; + } // eingetragene lv-gesamtnoten freigeben diff --git a/cis/private/lehre/fotoliste.pdf.php b/cis/private/lehre/fotoliste.pdf.php index 018ef6d7e..353f3a2ad 100644 --- a/cis/private/lehre/fotoliste.pdf.php +++ b/cis/private/lehre/fotoliste.pdf.php @@ -103,6 +103,7 @@ $gruppen_string = ''; $gruppen_string_arr = array(); $stg_typ = $stg->typ; $stg_bezeichnung = $stg->bezeichnung; +$lv_bezeichnung = ''; //structure overall lehrveranstaltungs data if ($result = $db->db_query($qry)) { @@ -154,6 +155,7 @@ $qry = 'SELECT DISTINCT ON (nachname, vorname, person_id) vorname, nachname, + wahlname, matrikelnr, tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, @@ -238,6 +240,16 @@ if ($result = $db->db_query($qry)) { if ($row->stg_kz_student == $a_o_kz) //Außerordentliche Studierende $zusatz .= '(a.o.)'; + //wenn Wahlname vorhanden, wird dieser anstelle des Vornamens angezeigt + if ($row->wahlname != '') + { + $vorname = $row->wahlname; + } + else + { + $vorname = $row->vorname; + } + //allow admin and assistenz to see ALL fotos (even if locked by user) if ($show_all_fotos) $row->foto_sperre = 'f'; @@ -272,7 +284,7 @@ if ($result = $db->db_query($qry)) { //add studierenden data for XML $data[] = array('studierende' => array( - 'vorname' => $row->vorname, + 'vorname' => $vorname, 'nachname' => mb_strtoupper($row->nachname, 'UTF-8'), 'personenkennzeichen' => trim($row->matrikelnr), 'geschlecht' => $row->geschlecht, diff --git a/cis/private/lehre/notenliste.php b/cis/private/lehre/notenliste.php index 842d4b603..00a07b480 100644 --- a/cis/private/lehre/notenliste.php +++ b/cis/private/lehre/notenliste.php @@ -136,7 +136,7 @@ if (! check_student($user)) } else { - $qry = "SELECT vw_student.vorname, vw_student.nachname, vw_student.prestudent_id, tbl_studiengang.studiengang_kz + $qry = "SELECT vw_student.vorname, vw_student.nachname, vw_student.wahlname, vw_student.prestudent_id, tbl_studiengang.studiengang_kz FROM public.tbl_studiengang JOIN campus.vw_student USING (studiengang_kz) WHERE campus.vw_student.uid = " . $db->db_add_param($user) . ";"; @@ -148,6 +148,7 @@ else $vorname = $row->vorname; $nachname = $row->nachname; + $wahlname = $row->wahlname; $prestudent_id = $row->prestudent_id; $stg_obj = new studiengang(); $stg_obj->load($row->studiengang_kz); @@ -313,7 +314,7 @@ else // Noten ohne Wert werden entfernen if(isset($notenarr[$row->note]['notenwert'])) { - $notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = $notenarr[$row->note]['notenwert']; + $notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = $notenarr[$row->note]['notenwert']; $notenSummenArray[$row->lehrveranstaltung_id]['ects'] = $row->ects; } } diff --git a/cis/private/lehre/notenliste.xls.php b/cis/private/lehre/notenliste.xls.php index ad25a6bc2..74cb7e7c1 100644 --- a/cis/private/lehre/notenliste.xls.php +++ b/cis/private/lehre/notenliste.xls.php @@ -167,7 +167,7 @@ else //Lektoren ermitteln $qry = "SELECT - distinct vorname, nachname + distinct vorname, nachname, wahlname FROM campus.vw_benutzer, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter WHERE @@ -211,7 +211,7 @@ else $qry = " SELECT distinct on(nachname, vorname, person_id) - vorname, nachname, matrikelnr, person_id, tbl_student.student_uid as uid, + vorname, nachname, wahlname, matrikelnr, person_id, tbl_student.student_uid as uid, tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe, (SELECT status_kurzbz FROM public.tbl_prestudentstatus @@ -277,6 +277,8 @@ else $worksheet->write($lines,1,$elem->uid); $worksheet->write($lines,2,$elem->nachname.$inc); $worksheet->write($lines,3,$elem->vorname); + //wenn Wahlname vorhanden überschreibt dieser den Vornamen + $worksheet->write($lines,3,$elem->wahlname); $worksheet->write($lines,4,'="'.$elem->semester.$elem->verband.$elem->gruppe.'"'); $worksheet->write($lines,5,'="'.trim($elem->matrikelnr).'"',$format_highlight); $worksheet->write($lines,6, $note, $format_highlightright); diff --git a/cis/private/profile/freebusy.php b/cis/private/profile/freebusy.php index d2e4f9bba..34cfc05ba 100644 --- a/cis/private/profile/freebusy.php +++ b/cis/private/profile/freebusy.php @@ -19,7 +19,7 @@ */ /* * GUI fuer die FreeBusy Verwaltung - * + * * Mit diesem Tool koennen FreeBusy URLs aus verschiedenen Quellen zu einer * FreeBusy URL zusammengefasst werden */ @@ -32,7 +32,7 @@ require_once('../../../include/benutzerberechtigung.class.php'); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); - + $user = get_uid(); $sprache = getSprache(); $p = new phrasen($sprache); @@ -60,23 +60,23 @@ echo ' '.$p->t('freebusy/titel').' - + - +