diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index dabedb641..c5134e7d9 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -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; + } } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 589e4ac7e..d88514ece 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -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' + ) + ) + ), );