Merge branch 'bugfix/STGL-kann-alte-Anrechnungen-nicht-sehen' into feature-26625/Anrechnungen-BFI-Änderungen-und-Sonstige

This commit is contained in:
Cris
2022-12-06 14:15:15 +01:00
21 changed files with 271 additions and 118 deletions
+21 -7
View File
@@ -37,18 +37,32 @@ 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)
{
$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])
{
show_error('You are not assigned to this course yet.');
}
// Get lehrveranstaltung data.
// If it is a first time request for Anrechnung...
if (isEmptyString($anrechnung_id))
{
//...get LV by student to check also, if student is assigned to that lv
$result = $this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id);
if (!hasData($result))
{
// ...and break, if course is not assigned to student
show_error('You are not assigned to this course yet.');
}
}
//...in any other case (STGL View; Lector View; Student View when Anrechnung exist)
else
{
$result = $this->ci->LehrveranstaltungModel->load($lv_id);
}
$lv = getData($result)[0];
// Get the students personal data
if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0])