Merge branch 'feature-61164/AbgabetoolQualityGates'

This commit is contained in:
Andreas Österreicher
2026-02-13 13:58:30 +01:00
5 changed files with 75 additions and 59 deletions
@@ -643,6 +643,24 @@ export const AbgabeMitarbeiterDetail = {
'projektarbeit'(newVal) {
// set invertedFixtermin field for UI/UX purposes -> avoid double negation in text
// reset newTermin object
const typ = this.abgabeTypeOptions.find(opt => opt.paabgabetyp_kurzbz === 'zwischen')
this.newTermin = {
'paabgabe_id': -1,
'projektarbeit_id': newVal.projektarbeit_id,
'fixtermin': false,
'invertedFixtermin': true,
'kurzbz': '',
'datum': new Date().toISOString().split('T')[0],
'note': this.allowedNotenOptions.find(opt => opt.note == 9),
'beurteilungsnotiz': '',
'upload_allowed': typ.upload_allowed_default,
'paabgabetyp_kurzbz': '',
'bezeichnung': typ,
'abgabedatum': null,
'insertvon': this.viewData?.uid ?? ''
}
newVal?.abgabetermine?.forEach(termin => termin.invertedFixtermin = !termin.fixtermin)
// default select german if projektarbeit sprache was null
@@ -7,6 +7,7 @@ import ApiAbgabe from '../../../api/factory/abgabe.js'
import ApiStudiensemester from '../../../api/factory/studiensemester.js';
import AbgabeterminStatusLegende from "./StatusLegende.js";
import FhcOverlay from "../../Overlay/FhcOverlay.js";
import { splitMailsHelper } from "../../../helpers/EmailHelpers.js"
// spoofed date testing
// const todayISO = '2025-08-08'
@@ -226,18 +227,17 @@ export const AbgabetoolAssistenz = {
]};
},
methods: {
sammelMailStudent() {
sammelMailStudent(param) {
const emails = this.selectedData
.map(row => `${row.student_uid}@${this.domain}`)
.join(',');
const uniqueRecipients = [...new Set(emails)];
const subject = this.$p.t('abgabetool/c4sammelmailStudentBetreff', [this.selectedStudiengangOption?.bezeichnung]);
const href = `mailto:${emails}?subject=${subject}`;
window.location.href = href
splitMailsHelper(uniqueRecipients, param.originalEvent, subject, this.$fhcAlert, this.$p)
},
sammelMailBetreuer() {
sammelMailBetreuer(param) {
const recipientList = [];
this.selectedData.forEach(row => {
if (row.betreuer_mail) recipientList.push(row.betreuer_mail);
@@ -246,11 +246,8 @@ export const AbgabetoolAssistenz = {
// actually not necessary for email clients but looks better for assistenz if we avoid duplicates here
const uniqueRecipients = [...new Set(recipientList)];
const subject = this.$p.t('abgabetool/c4sammelmailBetreuerBetreff', [this.selectedStudiengangOption?.bezeichnung]);
const href = `mailto:${uniqueRecipients.join(',')}?subject=${encodeURIComponent(subject)}`;
window.location.href = href;
splitMailsHelper(uniqueRecipients, param.originalEvent, subject, this.$fhcAlert, this.$p)
},
selectHandler(e, cell) {
const row = cell.getRow();
@@ -1392,7 +1389,7 @@ export const AbgabetoolAssistenz = {
>
<i class="fa fa-envelope"></i>
</button>
<tiered-menu ref="menu" :model="emailItems" popup/>
<tiered-menu ref="menu" :model="emailItems" popup :autoZIndex="false" />
</template>
</core-filter-cmpt>
</div>
@@ -333,7 +333,6 @@ export const AbgabetoolMitarbeiter = {
pa.student = `${pa.vorname} ${pa.nachname}`
this.selectedProjektarbeit = pa
this.$refs.modalContainerAbgabeDetail.show()
}).finally(()=>{this.loading = false})
@@ -1,3 +1,4 @@
import { splitMailsHelper } from "../../../../helpers/EmailHelpers.js"
export default {
name: "Kontaktieren",
computed: {
@@ -22,60 +23,16 @@ export default {
},
methods: {
async splitMails(mails, event) {
let splititem = ",";
let maillist = mails.join(splititem);
let mailto = "";
if (maillist.length > 2024)
{
if (await this.$fhcAlert.confirm({message: this.$p.t('stv', 'zuvieleEMails') }) === false)
return;
}
let firstrun = true;
let useBcc = event?.ctrlKey || event?.metaKey;
while (maillist.length > 0)
{
if (maillist.length > 2024)
{
let splitposition = maillist.lastIndexOf(splititem, 1900);
mailto = maillist.substring(0, splitposition);
maillist = maillist.substring(splitposition + 1);
}
else
{
mailto = maillist;
maillist = "";
}
let mailLink = useBcc ? `mailto:?bcc=${mailto}` : `mailto:${mailto}`;
if (firstrun)
{
window.location.href = mailLink;
firstrun = false;
}
else
{
if (await this.$fhcAlert.confirm({message: this.$p.t('stv', 'weitereEMail')}) === true)
{
window.location.href = mailLink;
}
}
}
},
internMail(event) {
if (this.internMails.length)
{
this.splitMails(this.internMails, event);
splitMailsHelper(this.privateMails, event, null, this.$fhcAlert, this.$p)
}
},
privateMail(event) {
if (this.privateMails.length)
{
this.splitMails(this.privateMails, event);
splitMailsHelper(this.privateMails, event, null, this.$fhcAlert, this.$p)
}
}
},
+45
View File
@@ -0,0 +1,45 @@
export async function splitMailsHelper(mails, event, subject, alertPluginRef, phrasenPluginRef) {
let splititem = ",";
let maillist = mails.join(splititem);
let mailto = "";
// take subject line length + '?subject=' length into account
const subjectlength = subject && typeof subject === 'string' ? subject.length + 9 : 0
if (maillist.length > 2024)
{
if (await alertPluginRef.confirm({message: phrasenPluginRef.t('stv', 'zuvieleEMails') }) === false)
return;
}
let firstrun = true;
let useBcc = event?.ctrlKey || event?.metaKey;
while (maillist.length > 0)
{
if (maillist.length + subjectlength > 2024)
{
let splitposition = maillist.lastIndexOf(splititem, 1900);
mailto = maillist.substring(0, splitposition);
maillist = maillist.substring(splitposition + 1);
}
else
{
mailto = maillist;
maillist = "";
}
let mailLink = useBcc ? `mailto:?bcc=${mailto}` : `mailto:${mailto}`;
if(subject && typeof subject === 'string') mailLink += `?subject=${subject}`
if (firstrun)
{
window.location.href = mailLink;
firstrun = false;
}
else
{
if (await alertPluginRef.confirm({message: phrasenPluginRef.t('stv', 'weitereEMail')}) === true)
{
window.location.href = mailLink;
}
}
}
}