mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
checkIfLastBewerberAndAufgenommenerShareSemesters
This commit is contained in:
@@ -173,7 +173,7 @@ class PrestudentstatusCheckLib
|
||||
*/
|
||||
public function checkIfExistingBewerberstatus($prestudent_id)
|
||||
{
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_BEWERBER
|
||||
]);
|
||||
@@ -193,7 +193,7 @@ class PrestudentstatusCheckLib
|
||||
*/
|
||||
public function checkIfExistingAufgenommenerstatus($prestudent_id)
|
||||
{
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_AUFGENOMMENER
|
||||
]);
|
||||
@@ -203,6 +203,55 @@ class PrestudentstatusCheckLib
|
||||
return success(hasData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the last Bewerber status and the last Aufgenommener status
|
||||
* have the same studiensemester and ausbildungssemester.
|
||||
*
|
||||
* Attention:
|
||||
* If one of those two status is missing the function returns true!
|
||||
*
|
||||
* @param integer $prestudent_id
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function checkIfLastBewerberAndAufgenommenerShareSemesters($prestudent_id)
|
||||
{
|
||||
$this->_ci->PrestudentstatusModel->addOrder('datum', 'DESC');
|
||||
$this->_ci->PrestudentstatusModel->addOrder('insertamum', 'DESC');
|
||||
$this->_ci->PrestudentstatusModel->addLimit(1);
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_BEWERBER
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
if (!hasData($result))
|
||||
return success(true);
|
||||
|
||||
$bewerber = current(getData($result));
|
||||
|
||||
$this->_ci->PrestudentstatusModel->addOrder('datum', 'DESC');
|
||||
$this->_ci->PrestudentstatusModel->addOrder('insertamum', 'DESC');
|
||||
$this->_ci->PrestudentstatusModel->addLimit(1);
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_AUFGENOMMENER
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
if (!hasData($result))
|
||||
return success(true);
|
||||
|
||||
$aufgenommener = current(getData($result));
|
||||
|
||||
return success(
|
||||
$bewerber->studiensemester_kurzbz == $aufgenommener->studiensemester_kurzbz
|
||||
&& $bewerber->ausbildungssemester == $aufgenommener->ausbildungssemester
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Bismeldestichtag erreicht
|
||||
*
|
||||
|
||||
@@ -28176,6 +28176,26 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_lastBewerberAndAufgenommenerSemesters',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Studiensemester oder Ausbildungsemester des Berwerberstatus und des Aufgenommenenstatus passen nicht überein',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The study semester or training semester of the applicant status and the accepted status do not match',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
|
||||
Reference in New Issue
Block a user