mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
Added Antragssperre for Noten, when STGL wants to create Anrechnung
Added check, if LV was already graded and if grades are defined in configs 'blocking grades array'. If so, Anrechnung is not allowed. Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
@@ -47,6 +47,9 @@ class CreateAnrechnung extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->setControllerId();
|
||||
@@ -140,6 +143,12 @@ class CreateAnrechnung extends Auth_Controller
|
||||
$this->terminateWithJsonError($this->p->t('global', 'antragBereitsGestellt'));
|
||||
}
|
||||
|
||||
// Exit if Lehrveranstaltung was already graded with application blocking grades
|
||||
if (self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id, $prestudent_id))
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('anrechnung', 'antragBenotungBlockiert'));
|
||||
}
|
||||
|
||||
// Upload document
|
||||
$result = self::_uploadFile();
|
||||
|
||||
@@ -231,4 +240,32 @@ class CreateAnrechnung extends Auth_Controller
|
||||
return $this->dmslib->upload($dms, 'uploadfile', array('pdf'));
|
||||
}
|
||||
|
||||
private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id, $prestudent_id)
|
||||
{
|
||||
// Get Student UID
|
||||
$student_uid = $this->StudentModel->getUID($prestudent_id);
|
||||
|
||||
// Get Note of Lehrveranstaltung
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$result = $this->LvgesamtnoteModel->load(array(
|
||||
'student_uid' => $student_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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12232,6 +12232,26 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'anrechnung',
|
||||
'phrase' => 'antragBenotungBlockiert',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => "Antrag kann aufgrund der vorhandenen Benotung nicht erstellt werden.",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => "Application can not be created due to existing grade.",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user