Fixed: Now application can only be done for actual study semester

Before student could apply for past study semester, which should not be
possible. Fixed now.

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-03-24 17:16:17 +01:00
committed by cris-technikum
parent 683e9ffdda
commit 997f6f406b
2 changed files with 41 additions and 0 deletions
@@ -141,6 +141,13 @@ class requestAnrechnung extends Auth_Controller
{
show_error('Der Antrag wurde bereits gestellt');
}
// Exit, if application is not for actual studysemester
if (!self::_applicationIsForActualSS($studiensemester_kurzbz))
{
show_error ($this->p->t('anrechnung', 'antragNurImAktSS'));
}
// Start DB transaction
$this->db->trans_start(false);
@@ -317,4 +324,18 @@ class requestAnrechnung extends Auth_Controller
return $result;
}
/**
* Check, if applications' study semester is actual study semester
* @param $studiensemester_kurzbz
* @return bool
*/
private function _applicationIsForActualSS($studiensemester_kurzbz)
{
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$result = $this->StudiensemesterModel->getNearest();
$actual_ss = getData($result)[0]->studiensemester_kurzbz;
return $studiensemester_kurzbz == $actual_ss;
}
}
+20
View File
@@ -10330,6 +10330,26 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'anrechnung',
'phrase' => 'antragNurImAktSS',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Der Antrag kann nur für das aktuelle Semester gestellt werden",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => "You only can apply for the actual study semester",
'description' => '',
'insertvon' => 'system'
)
)
),
);