actions new, update and delete aufnahmetermine

This commit is contained in:
ma0068
2025-04-25 16:15:27 +02:00
parent 2ab01132b1
commit bf0cd8e8e3
6 changed files with 556 additions and 161 deletions
@@ -14,6 +14,9 @@ class Aufnahmetermine extends FHCAPI_Controller
'insertAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
'updateAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
'deleteAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
'getListPlacementTests' => ['admin:rw', 'assistenz:rw'],
'getListStudyPlans' => ['admin:rw', 'assistenz:rw'],
]);
// Load Libraries
@@ -23,11 +26,12 @@ class Aufnahmetermine extends FHCAPI_Controller
// Load language phrases
$this->loadPhrases([
'ui',
'mobility'
'admission'
]);
// Load models
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
$this->load->model('crm/RtPerson_model', 'RtPersonModel');
}
public function getAufnahmetermine($person_id)
@@ -44,106 +48,62 @@ class Aufnahmetermine extends FHCAPI_Controller
$this->load->library('form_validation');
$authUID = getAuthUID();
$student_uid = $this->input->post('uid');
$formData = $this->input->post('formData');
$person_id = $this->input->post('person_id');
if(!$student_uid)
if(!$person_id)
{
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
}
$formData = $this->input->post('formData');
$_POST['von'] = (isset($formData['von']) && !empty($formData['von'])) ? $formData['von'] : null;
$_POST['bis'] = (isset($formData['bis']) && !empty($formData['bis'])) ? $formData['bis'] : null;
$_POST['nation_code'] = (isset($formData['nation_code']) && !empty($formData['nation_code'])) ? $formData['nation_code'] : 'A';
$_POST['mobilitaetsprogramm_code'] = (isset($formData['mobilitaetsprogramm_code']) && !empty($formData['mobilitaetsprogramm_code'])) ? $formData['mobilitaetsprogramm_code'] : null;
$_POST['herkunftsland_code'] = (isset($formData['herkunftsland_code']) && !empty($formData['herkunftsland_code'])) ? $formData['herkunftsland_code'] : 'A';
$_POST['ects_erworben'] = (isset($formData['ects_erworben']) && !empty($formData['ects_erworben'])) ? $formData['ects_erworben'] : null;
$_POST['ects_angerechnet'] = (isset($formData['ects_angerechnet']) && !empty($formData['ects_angerechnet'])) ? $formData['ects_angerechnet'] : null;
$_POST['lehreinheit_id'] = (isset($formData['lehreinheit_id']) && !empty($formData['lehreinheit_id'])) ? $formData['lehreinheit_id'] : null;
$this->form_validation->set_rules('nation_code', 'Nation_code', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Nation_code'])
$_POST['rt_id'] = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null;
$_POST['anmeldedatum'] = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null;
$_POST['teilgenommen'] = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false;
$_POST['studienplan_id'] = (isset($formData['studienplan_id']) && !empty($formData['studienplan_id'])) ? $formData['studienplan_id'] : null;
$_POST['punkte'] = (isset($formData['punkte']) && !empty($formData['punkte'])) ? $formData['punkte'] : null;
$this->form_validation->set_rules('punkte', 'Punkte', 'numeric', [
'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Punkte'])
]);
$this->form_validation->set_rules('herkunftsland_code', 'Herkunftsland_code', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Herkunftsland_code'])
$this->form_validation->set_rules('studienplan_id', 'studienplan_id', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studienplan'])
]);
$this->form_validation->set_rules('mobilitaetsprogramm_code', 'Mobilitaetsprogramm_code', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Mobilitaetsprogramm_code'])
]);
$this->form_validation->set_rules('von', 'VonDatum', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
$this->form_validation->set_rules('rt_id', 'Reihungstest_id', 'required', [
'is_valid_date' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Reihungstest'])
]);
$this->form_validation->set_rules('bis', 'VBisDatum', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VBisDatum'])
$this->form_validation->set_rules('anmeldedatum', 'AnmeldeDatum', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Anmeldedatum'])
]);
$this->form_validation->set_rules('ects_erworben', 'Ects_erworben', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_erworben'])
]);
$this->form_validation->set_rules('ects_angerechnet', 'Ects_angerechnet', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_angerechnet'])
]);
$this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Lehreinheit'])
]);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$ort = (isset($formData['ort']) && !empty($formData['ort'])) ? $formData['ort'] : null;
$universitaet = (isset($formData['universitaet']) && !empty($formData['universitaet'])) ? $formData['universitaet'] : null;
$localPurposes = (isset($formData['localPurposes']) && !empty($formData['localPurposes'])) ? $formData['localPurposes'] : null;
$localSupports = (isset($formData['localSupports']) && !empty($formData['localSupports'])) ? $formData['localSupports'] : null;
$result = $this->BisioModel->insert([
'student_uid' => $student_uid,
'von' => $_POST['von'],
'bis' => $_POST['bis'],
'mobilitaetsprogramm_code' => $_POST['mobilitaetsprogramm_code'],
'nation_code' => $_POST['nation_code'],
'herkunftsland_code' => $_POST['herkunftsland_code'],
'lehreinheit_id' => $_POST['lehreinheit_id'],
'ort' => $ort,
'universitaet' => $universitaet,
'ects_erworben' => $_POST['ects_erworben'] ,
'ects_angerechnet' => $_POST['ects_angerechnet'],
$result = $this->RtPersonModel->insert([
'person_id' => $person_id,
'rt_id' => $_POST['rt_id'],
'anmeldedatum' => $_POST['anmeldedatum'],
'teilgenommen' => $_POST['teilgenommen'],
'studienplan_id' => $_POST['studienplan_id'],
'punkte' => $_POST['punkte'],
'insertamum' => date('c'),
'insertvon' => $authUID,
]);
$aufnahmetermin_id = $this->getDataOrTerminateWithError($result);
$data = $this->getDataOrTerminateWithError($result);
//check if localData (purposes)
if(count($localPurposes) > 0){
foreach ($localPurposes as $zweck){
$zweck = (int)$zweck;
$this->addAufnahmeterminPurpose($aufnahmetermin_id, $zweck);
}
}
//check if localData (supports)
if(count($localSupports) > 0){
foreach ($localSupports as $support){
$this->addAufnahmeterminSupport($aufnahmetermin_id, $support);
}
}
$this->terminateWithSuccess($aufnahmetermin_id);
$this->terminateWithSuccess($data);
}
public function loadAufnahmetermin($aufnahmetermin_id)
public function loadAufnahmetermin($rt_person_id)
{
$this->BisioModel->addSelect("*");
$this->BisioModel->addJoin('bis.tbl_mobilitaetsprogramm mp', 'ON (mp.mobilitaetsprogramm_code = bis.tbl_bisio.mobilitaetsprogramm_code)', 'LEFT');
$this->BisioModel->addJoin('lehre.tbl_lehreinheit le', 'ON (le.lehreinheit_id = bis.tbl_bisio.lehreinheit_id)','LEFT');
$result = $this->BisioModel->loadWhere(
array('aufnahmetermin_id' => $aufnahmetermin_id)
$result = $this->RtPersonModel->loadWhere(
array('rt_person_id' => $rt_person_id)
);
$data = $this->getDataOrTerminateWithError($result);
@@ -152,118 +112,96 @@ class Aufnahmetermine extends FHCAPI_Controller
public function updateAufnahmetermin()
{
$this->load->library('form_validation');
$authUID = getAuthUID();
$student_uid = $this->input->post('uid');
if(!$student_uid)
{
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
}
$formData = $this->input->post('formData');
$rt_person_id = $this->input->post('rt_person_id');
$person_id = (isset($formData['person_id']) && !empty($formData['person_id'])) ? $formData['person_id'] : null;
$_POST['von'] = (isset($formData['von']) && !empty($formData['von'])) ? $formData['von'] : null;
$_POST['bis'] = (isset($formData['bis']) && !empty($formData['bis'])) ? $formData['bis'] : null;
$_POST['nation_code'] = (isset($formData['nation_code']) && !empty($formData['nation_code'])) ? $formData['nation_code'] : 'A';
$_POST['mobilitaetsprogramm_code'] = (isset($formData['mobilitaetsprogramm_code']) && !empty($formData['mobilitaetsprogramm_code'])) ? $formData['mobilitaetsprogramm_code'] : null;
$_POST['herkunftsland_code'] = (isset($formData['herkunftsland_code']) && !empty($formData['herkunftsland_code'])) ? $formData['herkunftsland_code'] : 'A';
$_POST['ects_erworben'] = (isset($formData['ects_erworben']) && !empty($formData['ects_erworben'])) ? $formData['ects_erworben'] : null;
$_POST['ects_angerechnet'] = (isset($formData['ects_angerechnet']) && !empty($formData['ects_angerechnet'])) ? $formData['ects_angerechnet'] : null;
$_POST['lehreinheit_id'] = (isset($formData['lehreinheit_id']) && !empty($formData['lehreinheit_id'])) ? $formData['lehreinheit_id'] : null;
$this->form_validation->set_rules('nation_code', 'Nation_code', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Nation_code'])
if(!$person_id)
{
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
}
if(!$rt_person_id)
{
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'RT_Person ID']), self::ERROR_TYPE_GENERAL);
}
$_POST['rt_id'] = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null;
$_POST['anmeldedatum'] = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null;
$_POST['teilgenommen'] = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false;
$_POST['studienplan_id'] = (isset($formData['studienplan_id']) && !empty($formData['studienplan_id'])) ? $formData['studienplan_id'] : null;
$_POST['punkte'] = (isset($formData['punkte']) && !empty($formData['punkte'])) ? $formData['punkte'] : null;
$this->form_validation->set_rules('punkte', 'Punkte', 'numeric', [
'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Punkte'])
]);
$this->form_validation->set_rules('herkunftsland_code', 'Herkunftsland_code', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Herkunftsland_code'])
$this->form_validation->set_rules('studienplan_id', 'studienplan_id', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studienplan'])
]);
$this->form_validation->set_rules('mobilitaetsprogramm_code', 'Mobilitaetsprogramm_code', 'required', [
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Mobilitaetsprogramm_code'])
]);
$this->form_validation->set_rules('von', 'VonDatum', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
$this->form_validation->set_rules('rt_id', 'Reihungstest_id', 'required', [
'is_valid_date' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Reihungstest'])
]);
$this->form_validation->set_rules('bis', 'VBisDatum', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VBisDatum'])
$this->form_validation->set_rules('anmeldedatum', 'AnmeldeDatum', 'is_valid_date', [
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Anmeldedatum'])
]);
$this->form_validation->set_rules('ects_erworben', 'Ects_erworben', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_erworben'])
]);
$this->form_validation->set_rules('ects_angerechnet', 'Ects_angerechnet', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_angerechnet'])
]);
$this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Lehreinheit'])
]);
if ($this->form_validation->run() == false)
{
$this->terminateWithValidationErrors($this->form_validation->error_array());
}
$result = $this->BisioModel->update(
$result = $this->RtPersonModel->update(
[
'aufnahmetermin_id' => $formData['aufnahmetermin_id']
'rt_person_id' => $rt_person_id,
'person_id' => $person_id,
],
[
'student_uid' => $student_uid,
'von' => $_POST['von'],
'bis' => $_POST['bis'],
'mobilitaetsprogramm_code' => $_POST['mobilitaetsprogramm_code'],
'nation_code' => $_POST['nation_code'],
'herkunftsland_code' => $_POST['herkunftsland_code'],
'lehreinheit_id' => $_POST['lehreinheit_id'],
'ort' => $formData['ort'],
'universitaet' => $formData['universitaet'],
'ects_erworben' => $_POST['ects_erworben'] ,
'ects_angerechnet' => $_POST['ects_angerechnet'],
'updateamum' => date('c'),
'updatevon' => $authUID,
]
);
'rt_id' => $_POST['rt_id'],
'anmeldedatum' => $_POST['anmeldedatum'],
'teilgenommen' => $_POST['teilgenommen'],
'studienplan_id' => $_POST['studienplan_id'],
'punkte' => $_POST['punkte'],
'insertamum' => date('c'),
'insertvon' => $authUID,
]);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess(current($data));
$this->terminateWithSuccess($data);
}
public function deleteAufnahmetermin($aufnahmetermin_id)
public function deleteAufnahmetermin($rt_person_id)
{
//check if extension table exists
$result = $this->BisioModel->tableExists('extension', 'tbl_mo_bisioidzuordnung');
$data = $this->getDataOrTerminateWithError($result);
//if table exists check if existing entry
if(!empty($data))
{
$this->BisioModel->addSelect("count(*)");
$this->BisioModel->addJoin('extension.tbl_mo_bisioidzuordnung mo', 'ON (mo.aufnahmetermin_id = bis.tbl_bisio.aufnahmetermin_id)', 'LEFT');
$resultCheckMo = $this->BisioModel->loadWhere(
array('mo.aufnahmetermin_id' => $aufnahmetermin_id)
);
$resultCheckMo = $this->getDataOrTerminateWithError($resultCheckMo);
$count = current($resultCheckMo)->count;
$existsInExtension = $count > 0 ? true : false;
if($existsInExtension)
$this->terminateWithError($this->p->t('mobility', 'error_existingEntryInExtension'), self::ERROR_TYPE_GENERAL);
}
$result = $this->BisioModel->delete(
array('aufnahmetermin_id' => $aufnahmetermin_id)
$result = $this->RtPersonModel->delete(
array('rt_person_id' => $rt_person_id)
);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function getListPlacementTests()
{
$result = $this->ReihungstestModel->getAllReihungstests();
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function getListStudyPlans($person_id)
{
$this->load->model('organisation/Studienplan_model','StudienplanModel');
$result = $this->StudienplanModel->getStudienplaeneForPerson($person_id);;
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -550,4 +550,37 @@ class Reihungstest_model extends DB_Model
return $this->execQuery($query, array($person_id));
}
/**
* Loads all placement tests
* @return array Returns object array with data of placement tests
*/
//TODO(Manu) finish Details
public function getAllReihungstests()
{
$query = '
SELECT * FROM public.tbl_reihungstest
JOIN public.tbl_studiengang ON tbl_reihungstest.studiengang_kz = tbl_studiengang.studiengang_kz
-- JOIN lehre.tbl_studienplan sp USING(studienplan_id)
-- JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
ORDER BY datum DESC NULLS LAST, uhrzeit
';
return $this->execQuery($query);
}
public function getReihungstestsPs($prestudent_id)
{
$query = '
SELECT * FROM public.tbl_reihungstest
JOIN public.tbl_studiengang ON tbl_reihungstest.studiengang_kz = tbl_studiengang.studiengang_kz
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
ORDER BY datum DESC, uhrzeit
';
return $this->execQuery($query);
}
}
@@ -134,4 +134,17 @@ class Studienplan_model extends DB_Model
'prestudent_id' => $prestudent_id
]);
}
public function getStudienplaeneForPerson($person_id)
{
$this->addDistinct();
$this->addSelect($this->dbTable . '.*');
$this->addSelect('ps.*');
$this->addJoin('public.tbl_prestudentstatus pss', 'studienplan_id');
$this->addJoin('public.tbl_prestudent ps', 'prestudent_id');
return $this->loadWhere([
'person_id' => $person_id
]);
}
}
@@ -22,4 +22,43 @@ export default {
url: 'api/frontend/v1/stv/aufnahmetermine/getAufnahmetermine/' + person_id,
};
},
getListPlacementTests(){
return {
method: 'get',
url: 'api/frontend/v1/stv/aufnahmetermine/getListPlacementTests/',
};
},
getListStudyPlans(person_id){
return {
method: 'get',
url: 'api/frontend/v1/stv/aufnahmetermine/getListStudyPlans/' + person_id,
};
},
addNewPlacementTest(params){
return {
method: 'post',
url: 'api/frontend/v1/stv/aufnahmetermine/insertAufnahmetermin/',
params
};
},
loadPlacementTest(rt_person_id){
return {
method: 'get',
url: 'api/frontend/v1/stv/aufnahmetermine/loadAufnahmetermin/' + rt_person_id,
};
},
updatePlacementTest(params){
return {
method: 'post',
url: 'api/frontend/v1/stv/aufnahmetermine/updateAufnahmetermin/',
params
};
},
deletePlacementTest(rt_person_id){
return {
method: 'post',
url: 'api/frontend/v1/stv/aufnahmetermine/deleteAufnahmetermin/' + rt_person_id
};
}
}
@@ -34,17 +34,70 @@ export default {
{title: "rt_id", field: "rt_id"},
{title: "rt_person_id", field: "rt_person_id"},
{title: "person_id", field: "person_id"},
{title: "datum", field: "datum"},
{title: "datum", field: "datum",
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
const date = new Date(dateStr);
return date.toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
}
},
{title: "stufe", field: "stufe"},
{title: "studiensemester", field: "studiensemester_kurzbz"},
{title: "anmerkung", field: "anmerkung", visible: false},
{title: "anmeldedatum", field: "anmeldedatum", visible: false},
{title: "anmeldedatum", field: "anmeldedatum", visible: false,
formatter: function (cell) {
const dateStr = cell.getValue();
if (!dateStr) return "";
const date = new Date(dateStr);
return date.toLocaleString("de-DE", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
}
},
{title: "punkte", field: "punkte"},
{title: "teilgenommen", field: "teilgenommen"},
{title: "ort", field: "ort", visible: false},
{title: "studienplan", field: "studienplan", visible: false},
{title: "studienplan_id", field: "studienplan_id", visible: false},
{title: "stg_kuerzel", field: "stg_kuerzel"},
{
title: 'Aktionen', field: 'actions',
minWidth: 150, // Ensures Action-buttons will be always fully displayed
formatter: (cell, formatterParams, onRendered) => {
let container = document.createElement('div');
container.className = "d-flex gap-2";
let button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-edit"></i>';
button.title = this.$p.t('ui', 'bearbeiten');
button.addEventListener('click', (event) =>
this.actionEditPlacementTest(cell.getData().rt_person_id)
);
container.append(button);
button = document.createElement('button');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-xmark"></i>';
button.title = this.$p.t('ui', 'loeschen');
button.addEventListener('click', () =>
this.actionDeletePlacementTest(cell.getData().rt_person_id)
);
container.append(button);
return container;
},
frozen: true
}
],
layout: 'fitDataFill',
layoutColumnsOnNewData: false,
@@ -56,13 +109,129 @@ export default {
tabulatorEvents: [],
formData: {},
statusNew: true,
listPlacementTests: [],
listStudyPlans: []
}
},
methods: {},
methods: {
actionNewPlacementTest() {
this.resetForm();
this.statusNew = true;
this.$refs.placementTestModal.show();
},
actionEditPlacementTest(rt_person_id) {
console.log("edit Test " + rt_person_id);
this.resetForm();
this.statusNew = false;
this.loadPlacementTest(rt_person_id);
this.$refs.placementTestModal.show();
},
actionDeletePlacementTest(rt_person_id) {
this.$fhcAlert
.confirmDelete()
.then(result => result
? rt_person_id
: Promise.reject({handled: true}))
.then(this.deletePlacementTest)
.catch(this.$fhcAlert.handleSystemError);
},
addNewPlacementTest() {
const dataToSend = {
person_id: this.student.person_id,
formData: this.formData
};
return this.$refs.formPlacementTest
.call(ApiStvAdmissionDates.addNewPlacementTest(dataToSend))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal("placementTestModal");
this.resetForm();
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
this.reload();
});
},
hideModal(modalRef){
this.$refs[modalRef].hide();
},
reload() {
this.$refs.table.reloadTable();
},
loadPlacementTest(rt_person_id) {
console.log("load Test " + rt_person_id);
return this.$api
.call(ApiStvAdmissionDates.loadPlacementTest(rt_person_id))
.then(result => {
this.formData = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
updatePlacementTest(rt_person_id) {
const dataToSend = {
formData: this.formData,
rt_person_id: rt_person_id,
};
this.$refs.formPlacementTest
.call(ApiStvAdmissionDates.updatePlacementTest(dataToSend))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
this.hideModal("placementTestModal");
this.resetForm();
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
this.reload();
});
},
deletePlacementTest(rt_person_id) {
console.log("delete Test" + rt_person_id);
return this.$api
.call(ApiStvAdmissionDates.deletePlacementTest(rt_person_id))
.then(response => {
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
})
.catch(this.$fhcAlert.handleSystemError)
.finally(() => {
this.reload();
});
},
resetForm() {
console.log("resetForm");
this.formData = {};
/*
this.formData.von = new Date();
this.formData.bis = new Date();
this.formData.mobilitaetsprogramm_code = 7;
this.formData.nation_code = 'A';
this.formData.herkunftsland_code = 'A';
this.formData.rt_id = null;
this.formData.localPurposes = [];
this.formData.localSupports = [];
this.formData.lehrveranstaltung_id = '',
this.formData.lehreinheit_id = '',
this.statusNew = true;
this.listLes = [];*/
},
},
created() {
this.$api
.call(ApiStvAdmissionDates.getListPlacementTests())
.then(result => {
this.listPlacementTests = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
this.$api
.call(ApiStvAdmissionDates.getListStudyPlans(this.student.person_id))
.then(result => {
this.listStudyPlans = result.data;
})
.catch(this.$fhcAlert.handleSystemError);
},
template: `
<div class="stv-details-admission-dates-table h-100 pb-3">
<div class="stv-details-admission-table h-100 pb-3">
<h4>Allgemein</h4>
<core-filter-cmpt
@@ -74,10 +243,113 @@ export default {
reload
new-btn-show
:new-btn-label="this.$p.t('lehre', 'reihungstest')"
@click:new="actionNewMobility"
@click:new="actionNewPlacementTest"
>
</core-filter-cmpt>
{{formData}}
<!-- {{student}}-->
<!-- {{listPlacementTests}}-->
<!--Modal: placementTestModal-->
<bs-modal ref="placementTestModal" dialog-class="modal-dialog-scrollable">
<template #title>
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('admission', 'admission_new')}}</p>
<p v-else class="fw-bold mt-3">{{$p.t('admission', 'admission_edit')}}</p>
</template>
<form-form ref="formPlacementTest" @submit.prevent>
<div class="row mb-3">
<form-input
container-class="stv-details-admission-placementtest"
:label="$p.t('lehre', 'reihungstest')"
type="select"
v-model="formData.rt_id"
name="reihungstest_id"
>
<option value=""> -- {{ $p.t('fehlermonitoring', 'keineAuswahl') }} --</option>
<option
v-for="test in listPlacementTests"
:key="test.reihungstest_id"
:value="test.reihungstest_id"
>
{{test.reihungstest_id}} {{test.studiensemester_kurzbz}} St.{{test.stufe}} {{test.kurzbzlang}} {{test.datum}} {{test.uhrzeit}}
{{test.anmerkung}} (x/{{test.max_teilnehmer}}) {{test.rt_id}}
</option>
</form-input>
</div>
<div class="row mb-3">
<form-input
container-class="stv-details-admission-anmeldedatum"
:label="$p.t('admission', 'anmeldundRtAm')"
type="DatePicker"
v-model="formData.anmeldedatum"
auto-apply
:enable-time-picker="false"
format="dd.MM.yyyy"
name="anmeldedatum"
:teleport="true"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
container-class="stv-details-admission-teilgenommen"
type="checkbox"
name="teilgenommen"
:label="$p.t('admission/rtAngetreten')"
v-model="formData.teilgenommen"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
container-class="stv-details-admission-studyplan"
:label="$p.t('lehre', 'studienplan')"
type="select"
v-model="formData.studienplan_id"
name="studienplan_id"
>
<option value=""> -- {{ $p.t('fehlermonitoring', 'keineAuswahl') }} --</option>
<option
v-for="stplan in listStudyPlans"
:key="stplan.studienplan_id"
:value="stplan.studienplan_id"
>
{{stplan.bezeichnung}}
</option>
</form-input>
</div>
<div class="row mb-3">
<form-input
container-class="stv-details-admission-points"
:label="$p.t('exam', 'punkte')"
type="text"
v-model="formData.punkte"
name="punkte"
>
</form-input>
</div>
<!--TODO(Manu) Reihungstestergebnis holen-->
</form-form>
<template #footer>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
<button v-if="statusNew" class="btn btn-primary" @click="addNewPlacementTest()"> {{$p.t('ui', 'speichern')}}</button>
<button v-else class="btn btn-primary" @click="updatePlacementTest(formData.rt_id)"> {{$p.t('ui', 'speichern')}}</button>
</template>
</div>
`
}
+100
View File
@@ -41436,6 +41436,106 @@ and represent the current state of research on the topic. The prescribed citatio
)
)
),
array(
'app' => 'core',
'category' => 'admission',
'phrase' => 'admission_edit',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aufnahmetermin bearbeiten',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Edit appointment for participation placement test',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'admission',
'phrase' => 'admission_delete',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aufnahmetermin Löschen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Delete Admission Date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'admission',
'phrase' => 'admission_new',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Termin für Teilnahme am Reihungstest anlegen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Create appointment for participation placement test',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'admission',
'phrase' => 'anmeldundRtAm',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anmeldung zum Reihungstest am',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Registration for the ranking test on',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'admission',
'phrase' => 'rtAngetreten',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Zum Reihungstest angetreten',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Participated in the ranking test',
'description' => '',
'insertvon' => 'system'
)
)
),
// FHC4 STUDIERENDENVERWALTUNG AUFNAHMETERMINE ENDE ---------------------------------------------------------------
);