From 273f00a9c431b68525fb7205a1c3b0dee38a3b09 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Fri, 24 Jul 2026 13:52:05 +0200 Subject: [PATCH] =?UTF-8?q?added=20accept/cancel=20prompt=20to=20Notenvors?= =?UTF-8?q?chlag=20=C3=BCbernehmen=20spelling=20out=20the=20current=20beno?= =?UTF-8?q?tungsdatum=20to=20the=20user;=20also=20added=20a=20list=20over?= =?UTF-8?q?=20all=20changedNoten=20which=20are=20about=20to=20be=20freigeg?= =?UTF-8?q?eben=20in=20the=20Notenfreigabe=20Modal=20before=20entering=20a?= =?UTF-8?q?=20password;=20fixed/added=20some=20phrasen;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/api/frontend/v1/Noten.php | 5 +- .../Cis/Benotungstool/Benotungstool.js | 70 ++++++++- system/phrasesupdate.php | 140 ++++++++++++++++++ 3 files changed, 208 insertions(+), 7 deletions(-) diff --git a/application/controllers/api/frontend/v1/Noten.php b/application/controllers/api/frontend/v1/Noten.php index 98ba825a8..15ea11b11 100644 --- a/application/controllers/api/frontend/v1/Noten.php +++ b/application/controllers/api/frontend/v1/Noten.php @@ -68,7 +68,8 @@ class Noten extends FHCAPI_Controller 'person', 'benotungstool', 'lehre', - 'ui' + 'ui', + 'password' ]); $this->load->model('education/LePruefung_model', 'LePruefungModel'); @@ -461,7 +462,7 @@ class Noten extends FHCAPI_Controller } if(!$this->AuthLib->checkUserAuthByUsernamePassword(getAuthUID(), $result->password)->retval) { - $this->terminateWithError($this->p->t('global', 'wrongPassword'), 'general'); + $this->terminateWithError($this->p->t('password', 'wrongPassword'), 'general'); } $lv_id = $result->lv_id; diff --git a/public/js/components/Cis/Benotungstool/Benotungstool.js b/public/js/components/Cis/Benotungstool/Benotungstool.js index b0b5969b8..ecc1aaca6 100644 --- a/public/js/components/Cis/Benotungstool/Benotungstool.js +++ b/public/js/components/Cis/Benotungstool/Benotungstool.js @@ -1235,18 +1235,31 @@ export const Benotungstool = { return value }, - saveNote(e, cell) { // Notenvorschlag freigeben + async saveNote(e, cell) { // Notenvorschlag freigeben const row = cell.getRow() const data = row.getData() - + if(!data.note_vorschlag) return - + // if vorschlag is the same as lv_note do nothing if(data.note_vorschlag == data.lv_note) return - + // if the student already has pruefungen disable this part if(data.pruefungen.length) return - + + // confirm before writing the LV-Gesamtnote + const noteOption = this.notenOptions.find(opt => opt.note == data.note_vorschlag) + const noteBezeichnung = noteOption ? noteOption.bezeichnung : data.note_vorschlag + const dateLocale = this.$p.user_language?.value === 'English' ? 'en-GB' : 'de-AT' + const benotungsdatum = new Date().toLocaleString(dateLocale) + if(await this.$fhcAlert.confirm({ + message: this.$p.t('benotungstool/c4notenvorschlagUebernehmenConfirm', [noteBezeichnung, data.vorname, data.nachname, data.uid, benotungsdatum]), + acceptClass: 'p-button-primary', + rejectClass: 'p-button-secondary' + }) === false) { + return + } + this.loading = true this.$api.call(ApiNoten.saveNotenvorschlag(this.lv_id, this.sem_kurzbz, data.uid, data.note_vorschlag, data.punkte)) .then((res) => { @@ -2596,6 +2609,24 @@ export const Benotungstool = { }, []) : [] return cs }, + // Row-by-row preview for the Noten-freigeben modal, over the exact set that + // saveStudentenNoten will release (changedNoten). Freigabe releases the LV-Note + // (lv_note); it does not itself write the Zeugnisnote (that is a separate übernahme). + // So we compare what is currently on record in the Zeugnis (note) against the + // LV-Note that is about to be freigegeben (lv_note), and flag any mismatch. + freigabeSummary() { + return this.changedNoten.map(s => { + const zeugnisOpt = this.notenOptions?.find(opt => opt.note == s.note) + const releaseOpt = this.notenOptions?.find(opt => opt.note == s.lv_note) + return { + uid: s.uid, + name: `${s.vorname} ${s.nachname}`, + currentNote: zeugnisOpt ? zeugnisOpt.bezeichnung : (s.note || '—'), + releasedNote: releaseOpt ? releaseOpt.bezeichnung : (s.lv_note || '—'), + changed: (s.note ?? '') != (s.lv_note ?? '') + } + }) + }, getNotenfreigabeHinweistext() { return this.$capitalize(this.$p.t('benotungstool/notenfreigabeHinweistextv4')) }, @@ -2717,6 +2748,35 @@ export const Benotungstool = {
+
+
+
{{ $p.t('benotungstool/c4freigabeSummaryHeading', [freigabeSummary.length]) }}
+
+ + + + + + + + + + + + + + + + + +
{{ $capitalize($p.t('benotungstool/c4student')) }}{{ $capitalize($p.t('benotungstool/c4freigabeSummaryCurrent')) }}{{ $capitalize($p.t('benotungstool/c4freigabeSummaryReleased')) }}
{{ row.name }} ({{ row.uid }}){{ row.currentNote }}{{ row.releasedNote }}
+
+
{{ $p.t('benotungstool/c4freigabeSummaryLegend') }}
+
+
+
+
{{ $p.t('benotungstool/c4freigabeSummaryEmpty') }}
+
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index b9269528d..c21b682ac 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -59704,6 +59704,146 @@ I have been informed that I am under no obligation to consent to the transmissio ) ) ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4notenvorschlagUebernehmenConfirm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Möchten Sie wirklich die Note "{0}" für den Studenten {1} {2} ({3}) mit Benotungsdatum {4} eintragen?', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Do you really want to enter the grade "{0}" for the student {1} {2} ({3}) with grading date {4}?', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4freigabeSummaryHeading', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Folgende Noten werden freigegeben ({0}):', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'The following grades will be approved ({0}):', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4student', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Student', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Student', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4freigabeSummaryCurrent', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bisher im Zeugnis', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Currently on transcript', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4freigabeSummaryReleased', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wird freigegeben', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Will be approved', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4freigabeSummaryLegend', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Grün markierte Noten weichen von der bisher im Zeugnis eingetragenen Note ab.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Grades highlighted in green differ from the grade currently on the transcript.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'benotungstool', + 'phrase' => 'c4freigabeSummaryEmpty', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Es sind keine geänderten Noten zur Freigabe vorhanden.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'There are no changed grades to approve.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'benotungstool',