Fixed: Old Anrechnungen sometimes failed to open

...this is fixed now
This commit is contained in:
Cris
2023-03-20 13:48:23 +01:00
parent b59b00dbe4
commit 8035176e8b
3 changed files with 20 additions and 7 deletions
@@ -90,7 +90,8 @@ class approveAnrechnungDetail extends Auth_Controller
$antragData = $this->anrechnunglib->getAntragData(
$anrechnungData->prestudent_id,
$anrechnungData->studiensemester_kurzbz,
$anrechnungData->lehrveranstaltung_id
$anrechnungData->lehrveranstaltung_id,
$anrechnung_id
);
// Get Empfehlung data
@@ -84,7 +84,8 @@ class reviewAnrechnungDetail extends Auth_Controller
$antragData = $this->anrechnunglib->getAntragData(
$anrechnungData->prestudent_id,
$anrechnungData->studiensemester_kurzbz,
$anrechnungData->lehrveranstaltung_id
$anrechnungData->lehrveranstaltung_id,
$anrechnung_id
);
// Get Empfehlung data
+16 -5
View File
@@ -37,19 +37,30 @@ class AnrechnungLib
* @param $lv_id
* @return StdClass
*/
public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id)
public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id, $anrechnung_id = null)
{
$antrag_data = new StdClass();
// Get students UID.
$uid = $this->ci->StudentModel->getUID($prestudent_id);
// Get lehrveranstaltung data. Break, if course is not assigned to student.
if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0])
// If Anrechnung exists
if (is_numeric($anrechnung_id))
{
// Just load LV by lv_id
$result = $this->ci->LehrveranstaltungModel->load($lv_id);
$lv = getData($result)[0];
}
// If Anrechnung not exists
else
{
// Load LV, but check if student is assigned to that LV. Break, if not.
if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0])
{
show_error('You are not assigned to this course yet.');
}
}
// Get the students personal data
if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0])
{