mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
refactor actions prestudentLib
This commit is contained in:
@@ -153,11 +153,6 @@ class Status extends FHCAPI_Controller
|
||||
$ausbildungssemester = $lastStatusData->ausbildungssemester;
|
||||
}
|
||||
|
||||
/* if($status_kurzbz != 'Student')
|
||||
{
|
||||
$ausbildungssemester = $lastStatusData->ausbildungssemester;
|
||||
}*/
|
||||
|
||||
//check if Rolle already exists
|
||||
$result = $this->PrestudentstatusModel->checkIfExistingPrestudentRolle(
|
||||
$prestudent_id,
|
||||
@@ -231,7 +226,6 @@ class Status extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
//check if studentrolle already exists
|
||||
//TODO(manu) refactor and test
|
||||
if($status_kurzbz == 'Student' || $status_kurzbz == 'Diplomand' || $lastStatusData->status_kurzbz == 'Student')
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
@@ -276,7 +270,6 @@ class Status extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
//check if Bismeldestichtag erreicht
|
||||
//TODO(manu) Test...
|
||||
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
|
||||
$result = $this->BismeldestichtagModel->checkIfMeldestichtagErreicht($new_status_datum);
|
||||
if (isError($result))
|
||||
@@ -320,7 +313,7 @@ class Status extends FHCAPI_Controller
|
||||
$studiensemester_kurzbz = $lastStatusData->studiensemester_kurzbz;
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
$result = $this->prestudentlib->setUnterbrecherFas($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $datum, $bestaetigtam, $bestaetigtvon);
|
||||
$result = $this->prestudentlib->setUnterbrecher($prestudent_id, $studiensemester_kurzbz, null, null, $ausbildungssemester);
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
@@ -329,11 +322,8 @@ class Status extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($prestudent_id);
|
||||
}
|
||||
|
||||
//TODO(Manu) documentation: here setStudent Logic!
|
||||
if($status_kurzbz == 'Student')
|
||||
{
|
||||
//return $this->terminateWithError($studiensemester_kurzbz . " - " . $ausbildungssemester, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
$result = $this->prestudentlib->setStudent($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $statusgrund_id, $bestaetigtam, $bestaetigtvon);
|
||||
|
||||
@@ -348,10 +338,8 @@ class Status extends FHCAPI_Controller
|
||||
|
||||
if($status_kurzbz == 'Diplomand')
|
||||
{
|
||||
//return $this->terminateWithError("in setDiplomand", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
$result = $this->prestudentlib->setDiplomand($prestudent_id, $studiensemester_kurzbz,$ausbildungssemester, $bestaetigtam, $bestaetigtvon);
|
||||
$result = $this->prestudentlib->setDiplomand($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
@@ -364,10 +352,8 @@ class Status extends FHCAPI_Controller
|
||||
|
||||
if($status_kurzbz == 'Absolvent')
|
||||
{
|
||||
//return $this->terminateWithError("in setAbsolvent", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('PrestudentLib');
|
||||
$result = $this->prestudentlib->setAbsolvent($prestudent_id, $studiensemester_kurzbz,$ausbildungssemester, $bestaetigtam, $bestaetigtvon);
|
||||
$result = $this->prestudentlib->setAbsolvent($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
@@ -378,8 +364,6 @@ class Status extends FHCAPI_Controller
|
||||
|
||||
}
|
||||
|
||||
return $this->terminateWithError("Warning! not in setStatus Mode", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_begin(); // Beginnen der Transaktion
|
||||
|
||||
@@ -405,7 +389,6 @@ class Status extends FHCAPI_Controller
|
||||
if ($this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if($isStudent)
|
||||
@@ -455,7 +438,8 @@ class Status extends FHCAPI_Controller
|
||||
if ($this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
return $this->terminateWithError($this->p->t('lehre','error_duringInsertUpdateLehrverband'), self::ERROR_TYPE_GENERAL);
|
||||
// return $this->terminateWithError($result->code);
|
||||
return $this->terminateWithError($this->p->t('lehre','error_duringInsertUpdateLehrverband'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//update(fuer Abbrecher und Unterbrecher)
|
||||
|
||||
@@ -206,7 +206,7 @@ class PrestudentLib
|
||||
return success();
|
||||
}
|
||||
|
||||
public function setUnterbrecher($prestudent_id, $studiensemester_kurzbz, $studierendenantrag_id, $insertvon = null)
|
||||
public function setUnterbrecher($prestudent_id, $studiensemester_kurzbz, $studierendenantrag_id = null, $insertvon = null, $ausbildungssemester = null)
|
||||
{
|
||||
$ausbildungssemester_plus = 0;
|
||||
if (!$insertvon)
|
||||
@@ -259,21 +259,32 @@ class PrestudentLib
|
||||
|
||||
$student = current($result);
|
||||
|
||||
$resultAntrag = $this->_ci->StudierendenantragModel->load($studierendenantrag_id);
|
||||
if (isError($resultAntrag))
|
||||
return $resultAntrag;
|
||||
$resultAntrag = getData($resultAntrag);
|
||||
if (!$resultAntrag)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $studierendenantrag_id]));
|
||||
if($studierendenantrag_id)
|
||||
{
|
||||
$resultAntrag = $this->_ci->StudierendenantragModel->load($studierendenantrag_id);
|
||||
if (isError($resultAntrag))
|
||||
return $resultAntrag;
|
||||
$resultAntrag = getData($resultAntrag);
|
||||
if (!$resultAntrag)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $studierendenantrag_id]));
|
||||
|
||||
$antrag = current($resultAntrag);
|
||||
$antrag = current($resultAntrag);
|
||||
$anmerkung = 'Wiedereinstieg ' . $antrag->datum_wiedereinstieg;
|
||||
}
|
||||
else
|
||||
$anmerkung = '';
|
||||
|
||||
if($ausbildungssemester)
|
||||
$semester = $ausbildungssemester;
|
||||
else
|
||||
$semester = $prestudent_status->ausbildungssemester + $ausbildungssemester_plus;
|
||||
|
||||
//Status updaten
|
||||
$result = $this->_ci->PrestudentstatusModel->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_UNTERBRECHER,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $prestudent_status->ausbildungssemester + $ausbildungssemester_plus,
|
||||
'ausbildungssemester' => $semester,
|
||||
'datum' => date('c'),
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('c'),
|
||||
@@ -281,7 +292,7 @@ class PrestudentLib
|
||||
'studienplan_id'=> $prestudent_status->studienplan_id,
|
||||
'bestaetigtvon' => $insertvon,
|
||||
'bestaetigtam' => date('c'),
|
||||
'anmerkung'=> 'Wiedereinstieg ' . $antrag->datum_wiedereinstieg
|
||||
'anmerkung'=> $anmerkung
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
@@ -410,22 +421,19 @@ class PrestudentLib
|
||||
return success();
|
||||
}
|
||||
|
||||
public function setUnterbrecherFas($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $datum, $bestaetigtAm, $bestaetigtVon)
|
||||
|
||||
public function setStudent($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $statusgrund_id, $bestaetigtAm, $bestaetigtVon)
|
||||
{
|
||||
$insertvon = getAuthUID();
|
||||
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result) {
|
||||
//NOTE(manu): only valid if nextSemester focus max
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
//if not Wiederholer
|
||||
if($statusgrund_id != 16)
|
||||
{
|
||||
//check if ausbildungssemester is last
|
||||
$this->_ci->StudiengangModel->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$res = $this->_ci->StudiengangModel->loadWhere(['p.prestudent_id' => $prestudent_id]);
|
||||
@@ -438,8 +446,6 @@ class PrestudentLib
|
||||
|
||||
$studiengang = current(getData($res));
|
||||
$prestudent_status = current($result);
|
||||
if($prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester)
|
||||
$ausbildungssemester_plus = 1;
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
@@ -461,211 +467,6 @@ class PrestudentLib
|
||||
|
||||
$student = current($result);
|
||||
|
||||
/* $resultAntrag = $this->_ci->StudierendenantragModel->load($studierendenantrag_id);
|
||||
if (isError($resultAntrag))
|
||||
return $resultAntrag;
|
||||
$resultAntrag = getData($resultAntrag);
|
||||
if (!$resultAntrag)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $studierendenantrag_id]));
|
||||
|
||||
$antrag = current($resultAntrag);*/
|
||||
|
||||
//Status updaten
|
||||
$result = $this->_ci->PrestudentstatusModel->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_UNTERBRECHER,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $ausbildungssemester,
|
||||
'datum' => date('c'),
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('c'),
|
||||
'orgform_kurzbz'=> $prestudent_status->orgform_kurzbz,
|
||||
'studienplan_id'=> $prestudent_status->studienplan_id,
|
||||
'bestaetigtvon' => $insertvon,
|
||||
'bestaetigtam' => date('c'),
|
||||
/* 'anmerkung'=> 'Wiedereinstieg ' . $antrag->datum_wiedereinstieg*/
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
//Verband anlegen
|
||||
$result = $this->_ci->LehrverbandModel->load([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => ''
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
{
|
||||
$result = $this->_ci->LehrverbandModel->load([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => '',
|
||||
'gruppe' => ''
|
||||
]);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
$this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => '',
|
||||
'gruppe' => '',
|
||||
'bezeichnung' => 'Ab-Unterbrecher',
|
||||
'aktiv' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'bezeichnung' => 'Unterbrecher',
|
||||
'aktiv' => true
|
||||
]);
|
||||
}
|
||||
|
||||
//noch nicht eingetragene Zeugnisnoten auf 9 setzen
|
||||
$result = $this->_ci->ZeugnisnoteModel->getZeugnisnoten($student->student_uid, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result) ?: [];
|
||||
|
||||
foreach ($result as $lv)
|
||||
{
|
||||
if (!$lv->note)
|
||||
{
|
||||
$result = $this->_ci->ZeugnisnoteModel->insert([
|
||||
'note' => 9,
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz,
|
||||
'student_uid' => $lv->uid,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$result = $this->_ci->ZeugnisnoteModel->update([
|
||||
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz,
|
||||
'student_uid' => $lv->uid,
|
||||
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id
|
||||
], [
|
||||
'note' => 9
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Update Aktionen
|
||||
|
||||
//StudentModel updaten
|
||||
$this->_ci->StudentModel->update([
|
||||
'student_uid' => $student->student_uid
|
||||
], [
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'semester' => 0,
|
||||
'updatevon' => $insertvon,
|
||||
'updateamum' => date('c')
|
||||
]);
|
||||
|
||||
//Studentlehrverband setzen
|
||||
$result = $this->_ci->StudentlehrverbandModel->loadWhere([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student->student_uid
|
||||
]);
|
||||
if (hasData($result)) {
|
||||
$this->_ci->StudentlehrverbandModel->update([
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'student_uid' => $student->student_uid
|
||||
], [
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $insertvon
|
||||
]);
|
||||
} else {
|
||||
$this->_ci->StudentlehrverbandModel->insert([
|
||||
'student_uid' => $student->student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $student->studiengang_kz,
|
||||
'semester' => 0,
|
||||
'verband' => 'B',
|
||||
'gruppe' => '',
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $insertvon
|
||||
]);
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
public function setStudent($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $statusgrund_id, $bestaetigtAm, $bestaetigtVon)
|
||||
{
|
||||
$insertvon = getAuthUID();
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
{
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
if($statusgrund_id != 16)
|
||||
{
|
||||
//check if ausbildungssemester is last
|
||||
$this->_ci->StudiengangModel->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$res = $this->_ci->StudiengangModel->loadWhere(['p.prestudent_id' => $prestudent_id]);
|
||||
if(isError($res))
|
||||
return $res;
|
||||
if(!hasData($res))
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_stg_for_prestudent', [
|
||||
'prestudent_id' => $prestudent_id
|
||||
]));
|
||||
|
||||
$studiengang = current(getData($res));
|
||||
$prestudent_status = current($result);
|
||||
if($prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester)
|
||||
$ausbildungssemester_plus = 1;
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_prestudent_in_sem', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$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]));
|
||||
|
||||
$student = current($result);
|
||||
|
||||
//Status updaten
|
||||
$result = $this->_ci->PrestudentstatusModel->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
@@ -678,8 +479,8 @@ class PrestudentLib
|
||||
'insertamum' => date('c'),
|
||||
'orgform_kurzbz'=> $prestudent_status->orgform_kurzbz,
|
||||
'studienplan_id'=> $prestudent_status->studienplan_id,
|
||||
'bestaetigtvon' => $insertvon,
|
||||
'bestaetigtam' => date('c'),
|
||||
'bestaetigtvon' => $bestaetigtVon,
|
||||
'bestaetigtam' => $bestaetigtAm
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
@@ -687,7 +488,7 @@ class PrestudentLib
|
||||
|
||||
$result = $this->_ci->StudentModel->checkIfUid($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
return $result;
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
@@ -699,7 +500,7 @@ class PrestudentLib
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
return $result;
|
||||
}
|
||||
|
||||
$studentData = current(getData($result) ? : []);
|
||||
@@ -721,48 +522,14 @@ class PrestudentLib
|
||||
return success();
|
||||
}
|
||||
|
||||
public function setDiplomand($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester,$bestaetigtAm, $bestaetigtVon)
|
||||
public function setDiplomand($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester)
|
||||
{
|
||||
$insertvon = getAuthUID();
|
||||
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
{
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
if($statusgrund_id != 16)
|
||||
{
|
||||
//check if ausbildungssemester is last
|
||||
$this->_ci->StudiengangModel->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$res = $this->_ci->StudiengangModel->loadWhere(['p.prestudent_id' => $prestudent_id]);
|
||||
if(isError($res))
|
||||
return $res;
|
||||
if(!hasData($res))
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_stg_for_prestudent', [
|
||||
'prestudent_id' => $prestudent_id
|
||||
]));
|
||||
|
||||
$studiengang = current(getData($res));
|
||||
$prestudent_status = current($result);
|
||||
if($prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester)
|
||||
$ausbildungssemester_plus = 1;
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_prestudent_in_sem', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$prestudent_status = current($result);
|
||||
$result = $this->_ci->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
@@ -780,8 +547,7 @@ class PrestudentLib
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_DIPLOMAND,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
// 'statusgrund_id' => $statusgrund_id,
|
||||
// 'ausbildungssemester' => $ausbildungssemester,
|
||||
'ausbildungssemester' => $ausbildungssemester,
|
||||
'datum' => date('c'),
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('c'),
|
||||
@@ -796,7 +562,7 @@ class PrestudentLib
|
||||
|
||||
$result = $this->_ci->StudentModel->checkIfUid($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
return $result;
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
@@ -808,7 +574,7 @@ class PrestudentLib
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
return $result;
|
||||
}
|
||||
|
||||
$studentData = current(getData($result) ? : []);
|
||||
@@ -826,52 +592,31 @@ class PrestudentLib
|
||||
$gruppe,
|
||||
$studiensemester_kurzbz
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
public function setAbsolvent($prestudent_id,$studiensemester_kurzbz, $ausbildungssemester, $bestaetigtAm, $bestaetigtVon)
|
||||
public function setAbsolvent($prestudent_id, $studiensemester_kurzbz, $ausbildungssemester)
|
||||
{
|
||||
//TODO(Manu) makes no difference
|
||||
/* if (gettype($ausbildungssemester) != "integer") {
|
||||
$ausbildungssemester = (int)$ausbildungssemester;
|
||||
}*/
|
||||
|
||||
/* if (!is_string($ausbildungssemester)) {
|
||||
$ausbildungssemester = (string)$ausbildungssemester; // Oder verwende strval($ausbildungssemester)
|
||||
}*/
|
||||
|
||||
$insertvon = getAuthUID();
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
if (!$result)
|
||||
{
|
||||
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$result = getData($result);
|
||||
|
||||
if($statusgrund_id != 16)
|
||||
{
|
||||
//check if ausbildungssemester is last
|
||||
$this->_ci->StudiengangModel->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$res = $this->_ci->StudiengangModel->loadWhere(['p.prestudent_id' => $prestudent_id]);
|
||||
if(isError($res))
|
||||
return $res;
|
||||
if(!hasData($res))
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_stg_for_prestudent', [
|
||||
'prestudent_id' => $prestudent_id
|
||||
]));
|
||||
|
||||
$studiengang = current(getData($res));
|
||||
$prestudent_status = current($result);
|
||||
if($prestudent_status->ausbildungssemester + 1 < $studiengang->max_semester)
|
||||
$ausbildungssemester_plus = 1;
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_prestudent_in_sem', [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$prestudent_status = current($result);
|
||||
$result = $this->_ci->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
@@ -882,15 +627,14 @@ class PrestudentLib
|
||||
if (!$result)
|
||||
return error($this->_ci->p->t('studierendenantrag', 'error_no_student_for_prestudent', ['prestudent_id' => $prestudent_id]));
|
||||
|
||||
$student = current($result);
|
||||
// $student = current($result);
|
||||
|
||||
//Status updaten
|
||||
$result = $this->_ci->PrestudentstatusModel->insert([
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => Prestudentstatus_model::STATUS_ABSOLVENT,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
// 'statusgrund_id' => $statusgrund_id,
|
||||
// 'ausbildungssemester' => $ausbildungssemester,
|
||||
'ausbildungssemester' => $ausbildungssemester,
|
||||
'datum' => date('c'),
|
||||
'insertvon' => $insertvon,
|
||||
'insertamum' => date('c'),
|
||||
@@ -905,7 +649,7 @@ class PrestudentLib
|
||||
|
||||
$result = $this->_ci->StudentModel->checkIfUid($prestudent_id);
|
||||
if (isError($result)) {
|
||||
return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
return $result;
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
@@ -917,7 +661,7 @@ class PrestudentLib
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
return $result;
|
||||
}
|
||||
|
||||
$studentData = current(getData($result) ? : []);
|
||||
@@ -935,6 +679,10 @@ class PrestudentLib
|
||||
$gruppe,
|
||||
$studiensemester_kurzbz
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ class Studentlehrverband_model extends DB_Model
|
||||
|
||||
if ($result->retval == "0")
|
||||
{
|
||||
//$this->terminateWithError("in section 0 und weiter.. wo verband auf leer gesetzt wird", self::ERROR_TYPE_GENERAL);
|
||||
$result = $this->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'semester' => $ausbildungssemester,
|
||||
@@ -87,6 +86,8 @@ class Studentlehrverband_model extends DB_Model
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Lehrverband insert
|
||||
$bezeichnung = $verband == 'A' ? ' Abbrecher' : 'Unterbrecher';
|
||||
$result = $this->LehrverbandModel->insert([
|
||||
@@ -104,6 +105,7 @@ class Studentlehrverband_model extends DB_Model
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Studentlehrverband insert or update
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$result = $this->StudentlehrverbandModel->checkIfStudentLehrverbandExists($student_uid, $studiensemester_kurzbz);
|
||||
|
||||
@@ -39,6 +39,7 @@ class Lehrverband_model extends DB_Model
|
||||
|
||||
$result = $this->execQuery($qry, array($studiengang_kz, $semester, $verband, $gruppe));
|
||||
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
return error($result);
|
||||
|
||||
@@ -2,7 +2,6 @@ import {CoreFilterCmpt} from "../../../../filter/Filter.js";
|
||||
import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
import FormForm from '../../../../Form/Form.js';
|
||||
import FormInput from '../../../../Form/Input.js';
|
||||
import {CoreRESTClient} from "../../../../../RESTClient.js";
|
||||
|
||||
export default{
|
||||
components: {
|
||||
@@ -49,11 +48,6 @@ export default{
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
/* personIds(){
|
||||
if (this.modelValue.person_id)
|
||||
return [this.modelValue.person_id];
|
||||
return this.modelValue.map(e => e.person_id);
|
||||
},*/
|
||||
prestudentIds(){
|
||||
if (this.modelValue.prestudent_id)
|
||||
{
|
||||
@@ -71,7 +65,6 @@ export default{
|
||||
name: `${this.modelValue.vorname} ${this.modelValue.nachname}`
|
||||
};
|
||||
dataArray.push(newObj);
|
||||
//console.log(dataArray);
|
||||
return dataArray;
|
||||
}
|
||||
else
|
||||
@@ -94,7 +87,7 @@ export default{
|
||||
},
|
||||
arrayStg(){
|
||||
let stgInteger = this.hasAssistenzPermissionForStgs.map(item => {
|
||||
return parseInt(item); // Wandelt jeden String in eine ganze Zahl um
|
||||
return parseInt(item);
|
||||
});
|
||||
return stgInteger;
|
||||
},
|
||||
@@ -140,11 +133,6 @@ export default{
|
||||
minWidth: 150, // Ensures Action-buttons will be always fully displayed
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
|
||||
|
||||
//let disableButton = false;
|
||||
//const rowData = this.row.getData();
|
||||
|
||||
|
||||
let container = document.createElement('div');
|
||||
container.className = "d-flex gap-2";
|
||||
|
||||
@@ -266,8 +254,6 @@ export default{
|
||||
}
|
||||
}
|
||||
],
|
||||
// }
|
||||
|
||||
statusData: {},
|
||||
listStudiensemester: [],
|
||||
maxSem: Array.from({ length: 11 }, (_, index) => index),
|
||||
@@ -365,7 +351,6 @@ export default{
|
||||
this.actionButton = statusgrund;
|
||||
this.actionStatusText = statusText;
|
||||
|
||||
console.log("statusgrund: " + this.actionButton + ' , statusText: ' + this.actionStatusText + ' sem: ' + this.actionSem);
|
||||
if(this.actionStatusText != "Student" && this.actionStatusText != "Wiederholer")
|
||||
this.$refs.confirmStatusAction.show();
|
||||
else
|
||||
@@ -382,10 +367,10 @@ export default{
|
||||
};
|
||||
console.log(this.updateData);
|
||||
this.newArray = this.updateData.map(objekt => ({ ...objekt, ...abbruchData }));
|
||||
console.log(this.newArray);
|
||||
/* console.log(this.newArray);
|
||||
|
||||
console.log("in changeStatusToAbbrecher" + prestudentIds);
|
||||
console.log("count: " + prestudentIds.length);
|
||||
console.log("count: " + prestudentIds.length);*/
|
||||
|
||||
this.addNewStatus(prestudentIds);
|
||||
},
|
||||
@@ -400,8 +385,6 @@ export default{
|
||||
};
|
||||
|
||||
this.newArray = this.updateData.map(objekt => ({ ...objekt, ...deltaData }));
|
||||
|
||||
console.log("in changeStatusToAbbrecher" + prestudentIds);
|
||||
this.addNewStatus(prestudentIds);
|
||||
},
|
||||
changeStatusToUnterbrecher(prestudentIds){
|
||||
@@ -414,8 +397,6 @@ export default{
|
||||
};
|
||||
|
||||
this.newArray = this.updateData.map(objekt => ({ ...objekt, ...deltaData }));
|
||||
|
||||
console.log("in changeStatusToUnterbrecher" + prestudentIds);
|
||||
this.addNewStatus(prestudentIds);
|
||||
},
|
||||
changeStatusToStudent(prestudentIds){
|
||||
@@ -428,8 +409,6 @@ export default{
|
||||
};
|
||||
|
||||
this.newArray = this.updateData.map(objekt => ({ ...objekt, ...deltaData, ausbildungssemester: this.actionSem}));
|
||||
|
||||
console.log("in changeStatusToStudent" + prestudentIds);
|
||||
this.addNewStatus(prestudentIds);
|
||||
},
|
||||
changeStatusToWiederholer(prestudentIds){
|
||||
@@ -522,8 +501,6 @@ export default{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Feedback Success als infoalert
|
||||
if (countSuccess > 0) {
|
||||
this.$fhcAlert.alertInfo(this.$p.t('ui', 'successNewStatus', {
|
||||
@@ -572,7 +549,6 @@ export default{
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
/* window.scrollTo(0, 0);*/
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
@@ -659,13 +635,13 @@ export default{
|
||||
this.listStudiensemester = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
/* this.$fhcApi
|
||||
this.$fhcApi
|
||||
.get('api/frontend/v1/stv/prestudent/getStudienplaene/' + this.modelValue.prestudent_id)
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
this.listStudienplaene = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);*/
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
this.$fhcApi
|
||||
.get('api/frontend/v1/stv/status/getStatusgruende/')
|
||||
.then(result => result.data)
|
||||
|
||||
Reference in New Issue
Block a user