diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index e0a185f9b..19129b606 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -242,74 +242,89 @@ class Message_model extends DB_Model */ public function getMessagesForTable($person_id, $offset, $limit) { - $sql_base = " - SELECT + $sql = <<execQuery($sql, $parametersArray); - - if (isError($count)) - return $count; - - $count = ceil(current(getData($count))->count/$limit); - $sql = " - SELECT * FROM ( - " . $sql_base . " - ) a - ORDER BY insertamum DESC - LIMIT ? - OFFSET ? - "; + (COALESCE(ps.titelpre,'') || ' ' || COALESCE(ps.vorname,'') || ' ' || COALESCE(ps.nachname,'') || ' ' || COALESCE(ps.titelpost,'')) as sender, + (COALESCE(pr.titelpre,'') || ' ' || COALESCE(pr.vorname,'') || ' ' || COALESCE(pr.nachname,'') || ' ' || COALESCE(pr.titelpost,'')) as recipient, + fm.sender_id, + fm.recipient_id, + ms.status, + ms.insertamum as statusdatum + from + filtered_messages fm + join + public.tbl_msg_message m on fm.message_id = m.message_id + join + lastmsgstatus ms on fm.message_id = ms.message_id and fm.recipient_id = ms.person_id + left join + public.tbl_person ps on ps.person_id = fm.sender_id + left join + public.tbl_person pr on pr.person_id = fm.recipient_id + order by + m.insertamum DESC + limit ? + offset ?; +EOSQL; $parametersArray = array($person_id, $person_id, $limit, $offset); + $count = 0; $data = $this->execQuery($sql, $parametersArray); if (isError($data)) return $data; $data = getData($data); + if($data) + { + $count = ceil($data[0]->total_msgs / $limit); + } return success(['data' => $data, 'count' => $count]); } diff --git a/public/css/tags.css b/public/css/tags.css index 9e0d7ee4b..e92f415b2 100644 --- a/public/css/tags.css +++ b/public/css/tags.css @@ -51,6 +51,14 @@ background-color: #6d4c41; } +.tag_dark_grey { + background-color: #595959; +} + +.tag_light_grey { + background-color: #9a9a9a; +} + .tag_blau { background-color: #508498; } diff --git a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js index 42952d0df..971783746 100644 --- a/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js +++ b/public/js/components/Cis/Abgabetool/AbgabeMitarbeiterDetail.js @@ -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 @@ -711,6 +729,7 @@ export const AbgabeMitarbeiterDetail = { v-model="newTermin.bezeichnung" :options="getAllowedAbgabeTypeOptions" :optionLabel="getOptionLabelAbgabetyp" + :optionDisabled="getOptionDisabled" scrollHeight="300px"> diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js index 7fa78f7d1..34ddd3fc2 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js @@ -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(); @@ -969,7 +966,10 @@ export const AbgabetoolAssistenz = { // this.loadProjektarbeiten() this.calcMaxTableHeight() - } + }, + getOptionDisabled(option) { + return !option.aktiv + }, }, computed: { emailItems() { @@ -1179,7 +1179,8 @@ export const AbgabetoolAssistenz = { :style="{'width': '100%'}" v-model="serienTermin.bezeichnung" :options="abgabeTypeOptions" - :optionLabel="getOptionLabelAbgabetyp"> + :optionLabel="getOptionLabelAbgabetyp" + :optionDisabled="getOptionDisabled"> @@ -1392,7 +1393,7 @@ export const AbgabetoolAssistenz = { > - + diff --git a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js index 67e1d09af..f33333ea3 100644 --- a/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js +++ b/public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js @@ -304,7 +304,7 @@ export const AbgabetoolMitarbeiter = { pa.isCurrent = res.data[1] let paIsBenotet = false - if(pa.note !== undefined && pa !== null) { + if(pa.note !== undefined && pa.note !== null) { // check if the note is not defined as a non final projektarbeit note const opt = this.notenOptionsNonFinal.find(opt => opt.note) // if thats the case allow further work @@ -333,7 +333,6 @@ export const AbgabetoolMitarbeiter = { pa.student = `${pa.vorname} ${pa.nachname}` this.selectedProjektarbeit = pa - this.$refs.modalContainerAbgabeDetail.show() }).finally(()=>{this.loading = false}) diff --git a/public/js/components/Messages/Details/TableMessages.js b/public/js/components/Messages/Details/TableMessages.js index 861965900..78acc5803 100644 --- a/public/js/components/Messages/Details/TableMessages.js +++ b/public/js/components/Messages/Details/TableMessages.js @@ -316,6 +316,7 @@ export default { setHeader('statusdatum', this.$p.t('notiz', 'letzte_aenderung')); this.$refs.table.tabulator.rowManager.getDisplayRows(); + this.$emit('tabulator_tablebuilt'); } }, { @@ -423,4 +424,4 @@ export default { ` -} \ No newline at end of file +} diff --git a/public/js/components/Messages/Messages.js b/public/js/components/Messages/Messages.js index 1f9afcb9e..5e247ddb5 100644 --- a/public/js/components/Messages/Messages.js +++ b/public/js/components/Messages/Messages.js @@ -56,6 +56,7 @@ export default { }, data() { return { + tablebuilt: false, isVisibleDiv: false, messageId: null } @@ -139,8 +140,10 @@ export default { }, resetMessageId(){ this.messageId = null; + }, + tableBuilt: function() { + this.tablebuilt = true; } - }, template: `
@@ -155,6 +158,7 @@ export default { -
+
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js index bd7554a47..43995b918 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js @@ -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) } } }, diff --git a/public/js/helpers/EmailHelpers.js b/public/js/helpers/EmailHelpers.js new file mode 100644 index 000000000..87daa828a --- /dev/null +++ b/public/js/helpers/EmailHelpers.js @@ -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; + } + } + + } +} \ No newline at end of file diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 793930243..4ddb38203 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -91,6 +91,7 @@ require_once('dbupdate_3.4/69065_Projektarbeiten_Firmen_verwalten.php'); require_once('dbupdate_3.4/68744_StV_settings.php'); require_once('dbupdate_3.4/62889_reihungstest_ueberwachung_mit_constructor.php'); require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php'); +require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/dbupdate_3.4/71645_studvw_messagetab_ladezeit.php b/system/dbupdate_3.4/71645_studvw_messagetab_ladezeit.php new file mode 100644 index 000000000..4ad88fba9 --- /dev/null +++ b/system/dbupdate_3.4/71645_studvw_messagetab_ladezeit.php @@ -0,0 +1,28 @@ +db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_msg_message_person_id'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE INDEX idx_tbl_msg_message_person_id ON public.tbl_msg_message USING btree (person_id)"; + + if (! $db->db_query($qry)) + echo 'idx_tbl_msg_message_person_id: ' . $db->db_last_error() . '
'; + else + echo 'Index idx_tbl_msg_message_person_id angelegt
'; + } +} + +if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_msg_recipient_person_id'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE INDEX idx_tbl_msg_recipient_person_id ON public.tbl_msg_recipient USING btree (person_id)"; + + if (! $db->db_query($qry)) + echo 'idx_tbl_msg_recipient_person_id: ' . $db->db_last_error() . '
'; + else + echo 'Index idx_tbl_msg_recipient_person_id angelegt
'; + } +}