Status Diplomand

This commit is contained in:
cgfhtw
2024-08-06 16:24:38 +02:00
parent 21e69c6d94
commit 09a0536921
2 changed files with 9 additions and 55 deletions
@@ -477,15 +477,11 @@ class Status extends FHCAPI_Controller
);
break;
case Prestudentstatus_model::STATUS_DIPLOMAND:
$this->load->library('PrestudentLib');
$result = $this->prestudentlib->setDiplomand($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester);
if (isError($result))
{
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
else
$this->terminateWithSuccess($prestudent_id);
$result = $this->prestudentlib->setDiplomand(
$prestudent_id,
$studiensemester_kurzbz,
$ausbildungssemester
);
break;
case Prestudentstatus_model::STATUS_ABSOLVENT:
$this->load->library('PrestudentLib');
+4 -46
View File
@@ -519,23 +519,18 @@ class PrestudentLib
public function setDiplomand($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester)
{
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
if (isError($result))
return $result;
if (!hasData($result))
return error($this->_ci->p->t('studierendenantrag', 'error_no_student_for_prestudent', ['prestudent_id' => $prestudent_id]));
$result = getData($result) ?: [];
$prestudent_status = current(getData($result));
$prestudent_status = current($result);
$result = $this->_ci->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
if (isError($result))
return $result;
$result = getData($result);
if (!$result)
return error($this->_ci->p->t('studierendenantrag', 'error_no_student_for_prestudent', ['prestudent_id' => $prestudent_id]));
// Update Aktionen
//Status updaten
// Status updaten
$result = $this->_ci->PrestudentstatusModel->insert([
'prestudent_id' => $prestudent_id,
'status_kurzbz' => Prestudentstatus_model::STATUS_DIPLOMAND,
@@ -553,43 +548,6 @@ class PrestudentLib
if (isError($result))
return $result;
$result = $this->_ci->StudentModel->checkIfUid($prestudent_id);
if (isError($result)) {
return $result;
}
$student_uid = $result->retval;
//load student
$result = $this->_ci->StudentModel->loadWhere(
array(
'student_uid' => $student_uid
)
);
if (isError($result))
{
return $result;
}
$studentData = current(getData($result) ? : []);
$verband = $studentData->verband == '' ? '' : $studentData->verband;
$gruppe = $studentData->gruppe == '' ? '' : $studentData->gruppe;
$studiengang_kz = $studentData->studiengang_kz;
//process studentlehrverband
$this->_ci->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
$result = $this->_ci->StudentlehrverbandModel->processStudentlehrverband(
$student_uid,
$studiengang_kz,
$ausbildungssemester,
$verband,
$gruppe,
$studiensemester_kurzbz
);
if (isError($result))
{
return $result;
}
return success();
}