mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-18 07:22:17 +00:00
Standard validations, show Hint KommPrfg, disable noten not active
This commit is contained in:
@@ -46,6 +46,22 @@ class Pruefung extends FHCAPI_Controller
|
||||
|
||||
//Load Models
|
||||
$this->load->model('education/LePruefung_model', 'PruefungModel');
|
||||
|
||||
//TODO(Manu) check
|
||||
// Additional Permission Checks
|
||||
//not working if activated?
|
||||
/* if ($this->router->method == 'insertPruefung'
|
||||
|| $this->router->method == 'updatePruefung'
|
||||
|| $this->router->method == 'deletePruefung'
|
||||
) {
|
||||
$prestudent_id = current(array_slice($this->uri->rsegments, 2));
|
||||
$this->checkPermissionsForPrestudent($prestudent_id, ['admin:rw', 'assistenz:rw']);
|
||||
}*/
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'global', 'ui','lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getPruefungen($student_uid, $studiensemester_kurzbz = null)
|
||||
@@ -101,7 +117,6 @@ class Pruefung extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
public function insertPruefung(){
|
||||
//TODO(Manu) Berechtigungen
|
||||
|
||||
$authUID = getAuthUID();
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
@@ -114,10 +129,27 @@ 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(
|
||||
'datum', $this->p->t('global', 'datum'), ['is_valid_date']
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->PruefungModel->insert([
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
@@ -137,7 +169,7 @@ class Pruefung extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
public function updatePruefung($pruefung_id){
|
||||
//TODO(Manu) validations and Berechtigungen
|
||||
|
||||
$result = $this->PruefungModel->load($pruefung_id);
|
||||
|
||||
$oldpruefung = $this->getDataOrTerminateWithError($result);
|
||||
@@ -154,6 +186,29 @@ class Pruefung extends FHCAPI_Controller
|
||||
$pruefungstyp_kurzbz = $this->input->post('pruefungstyp_kurzbz');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
|
||||
$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(
|
||||
'datum', $this->p->t('global', 'datum'), ['is_valid_date']
|
||||
);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$result = $this->PruefungModel->update(
|
||||
[
|
||||
'pruefung_id' => $pruefung_id
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
$configArray = [
|
||||
'generateAlias' => !defined('GENERATE_ALIAS_STUDENT') ? true : GENERATE_ALIAS_STUDENT,
|
||||
'showZgvDoktor' => !defined('ZGV_DOKTOR_ANZEIGEN') ? false : ZGV_DOKTOR_ANZEIGEN,
|
||||
'showZgvErfuellt' => !defined('ZGV_ERFUELLT_ANZEIGEN') ? false : ZGV_ERFUELLT_ANZEIGEN
|
||||
'showZgvErfuellt' => !defined('ZGV_ERFUELLT_ANZEIGEN') ? false : ZGV_ERFUELLT_ANZEIGEN,
|
||||
'showHintKommPrfg' => !defined('FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT') ? false : FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT
|
||||
];
|
||||
?>
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ export default {
|
||||
configGenerateAlias: this.config.generateAlias,
|
||||
configShowZgvDoktor: this.config.showZgvDoktor,
|
||||
configShowZgvErfuellt: this.config.showZgvErfuellt,
|
||||
configShowHintKommPrfg: this.config.showHintKommPrfg,
|
||||
hasBpkPermission: this.permissions['student/bpk'],
|
||||
hasAliasPermission: this.permissions['student/alias'],
|
||||
hasPrestudentPermission: this.permissions['basis/prestudent'],
|
||||
|
||||
@@ -12,6 +12,14 @@ export default{
|
||||
defaultSemester: {
|
||||
from: 'defaultSemester',
|
||||
},
|
||||
showHintKommPrfg: {
|
||||
from: 'configShowHintKommPrfg',
|
||||
default: false
|
||||
},
|
||||
showZgvErfuellt: {
|
||||
from: 'configShowZgvErfuellt',
|
||||
default: false
|
||||
},
|
||||
/* $reloadList: {
|
||||
from: '$reloadList',
|
||||
required: true
|
||||
@@ -166,19 +174,18 @@ export default{
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
actionNewPruefung(){
|
||||
actionNewPruefung(lv_id){
|
||||
this.statusNew = true;
|
||||
this.isStartDropDown = true;
|
||||
this.resetModal();
|
||||
|
||||
/* this.getLvsByStudent(this.uid).then(() => {
|
||||
this.$refs.pruefungModal.show();
|
||||
});*/
|
||||
|
||||
this.pruefungData.note = 9;
|
||||
this.pruefungData.datum = new Date();
|
||||
this.pruefungData.pruefungstyp_kurzbz = null;
|
||||
if(lv_id){
|
||||
this.pruefungData.lehrveranstaltung_id = lv_id;
|
||||
}
|
||||
this.$refs.pruefungModal.show();
|
||||
// this.prepareDropdowns();
|
||||
// this.$refs.pruefungModal.show();
|
||||
|
||||
},
|
||||
actionNewFromOldPruefung(pruefung_id) {
|
||||
this.statusNew = true;
|
||||
@@ -187,6 +194,7 @@ export default{
|
||||
this.pruefungData.note = 9;
|
||||
this.pruefungData.datum = new Date();
|
||||
this.pruefungData.pruefungstyp_kurzbz = null;
|
||||
this.pruefungData.anmerkung = null;
|
||||
this.prepareDropdowns();
|
||||
|
||||
this.$refs.pruefungModal.show();
|
||||
@@ -203,7 +211,6 @@ export default{
|
||||
});
|
||||
},
|
||||
actionDeletePruefung(pruefung_id) {
|
||||
console.log("action delete Prüfung" + pruefung_id);
|
||||
this.loadPruefung(pruefung_id).then(() => {
|
||||
if(this.pruefungData.pruefung_id)
|
||||
|
||||
@@ -218,7 +225,7 @@ export default{
|
||||
});
|
||||
},
|
||||
addPruefung(){
|
||||
this.$fhcApi.post('api/frontend/v1/stv/pruefung/insertPruefung/',
|
||||
this.$fhcApi.post('api/frontend/v1/stv/Pruefung/insertPruefung/',
|
||||
this.pruefungData
|
||||
).then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
@@ -325,6 +332,17 @@ getLvsByStudent(student_uid, studiensemester_kurzbz){
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
handleTypeChange(){
|
||||
if( this.showHintKommPrfg
|
||||
&& (this.pruefungData.pruefungstyp_kurzbz === 'kommPruef'
|
||||
|| this.pruefungData.pruefungstyp_kurzbz === 'zusKommPruef')){
|
||||
|
||||
//TODO(Manu) phrase
|
||||
this.pruefungData.anmerkung = 'Bitte bei Neuanlage einer kommissionellen Prüfung das Datum der Noteneintragung ' +
|
||||
'(i. d. R. heute) eintragen, um den korrekten Fristenablauf der Wiederholung zu ermöglichen.';
|
||||
}
|
||||
|
||||
},
|
||||
prepareDropdowns(){
|
||||
|
||||
// Get Lvs from Student
|
||||
@@ -397,8 +415,13 @@ getLvsByStudent(student_uid, studiensemester_kurzbz){
|
||||
template: `
|
||||
<div class="stv-details-pruefung-pruefung-list 100 pt-3">
|
||||
|
||||
<!-- {{pruefungData}}-->
|
||||
{{showHintKommPrfg}}
|
||||
{{showZgvErfuellt}}
|
||||
|
||||
{{lv_teile}}
|
||||
|
||||
<hr>
|
||||
{{listLes}}
|
||||
aktuelles Sem: {{defaultSemester}} <br>
|
||||
current Sem: {{currentSemester}}
|
||||
<hr>
|
||||
@@ -473,6 +496,7 @@ getLvsByStudent(student_uid, studiensemester_kurzbz){
|
||||
name="lehrveranstaltung"
|
||||
:label="$p.t('lehre/lehrveranstaltung')"
|
||||
v-model="pruefungData.lehrveranstaltung_id"
|
||||
@change="actionNewPruefung(pruefungData.lehrveranstaltung_id)"
|
||||
>
|
||||
<option
|
||||
v-for="lv in listLvs"
|
||||
@@ -531,6 +555,7 @@ getLvsByStudent(student_uid, studiensemester_kurzbz){
|
||||
name="typ"
|
||||
:label="$p.t('global/typ')"
|
||||
v-model="pruefungData.pruefungstyp_kurzbz"
|
||||
@change="handleTypeChange()"
|
||||
>
|
||||
<option :value="null">
|
||||
-- keine Auswahl --
|
||||
@@ -556,6 +581,7 @@ getLvsByStudent(student_uid, studiensemester_kurzbz){
|
||||
v-for="note in listMarks"
|
||||
:key="note.note"
|
||||
:value="note.note"
|
||||
:disabled="!note.aktiv"
|
||||
>
|
||||
{{note.bezeichnung}}
|
||||
</option>
|
||||
@@ -578,10 +604,11 @@ getLvsByStudent(student_uid, studiensemester_kurzbz){
|
||||
|
||||
<form-input
|
||||
container-class="mb-3"
|
||||
type="text"
|
||||
type="textarea"
|
||||
name="name"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
v-model="pruefungData.anmerkung"
|
||||
rows="4"
|
||||
>
|
||||
</form-input>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user