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 = {
- - - diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js index 0a4028a27..7fa78f7d1 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js @@ -38,6 +38,7 @@ export const AbgabetoolAssistenz = { return { abgabeTypeOptions: Vue.computed(() => this.abgabeTypeOptions), allowedNotenOptions: Vue.computed(() => this.allowedNotenOptions), + notenOptionsNonFinal: Vue.computed(() => this.notenOptionsNonFinal), turnitin_link: Vue.computed(() => this.turnitin_link), old_abgabe_beurteilung_link: Vue.computed(() => this.old_abgabe_beurteilung_link), abgabetypenBetreuer: Vue.computed(() => this.abgabeTypeOptions) @@ -86,6 +87,7 @@ export const AbgabetoolAssistenz = { notenOptions: null, allowedNotenFilterOptions: null, allowedNotenOptions: null, + notenOptionsNonFinal: null, serienTermin: Vue.reactive({ datum: new Date(), bezeichnung: { @@ -1089,6 +1091,10 @@ export const AbgabetoolAssistenz = { this.allowedNotenOptions = this.notenOptions.filter( opt => res.data[1].includes(opt.note) ); + + this.notenOptionsNonFinal = this.notenOptions.filter( + opt => res.data[2].includes(opt.note) + ) } this.allowedNotenFilterOptions = [ diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js index df521d52d..67e1d09af 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js @@ -22,6 +22,7 @@ export const AbgabetoolMitarbeiter = { abgabeTypeOptions: Vue.computed(() => this.abgabeTypeOptions), abgabetypenBetreuer: Vue.computed(() => this.abgabetypenBetreuer), allowedNotenOptions: Vue.computed(() => this.allowedNotenOptions), + notenOptionsNonFinal: Vue.computed(() => this.notenOptionsNonFinal), turnitin_link: Vue.computed(() => this.turnitin_link), old_abgabe_beurteilung_link: Vue.computed(() => this.old_abgabe_beurteilung_link) } @@ -50,6 +51,7 @@ export const AbgabetoolMitarbeiter = { abgabeTypeOptions: null, notenOptions: null, allowedNotenOptions: null, + notenOptionsNonFinal: null, serienTermin: Vue.reactive({ datum: new Date(), bezeichnung: { @@ -301,7 +303,15 @@ export const AbgabetoolMitarbeiter = { pa.abgabetermine = res.data[0].retval pa.isCurrent = res.data[1] - const paIsBenotet = pa.note !== null + let paIsBenotet = false + if(pa.note !== undefined && pa !== 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) paIsBenotet = false + // else the PA is to be considered finished + paIsBenotet = true + } pa.abgabetermine.forEach(termin => { termin.note = this.allowedNotenOptions.find(opt => opt.note == termin.note) @@ -471,6 +481,10 @@ export const AbgabetoolMitarbeiter = { this.allowedNotenOptions = this.notenOptions.filter( opt => res.data[1].includes(opt.note) ) + + this.notenOptionsNonFinal = this.notenOptions.filter( + opt => res.data[2].includes(opt.note) + ) } }).catch(e => {