mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-04 04:19:28 +00:00
Check Personenkennzeichen
This commit is contained in:
@@ -584,6 +584,46 @@ class PrestudentstatusCheckLib
|
||||
return success(getData($result)['diplomant']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if Personenkennzeichen is set correctly.
|
||||
*
|
||||
* @param integer $prestudent_id
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function checkPersonenkennzeichen($prestudent_id)
|
||||
{
|
||||
$this->_ci->PrestudentstatusModel->addSelect('tbl_prestudentstatus.prestudent_id');
|
||||
$this->_ci->PrestudentstatusModel->addSelect('tbl_student.matrikelnr');
|
||||
|
||||
$this->_ci->PrestudentstatusModel->addJoin('public.tbl_student', 'prestudent_id');
|
||||
|
||||
$this->_ci->PrestudentstatusModel->addOrder('tbl_prestudentstatus.datum', 'DESC');
|
||||
$this->_ci->PrestudentstatusModel->addOrder('tbl_prestudentstatus.insertamum', 'DESC');
|
||||
$this->_ci->PrestudentstatusModel->addOrder('tbl_prestudentstatus.ext_id', 'DESC');
|
||||
|
||||
$this->_ci->PrestudentstatusModel->addLimit(1);
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->loadWhere([
|
||||
'tbl_prestudentstatus.status_kurzbz' => self::STATUS_STUDENT
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
if (!hasData($result))
|
||||
return success(true); // Not a student yet so no wrong personenkennzeichen
|
||||
|
||||
$data = current(getData($result));
|
||||
|
||||
$jahr = $this->_ci->StudiensemesterModel->getStudienjahrNumberFromStudiensemester($data->studiensemester_kurzbz);
|
||||
|
||||
|
||||
return success($jahr == mb_substr($data->matrikelnr, 0, 2));
|
||||
}
|
||||
|
||||
// TODO(chris): check status history error_bewerberOrgformUngleichStudentOrgform
|
||||
|
||||
/**
|
||||
* Check if History of StatusData is valid
|
||||
* @param integer $prestudent_id
|
||||
|
||||
Reference in New Issue
Block a user