diff --git a/application/config/abgabe.php b/application/config/abgabe.php index 5cf3042ed..f806e1ef8 100644 --- a/application/config/abgabe.php +++ b/application/config/abgabe.php @@ -26,7 +26,9 @@ $config['RELEVANT_PAABGABETYPEN_SAMMELMAIL_ASSISTENZ'] = ['end']; $config['RELEVANT_PAABGABETYPEN_SAMMELMAIL_STUDENT'] = ['qualgate1', 'qualgate2', 'zwischen', 'note', 'abstract', 'end', 'enda']; //$config['ALLOWED_NOTEN_ABGABETOOL'] = ['Bestanden', 'Nicht bestanden']; $config['ALLOWED_NOTEN_ABGABETOOL'] = [10, 14]; // tbl_note pk - +// benotete projektarbeiten sperren weitere terminanlage & bearbeitung, diese noten sind ausnahmen dieser Regel +// wie zB "Nicht beurteilt" & "Noch nicht eingetragen" +$config['NONFINAL_NOTEN_ABGABETOOL'] = [7, 9]; $config['beurteilung_link_fallback'] = 'addons/fhtw/content/projektbeurteilung/projektbeurteilungDocumentExport.php?projektarbeit_id=?&betreuerart_kurzbz=?&person_id=?'; $config['PROJEKTARBEITSBEURTEILUNG_MAIL_BASELINK_ERSTBEGUTACHTER'] = 'index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter'; diff --git a/application/controllers/api/frontend/v1/Abgabe.php b/application/controllers/api/frontend/v1/Abgabe.php index c8f48b9df..b37c64713 100644 --- a/application/controllers/api/frontend/v1/Abgabe.php +++ b/application/controllers/api/frontend/v1/Abgabe.php @@ -801,7 +801,10 @@ class Abgabe extends FHCAPI_Controller $allowed_noten_abgabetool = $this->config->item('ALLOWED_NOTEN_ABGABETOOL'); - $this->terminateWithSuccess(array($noten, $allowed_noten_abgabetool)); + $nonfinal_noten_abgabetool = $this->config->item('NONFINAL_NOTEN_ABGABETOOL'); + + + $this->terminateWithSuccess(array($noten, $allowed_noten_abgabetool, $nonfinal_noten_abgabetool)); } /** diff --git a/application/models/education/Projektarbeit_model.php b/application/models/education/Projektarbeit_model.php index e2d4d1b70..5e453056d 100644 --- a/application/models/education/Projektarbeit_model.php +++ b/application/models/education/Projektarbeit_model.php @@ -299,7 +299,7 @@ class Projektarbeit_model extends DB_Model * FROM (SELECT tbl_person.vorname, tbl_person.nachname, tbl_studiengang.typ, tbl_studiengang.kurzbz, - tbl_projektarbeit.projekttyp_kurzbz, tbl_projekttyp.bezeichnung, tbl_projektarbeit.titel, tbl_projektarbeit.projektarbeit_id, + tbl_projektarbeit.projekttyp_kurzbz, tbl_projekttyp.bezeichnung, tbl_projektarbeit.titel, tbl_projektarbeit.projektarbeit_id, tbl_projektarbeit.note, tbl_projektbetreuer.person_id as betreuer_person_id, tbl_projektbetreuer.betreuerart_kurzbz, tbl_betreuerart.beschreibung AS betreuerart_beschreibung, tbl_benutzer.uid, tbl_student.matrikelnr, tbl_lehreinheit.studiensemester_kurzbz, public.tbl_student.student_uid FROM lehre.tbl_projektarbeit diff --git a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js index 35633321d..42952d0df 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js @@ -21,6 +21,7 @@ export const AbgabeMitarbeiterDetail = { 'abgabeTypeOptions', 'abgabetypenBetreuer', 'allowedNotenOptions', + 'notenOptionsNonFinal', 'turnitin_link', 'old_abgabe_beurteilung_link' ], @@ -48,7 +49,7 @@ export const AbgabeMitarbeiterDetail = { label: Vue.computed(() => this.$p.t('abgabetool/c4newAbgabetermin')), icon: "fa fa-plus", command: this.openCreateNewAbgabeModal, - disabled: Vue.computed(() => this.projektarbeit?.betreuerart_kurzbz == 'Zweitbegutachter') + disabled: Vue.computed(() => !this.getAllowedToCreateNewTermin) }, { label: Vue.computed(() => this.$p.t('abgabetool/c4benoten')), @@ -478,6 +479,21 @@ export const AbgabeMitarbeiterDetail = { }, computed: { + getAllowedToCreateNewTermin() { + if(this.assistenzMode) return true + if(this.projektarbeit?.betreuerart_kurzbz == 'Zweitbegutachter') return false + if(this.projektarbeit?.note !== undefined && this.projektarbeit.note !== null) { + // check if the note is not defined as a non final projektarbeit note + const opt = this.notenOptionsNonFinal.find(opt => opt.note) + // if thats the case allow further work + if(opt) return true + // else the PA is to be considered finished + return false + } + + // normally should be allowed if no rules apply + return true + }, allowedToSaveZusatzdaten() { return this.form.schlagwoerter.length > 0 && this.form.schlagwoerter_en.length > 0 && this.form.abstract.length > 0 && this.form.abstract_en.length > 0 && this.form.seitenanzahl > 0 }, @@ -755,9 +771,8 @@ export const AbgabeMitarbeiterDetail = {