Merge branch 'feature-63444/stv_mehrfachaktion_mail_an_private_oder_interne_adresse' into studvw_2025-11_rc

This commit is contained in:
Harald Bamberger
2025-11-04 17:06:23 +01:00
3 changed files with 226 additions and 0 deletions
@@ -245,6 +245,11 @@ class Config extends FHCAPI_Controller
]
];
$result['kontaktieren'] = [
'title' => $this->p->t('stv', 'tab_kontaktieren'),
'component' => './Stv/Studentenverwaltung/Details/Kontaktieren.js',
];
Events::trigger('stv_conf_students', function & () use (&$result) {
return $result;
});
@@ -0,0 +1,101 @@
export default {
name: "Kontaktieren",
computed: {
internMails() {
if (this.modelValue.mail_intern)
{
return [this.modelValue.mail_intern];
}
return this.modelValue.map(e => e.mail_intern);
},
privateMails()
{
if (this.modelValue.mail_privat)
{
return [this.modelValue.mail_privat];
}
return this.modelValue.map(e => e.mail_privat);
},
},
props: {
modelValue: Object
},
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);
}
},
privateMail(event) {
if (this.privateMails.length)
{
this.splitMails(this.privateMails, event);
}
}
},
template: `
<div>
<div id="elementID"></div>
<div class="row">
<div class="col-lg-2">
<button class="btn btn-primary mb-2" @click="internMail($event)" :title="$p.t('stv', 'bccEMail')">
<i class="fa-solid fa-mail"></i> {{$p.t('stv', 'internEMail')}}
</button>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<button class="btn btn-primary mb-2" @click="privateMail($event)" :title="$p.t('stv', 'bccEMail')">
<i class="fa-solid fa-mail"></i> {{$p.t('stv', 'privateEMail')}}
</button>
</div>
</div>
</div>`
};
+120
View File
@@ -43318,6 +43318,126 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'tab_kontaktieren',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Kontaktieren',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Get in Contact',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'internEMail',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'E-Mail senden (intern)',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Send email (internal)',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'privateEMail',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'E-Mail senden (privat)',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Send email (private)',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'bccEMail',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'STRG-Taste für BCC',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'CTRL-Key for BCC',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'weitereEMail',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ein weiteres Fenster wird geöffnet. Fortfahren?',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'A new window will open. Continue?',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'stv',
'phrase' => 'zuvieleEMails',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Aufgrund der hohen Empfängerzahl muss die Nachricht auf mehrere E-Mails aufgeteilt werden.',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Due to the large number of recipients, the message needs to be split across multiple emails.',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abschlusspruefung',