bugfixes changeStatus, generateMatrikelnummer, updateLists, validations

This commit is contained in:
ma0068
2024-07-15 15:41:45 +02:00
parent 5043f00c97
commit 58403ff00e
6 changed files with 351 additions and 317 deletions
@@ -245,6 +245,35 @@ class PrestudentstatusCheckLib
return success(getData($result));
}
/**
* Checks if status aufgenommen already exists.
* @return error if invalid
* @return error if no status Aufgenommen, success otherwise
*/
public function checkIfExistingAufgenommenerstatus($prestudent_id)
{
$result = $this->_getApplicationData($prestudent_id);
if(isError($result))
{
return getData($result);
}
$result = current(getData($result));
$studentName = trim ($result->vorname.' '.$result->nachname);
$result = $this->_ci->PrestudentstatusModel->checkIfExistingAufgenommenerstatus(
$prestudent_id
);
if(isError($result))
{
return getData($result);
}
if(getData($result) == "0")
{
return error($this->_ci->p->t('lehre','error_keinAufgenommener', ['name' => $studentName]));
}
return success(getData($result));
}
/**
* Check if Bismeldestichtag erreicht
* @param Date $statusDatum