mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
Merge remote-tracking branch 'origin/feature-30660/FHC4_StudierendenGUI_Prototyp' into feature-30660/FHC4_StudierendenGUI_Prototyp
This commit is contained in:
@@ -31,6 +31,10 @@ class Config extends FHC_Controller
|
||||
'title' => 'PreStudentIn',
|
||||
'component' => './Stv/Studentenverwaltung/Details/Prestudent.js'
|
||||
];
|
||||
$result['status'] = [
|
||||
'title' => 'Status',
|
||||
'component' => './Stv/Studentenverwaltung/Details/Status.js'
|
||||
];
|
||||
$result['noten'] = [
|
||||
'title' => 'Noten',
|
||||
'component' => './Stv/Studentenverwaltung/Details/Noten.js'
|
||||
|
||||
@@ -44,17 +44,24 @@ class Status extends FHC_Controller
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getLastBismeldestichtag()
|
||||
{
|
||||
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
|
||||
|
||||
$result = $this->BismeldestichtagModel->getLastReachedMeldestichtag();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function addNewStatus($prestudent_id)
|
||||
{
|
||||
/* $this->load->library('form_validation');
|
||||
$granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz') ? $this->permissionlib->getSTG_isEntitledFor('assistenz') : [];
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin') ? $this->permissionlib->getSTG_isEntitledFor('admin') : [];
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}*/
|
||||
|
||||
//check rights
|
||||
//get Studiengang von prestudent_id
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'ON (p.person_id = public.tbl_prestudent.person_id)');
|
||||
$result = $this->PrestudentModel->load([
|
||||
@@ -73,10 +80,7 @@ class Status extends FHC_Controller
|
||||
$name = trim($result->vorname . " ". $result->nachname);
|
||||
$zgv_code = $result->zgv_code;
|
||||
|
||||
//TODO(Manu) check: Annahme, dass hier immer suid bei Berechtigung STG vergeben wird!
|
||||
$granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz') ? $this->permissionlib->getSTG_isEntitledFor('assistenz') : [];
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin') ? $this->permissionlib->getSTG_isEntitledFor('admin') : [];
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
$isStudent = false;
|
||||
|
||||
if(!in_array($stg, $granted)){
|
||||
$result = "Sie haben keine Schreibrechte fuer diesen Studiengang!";
|
||||
@@ -100,9 +104,6 @@ class Status extends FHC_Controller
|
||||
$rt_stufe = $this->input->post('rt_stufe');
|
||||
$bestaetigtvon = $uid;
|
||||
|
||||
// Start DB transaction
|
||||
//$this->db->trans_start(false);
|
||||
|
||||
//GET lastStatus
|
||||
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
|
||||
@@ -111,8 +112,12 @@ class Status extends FHC_Controller
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$lastStatusData = current(getData($result));
|
||||
//var_dump($lastStatusData);
|
||||
elseif(!hasData($result))
|
||||
{
|
||||
$lastStatusData = [];
|
||||
}
|
||||
else
|
||||
$lastStatusData = current(getData($result));
|
||||
|
||||
//Different handling depending on newStatus
|
||||
if($status_kurzbz == 'Absolvent' || $status_kurzbz == 'Diplomand')
|
||||
@@ -122,10 +127,10 @@ class Status extends FHC_Controller
|
||||
}
|
||||
|
||||
//Todo(manu) check if this check makes sense?
|
||||
/* if($status_kurzbz != 'Student')
|
||||
{
|
||||
$ausbildungssemester = $lastStatusData->ausbildungssemester;
|
||||
}*/
|
||||
/* if($status_kurzbz != 'Student')
|
||||
{
|
||||
$ausbildungssemester = $lastStatusData->ausbildungssemester;
|
||||
}*/
|
||||
|
||||
//check if Rolle already exists
|
||||
$result = $this->PrestudentstatusModel->checkIfExistingPrestudentRolle($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $ausbildungssemester);
|
||||
@@ -141,7 +146,7 @@ class Status extends FHC_Controller
|
||||
}
|
||||
|
||||
|
||||
//Check ob Reihungstest berücksichtigt werden soll
|
||||
//Check Reihungstest
|
||||
if(REIHUNGSTEST_CHECK)
|
||||
{
|
||||
if($status_kurzbz=='Bewerber' && !$reihungstest_angetreten)
|
||||
@@ -212,9 +217,17 @@ class Status extends FHC_Controller
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if($result->retval == "0")
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result->code);
|
||||
}
|
||||
if($result->retval != "0")
|
||||
{
|
||||
$isStudent = true;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO(Manu) permission not working here...
|
||||
$hasPermissionToSkipStatusCheck = $this->permissionlib->isBerechtigt('student/keine_studdatuspruefung');
|
||||
/* var_dump($hasPermissionToSkipStatusCheck);
|
||||
|
||||
@@ -237,17 +250,34 @@ class Status extends FHC_Controller
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
//check if Bismeldestichtag erreicht
|
||||
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
|
||||
$result = $this->BismeldestichtagModel->checkIfMeldestichtagErreicht($new_status_datum);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if($result->retval == "1")
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result->code));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_start(false);
|
||||
|
||||
$result = $this->PrestudentstatusModel->insert(
|
||||
[
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'bewerbung_abgeschicktamum' => $bewerbung_abgeschicktamum,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studienplan_id' => $studienplan_id,
|
||||
'studienplan_id' => $lastStatusData->studienplan_id,
|
||||
'ausbildungssemester' => $ausbildungssemester,
|
||||
'anmerkung' => $anmerkung,
|
||||
'statusgrund_id' => $statusgrund_id,
|
||||
'insertvon' => $uid,
|
||||
'insertamum' => date('c'),
|
||||
@@ -257,15 +287,103 @@ class Status extends FHC_Controller
|
||||
'rt_stufe' => $rt_stufe
|
||||
]
|
||||
);
|
||||
if (isError($result))
|
||||
|
||||
// Transaction complete!
|
||||
$this->db->trans_complete();
|
||||
|
||||
if ($this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
if($isStudent)
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->checkIfUid($prestudent_id);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
//load student
|
||||
$result = $this->StudentModel->loadWhere(
|
||||
array(
|
||||
'student_uid' => $student_uid
|
||||
)
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
$this->outputJson($result);
|
||||
}
|
||||
$studentData = current(getData($result));
|
||||
$verband = $studentData->verband == '' ? '' : $studentData->verband;
|
||||
$gruppe = $studentData->gruppe == '' ? '' : $studentData->gruppe;
|
||||
|
||||
//check if Studentlehrverband exists
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$result = $this->StudentlehrverbandModel->checkIfStudentLehrverbandExists($student_uid, $studiensemester_kurzbz);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if ($result->retval == "0")
|
||||
{
|
||||
$result = $this->StudentlehrverbandModel->insert(
|
||||
[
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'semester' => $ausbildungssemester,
|
||||
'verband' => $verband,
|
||||
'gruppe' => $gruppe,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid,
|
||||
'studiengang_kz' => $studentData->studiengang_kz
|
||||
]);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
return $this->outputJson("Error in insert Studentlehrverband");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->StudentlehrverbandModel->update(
|
||||
[
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
],
|
||||
[
|
||||
'semester' => $ausbildungssemester,
|
||||
'verband' => $verband,
|
||||
'gruppe' => $gruppe,
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => $uid,
|
||||
'studiengang_kz' => $studentData->studiengang_kz
|
||||
]);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
return $this->outputJson("Error in insert Studentlehrverband");
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->db->trans_commit();
|
||||
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function loadStatus()
|
||||
{
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
@@ -309,31 +427,32 @@ class Status extends FHC_Controller
|
||||
$status_kurzbz = $this->input->post('status_kurzbz');
|
||||
$ausbildungssemester = $this->input->post('ausbildungssemester');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$deletePrestudent = false;
|
||||
|
||||
//TODO(Manu) check: warum sind beim Löschen andere Berechtigungen?
|
||||
//TODO(Manu) check permissions: warum sind beim Löschen andere Berechtigungen?
|
||||
//ich darf keine Stati anlegen, aber löschen, wenn mehr als einer übrig???
|
||||
/* $granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz');
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin');
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
/* $granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz');
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin');
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load([
|
||||
'prestudent_id'=> $prestudent_id,
|
||||
]);
|
||||
if(isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$result = current(getData($result));
|
||||
$stg = $result->studiengang_kz;
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load([
|
||||
'prestudent_id'=> $prestudent_id,
|
||||
]);
|
||||
if(isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$result = current(getData($result));
|
||||
$stg = $result->studiengang_kz;
|
||||
|
||||
if(!in_array($stg, $granted))
|
||||
{
|
||||
$result = "Sie haben keine Schreibrechte fuer diesen Studiengang!";
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}*/
|
||||
if(!in_array($stg, $granted))
|
||||
{
|
||||
$result = "Sie haben keine Schreibrechte fuer diesen Studiengang!";
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}*/
|
||||
|
||||
$isBerechtigtAdmin = $this->permissionlib->isBerechtigt('admin', null, 'suid');
|
||||
$isBerechtigtNoStudstatusCheck = $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung', null, 'suid');
|
||||
@@ -346,22 +465,31 @@ class Status extends FHC_Controller
|
||||
}
|
||||
|
||||
|
||||
if(!$isBerechtigtAdmin && !$isBerechtigtNoStudstatusCheck)
|
||||
//check if last status
|
||||
$result = $this->PrestudentstatusModel->checkIfLastStatusEntry($prestudent_id);
|
||||
if (isError($result))
|
||||
{
|
||||
//check if last status
|
||||
$result = $this->PrestudentstatusModel->checkIfLastStatusEntry($prestudent_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
if($result->retval == "1")
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
if($result->retval == "1")
|
||||
{
|
||||
//Berechtigungen nach Check prüfen!
|
||||
if(!$isBerechtigtAdmin && !$isBerechtigtNoStudstatusCheck)
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result->code);
|
||||
}
|
||||
else
|
||||
{
|
||||
$deletePrestudent = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_start(false);
|
||||
|
||||
//TODO(manu) $this->db->trans_start(false); and rollback?
|
||||
//Delete Status
|
||||
$result = $this->PrestudentstatusModel->delete(
|
||||
array(
|
||||
@@ -371,34 +499,43 @@ class Status extends FHC_Controller
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
elseif(!hasData($result)) {
|
||||
$this->outputJson($result);
|
||||
}
|
||||
//return $this->outputJsonSuccess(current(getData($result)));
|
||||
|
||||
// Delete Studentlehrverband if no Status left
|
||||
// Transaction complete!
|
||||
$this->db->trans_complete();
|
||||
|
||||
if ( $this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
if(!hasData($result)) {
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
$this->db->trans_commit();
|
||||
|
||||
//Delete Studentlehrverband if no Status left
|
||||
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id, $studiensemester_kurzbz);
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if(!hasData($result))
|
||||
if (!hasData($result))
|
||||
{
|
||||
//get student_uid
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->checkIfUid($prestudent_id);
|
||||
if(isError($result))
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->outputJson($result);
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
@@ -413,25 +550,53 @@ class Status extends FHC_Controller
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson("Fehler beim Löschen der Lehrverbandszuordnung");
|
||||
}
|
||||
if(!hasData($result)) {
|
||||
if (!hasData($result))
|
||||
{
|
||||
$this->outputJson($result);
|
||||
var_dump("no data2");
|
||||
}
|
||||
$this->outputJsonSuccess(true);
|
||||
|
||||
}
|
||||
|
||||
//Delete Prestudent if no data is left
|
||||
if($deletePrestudent)
|
||||
{
|
||||
//TODO(manu) check all connected tables and delete them
|
||||
//es wird noch auf prestudent_dokumentprestudent verwiesen
|
||||
//löschen zuerst von Doks
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->delete(
|
||||
array(
|
||||
'prestudent_id' => $prestudent_id
|
||||
)
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
return $this->outputJsonSuccess(true);
|
||||
if(!hasData($result))
|
||||
{
|
||||
$this->outputJson($result);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
|
||||
|
||||
}
|
||||
//TODO(manu) $this->db->trans_start(false); and rollback?
|
||||
//TODO(manu) ganzen Prestudenten löschen, wenn kein Eintrag mehr
|
||||
|
||||
return $this->outputJsonSuccess(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function updateStatus($key_prestudent_id, $key_status_kurzbz, $key_studiensemester_kurzbz, $key_ausbildungssemester)
|
||||
{
|
||||
//TODO(Manu) check: Annahme, dass hier immer suid bei Berechtigung STG vergeben wird!
|
||||
$hasPermissionToSkipStatusCheck = $this->permissionlib->isBerechtigt('student/keine_studdatuspruefung');
|
||||
$granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz') ? $this->permissionlib->getSTG_isEntitledFor('assistenz') : [];
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin') ? $this->permissionlib->getSTG_isEntitledFor('admin') : [];
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
|
||||
$isStudent = false;
|
||||
|
||||
//get Studiengang von prestudent_id
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load([
|
||||
@@ -451,6 +616,9 @@ class Status extends FHC_Controller
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//var_dump($key_prestudent_id, $key_status_kurzbz, $key_studiensemester_kurzbz, $key_ausbildungssemester);
|
||||
|
||||
/* $this->load->library('form_validation');
|
||||
@@ -478,57 +646,134 @@ class Status extends FHC_Controller
|
||||
$rt_stufe = $this->input->post('rt_stufe');
|
||||
$bestaetigtvon = $uid;
|
||||
|
||||
// Start DB transaction
|
||||
//$this->db->trans_start(false);
|
||||
//check if Bismeldestichtag erreicht
|
||||
if(!$hasPermissionToSkipStatusCheck)
|
||||
{
|
||||
$this->load->model('codex/Bismeldestichtag_model', 'BismeldestichtagModel');
|
||||
$result = $this->BismeldestichtagModel->checkIfMeldestichtagErreicht($datum, $studiensemester_kurzbz);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if ($result->retval == "1") {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
//return $this->outputJson(getError($result->code));
|
||||
//Fehlermeldung überschrieben, passender
|
||||
return $this->outputJson("Meldestichtag erreicht - Bearbeiten nicht mehr möglich");
|
||||
}
|
||||
}
|
||||
|
||||
//check if Rolle already exists
|
||||
if(($key_studiensemester_kurzbz != $studiensemester_kurzbz)
|
||||
|| ($key_ausbildungssemester != $ausbildungssemester))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->checkIfExistingPrestudentRolle($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $ausbildungssemester);
|
||||
if (isError($result))
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->checkIfExistingPrestudentRolle($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $ausbildungssemester);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if($result->retval == '1')
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result->code);
|
||||
}
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if($result->retval == '1')
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result->code);
|
||||
}
|
||||
}
|
||||
|
||||
//check if studentrolle already exists
|
||||
if($status_kurzbz == 'Student')
|
||||
{
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->checkIfExistingStudentRolle($prestudent_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if($result->retval == "0")
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result->code);
|
||||
}
|
||||
if($result->retval != "0")
|
||||
{
|
||||
$isStudent = true;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO(Manu) permission not working here...
|
||||
$hasPermissionToSkipStatusCheck = $this->permissionlib->isBerechtigt('student/keine_studdatuspruefung');
|
||||
/* var_dump($hasPermissionToSkipStatusCheck);
|
||||
|
||||
$basis = $this->permissionlib->isBerechtigt('basis/prestudent');
|
||||
var_dump($basis);*/
|
||||
if(!$hasPermissionToSkipStatusCheck)
|
||||
{
|
||||
//Block STATUSCHECKS
|
||||
//bei update wohl nicht?
|
||||
/* $new_status_datum = isset($datum) ? $datum : date('Y-m-d');
|
||||
$result = $this->PrestudentstatusModel->checkDatumNewStatus($new_status_datum);
|
||||
|
||||
//$new_status_datum = isset($datum) ? $datum : date('Y-m-d');
|
||||
|
||||
$result = $this->PrestudentstatusModel->checkIfValidStatusHistory($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $datum, $ausbildungssemester);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}*/
|
||||
|
||||
$new_status_datum = isset($datum) ? $datum : date('Y-m-d');
|
||||
|
||||
$result = $this->PrestudentstatusModel->checkIfValidStatusHistory($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $new_status_datum, $ausbildungssemester);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
//return $this->outputJson("DEBUG: in Funktion checkIfValidStatusHistory");
|
||||
}
|
||||
$statusArr = $result; //wenn return result ok
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_start(false);
|
||||
|
||||
if($isStudent)
|
||||
{
|
||||
//Studentlehrverband anlegen
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->checkIfUid($prestudent_id);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
//check if Lehrverband exists
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$result = $this->StudentlehrverbandModel->checkIfLehrverbandExists($student_uid, $studiensemester_kurzbz);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if ($result->retval == "0") {
|
||||
//load Data Studentlehrverband
|
||||
$result = $this->StudentlehrverbandModel->load(
|
||||
[
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
return $this->outputJson("Error in insert Studentlehrverband");
|
||||
}
|
||||
$lvbData = current(getData($result));
|
||||
|
||||
$result = $this->StudentlehrverbandModel->insert(
|
||||
[
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'semester' => $ausbildungssemester,
|
||||
'verband' => $lvbData->verband,
|
||||
'gruppe' => $lvbData->gruppe,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid,
|
||||
'studiengang_kz' => $lvbData->studiengang_kz
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
return $this->outputJson("Error in insert Studentlehrverband");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//update status
|
||||
$result = $this->PrestudentstatusModel->update(
|
||||
[
|
||||
'prestudent_id' => $key_prestudent_id,
|
||||
@@ -553,20 +798,24 @@ class Status extends FHC_Controller
|
||||
'rt_stufe' => $rt_stufe
|
||||
]
|
||||
);
|
||||
if (isError($result))
|
||||
|
||||
// Transaction complete!
|
||||
$this->db->trans_complete();
|
||||
|
||||
if ($this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
return error('No Statusdata vorhanden');
|
||||
}
|
||||
|
||||
|
||||
$this->db->trans_commit();
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
public function advanceStatus($key_prestudent_id, $key_status_kurzbz, $key_studiensemester_kurzbz, $key_ausbildungssemester)
|
||||
{
|
||||
//TODO(Manu) check: Annahme, dass hier immer suid bei Berechtigung STG vergeben wird!
|
||||
$granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz') ? $this->permissionlib->getSTG_isEntitledFor('assistenz') : [];
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin') ? $this->permissionlib->getSTG_isEntitledFor('admin') : [];
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
@@ -659,6 +908,9 @@ class Status extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
// Start DB transaction
|
||||
$this->db->trans_start(false);
|
||||
|
||||
//insert prestudentstatus
|
||||
$uid = getAuthUID();
|
||||
$result = $this->PrestudentstatusModel->insert(
|
||||
@@ -674,16 +926,20 @@ class Status extends FHC_Controller
|
||||
'studienplan_id' => $statusData->studienplan_id,
|
||||
'datum' => date('c'),
|
||||
'anmerkung' => $statusData->anmerkung
|
||||
|
||||
]
|
||||
);
|
||||
if (isError($result))
|
||||
|
||||
// Transaction complete!
|
||||
$this->db->trans_complete();
|
||||
|
||||
if ($this->db->trans_status() === false || isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
//return $this->outputJson(getError($result));
|
||||
return $this->outputJson("DEBUG: in insert Funktion");
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
//TodoManu -> check if student, was wenn kein Studentstatus
|
||||
//Studentlehrverband anlegen
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->checkIfUid($key_prestudent_id);
|
||||
@@ -694,9 +950,9 @@ class Status extends FHC_Controller
|
||||
}
|
||||
$student_uid = $result->retval;
|
||||
|
||||
//check if Lehrverband exists
|
||||
//check if Studentehrverband exists
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$result = $this->StudentlehrverbandModel->checkIfLehrverbandExists($student_uid, $studiensem_next);
|
||||
$result = $this->StudentlehrverbandModel->checkIfStudentlehrverbandExists($student_uid, $studiensem_next);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
@@ -704,7 +960,7 @@ class Status extends FHC_Controller
|
||||
}
|
||||
if ($result->retval == "0")
|
||||
{
|
||||
//load Data Lehrverband
|
||||
//load Data Studentlehrverband
|
||||
$result = $this->StudentlehrverbandModel->load(
|
||||
[
|
||||
'student_uid' => $student_uid,
|
||||
@@ -717,6 +973,7 @@ class Status extends FHC_Controller
|
||||
return $this->outputJson("Error in insert Studentlehrverband");
|
||||
}
|
||||
$lvbData = current(getData($result));
|
||||
var_dump($lvbData);
|
||||
|
||||
$result = $this->StudentlehrverbandModel->insert(
|
||||
[
|
||||
@@ -731,13 +988,108 @@ class Status extends FHC_Controller
|
||||
]);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
return $this->outputJson("Error in insert Studentlehrverband");
|
||||
}
|
||||
}
|
||||
$this->db->trans_commit();
|
||||
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
public function confirmStatus($key_prestudent_id, $key_status_kurzbz, $key_studiensemester_kurzbz, $key_ausbildungssemester)
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
//TODO(Manu) check: Annahme, dass hier immer suid bei Berechtigung STG vergeben wird!
|
||||
$granted_Ass = $this->permissionlib->getSTG_isEntitledFor('assistenz') ? $this->permissionlib->getSTG_isEntitledFor('assistenz') : [];
|
||||
$granted_Adm = $this->permissionlib->getSTG_isEntitledFor('admin') ? $this->permissionlib->getSTG_isEntitledFor('admin') : [];
|
||||
$granted = array_merge($granted_Ass, $granted_Adm);
|
||||
|
||||
//get Studiengang von prestudent_id
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load([
|
||||
'prestudent_id'=> $key_prestudent_id,
|
||||
]);
|
||||
if(isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$result = current(getData($result));
|
||||
|
||||
$stg = $result->studiengang_kz;
|
||||
|
||||
if(!in_array($stg, $granted)){
|
||||
$result = "Sie haben keine Schreibrechte fuer diesen Studiengang!";
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
$result = $this->PrestudentstatusModel->loadWhere(
|
||||
array(
|
||||
'prestudent_id' => $key_prestudent_id,
|
||||
'status_kurzbz' => $key_status_kurzbz,
|
||||
'ausbildungssemester' => $key_ausbildungssemester,
|
||||
'studiensemester_kurzbz' => $key_studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
elseif (!hasData($result)) {
|
||||
$this->outputJson($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$statusData = current(getData($result));
|
||||
}
|
||||
|
||||
//check if Status is unconfirmed.. TODO(manu) check further conditions? Status < Student
|
||||
if($statusData->bestaetigtam != NULL)
|
||||
{
|
||||
$result = "Der Status ist bereits bestätigt!";
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
//check if Bewerbung abgeschickt
|
||||
if($statusData->bewerbung_abgeschicktamum == NULL)
|
||||
{
|
||||
$result = "Die Bewerbung wurde noch nicht abgeschickt und kann deshalb nicht bestaetigt werden!";
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
$result = $this->PrestudentstatusModel->update(
|
||||
[
|
||||
'prestudent_id' => $key_prestudent_id,
|
||||
'status_kurzbz' => $key_status_kurzbz,
|
||||
'studiensemester_kurzbz' => $key_studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $key_ausbildungssemester,
|
||||
],
|
||||
[
|
||||
'bestaetigtam' => date('c'),
|
||||
'bestaetigtvon' => $uid,
|
||||
'updateamum='=> date('c'),
|
||||
'updatevon=' => $uid
|
||||
]
|
||||
);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
return error('No Statusdata vorhanden');
|
||||
}
|
||||
return $this->outputJsonSuccess(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
class Bismeldestichtag_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -11,4 +10,100 @@ class Bismeldestichtag_model extends DB_Model
|
||||
$this->dbTable = 'bis.tbl_bismeldestichtag';
|
||||
$this->pk = 'meldestichtag_id';
|
||||
}
|
||||
|
||||
public function getLastReachedMeldestichtag($studiensemester_kurzbz = null)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
meldestichtag_id, meldestichtag, studiensemester_kurzbz, insertamum, insertvon, updateamum, updatevon
|
||||
FROM
|
||||
bis.tbl_bismeldestichtag
|
||||
WHERE
|
||||
meldestichtag < NOW()
|
||||
";
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
$qry .= "
|
||||
AND
|
||||
studiensemester_kurzbz= ?";
|
||||
}
|
||||
|
||||
$qry .= "
|
||||
ORDER BY
|
||||
meldestichtag DESC
|
||||
LIMIT 1;";
|
||||
|
||||
$result = $this->execQuery($qry, array($studiensemester_kurzbz));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return error($result);
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
return success("0",'Kein Meldestichtag vorhanden');
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft, ob Meldestichtag für ein bestimmtes Statusdatum und Studiensemester erreicht ist.
|
||||
*
|
||||
* @param $status_datum
|
||||
* @return boolean true wenn erreicht, oder false
|
||||
*/
|
||||
public function checkIfMeldestichtagErreicht($status_datum, $studiensemester_kurzbz = null)
|
||||
{
|
||||
$erreicht = false;
|
||||
|
||||
if (isset($studiensemester_kurzbz))
|
||||
{
|
||||
// Studiensemesterende holen
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$result = $this->StudiensemesterModel->loadWhere(
|
||||
array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
if(isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$result = current(getData($result));
|
||||
|
||||
$studiensemester_ende = $result->ende;
|
||||
}
|
||||
|
||||
// letztes erreichtes Bismeldedatum holen
|
||||
$result = $this->getLastReachedMeldestichtag();
|
||||
if (isError($result))
|
||||
{
|
||||
return error($result);
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
return success("0",'No Statusdata vorhanden');
|
||||
}
|
||||
$stichtag = current(getData($result));
|
||||
$stichtag = $stichtag->meldestichtag;
|
||||
|
||||
// Prüfen, ob Studentstatusdatum oder Studiensemester vor dem Stichtagsdatum liegen
|
||||
if (isset($statusDatum))
|
||||
{
|
||||
if (isset($stichtag))
|
||||
$erreicht = $statusDatum < $stichtag;
|
||||
}
|
||||
|
||||
if (isset($studiensemester_ende))
|
||||
{
|
||||
$erreicht = $erreicht || $studiensemester_ende < $stichtag;
|
||||
}
|
||||
|
||||
if($erreicht)
|
||||
return success("1", "Studentstatus mit Datum oder Semesterende vor erreichtem Meldestichtag können nicht hinzugefügt werden");
|
||||
|
||||
return success("0", "Meldestatus nicht erreicht");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -734,58 +734,15 @@ class Prestudent_model extends DB_Model
|
||||
*/
|
||||
public function getHistoryPrestudent($prestudent_id)
|
||||
{
|
||||
//TODO(Manu) refactor
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
$result = $this->StudentModel->checkIfUID($prestudent_id);
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
return getData($result);
|
||||
}
|
||||
if($result->retval != "0")
|
||||
{
|
||||
$query = "
|
||||
SELECT
|
||||
ps.status_kurzbz,
|
||||
ps.studiensemester_kurzbz,
|
||||
ps.ausbildungssemester,
|
||||
ps.datum,
|
||||
TO_CHAR(ps.datum::timestamp, 'DD.MM.YYYY') AS format_datum,
|
||||
sp.bezeichnung,
|
||||
ps.bestaetigtam,
|
||||
TO_CHAR(ps.bestaetigtam::timestamp, 'DD.MM.YYYY') AS format_bestaetigtam,
|
||||
ps.bewerbung_abgeschicktamum,
|
||||
TO_CHAR(ps.bewerbung_abgeschicktamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_bewerbung_abgeschicktamum,
|
||||
stg.statusgrund_kurzbz,
|
||||
ps.orgform_kurzbz,
|
||||
ps.prestudent_id,
|
||||
sp.studienplan_id,
|
||||
ps.anmerkung,
|
||||
ps.bestaetigtvon,
|
||||
ps.insertamum,
|
||||
TO_CHAR(ps.insertamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_insertamum,
|
||||
ps.insertvon,
|
||||
ps.updateamum,
|
||||
TO_CHAR(ps.updateamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_updateamum,
|
||||
ps.updatevon
|
||||
FROM public.tbl_prestudentstatus ps
|
||||
LEFT JOIN public.tbl_student st USING (prestudent_id)
|
||||
LEFT JOIN public.tbl_studiengang sg ON (st.studiengang_kz = sg.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan sp USING (studienplan_id)
|
||||
LEFT JOIN public.tbl_status_grund stg USING (statusgrund_id)
|
||||
WHERE prestudent_id = ?
|
||||
ORDER BY datum DESC
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = "
|
||||
SELECT
|
||||
ps.status_kurzbz2,
|
||||
$query = "
|
||||
SELECT
|
||||
ps.status_kurzbz,
|
||||
ps.studiensemester_kurzbz,
|
||||
ps.ausbildungssemester,
|
||||
CASE WHEN ps.status_kurzbz IN ('Student', 'Diplomand') THEN CONCAT(lv.semester, lv.verband, lv.gruppe) END AS lehrverband,
|
||||
ps.ausbildungssemester,
|
||||
CASE WHEN ps.status_kurzbz IN ('Student', 'Diplomand')
|
||||
THEN CONCAT(lv.semester, lv.verband, lv.gruppe)
|
||||
ELSE ''
|
||||
END AS lehrverband,
|
||||
ps.datum,
|
||||
TO_CHAR(ps.datum::timestamp, 'DD.MM.YYYY') AS format_datum,
|
||||
sp.bezeichnung,
|
||||
@@ -804,19 +761,26 @@ class Prestudent_model extends DB_Model
|
||||
ps.insertvon,
|
||||
ps.updateamum,
|
||||
TO_CHAR(ps.updateamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_updateamum,
|
||||
ps.updatevon
|
||||
FROM public.tbl_prestudentstatus ps
|
||||
JOIN public.tbl_student st USING (prestudent_id)
|
||||
JOIN public.tbl_studentlehrverband lv ON (st.student_uid = lv.student_uid)
|
||||
JOIN public.tbl_studiengang sg ON (lv.studiengang_kz = sg.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan sp USING (studienplan_id)
|
||||
LEFT JOIN public.tbl_status_grund stg USING (statusgrund_id)
|
||||
ps.updatevon
|
||||
FROM
|
||||
public.tbl_prestudentstatus ps
|
||||
JOIN
|
||||
public.tbl_student st USING (prestudent_id)
|
||||
JOIN
|
||||
public.tbl_studiengang sg ON (st.studiengang_kz = sg.studiengang_kz)
|
||||
LEFT JOIN
|
||||
lehre.tbl_studienplan sp USING (studienplan_id)
|
||||
LEFT JOIN
|
||||
public.tbl_status_grund stg USING (statusgrund_id)
|
||||
LEFT JOIN
|
||||
public.tbl_studentlehrverband lv ON
|
||||
(st.student_uid = lv.student_uid
|
||||
AND st.student_uid IS NOT NULL
|
||||
AND lv.studiensemester_kurzbz = ps.studiensemester_kurzbz)
|
||||
WHERE prestudent_id = ?
|
||||
and lv.studiensemester_kurzbz = ps.studiensemester_kurzbz
|
||||
ORDER BY datum DESC
|
||||
";
|
||||
";
|
||||
|
||||
}
|
||||
return $this->execQuery($query, array($prestudent_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,13 +504,19 @@ class Prestudentstatus_model extends DB_Model
|
||||
$new_status_semesterstart = $studiensemester->start;
|
||||
|
||||
//get all prestudentstati
|
||||
//TODO(manu) errorlogic
|
||||
$resultPs = $this->getAllPrestudentstatiWithStudiensemester($prestudent_id);
|
||||
if (isError($resultPs))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($resultPs));
|
||||
$resultArr = [];
|
||||
}
|
||||
$resultArr = $resultPs->retval;
|
||||
if(!hasData($resultPs))
|
||||
{
|
||||
$resultArr = [];
|
||||
}
|
||||
else
|
||||
$resultArr = $resultPs->retval;
|
||||
|
||||
$statusArr = array();
|
||||
|
||||
$newStatusInserted = false;
|
||||
@@ -587,7 +593,7 @@ class Prestudentstatus_model extends DB_Model
|
||||
isset($next_status) && $curr_status_kurzbz == 'Diplomand' && $next_status->status_kurzbz == 'Student'
|
||||
)
|
||||
{
|
||||
return error("Nach Diplomantenstatus darf kein Studentenstatus mehr eingetragen werden");
|
||||
return error("Nach Diplomandenstatus darf kein Studentenstatus mehr eingetragen werden");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -605,7 +611,7 @@ class Prestudentstatus_model extends DB_Model
|
||||
$isNewStatus = $old_status_studiensemester_kurzbz == '' && $old_status_ausbildungssemester == '';
|
||||
|
||||
$qry = "
|
||||
SELECT public.tbl_prestudentstatus.status_kurzbz,
|
||||
SELECT public.tbl_prestudentstatus.status_kurzbz,
|
||||
public.tbl_prestudentstatus.studiensemester_kurzbz,
|
||||
public.tbl_prestudentstatus.ausbildungssemester,
|
||||
public.tbl_prestudentstatus.datum,
|
||||
@@ -625,7 +631,7 @@ class Prestudentstatus_model extends DB_Model
|
||||
return error($result);
|
||||
}
|
||||
if (!hasData($result)) {
|
||||
return error('No Statusdata vorhanden');
|
||||
return success("0",'No Statusdata vorhanden');
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -82,7 +82,7 @@ class Student_model extends DB_Model
|
||||
|
||||
if(isError($result))
|
||||
{
|
||||
return error("0", "Error while checking student_uid");
|
||||
return error( "Error while checking student_uid");
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
@@ -143,7 +143,8 @@ class Student_model extends DB_Model
|
||||
{
|
||||
return error($result);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
$resultObject = current(getData($result));
|
||||
|
||||
if (property_exists($resultObject, 'anzahl')) {
|
||||
|
||||
@@ -14,14 +14,12 @@ class Studentlehrverband_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Rolle already exists
|
||||
* @param integer $prestudent_id
|
||||
* @param string $status_kurzbz
|
||||
* Check if Studentlehrverband already exists
|
||||
* @param string $student_id
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param integer $ausbildungssemester
|
||||
* @return 1: if Rolle exists, 0: if it doesn't
|
||||
*/
|
||||
public function checkIfLehrverbandExists($student_uid, $studiensemester_kurzbz)
|
||||
public function checkIfStudentlehrverbandExists($student_uid, $studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "SELECT
|
||||
*
|
||||
@@ -40,11 +38,11 @@ class Studentlehrverband_model extends DB_Model
|
||||
}
|
||||
elseif (!hasData($result))
|
||||
{
|
||||
return success("0", "Kein Lehrverband vorhanden!");
|
||||
return success("0", "Kein Studentlehrverband vorhanden!");
|
||||
}
|
||||
else
|
||||
{
|
||||
return success("1","Lehrverband vorhanden!");
|
||||
return success("1","Studentlehrverband vorhanden!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,37 @@ class Lehrverband_model extends DB_Model
|
||||
$this->dbTable = 'public.tbl_lehrverband';
|
||||
$this->pk = array('gruppe', 'verband', 'semester', 'studiengang_kz');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Lehrverband already exists
|
||||
* @param string $student_id
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @return 1: if Rolle exists, 0: if it doesn't
|
||||
*/
|
||||
public function checkIfLehrverbandExists($student_uid, $studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
public.tbl_studentlehrverband
|
||||
WHERE
|
||||
student_uid = ?
|
||||
AND
|
||||
studiensemester_kurzbz = ?";
|
||||
|
||||
$result = $this->execQuery($qry, array($student_uid, $studiensemester_kurzbz));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return error($result);
|
||||
}
|
||||
elseif (!hasData($result))
|
||||
{
|
||||
return success("0", "Kein Lehrverband vorhanden!");
|
||||
}
|
||||
else
|
||||
{
|
||||
return success("1","Lehrverband vorhanden!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,13 @@ html {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
.tabulator-row.disabled.tabulator-row-odd .tabulator-cell {
|
||||
color: var(--gray-400);
|
||||
}
|
||||
.tabulator-row.disabled.tabulator-row-even .tabulator-cell {
|
||||
color: var(--gray-500);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
#sidebarMenu {
|
||||
visibility: visible!important;
|
||||
|
||||
@@ -53,4 +53,4 @@
|
||||
box-shadow: 0 0 0 .24rem rgba(13,110,253,.25);
|
||||
z-index: 1;
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,13 +56,32 @@ export default {
|
||||
listStgTyp: [],
|
||||
listFoerderrelevant: [],
|
||||
initialFormData: {},
|
||||
deltaArray: [],
|
||||
actionUpdate: false,
|
||||
deltaArray: {},
|
||||
actionUpdate: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
deltaLength() {
|
||||
return Object.keys(this.deltaArray).length;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
data: {
|
||||
// TODO(chris): use @input instead?
|
||||
handler(n) {
|
||||
|
||||
const delta = {};
|
||||
for (const key in this.data) {
|
||||
if (this.data[key] !== this.initialFormData[key]) {
|
||||
delta[key] = this.data[key];
|
||||
this.actionUpdate = true;
|
||||
}
|
||||
}
|
||||
//this.deltaArray.push(delta);
|
||||
this.deltaArray = delta;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -78,13 +97,6 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
updatePrestudent(){
|
||||
this.detectChanges();
|
||||
|
||||
/* this.$nextTick(() => {
|
||||
|
||||
if (this.actionUpdate) {
|
||||
console.log("Action");*/
|
||||
//todo(manu) checken, ob überhaupt eine Änderung vorgenommen wurde
|
||||
CoreRESTClient.post('components/stv/Prestudent/updatePrestudent/' + this.modelValue.prestudent_id,
|
||||
this.deltaArray
|
||||
).then(response => {
|
||||
@@ -105,16 +117,9 @@ export default {
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
/* } else {
|
||||
console.log("no action");
|
||||
}
|
||||
});*/
|
||||
|
||||
|
||||
|
||||
},
|
||||
detectChanges() {
|
||||
/* //besser im watch teil, dann wird Änderung immer verfolgt
|
||||
detectChanges() {
|
||||
const delta = {};
|
||||
for (const key in this.data) {
|
||||
if (this.data[key] !== this.initialFormData[key]) {
|
||||
@@ -123,7 +128,7 @@ export default {
|
||||
}
|
||||
}
|
||||
this.deltaArray.push(delta);
|
||||
},
|
||||
},*/
|
||||
},
|
||||
created() {
|
||||
this.loadPrestudent();
|
||||
@@ -198,12 +203,11 @@ export default {
|
||||
<div class="stv-details-details h-100 pb-3">
|
||||
<form-form ref="form" class="stv-details-prestudent" @submit.prevent="updatePrestudent">
|
||||
<div class="position-sticky top-0 z-1">
|
||||
<button type="submit" class="btn btn-primary position-absolute top-0 end-0" >Speichern</button>
|
||||
<button type="submit" class="btn btn-primary position-absolute top-0 end-0" :disabled="!deltaLength">Speichern</button>
|
||||
</div>
|
||||
<!--<form ref="form">-->
|
||||
<fieldset class="overflow-hidden">
|
||||
<legend>Zugangsvoraussetzungen für {{modelValue.nachname}} {{modelValue.vorname}}</legend>
|
||||
<!-- <template v-if="data">-->
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="col-3"
|
||||
@@ -536,7 +540,7 @@ export default {
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<!-- <div class="row mb-3">
|
||||
<form-input
|
||||
container-class="col-5"
|
||||
label="MentorIn"
|
||||
@@ -545,7 +549,7 @@ export default {
|
||||
name="mentor"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
</fieldset>
|
||||
|
||||
@@ -553,24 +557,17 @@ export default {
|
||||
|
||||
<br>
|
||||
|
||||
<!-- {{defaultSemester}} | {{hasAdminPermission}} | {{hasAdminPermission}}-->
|
||||
|
||||
<div class="col-12 pb-3">
|
||||
<legend>Status</legend>
|
||||
<TblStatus :prestudent_id="modelValue.prestudent_id"></TblStatus>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
<div class="col-8">
|
||||
|
||||
<div class="col-8 d-flex justify-content-center">
|
||||
<legend>Gesamthistorie</legend>
|
||||
<TblHistory :person_id="modelValue.person_id"></TblHistory>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-12 pb-3">
|
||||
<legend>Status</legend>
|
||||
<TblStatus :prestudent_id="modelValue.prestudent_id"></TblStatus>
|
||||
</div>-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
@@ -71,11 +71,20 @@ export default{
|
||||
title: 'Aktionen', field: 'actions',
|
||||
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";
|
||||
|
||||
let button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
if (this.dataMeldestichtag && this.dataMeldestichtag > cell.getData().datum)
|
||||
button.className = 'btn btn-outline-secondary btn-action disabled';
|
||||
else
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-forward"></i>';
|
||||
button.title = 'Status vorrücken';
|
||||
button.addEventListener('click', () =>
|
||||
@@ -84,7 +93,10 @@ export default{
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
if (this.dataMeldestichtag && this.dataMeldestichtag > cell.getData().datum)
|
||||
button.className = 'btn btn-outline-secondary btn-action disabled';
|
||||
else
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-check"></i>';
|
||||
button.title = 'Status bestätigen';
|
||||
button.addEventListener('click', () =>
|
||||
@@ -93,7 +105,10 @@ export default{
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
if (this.dataMeldestichtag && this.dataMeldestichtag > cell.getData().datum)
|
||||
button.className = 'btn btn-outline-secondary btn-action disabled';
|
||||
else
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
button.title = 'Status bearbeiten';
|
||||
button.addEventListener('click', (event) =>
|
||||
@@ -102,7 +117,10 @@ export default{
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
if (this.dataMeldestichtag && this.dataMeldestichtag > cell.getData().datum)
|
||||
button.className = 'btn btn-outline-secondary btn-action disabled';
|
||||
else
|
||||
button.className = 'btn btn-outline-secondary btn-action';
|
||||
button.innerHTML = '<i class="fa fa-xmark"></i>';
|
||||
button.title = 'Status löschen';
|
||||
button.addEventListener('click', () =>
|
||||
@@ -115,6 +133,14 @@ export default{
|
||||
frozen: true
|
||||
},
|
||||
],
|
||||
rowFormatter: (row) => {
|
||||
const rowData = row.getData();
|
||||
if (this.dataMeldestichtag && this.dataMeldestichtag > rowData.datum)
|
||||
{
|
||||
row.getElement().classList.add('disabled');
|
||||
|
||||
}
|
||||
},
|
||||
layout: 'fitDataFill',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 'auto',
|
||||
@@ -127,7 +153,10 @@ export default{
|
||||
listStudienplaene: [],
|
||||
aufnahmestufen: {'': '-- keine Auswahl --', 1: 1, 2: 2, 3: 3},
|
||||
listStatusgruende: [],
|
||||
statusId: {}
|
||||
statusId: {},
|
||||
gruendeLength: {},
|
||||
dataMeldestichtag: null,
|
||||
stichtag: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -135,6 +164,14 @@ export default{
|
||||
return this.listStatusgruende.filter(grund => grund.status_kurzbz == this.statusData.status_kurzbz);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
data: {
|
||||
handler(n) {
|
||||
const start = this.status_kurzbz;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
actionNewStatus() {
|
||||
console.log("Action: Neuen Status hinzufügen");
|
||||
@@ -172,16 +209,6 @@ export default{
|
||||
if(this.statusData)
|
||||
this.$refs.deleteStatusModal.show();
|
||||
});
|
||||
|
||||
/* this.loadStatus({
|
||||
'prestudent_id': this.prestudent_id,
|
||||
'status_kurzbz': status,
|
||||
'studiensemester_kurzbz': stdsem,
|
||||
'ausbildungssemester': ausbildungssemester
|
||||
}).then(() => {
|
||||
if(this.statusData)
|
||||
this.$refs.deleteStatusModal.show();
|
||||
});*/
|
||||
},
|
||||
actionAdvanceStatus(status, stdsem, ausbildungssemester){
|
||||
console.log("Action: Status vorrücken: (" + status + ": " + stdsem + "/" + ausbildungssemester + ")")
|
||||
@@ -200,16 +227,21 @@ export default{
|
||||
actionConfirmStatus(status, stdsem, ausbildungssemester){
|
||||
console.log("Action: Status bestätigen: (" + status + ": " + stdsem + "/" + ausbildungssemester + ")")
|
||||
//this.$refs.deleteStatusModal.show();
|
||||
|
||||
/* this.loadStatus(status_id).then(() => {
|
||||
if(this.statusData.bankverbindung_id)
|
||||
this.$refs.deleteStatusModal.show();
|
||||
});*/
|
||||
this.statusId = {
|
||||
'prestudent_id': this.prestudent_id,
|
||||
'status_kurzbz': status,
|
||||
'studiensemester_kurzbz': stdsem,
|
||||
'ausbildungssemester': ausbildungssemester
|
||||
};
|
||||
this.loadStatus(this.statusId).then(() => {
|
||||
if(this.statusData)
|
||||
this.confirmStatus(this.statusId);
|
||||
});
|
||||
},
|
||||
addNewStatus(){
|
||||
CoreRESTClient.post('components/stv/Status/addNewStatus/' + this.prestudent_id,
|
||||
this.statusData
|
||||
).then(response => {
|
||||
).then(response => {
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('newStatusModal');
|
||||
@@ -258,6 +290,33 @@ export default{
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
confirmStatus(statusId){
|
||||
return CoreRESTClient.post('components/stv/Status/confirmStatus/' +
|
||||
this.statusId.prestudent_id + '/' +
|
||||
this.statusId.status_kurzbz + '/' +
|
||||
this.statusId.studiensemester_kurzbz + '/' +
|
||||
this.statusId.ausbildungssemester)
|
||||
.then(
|
||||
result => {
|
||||
if(!result.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Bestätigung Status erfolgreich');
|
||||
}
|
||||
else
|
||||
{
|
||||
const errorData = result.data.retval;
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
/* return result;*/
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
deleteStatus(status_id){
|
||||
return CoreRESTClient.post('components/stv/Status/deleteStatus/',
|
||||
status_id)
|
||||
@@ -273,7 +332,7 @@ export default{
|
||||
const errorData = result.data.retval;
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
/* return result;*/
|
||||
/* return result;*/
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
//console.log(error.response);
|
||||
@@ -367,14 +426,26 @@ export default{
|
||||
this.listStatusgruende = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
CoreRESTClient
|
||||
.get('components/stv/Status/getLastBismeldestichtag/')
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
.then(result => {
|
||||
this.dataMeldestichtag = result[0].meldestichtag;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
|
||||
|
||||
<p>TestData</p>
|
||||
{{statusData}}
|
||||
<hr>
|
||||
|
||||
Bismeldestichtag
|
||||
{{dataMeldestichtag }}
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Berechtigungen:
|
||||
Skip Check: {{hasPermissionToSkipStatusCheck}} |
|
||||
Admin: {{hasAdminPermission}} |
|
||||
@@ -386,7 +457,6 @@ export default{
|
||||
|
||||
<!--Modal: Add New Status-->
|
||||
<BsModal ref="newStatusModal">
|
||||
<!--TODO(manu) check stati: in FAs Absolvent, Abbrecher, Wartender nicht in Liste-->
|
||||
<template #title>Neuen Status hinzufügen</template>
|
||||
|
||||
<form-form class="row g-3" ref="statusData">
|
||||
@@ -426,7 +496,7 @@ export default{
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO(manu) if(defined('VORRUECKUNG_STATUS_MAX_SEMESTER') && VORRUECKUNG_STATUS_MAX_SEMESTER==false)-->
|
||||
<!-- TODO(manu) if(defined('VORRUECKUNG_STATUS_MAX_SEMESTER') && VORRUECKUNG_STATUS_MAX_SEMESTER==false) 100 Semester-->
|
||||
<div class="row mb-3">
|
||||
<label for="ausbildungssemester" class="form-label col-sm-4">Ausbildungssemester</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -527,9 +597,8 @@ export default{
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--TODO(manu): ganzes Feld ausblenden, wenn kein Statusgrund?-->
|
||||
<div class="row mb-3">
|
||||
|
||||
<div v-if="gruende.length > 0" class="row mb-3">
|
||||
<label for="grund" class="form-label col-sm-4">Grund</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
@@ -553,10 +622,13 @@ export default{
|
||||
|
||||
<!--Modal: Edit Status-->
|
||||
<BsModal ref="editStatusModal">
|
||||
<!--TODO(manu) check stati: in FAs Absolvent, Abbrecher, Wartender nicht in Liste-->
|
||||
<template #title>Status bearbeiten</template>
|
||||
<form-form class="row g-3" ref="statusData">
|
||||
|
||||
<div v-if="statusData.datum < dataMeldestichtag ">
|
||||
<b>Meldestichtag erreicht - Bearbeiten nicht mehr möglich</b>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="statusId" name="statusId" value="statusData.statusId">
|
||||
|
||||
<div class="row mb-3">
|
||||
@@ -590,7 +662,7 @@ export default{
|
||||
type="select"
|
||||
name="studiensemester_kurzbz"
|
||||
v-model="statusData['studiensemester_kurzbz']"
|
||||
> <!--TODO(manu) default aktueller Eintrag-->
|
||||
>
|
||||
<option v-for="sem in listStudiensemester" :key="sem.studiensemester_kurzbz" :value="sem.studiensemester_kurzbz">{{sem.studiensemester_kurzbz}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
@@ -697,8 +769,7 @@ export default{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--TODO(manu): ganzes Feld ausblenden, wenn kein Statusgrund?-->
|
||||
<div class="row mb-3">
|
||||
<div v-if="gruende.length > 0" class="row mb-3">
|
||||
<label for="grund" class="form-label col-sm-4">Grund</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
@@ -727,21 +798,6 @@ export default{
|
||||
<p>Prestudentstatus {{statusData.status_kurzbz}} (id: {{statusData.prestudent_id}}
|
||||
/ {{statusData.studiensemester_kurzbz}}) im {{statusData.ausbildungssemester}}. Ausbildungssemester wirklich löschen?</p>
|
||||
</template>
|
||||
<!-- <template #footer>
|
||||
<button
|
||||
ref="Close"
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
@click="deleteStatus({
|
||||
'prestudent_id': statusData.prestudent_id,
|
||||
'status_kurzbz': statusData.studiensemester_kurzbz,
|
||||
'studiensemester_kurzbz': statusData.studiensemester_kurzbz,
|
||||
'ausbildungssemester': statusData.ausbildungssemester
|
||||
})">OK</button>
|
||||
</template> -->
|
||||
<!-- <template #footer>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="deleteStatus(statusData.prestudent_id, statusData.status_kurzbz, statusData.ausbildungssemester, statusData.studiensemester_kurzbz)">OK</button>
|
||||
</template>-->
|
||||
<template #footer>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="deleteStatus(statusId)">OK</button>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import TblStatus from "./Prestudent/Status.js";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
TblStatus
|
||||
},
|
||||
props: {
|
||||
modelValue: Object,
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details-details h-100 pb-3">
|
||||
<div class="col-12 pb-3">
|
||||
<legend>Status</legend>
|
||||
<TblStatus :prestudent_id="modelValue.prestudent_id"></TblStatus>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
+171
-7
@@ -22868,6 +22868,177 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'notiz_new',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Neue Notiz',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'New Note',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'notiz_edit',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Notiz bearbeiten',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Edit Note',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'verfasser',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Verfasser*in',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'author',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'bearbeiter',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Bearbeiter*in',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'editor',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'erledigt',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'erledigt',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'completed',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'notiz',
|
||||
'phrase' => 'letzte_aenderung',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'letzte Änderung',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Last updated',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'error_fieldRequired',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Eingabefeld {field} ist erforderlich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The Input Field {field} is required',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'error_fieldNotNumeric',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Eingabefeld {field} darf nur Zahlen enthalten.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The Field {Field} must contain only numbers.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'error_fieldNoValidEmail',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Das Eingabefeld {field} muss eine gültige Email-Adresse enthalten.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The field {field} must contain a valid email address.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
)
|
||||
// Personalverwaltung begin
|
||||
array(
|
||||
'app' => 'core',
|
||||
@@ -23549,7 +23720,6 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
array(
|
||||
'app' => 'personalverwaltung',
|
||||
'category' => 'person',
|
||||
@@ -23590,8 +23760,6 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
array(
|
||||
'app' => 'personalverwaltung',
|
||||
'category' => 'person',
|
||||
@@ -23672,9 +23840,6 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
|
||||
array(
|
||||
'app' => 'personalverwaltung',
|
||||
'category' => 'core',
|
||||
@@ -25186,7 +25351,6 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user