mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 06:54:04 +00:00
Merge branch 'feature-61164/AbgabetoolQualityGates'
This commit is contained in:
@@ -643,6 +643,24 @@ export const AbgabeMitarbeiterDetail = {
|
|||||||
'projektarbeit'(newVal) {
|
'projektarbeit'(newVal) {
|
||||||
// set invertedFixtermin field for UI/UX purposes -> avoid double negation in text
|
// 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)
|
newVal?.abgabetermine?.forEach(termin => termin.invertedFixtermin = !termin.fixtermin)
|
||||||
|
|
||||||
// default select german if projektarbeit sprache was null
|
// 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 ApiStudiensemester from '../../../api/factory/studiensemester.js';
|
||||||
import AbgabeterminStatusLegende from "./StatusLegende.js";
|
import AbgabeterminStatusLegende from "./StatusLegende.js";
|
||||||
import FhcOverlay from "../../Overlay/FhcOverlay.js";
|
import FhcOverlay from "../../Overlay/FhcOverlay.js";
|
||||||
|
import { splitMailsHelper } from "../../../helpers/EmailHelpers.js"
|
||||||
|
|
||||||
// spoofed date testing
|
// spoofed date testing
|
||||||
// const todayISO = '2025-08-08'
|
// const todayISO = '2025-08-08'
|
||||||
@@ -226,18 +227,17 @@ export const AbgabetoolAssistenz = {
|
|||||||
]};
|
]};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sammelMailStudent() {
|
sammelMailStudent(param) {
|
||||||
|
|
||||||
const emails = this.selectedData
|
const emails = this.selectedData
|
||||||
.map(row => `${row.student_uid}@${this.domain}`)
|
.map(row => `${row.student_uid}@${this.domain}`)
|
||||||
.join(',');
|
.join(',');
|
||||||
|
const uniqueRecipients = [...new Set(emails)];
|
||||||
const subject = this.$p.t('abgabetool/c4sammelmailStudentBetreff', [this.selectedStudiengangOption?.bezeichnung]);
|
const subject = this.$p.t('abgabetool/c4sammelmailStudentBetreff', [this.selectedStudiengangOption?.bezeichnung]);
|
||||||
|
splitMailsHelper(uniqueRecipients, param.originalEvent, subject, this.$fhcAlert, this.$p)
|
||||||
const href = `mailto:${emails}?subject=${subject}`;
|
|
||||||
|
|
||||||
window.location.href = href
|
|
||||||
},
|
},
|
||||||
sammelMailBetreuer() {
|
sammelMailBetreuer(param) {
|
||||||
|
|
||||||
const recipientList = [];
|
const recipientList = [];
|
||||||
this.selectedData.forEach(row => {
|
this.selectedData.forEach(row => {
|
||||||
if (row.betreuer_mail) recipientList.push(row.betreuer_mail);
|
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
|
// actually not necessary for email clients but looks better for assistenz if we avoid duplicates here
|
||||||
const uniqueRecipients = [...new Set(recipientList)];
|
const uniqueRecipients = [...new Set(recipientList)];
|
||||||
|
|
||||||
const subject = this.$p.t('abgabetool/c4sammelmailBetreuerBetreff', [this.selectedStudiengangOption?.bezeichnung]);
|
const subject = this.$p.t('abgabetool/c4sammelmailBetreuerBetreff', [this.selectedStudiengangOption?.bezeichnung]);
|
||||||
const href = `mailto:${uniqueRecipients.join(',')}?subject=${encodeURIComponent(subject)}`;
|
splitMailsHelper(uniqueRecipients, param.originalEvent, subject, this.$fhcAlert, this.$p)
|
||||||
|
|
||||||
window.location.href = href;
|
|
||||||
},
|
},
|
||||||
selectHandler(e, cell) {
|
selectHandler(e, cell) {
|
||||||
const row = cell.getRow();
|
const row = cell.getRow();
|
||||||
@@ -1392,7 +1389,7 @@ export const AbgabetoolAssistenz = {
|
|||||||
>
|
>
|
||||||
<i class="fa fa-envelope"></i>
|
<i class="fa fa-envelope"></i>
|
||||||
</button>
|
</button>
|
||||||
<tiered-menu ref="menu" :model="emailItems" popup/>
|
<tiered-menu ref="menu" :model="emailItems" popup :autoZIndex="false" />
|
||||||
</template>
|
</template>
|
||||||
</core-filter-cmpt>
|
</core-filter-cmpt>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -333,7 +333,6 @@ export const AbgabetoolMitarbeiter = {
|
|||||||
pa.student = `${pa.vorname} ${pa.nachname}`
|
pa.student = `${pa.vorname} ${pa.nachname}`
|
||||||
|
|
||||||
this.selectedProjektarbeit = pa
|
this.selectedProjektarbeit = pa
|
||||||
|
|
||||||
this.$refs.modalContainerAbgabeDetail.show()
|
this.$refs.modalContainerAbgabeDetail.show()
|
||||||
|
|
||||||
}).finally(()=>{this.loading = false})
|
}).finally(()=>{this.loading = false})
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { splitMailsHelper } from "../../../../helpers/EmailHelpers.js"
|
||||||
export default {
|
export default {
|
||||||
name: "Kontaktieren",
|
name: "Kontaktieren",
|
||||||
computed: {
|
computed: {
|
||||||
@@ -22,60 +23,16 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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) {
|
internMail(event) {
|
||||||
if (this.internMails.length)
|
if (this.internMails.length)
|
||||||
{
|
{
|
||||||
this.splitMails(this.internMails, event);
|
splitMailsHelper(this.privateMails, event, null, this.$fhcAlert, this.$p)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
privateMail(event) {
|
privateMail(event) {
|
||||||
if (this.privateMails.length)
|
if (this.privateMails.length)
|
||||||
{
|
{
|
||||||
this.splitMails(this.privateMails, event);
|
splitMailsHelper(this.privateMails, event, null, this.$fhcAlert, this.$p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user