Added Antragssperre for Noten, that are defined in config array

. Added new config file
. Added check, if LV was already graded and if grades are defined in configs
'blocking grades array'. If so, Anrechnung is not allowed.
. Adapted GUI to process data via JS only

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-05-03 16:14:24 +02:00
committed by cris-technikum
parent d23faa6e96
commit a50a666d11
5 changed files with 125 additions and 12 deletions
@@ -41,6 +41,9 @@ class requestAnrechnung extends Auth_Controller
$this->load->helper('url');
$this->load->helper('hlp_sancho_helper');
// Load configs
$this->load->config('anrechnung');
// Load language phrases
$this->loadPhrases(
array(
@@ -82,6 +85,9 @@ class requestAnrechnung extends Auth_Controller
// $is_expired = self::_checkAntragDeadline($studiensemester_kurzbz);
$is_expired = false;
// Check if Lehrveranstaltung was already graded with application blocking grades
$is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
// Get Anrechung data
$anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id);
@@ -91,7 +97,8 @@ class requestAnrechnung extends Auth_Controller
$viewData = array(
'antragData' => $antragData,
'anrechnungData' => $anrechnungData,
'is_expired' => $is_expired
'is_expired' => $is_expired,
'is_blocked' => $is_blocked
);
$this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData);
@@ -299,6 +306,31 @@ class requestAnrechnung extends Auth_Controller
return $studiensemester_kurzbz == $actual_ss;
}
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id)
{
// Get Note of Lehrveranstaltung
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
$result = $this->LvgesamtnoteModel->load(array(
'student_uid' => $this->_uid,
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'lehrveranstaltung_id' => $lehrveranstaltung_id
)
);
// If Lehrveranstaltung has Note
if (hasData($result))
{
$note = getData($result)[0]->note;
// Check if Note is a blocking grade
if (in_array($note, $this->config->item('grades_blocking_application')))
{
return true;
}
}
return false;
}
/**
* Upload file via DMS library.
*