mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 15:32:17 +00:00
update Permissions, update validations, insert Termin1 with Termin2, finish phrases
This commit is contained in:
@@ -27,7 +27,6 @@ class Pruefung extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
//TODO(Manu) Berechtigungen
|
||||
parent::__construct([
|
||||
'getPruefungen' => ['admin:r', 'assistenz:r'],
|
||||
'loadPruefung' => ['admin:r', 'assistenz:r'],
|
||||
@@ -40,6 +39,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
'getMitarbeiterLv' => self::PERM_LOGGED,
|
||||
'getNoten' => self::PERM_LOGGED,
|
||||
'checkZeugnisnoteLv' => self::PERM_LOGGED,
|
||||
'checkTermin1' => self::PERM_LOGGED,
|
||||
'insertPruefung' => ['admin:rw', 'assistenz:rw'],
|
||||
'updatePruefung' =>['admin:rw', 'assistenz:rw'],
|
||||
'deletePruefung' =>['admin:rw', 'assistenz:rw'],
|
||||
@@ -48,26 +48,22 @@ class Pruefung extends FHCAPI_Controller
|
||||
//Load Models
|
||||
$this->load->model('education/LePruefung_model', 'PruefungModel');
|
||||
|
||||
// Additional Permission Checks
|
||||
//TODO(Manu) avoid php warning: Message: Illegal offset type
|
||||
//version with postParameter
|
||||
if ($this->router->method == 'insertPruefung') {
|
||||
|
||||
if ($this->router->method == 'insertPruefung')
|
||||
{
|
||||
$student_uid = $this->input->post('student_uid');
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->load($student_uid);
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$prestudent_id = current($student)->prestudent_id;
|
||||
|
||||
|
||||
$this->checkPermissionsForPrestudent($prestudent_id, ['admin:w', 'assistenz:w']);
|
||||
}
|
||||
|
||||
// parameter from uri
|
||||
if ($this->router->method == 'updatePruefung' || $this->router->method == 'deletePruefung') {
|
||||
|
||||
if ($this->router->method == 'updatePruefung' || $this->router->method == 'deletePruefung')
|
||||
{
|
||||
$pruefung_id = current(array_slice($this->uri->rsegments, 2));
|
||||
|
||||
$result = $this->PruefungModel->load($pruefung_id);
|
||||
@@ -76,37 +72,37 @@ class Pruefung extends FHCAPI_Controller
|
||||
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->load($student_uid);
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
$prestudent_id = current($student)->prestudent_id;
|
||||
|
||||
$this->checkPermissionsForPrestudent($prestudent_id, ['admin:rw', 'assistenz:rw']);
|
||||
}
|
||||
|
||||
if ($this->router->method == 'loadPruefung') {
|
||||
|
||||
if ($this->router->method == 'loadPruefung')
|
||||
{
|
||||
$pruefung_id = current(array_slice($this->uri->rsegments, 2));
|
||||
|
||||
$result = $this->PruefungModel->load($pruefung_id);
|
||||
$pruefung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
|
||||
$student_uid = current($pruefung)->student_uid;
|
||||
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->load($student_uid);
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
$prestudent_id = current($student)->prestudent_id;
|
||||
|
||||
$this->checkPermissionsForPrestudent($prestudent_id, ['admin:r', 'assistenz:r']);
|
||||
}
|
||||
|
||||
if ($this->router->method == 'getPruefungen') {
|
||||
$student_uid = current(array_slice($this->uri->rsegments, 2));
|
||||
|
||||
// $this->terminateWithError($student_id, self::ERROR_TYPE_GENERAL);
|
||||
if ($this->router->method == 'getPruefungen')
|
||||
{
|
||||
$student_uid = current(array_slice($this->uri->rsegments, 2));
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->load($student_uid);
|
||||
$result = $this->StudentModel->load([$student_uid]);
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
$prestudent_id = current($student)->prestudent_id;
|
||||
|
||||
@@ -149,7 +145,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
$this->PruefungModel->addSelect('tbl_pruefungstyp.beschreibung as typ_beschreibung');
|
||||
$this->PruefungModel->addSelect('tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz');
|
||||
|
||||
$this->PruefungModel->addJoin('lehre.tbl_lehreinheit', 'lehre.tbl_pruefung.lehreinheit_id=lehre.tbl_lehreinheit.lehreinheit_id');
|
||||
$this->PruefungModel->addJoin('lehre.tbl_lehreinheit', 'lehre.tbl_pruefung.lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id');
|
||||
$this->PruefungModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->PruefungModel->addJoin('lehre.tbl_note', 'note');
|
||||
$this->PruefungModel->addJoin('lehre.tbl_pruefungstyp', 'pruefungstyp_kurzbz');
|
||||
@@ -171,9 +167,26 @@ class Pruefung extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
public function insertPruefung(){
|
||||
|
||||
/**
|
||||
* Inserts a pruefung
|
||||
*
|
||||
* @param lehrveranstaltung_id, student_uid, lehreinheit_id
|
||||
*
|
||||
* @return values on success
|
||||
* retval 0: pruefung inserted
|
||||
* reval 1: pruefung and zeugnisnote inserted
|
||||
* retval 2: pruefung inserted, no insert Zeugnisnote
|
||||
* (change after date of examination)
|
||||
* retval 3: pruefung of type Termin2 inserted
|
||||
* and pruefung of type Termin1 as well
|
||||
* retval 5: prueufungen Termin 2 and 1 inserted
|
||||
* and no insert Zeugnisnote (change after date of examination)
|
||||
*/
|
||||
public function insertPruefung()
|
||||
{
|
||||
$authUID = getAuthUID();
|
||||
$lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id');
|
||||
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$student_uid = $this->input->post('student_uid');
|
||||
$mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
|
||||
@@ -185,19 +198,21 @@ class Pruefung extends FHCAPI_Controller
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id', $this->p->t('lehre', 'lehrveranstaltung'), 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre','lehrveranstaltung')]),
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehrveranstaltung')]),
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('lehreinheit_id', $this->p->t('lehre', 'lehreinheit'), 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre','lehreinheit')]),
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehreinheit')]),
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('pruefungstyp_kurzbz', $this->p->t('lehre', 'pruefung'), 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global','typ')]),
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global', 'typ')]),
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'datum', $this->p->t('global', 'datum'), ['is_valid_date']
|
||||
'datum',
|
||||
$this->p->t('global', 'datum'),
|
||||
['is_valid_date']
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
@@ -205,6 +220,23 @@ class Pruefung extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
//calculate studiensemester_kurzbz this from lehreinheit (case newPruefung)
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
if (!$studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
|
||||
$lehreinheit = $this->getDataOrTerminateWithError($result);
|
||||
$studiensemester_kurzbz = current($lehreinheit)->studiensemester_kurzbz;
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->PruefungModel->insert([
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
@@ -219,12 +251,120 @@ class Pruefung extends FHCAPI_Controller
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(true);
|
||||
//check if existing zeugnisnote
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
|
||||
$result = $this->ZeugnisnoteModel->loadWhere(array(
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
//insert zeugnisnote, if not existing
|
||||
$result = $this->ZeugnisnoteModel->insert(array(
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'note' => $note,
|
||||
'uebernahmedatum' => date('c'),
|
||||
'benotungsdatum' => $datum,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID
|
||||
));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess(1);
|
||||
}
|
||||
|
||||
$return_code = 0;
|
||||
|
||||
//handling Termin1 if not existing
|
||||
if($pruefungstyp_kurzbz == "Termin2")
|
||||
{
|
||||
$resultP = $this->PruefungModel->loadWhere(array(
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
'pruefungstyp_kurzbz' => 'Termin1'));
|
||||
|
||||
if (isError($resultP))
|
||||
{
|
||||
$this->terminateWithError(getError($resultP), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(!hasData($resultP))
|
||||
{
|
||||
//check if existing Zeugnisnote
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$this->ZeugnisnoteModel->addJoin('lehre.tbl_lehreinheit', 'lehrveranstaltung_id');
|
||||
|
||||
$resultP = $this->ZeugnisnoteModel->loadWhere(array(
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
'student_uid' => $student_uid,
|
||||
'lehre.tbl_zeugnisnote.studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
if (isError($resultP))
|
||||
{
|
||||
$this->terminateWithError(getError($resultP), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (!hasData($resultP))
|
||||
{
|
||||
$this->terminateWithError("Zeugnisnote existiert nicht", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$dataNote = current(getData($resultP));
|
||||
|
||||
$resultN = $this->PruefungModel->insert([
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'datum' => $dataNote->benotungsdatum,
|
||||
'pruefungstyp_kurzbz' => 'Termin1',
|
||||
'note' => $dataNote->note,
|
||||
'punkte' => $dataNote->punkte,
|
||||
'anmerkung' => 'automatisiert aus Zeugnisnote erstellt',
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $authUID,
|
||||
]);
|
||||
|
||||
if (isError($resultN)) {
|
||||
$this->terminateWithError(getError($resultN), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$return_code = 3;
|
||||
}
|
||||
}
|
||||
|
||||
$note = current(getData($result));
|
||||
$uebernahmedatum = new DateTime($note->uebernahmedatum);
|
||||
$benotungsdatum = new DateTime($note->benotungsdatum);
|
||||
|
||||
$checkDate = $uebernahmedatum === '' || $benotungsdatum > $uebernahmedatum
|
||||
? $benotungsdatum
|
||||
: $uebernahmedatum;
|
||||
|
||||
if ($checkDate >= $datum && $note !== $note->note)
|
||||
{
|
||||
$this->terminateWithSuccess($return_code + 2);
|
||||
}
|
||||
$this->terminateWithSuccess($return_code + 2);
|
||||
}
|
||||
|
||||
public function updatePruefung($pruefung_id){
|
||||
|
||||
/**
|
||||
* Updates a pruefung
|
||||
*
|
||||
* @param pruefung_id
|
||||
*
|
||||
* @return success or error
|
||||
*
|
||||
* no impact on lehre.tbl_zeugnisnote
|
||||
*/
|
||||
public function updatePruefung($pruefung_id)
|
||||
{
|
||||
$result = $this->PruefungModel->load($pruefung_id);
|
||||
|
||||
$oldpruefung = $this->getDataOrTerminateWithError($result);
|
||||
@@ -243,20 +383,37 @@ class Pruefung extends FHCAPI_Controller
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('lehrveranstaltung_id', $this->p->t('lehre', 'lehrveranstaltung'), 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre','lehrveranstaltung')]),
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('lehreinheit_id', $this->p->t('lehre', 'lehreinheit'), 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre','lehreinheit')]),
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('pruefungstyp_kurzbz', $this->p->t('lehre', 'pruefung'), 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global','typ')]),
|
||||
]);
|
||||
$this->form_validation->set_rules(
|
||||
'lehrveranstaltung_id',
|
||||
$this->p->t('lehre', 'lehrveranstaltung'),
|
||||
'required',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehrveranstaltung')]),
|
||||
]
|
||||
);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'datum', $this->p->t('global', 'datum'), ['is_valid_date']
|
||||
'lehreinheit_id',
|
||||
$this->p->t('lehre', 'lehreinheit'),
|
||||
'required',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'lehreinheit')]),
|
||||
]
|
||||
);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'pruefungstyp_kurzbz',
|
||||
$this->p->t('lehre', 'pruefung'),
|
||||
'required',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('global', 'typ')]),
|
||||
]
|
||||
);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'datum',
|
||||
$this->p->t('global', 'datum'),
|
||||
['is_valid_date']
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
@@ -284,8 +441,17 @@ class Pruefung extends FHCAPI_Controller
|
||||
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
public function deletePruefung($pruefung_id){
|
||||
/**
|
||||
* Deletes a pruefung
|
||||
*
|
||||
* @param pruefung_id
|
||||
*
|
||||
* @return success or error
|
||||
*
|
||||
* no impact on lehre.tbl_zeugnisnote
|
||||
*/
|
||||
public function deletePruefung($pruefung_id)
|
||||
{
|
||||
$result = $this->PruefungModel->load($pruefung_id);
|
||||
|
||||
$oldpruefung = $this->getDataOrTerminateWithError($result);
|
||||
@@ -319,8 +485,8 @@ class Pruefung extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function getAllLehreinheiten(){
|
||||
|
||||
public function getAllLehreinheiten()
|
||||
{
|
||||
$lv_id = $this->input->post('lv_id');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
|
||||
@@ -374,31 +540,28 @@ class Pruefung extends FHCAPI_Controller
|
||||
$lv_ids = array();
|
||||
$allDataMa = array();
|
||||
|
||||
foreach ($data as $lehrveranstaltung) {
|
||||
foreach ($data as $lehrveranstaltung)
|
||||
{
|
||||
$lv_ids[] = $lehrveranstaltung->lehrveranstaltung_id;
|
||||
}
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
foreach ($lv_ids as $id) {
|
||||
|
||||
foreach ($lv_ids as $id)
|
||||
{
|
||||
$resultMa = $this->MitarbeiterModel->getMitarbeiterFromLV($id);
|
||||
$dataMa = $this->getDataOrTerminateWithError($resultMa);
|
||||
|
||||
if (is_array($dataMa)) {
|
||||
if (is_array($dataMa))
|
||||
{
|
||||
$allDataMa = array_merge($allDataMa, $dataMa);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess($allDataMa);
|
||||
}
|
||||
|
||||
public function getLvsByStudent($student_uid, $studiensemester_kurzbz=null )
|
||||
public function getLvsByStudent($student_uid, $studiensemester_kurzbz = null)
|
||||
{
|
||||
//bei post request
|
||||
/* $student_uid = $this->input->post('student_uid');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');*/
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudent($student_uid, $studiensemester_kurzbz);
|
||||
@@ -443,11 +606,10 @@ class Pruefung extends FHCAPI_Controller
|
||||
$result = $this->ZeugnisnoteModel->loadWhere(array(
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id,
|
||||
'student_uid' => $student_uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz)
|
||||
);
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
return $this->terminateWithSuccess($data);
|
||||
|
||||
return $this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,9 @@ export default{
|
||||
from: 'configShowHintKommPrfg',
|
||||
default: false
|
||||
},
|
||||
/* $reloadList: {
|
||||
from: '$reloadList',
|
||||
required: true
|
||||
}*/
|
||||
lists: {
|
||||
from: 'lists'
|
||||
},
|
||||
},
|
||||
props: {
|
||||
uid: Number
|
||||
@@ -31,16 +30,17 @@ export default{
|
||||
ajaxRequestFunc: this.$fhcApi.get,
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
//TODO(Manu) remove not needed entries
|
||||
{title: "Datum", field: "format_datum"},
|
||||
{title: "Lehrveranstaltung", field: "lehrveranstaltung_bezeichnung"},
|
||||
{title: "Note", field: "note_bezeichnung"},
|
||||
{title: "StudSem", field: "studiensemester_kurzbz"}, //just testing
|
||||
//{title: "StudSem", field: "studiensemester_kurzbz"}, //just testing
|
||||
{title: "Anmerkung", field: "anmerkung"},
|
||||
{title: "Typ", field: "pruefungstyp_kurzbz"},
|
||||
{title: "PruefungId", field: "pruefung_id", visible: false},
|
||||
{title: "LehreinheitId", field: "lehreinheit_id", visible: false},
|
||||
{title: "Student_uid", field: "student_uid", visible: false},
|
||||
{title: "LV_id", field: "lehrveranstaltung_id", visible: false}, //just for testing
|
||||
//{title: "LV_id", field: "lehrveranstaltung_id", visible: false}, //just for testing
|
||||
{title: "Mitarbeiter_uid", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "Punkte", field: "punkte", visible: false},
|
||||
{
|
||||
@@ -96,28 +96,31 @@ export default{
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async () => {
|
||||
//console.log('tableBuilt');
|
||||
|
||||
/* const filter = this.$refs.table.tabulator.getFilters().filter(filter => filter.field == 'studiensemester_kurzbz').pop();
|
||||
if (filter) {
|
||||
this.isFilterSet = true;
|
||||
if (this.currentSemester !== filter.value) {
|
||||
this.$refs.table.tabulator.setFilter('studiensemester_kurzbz', '=', this.currentSemester);
|
||||
}
|
||||
}*/
|
||||
|
||||
await this.$p.loadCategory(['fristenmanagement', 'global', 'ui', 'exam']);
|
||||
await this.$p.loadCategory(['fristenmanagement', 'global', 'lehre', 'exam', 'ui']);
|
||||
let cm = this.$refs.table.tabulator.columnManager;
|
||||
|
||||
/* cm.getColumnByField('bezeichnung').component.updateDefinition({
|
||||
title: this.$p.t('global', 'typ')
|
||||
});*/
|
||||
|
||||
cm.getColumnByField('format_datum').component.updateDefinition({
|
||||
title: this.$p.t('global', 'datum')
|
||||
});
|
||||
cm.getColumnByField('lehrveranstaltung_bezeichnung').component.updateDefinition({
|
||||
title: this.$p.t('lehre', 'lehrveranstaltung')
|
||||
});
|
||||
cm.getColumnByField('note_bezeichnung').component.updateDefinition({
|
||||
title: this.$p.t('lehre', 'note')
|
||||
});
|
||||
cm.getColumnByField('anmerkung').component.updateDefinition({
|
||||
title: this.$p.t('global', 'anmerkung')
|
||||
});
|
||||
|
||||
|
||||
cm.getColumnByField('pruefungstyp_kurzbz').component.updateDefinition({
|
||||
title: this.$p.t('global', 'typ')
|
||||
});
|
||||
cm.getColumnByField('punkte').component.updateDefinition({
|
||||
title: this.$p.t('exam', 'punkte')
|
||||
});
|
||||
//TODO(Manu) Uncaught TypeError: e.element.after is not a function
|
||||
/* cm.getColumnByField('actions').component.updateDefinition({
|
||||
title: this.$p.t('global', 'actions')
|
||||
});*/
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -125,25 +128,20 @@ export default{
|
||||
listTypesExam: [],
|
||||
listLvsAndLes: [],
|
||||
listLvsAndMas: [],
|
||||
listLvs: [], //TODO(Manu) nachträglich sortieren
|
||||
listLvs: [],
|
||||
listLes: [],
|
||||
listMas: [], //TODO(Manu) Filter statt SELECT DISTINCT
|
||||
listMas: [],
|
||||
listMarks: [],
|
||||
zeugnisData: [],
|
||||
checkData:[],
|
||||
filter: false,
|
||||
statusNew: true,
|
||||
isStartDropDown: false,
|
||||
// componentKey: 0,
|
||||
isFilterSet: false,
|
||||
showHint: false,
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
/* lehrveranstaltungen(){
|
||||
return this.listLvsAndLes.filter((value, index, self) => {
|
||||
return self.indexOf(value) === index;
|
||||
});
|
||||
},*/
|
||||
lv_teile(){
|
||||
return this.listLvsAndLes.filter(lv => lv.lehrveranstaltung_id == this.pruefungData.lehrveranstaltung_id);
|
||||
},
|
||||
@@ -151,18 +149,6 @@ export default{
|
||||
return this.listLvsAndMas.filter(lv => lv.lehrveranstaltung_id == this.pruefungData.lehrveranstaltung_id);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/* defaultSemester(newVal, oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
console.log("variable did change");
|
||||
//this.reload(); // Methode aufrufen, um die Komponente neu zu laden
|
||||
this.componentKey += 1;
|
||||
}
|
||||
},
|
||||
modelValue() {
|
||||
this.$refs.table.reloadTable();
|
||||
}*/
|
||||
},
|
||||
methods:{
|
||||
loadPruefung(pruefung_id) {
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/pruefung/loadPruefung/' + pruefung_id)
|
||||
@@ -177,6 +163,7 @@ export default{
|
||||
this.isStartDropDown = true;
|
||||
this.resetModal();
|
||||
|
||||
this.pruefungData.student_uid = this.uid;
|
||||
this.pruefungData.note = 9;
|
||||
this.pruefungData.datum = new Date();
|
||||
this.pruefungData.pruefungstyp_kurzbz = null;
|
||||
@@ -226,7 +213,11 @@ export default{
|
||||
this.$fhcApi.post('api/frontend/v1/stv/Pruefung/insertPruefung/',
|
||||
this.pruefungData
|
||||
).then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.checkData = response.data;
|
||||
if (this.checkData === 2 || this.checkData === 5)
|
||||
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
|
||||
else
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('pruefungModal');
|
||||
this.resetModal();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
@@ -236,9 +227,11 @@ export default{
|
||||
});
|
||||
},
|
||||
updatePruefung(pruefung_id){
|
||||
this.checkChangeAfterExamDate();
|
||||
this.$fhcApi.post('api/frontend/v1/stv/pruefung/updatePruefung/' + pruefung_id,
|
||||
this.pruefungData
|
||||
).then(response => {
|
||||
this.checkData = response.data;
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('pruefungModal');
|
||||
this.resetModal();
|
||||
@@ -249,7 +242,7 @@ export default{
|
||||
});
|
||||
},
|
||||
checkTypeExam(){
|
||||
if( this.showHintKommPrfg
|
||||
if (this.showHintKommPrfg
|
||||
&& (this.pruefungData.pruefungstyp_kurzbz === 'kommPruef'
|
||||
|| this.pruefungData.pruefungstyp_kurzbz === 'zusKommPruef')){
|
||||
this.showHint = true;
|
||||
@@ -258,26 +251,23 @@ export default{
|
||||
this.showHint = false;
|
||||
},
|
||||
checkChangeAfterExamDate(){
|
||||
const data = {
|
||||
student_uid: this.pruefungData.student_uid,
|
||||
studiensemester_kurzbz: this.pruefungData.studiensemester_kurzbz,
|
||||
lehrveranstaltung_id: this.pruefungData.lehrveranstaltung_id
|
||||
};
|
||||
this.$fhcApi.post('api/frontend/v1/stv/pruefung/checkZeugnisnoteLv/', data)
|
||||
const data = {
|
||||
student_uid: this.pruefungData.student_uid,
|
||||
studiensemester_kurzbz: this.pruefungData.studiensemester_kurzbz,
|
||||
lehrveranstaltung_id: this.pruefungData.lehrveranstaltung_id
|
||||
};
|
||||
this.$fhcApi.post('api/frontend/v1/stv/pruefung/checkZeugnisnoteLv/', data)
|
||||
.then(result => {
|
||||
this.zeugnisData = result.data;
|
||||
|
||||
let checkDate = this.zeugnisData[0].uebernahmedatum === '' ||
|
||||
this.zeugnisData[0].benotungsdatum > this.zeugnisData[0].uebernahmedatum
|
||||
? this.zeugnisData[0].benotungsdatum
|
||||
: this.zeugnisData[0].uebernahmedatum;
|
||||
|
||||
if (checkDate >= this.pruefungData.datum
|
||||
&& this.pruefungData.note !== this.zeugnisData[0].note) {
|
||||
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
|
||||
}
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
this.zeugnisData = result.data;
|
||||
let checkDate = this.zeugnisData[0].uebernahmedatum === '' ||
|
||||
this.zeugnisData[0].benotungsdatum > this.zeugnisData[0].uebernahmedatum
|
||||
? this.zeugnisData[0].benotungsdatum
|
||||
: this.zeugnisData[0].uebernahmedatum;
|
||||
if (checkDate >= this.pruefungData.datum
|
||||
&& this.pruefungData.note !== this.zeugnisData[0].note) {
|
||||
this.$fhcAlert.alertInfo(this.$p.t('exam', 'hinweis_changeAfterExamDate'));
|
||||
}
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
deletePruefung(pruefung_id) {
|
||||
this.$fhcApi.post('api/frontend/v1/stv/pruefung/deletePruefung/' + pruefung_id)
|
||||
@@ -294,19 +284,6 @@ export default{
|
||||
},
|
||||
resetModal() {
|
||||
this.pruefungData = {};
|
||||
|
||||
/* this.pruefungData.strasse = null;
|
||||
this.pruefungData.zustellpruefunge = true;
|
||||
this.pruefungData.heimatpruefunge = true;
|
||||
this.pruefungData.rechnungspruefunge = false;
|
||||
this.pruefungData.co_name = null;
|
||||
this.pruefungData.firma_id = null;
|
||||
this.pruefungData.name = null;
|
||||
this.pruefungData.anmerkung = null;
|
||||
this.pruefungData.typ = 'h';
|
||||
this.pruefungData.nation = 'A';
|
||||
this.pruefungData.plz = null;*/
|
||||
|
||||
this.statusNew = true;
|
||||
},
|
||||
reload() {
|
||||
@@ -339,19 +316,16 @@ export default{
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
prepareDropdowns(){
|
||||
|
||||
// Get Ma from Lv
|
||||
this.getMaFromLv(this.pruefungData.lehrveranstaltung_id).then(() => {
|
||||
}).catch(error => {
|
||||
console.error('Error loading Ma data:', error);
|
||||
});
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
// Get Lehreinheiten
|
||||
this.getLehreinheiten(this.pruefungData.lehrveranstaltung_id, this.pruefungData.studiensemester_kurzbz).then(() => {
|
||||
|
||||
}).catch(error => {
|
||||
console.error('Error loading Lehreinheiten multiple:', error);
|
||||
});
|
||||
this.getLehreinheiten(
|
||||
this.pruefungData.lehrveranstaltung_id,
|
||||
this.pruefungData.studiensemester_kurzbz)
|
||||
.then(() => {
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$refs.pruefungModal.show();
|
||||
},
|
||||
@@ -398,14 +372,12 @@ export default{
|
||||
template: `
|
||||
<div class="stv-details-pruefung-pruefung-list 100 pt-3">
|
||||
|
||||
{{zeugnisData}}
|
||||
|
||||
<div>
|
||||
<div class="justify-content-end pb-3">
|
||||
<form-input
|
||||
container-class="form-switch"
|
||||
type="checkbox"
|
||||
label="Nur aktuelles Studiensemester anzeigen"
|
||||
:label="$p.t('exam/filter_currentSem')"
|
||||
v-model="isFilterSet"
|
||||
@change="onSwitchChange"
|
||||
>
|
||||
@@ -428,8 +400,8 @@ export default{
|
||||
<!--Modal: pruefungModal-->
|
||||
<bs-modal ref="pruefungModal">
|
||||
<template #title>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('exam', 'add_pruefung')}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$p.t('exam', 'edit_pruefung')}}</p>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{ $p.t('exam', 'add_pruefung') }}</p>
|
||||
<p v-else class="fw-bold mt-3">{{ $p.t('exam', 'edit_pruefung') }}</p>
|
||||
</template>
|
||||
|
||||
<form ref="form-pruefung" @submit.prevent class="row pt-3">
|
||||
@@ -449,7 +421,7 @@ export default{
|
||||
:key="lv.lehrveranstaltung_id"
|
||||
:value="lv.lehrveranstaltung_id"
|
||||
>
|
||||
{{lv.bezeichnung}} Semester {{lv.semester}} {{lv.lehrform_kurzbz}}
|
||||
{{ lv.bezeichnung }} Semester {{ lv.semester }} {{ lv.lehrform_kurzbz }}
|
||||
</option>
|
||||
</form-input>
|
||||
|
||||
@@ -461,13 +433,13 @@ export default{
|
||||
:label="$p.t('lehre/lehreinheit')"
|
||||
v-model="pruefungData.lehreinheit_id"
|
||||
>
|
||||
<option v-if="!listLes.length" disabled> -- Bitte Lv_Teil wählen --</option>
|
||||
<option v-if="!listLes.length" disabled> -- {{ $p.t('exam', 'bitteLvteilWaehlen') }} --</option>
|
||||
<option
|
||||
v-for="le in isStartDropDown ? lv_teile : listLes"
|
||||
:key="le.lehreinheit_id"
|
||||
:value="le.lehreinheit_id"
|
||||
>
|
||||
{{le.kurzbz}}-{{le.lehrform_kurzbz}} {{le.bezeichnung}} {{le.gruppe}} ({{le.kuerzel}})
|
||||
{{ le.kurzbz }}-{{ le.lehrform_kurzbz }} {{ le.bezeichnung }} {{ le.gruppe }} ({{ le.kuerzel }})
|
||||
</option>
|
||||
</form-input>
|
||||
|
||||
@@ -480,13 +452,13 @@ export default{
|
||||
v-model="pruefungData.mitarbeiter_uid"
|
||||
>
|
||||
|
||||
<option :value="null"> -- {{$p.t('exam', 'keineAuswahl')}} -- </option>
|
||||
<option :value="null"> -- {{ $p.t('exam', 'keineAuswahl') }} -- </option>
|
||||
<option
|
||||
v-for="ma in isStartDropDown ? lv_teile_ma : listMas"
|
||||
:key="ma.mitarbeiter_uid"
|
||||
:value="ma.mitarbeiter_uid"
|
||||
>
|
||||
{{ma.vorname}} {{ma.nachname}}
|
||||
{{ ma.vorname }} {{ ma.nachname }}
|
||||
</option>
|
||||
</form-input>
|
||||
|
||||
@@ -499,13 +471,13 @@ export default{
|
||||
v-model="pruefungData.pruefungstyp_kurzbz"
|
||||
@change="checkTypeExam"
|
||||
>
|
||||
<option :value="null">-- {{$p.t('exam', 'keineAuswahl')}} --</option>
|
||||
<option :value="null">-- {{ $p.t('exam', 'keineAuswahl') }} --</option>
|
||||
<option
|
||||
v-for="typ in listTypesExam"
|
||||
:key="typ.pruefungstyp_kurzbz"
|
||||
:value="typ.pruefungstyp_kurzbz"
|
||||
>
|
||||
{{typ.beschreibung}}
|
||||
{{ typ.beschreibung }}
|
||||
</option>
|
||||
</form-input>
|
||||
|
||||
@@ -516,7 +488,6 @@ export default{
|
||||
name="typ"
|
||||
:label="$p.t('lehre/note')"
|
||||
v-model="pruefungData.note"
|
||||
@change="checkChangeAfterExamDate"
|
||||
>
|
||||
<option
|
||||
v-for="note in listMarks"
|
||||
@@ -524,10 +495,10 @@ export default{
|
||||
:value="note.note"
|
||||
:disabled="!note.aktiv"
|
||||
>
|
||||
{{note.bezeichnung}}
|
||||
{{ note.bezeichnung }}
|
||||
</option>
|
||||
</form-input>
|
||||
|
||||
|
||||
<!--DropDown Datum-->
|
||||
<form-input
|
||||
container-class="mb-3"
|
||||
@@ -546,11 +517,10 @@ export default{
|
||||
<div v-if="showHint">
|
||||
<div class="form-control d-flex align-items-start">
|
||||
<i class="fa fa-info-circle text-primary me-2"></i>
|
||||
<div>{{$p.t('exam', 'hinweis_kommPrfg')}}</div>
|
||||
<div>{{ $p.t('exam', 'hinweis_kommPrfg') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<form-input
|
||||
container-class="mb-3"
|
||||
type="textarea"
|
||||
|
||||
@@ -30325,6 +30325,66 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'exam',
|
||||
'phrase' => 'bitteLvteilWaehlen',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Bitte Lv_Teil wählen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Please select teaching unit',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'exam',
|
||||
'phrase' => 'punkte',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Punkte',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Points',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'exam',
|
||||
'phrase' => 'filter_currentSem',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Nur aktuelles Studiensemester anzeigen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Display only current Semester',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user