mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 06:54:04 +00:00
fix AnrechnungJob.php person_id ambiguity; also checked some possible prestudent/student ambiguity in AnrechnungLib.php even if that would be rare; fixed a faulty transaction abort from return error to return false;
This commit is contained in:
@@ -168,13 +168,15 @@ class AnrechnungJob extends JOB_Controller
|
||||
// Get all yesterdays Anrechnungen, that did not process further than first status
|
||||
// (If Anrechnung is new, but STGL already started the process yesterday,
|
||||
// he does not need to be informed about this new Anrechnung anymore)
|
||||
// Studiengang of the student, not of the LV
|
||||
$this->AnrechnungModel->addSelect('anrechnung_id, studiensemester_kurzbz, student.studiengang_kz, lv.bezeichnung, vorname, nachname');
|
||||
// Studiengang of the prestudent, not of the LV (same source as the permission checks)
|
||||
$this->AnrechnungModel->addSelect('anrechnung_id, studiensemester_kurzbz, prestudent.studiengang_kz, lv.bezeichnung, vorname, nachname');
|
||||
$this->AnrechnungModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id');
|
||||
$this->AnrechnungModel->addJoin('public.tbl_student student', 'prestudent_id');
|
||||
$this->AnrechnungModel->addJoin('public.tbl_benutzer benutzer', 'ON (benutzer.uid = student.student_uid)');
|
||||
$this->AnrechnungModel->addJoin('public.tbl_person person', 'person_id');
|
||||
$this->AnrechnungModel->addOrder('student.studiengang_kz, lv.bezeichnung');
|
||||
// After tbl_person: tbl_prestudent also has person_id, that would make USING (person_id) ambiguous
|
||||
$this->AnrechnungModel->addJoin('public.tbl_prestudent prestudent', 'ON (prestudent.prestudent_id = student.prestudent_id)');
|
||||
$this->AnrechnungModel->addOrder('prestudent.studiengang_kz, lv.bezeichnung');
|
||||
|
||||
$result = $this->AnrechnungModel->loadWhere(
|
||||
'(lehre.tbl_anrechnung.insertamum)::date = (NOW() - INTERVAL \'24 HOURS\')::DATE
|
||||
|
||||
@@ -75,8 +75,14 @@ class AnrechnungLib
|
||||
show_error(getError($student));
|
||||
}
|
||||
|
||||
// Get studiengang bezeichnung of the student, not of the LV
|
||||
if (!$studiengang = getData($this->ci->StudiengangModel->load($student->studiengang_kz))[0])
|
||||
// Studiengang of the prestudent, not of the LV (same source as the permission checks)
|
||||
if (!$prestudent = getData($this->ci->PrestudentModel->load($prestudent_id))[0])
|
||||
{
|
||||
show_error('Failed loading prestudent data.');
|
||||
}
|
||||
|
||||
// Get studiengang bezeichnung
|
||||
if (!$studiengang = getData($this->ci->StudiengangModel->load($prestudent->studiengang_kz))[0])
|
||||
{
|
||||
show_error('Failed loading studiengang data.');
|
||||
}
|
||||
@@ -95,7 +101,7 @@ class AnrechnungLib
|
||||
$latest_zgv_bezeichnung = hasData($result) ? getData($result)[0]->bezeichnung : '';
|
||||
|
||||
// Get Sum of berufliche and schulische ECTS
|
||||
$result = $this->ci->LehrveranstaltungModel->getEctsSumSchulisch($uid, $prestudent_id, $student->studiengang_kz);
|
||||
$result = $this->ci->LehrveranstaltungModel->getEctsSumSchulisch($uid, $prestudent_id, $prestudent->studiengang_kz);
|
||||
$sumEctsSchulisch = getData($result)[0]->ectssumschulisch;
|
||||
|
||||
$result = $this->ci->LehrveranstaltungModel->getEctsSumBeruflich($uid);
|
||||
@@ -602,7 +608,7 @@ class AnrechnungLib
|
||||
$this->ci->db->trans_start(false);
|
||||
|
||||
// Insert new status inProgressLektor
|
||||
$result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR);
|
||||
$this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR);
|
||||
|
||||
/**
|
||||
* Anyway update empfehlung_anrechnung to be null
|
||||
@@ -622,7 +628,7 @@ class AnrechnungLib
|
||||
if ($this->ci->db->trans_status() === false)
|
||||
{
|
||||
$this->ci->db->trans_rollback();
|
||||
return error($result->msg, EXIT_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true; // recommended
|
||||
|
||||
Reference in New Issue
Block a user