mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-13 13:02:18 +00:00
remove unnecessary LE join in diplomasupplement.xml.php; fix studiensemester_kurzbz col datatype in dbupdate script; stv projektarbeit dropdown selection also by studienplan of current prestudent_status history entry
This commit is contained in:
@@ -42,6 +42,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->load->model('education/Note_model', 'NoteModel');
|
||||
$this->load->model('education/Projektbetreuer_model', 'BetreuerModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
// load libraries
|
||||
$this->load->library('PermissionLib');
|
||||
@@ -251,12 +253,36 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
if (!isset($student_uid)) $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
|
||||
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemester missing', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// get Lvs
|
||||
// get prestudent_id from student model
|
||||
$studentRes = $this->StudentModel->load(['student_uid' => $student_uid]);
|
||||
if(hasData($studentRes)) {
|
||||
$student = getData($studentRes);
|
||||
} else {
|
||||
$this->terminateWithError($studentRes, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// to get prestudent_status history
|
||||
$historyRes = $this->PrestudentstatusModel->getHistoryPrestudent($student[0]->prestudent_id);
|
||||
if(hasData($historyRes)) {
|
||||
$history = getData($historyRes);
|
||||
} else {
|
||||
$this->terminateWithError($historyRes, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// query for every lva of a studiengang that has projektarbeit flag true
|
||||
$lvsResult = $this->LehrveranstaltungModel->getLvsForProjektarbeit($student_uid, $studiengang_kz, $additional_lehrveranstaltung_id);
|
||||
|
||||
if (isError($lvsResult)) return $this->terminateWithError($lvsResult, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$lvs = hasData($lvsResult) ? getData($lvsResult) : [];
|
||||
|
||||
$lvsIDs = array_column($lvs, 'lehrveranstaltung_id');
|
||||
|
||||
// get current studienplan_id from status history to find out which lva options are actually assigned to the students studienplan
|
||||
// important so the projektarbeit has the correct lva assigned to be able to find and print the thesis title on the degree documents!
|
||||
$currentStatus = $history[0];
|
||||
$lvByStudienPlanRes = $this->LehrveranstaltungModel->getLvsByStudienplanByLvaIDs($currentStatus->studienplan_id, $lvsIDs);
|
||||
if(hasData($lvByStudienPlanRes)) {
|
||||
$lvs = getData($lvByStudienPlanRes);
|
||||
}
|
||||
|
||||
foreach ($lvs as $lv)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user