diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js index 96aeb818c..51a25c815 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js @@ -78,7 +78,7 @@ export default { layout: 'fitDataStretchFrozen', layoutColumnsOnNewData: false, height: 'auto', - minHeight: '200', + minHeight: '200' } }, computed: { @@ -437,20 +437,37 @@ export default { }, async addNewAbschlusspruefungMulti(){ try { - for (const student of this.studentUids) { + const arraySuccessfullySent = []; + const arrayError = []; - await this.$refs.formFinalExam.call( - ApiStvAbschlusspruefung.addNewAbschlusspruefung({ - uid: student, - formData: this.formData - }) - ); + for (const student of this.studentUids) { + try { + await this.$refs.formFinalExam.call( + ApiStvAbschlusspruefung.addNewAbschlusspruefung({ + uid: student, + formData: this.formData + }) + ); + arraySuccessfullySent.push(student); + } catch (error) { + arrayError.push(student); + } + } + if (arraySuccessfullySent.length) { + //this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); + //TODO(Manu) check if really needed in case of success + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave') + ': Uids: ' + arraySuccessfullySent.join(", ")); + } + + if (arrayError.length) { + this.$fhcAlert.alertError(this.$p.t('ui', 'errorSavingData') + ': Uids: ' + arrayError.join(", ")); + } + + if (arraySuccessfullySent.length) { + this.saveOrUpdateLocalStorage(); + this.hideModal("finalexamModal"); + this.resetForm(); } - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); - //save formData fields in LocalStorage - this.saveOrUpdateLocalStorage(); - this.hideModal('finalexamModal'); - this.resetForm(); } catch (error) { this.$fhcAlert.handleSystemError(error); } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 05bdfbbef..06f46950e 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -58377,6 +58377,26 @@ I have been informed that I am under no obligation to consent to the transmissio ) ) ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorSavingData', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Speichern der Daten nicht erfolgreich', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' =>'Data saving failed', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );