Changed: If LV has no lectors, show empty field instead of error message

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-03-22 17:28:29 +01:00
committed by cris-technikum
parent 00656efaef
commit 3a0720e4de
2 changed files with 8 additions and 4 deletions
@@ -535,6 +535,8 @@ class approveAnrechnungDetail extends Auth_Controller
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
* **/
$lector_arr = $this->_getLectors($anrechnung_arr);
// Send mail to lectors
foreach ($lector_arr as $lector)
+6 -4
View File
@@ -61,12 +61,14 @@ class AnrechnungLib
}
// Get lectors of lehrveranstaltung
$antrag_data->lektoren = array();
if (!$lv_lektoren = getData($this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id)))
$result = $this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id);
if (isError($result))
{
show_error('Failed loading course lectors.');
}
$lv_lektoren_arr = hasData($result) ? getData($result) : array();
// Set the given studiensemester
$antrag_data->lv_id = $lv_id;
$antrag_data->lv_bezeichnung = $lv->bezeichnung;
@@ -76,7 +78,7 @@ class AnrechnungLib
$antrag_data->nachname = $person->nachname;
$antrag_data->matrikelnr = $student->matrikelnr;
$antrag_data->stg_bezeichnung = $studiengang->bezeichnung;
$antrag_data->lektoren = $lv_lektoren;
$antrag_data->lektoren = $lv_lektoren_arr;
return $antrag_data;
}