From 8fddbc3a32655b4455b0ffc8df11ed351e6925b4 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 10 Apr 2026 09:15:34 +0200 Subject: [PATCH 1/5] delete watcher for formData fields, add setContent for loading Vorlage --- .../Messages/Details/NewMessage/Modal.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/public/js/components/Messages/Details/NewMessage/Modal.js b/public/js/components/Messages/Details/NewMessage/Modal.js index 47187de89..ed013b0d3 100644 --- a/public/js/components/Messages/Details/NewMessage/Modal.js +++ b/public/js/components/Messages/Details/NewMessage/Modal.js @@ -133,6 +133,7 @@ export default { return this.$api .call(ApiMessages.getDataVorlage(vorlage_kurzbz)) .then(response => { + this.editor.setContent(response.data.text); this.formData.body = response.data.text; this.formData.subject = response.data.subject; }).catch(this.$fhcAlert.handleSystemError); @@ -203,24 +204,6 @@ export default { }, }, watch: { - 'formData.body': { - handler(newVal) { - const tinymcsVal = this.editor.getContent(); - - if (newVal && tinymcsVal != newVal) { - //Inhalt des Editors aktualisieren - this.editor.setContent(newVal); - } - } - }, - 'formData.vorlage_kurzbz': { - handler(newVal){ - if (newVal && newVal != null) { - this.formData.subject = newVal; - return this.getDataVorlage(newVal); - } - } - }, messageId: { immediate: true, handler: async function (newMessageId) { From 843894405e8816c6f74faefd430202f7378b398c Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 10 Apr 2026 13:03:24 +0200 Subject: [PATCH 2/5] changes for NewDiv remove Watcher for formData Fields add predefault settings for tabulator fields add setContent for Editor change text for closing window/tab show alertSuccess for sending Message just in case of inSamePage --- .../Messages/Details/NewMessage/NewDiv.js | 61 ++++++------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/public/js/components/Messages/Details/NewMessage/NewDiv.js b/public/js/components/Messages/Details/NewMessage/NewDiv.js index b0c52f0f7..51da7bf94 100644 --- a/public/js/components/Messages/Details/NewMessage/NewDiv.js +++ b/public/js/components/Messages/Details/NewMessage/NewDiv.js @@ -64,7 +64,16 @@ export default { target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component //height: 800, //plugins: ['lists'], - toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify', + toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | link', + plugins: 'link', + link_context_toolbar: true, + automatic_uploads: true, + default_link_target: "_blank", + link_title: true, + target_list: [ + { title: 'New tab', value: '_blank' }, + { title: 'Same tab', value: '_self' } + ], style_formats: [ {title: 'Blocks', block: 'div'}, {title: 'Paragraph', block: 'p'}, @@ -98,7 +107,8 @@ export default { return this.$api .call(ApiMessages.sendMessage(this.typeId, data)) .then(response => { - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent')); + if(this.openMode == "inSamePage") + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent')); this.hideTemplate(); this.resetForm(); this.messageSent = true; @@ -114,19 +124,17 @@ export default { return this.$api .call(ApiMessages.getDataVorlage(vorlage_kurzbz)) .then(response => { + this.editor.setContent(response.data.text); this.formData.body = response.data.text; this.formData.subject = response.data.subject; }).catch(this.$fhcAlert.handleSystemError); }, getPreviewText(){ - console.log("subj" + this.formData.subject); const data = new FormData(); data.append('data', JSON.stringify(this.formData.body)); data.append('ids', JSON.stringify(this.id)); - console.log("subj" + this.formData.subject); - return this.$api .call(ApiMessages.getPreviewText( this.typeId, data)) @@ -190,38 +198,6 @@ export default { this.previewBody = this.previewText; }); }, - loadReplyData(messageId){ - this.$api - .call(ApiMessages.getReplyData(messageId)) - .then(result => { - this.replyData = result.data; - this.formData.subject = this.replyData[0].replySubject; - this.formData.body = this.replyData[0].replyBody; - this.formData.relationmessage_id = messageId; - }) - .catch(this.$fhcAlert.handleSystemError); - } - }, - watch: { - 'formData.body': { - handler(newVal) { - const tinymcsVal = this.editor.getContent(); - - if (newVal && tinymcsVal != newVal) { - //Inhalt des Editors aktualisieren - this.editor.setContent(newVal); - } - } - }, - 'formData.vorlage_kurzbz': { - handler(newVal){ - - if (newVal && newVal != null) { - this.formData.subject = newVal; - return this.getDataVorlage(newVal); - } - } - }, }, created(){ const missingparamsmsgs = []; @@ -291,9 +267,8 @@ export default { .catch(this.$fhcAlert.handleSystemError); //case of reply - if(this.messageId != null) { - this.loadReplyData(this.messageId); -/* this.$api + if(this.messageId) { + this.$api .call(ApiMessages.getReplyData(this.messageId)) .then(result => { this.replyData = result.data; @@ -301,7 +276,7 @@ export default { this.formData.body = this.replyData[0].replyBody; this.formData.relationmessage_id = this.messageId; }) - .catch(this.$fhcAlert.handleSystemError);*/ + .catch(this.$fhcAlert.handleSystemError); } }, @@ -499,10 +474,10 @@ export default {
- You can safely close this window. + You can safely close this window/tab.
- Sie können dieses Fenster schließen. + Fenster/Reiter kann geschlossen werden!
From 95a7797ae9f8ed9a8fe25af9e9188409f5dc5c7d Mon Sep 17 00:00:00 2001 From: ma0068 Date: Tue, 14 Apr 2026 15:46:34 +0200 Subject: [PATCH 3/5] delete unused apicall for mode modal add editor.setContent to function getReplyData readd loadReplyData and use v-show for visibleDiv for mode inSamePage --- .../Messages/Details/NewMessage/Modal.js | 14 +----------- .../Messages/Details/NewMessage/NewDiv.js | 22 +++++++++++-------- public/js/components/Messages/Messages.js | 4 ++-- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/public/js/components/Messages/Details/NewMessage/Modal.js b/public/js/components/Messages/Details/NewMessage/Modal.js index ed013b0d3..eeda421e6 100644 --- a/public/js/components/Messages/Details/NewMessage/Modal.js +++ b/public/js/components/Messages/Details/NewMessage/Modal.js @@ -214,6 +214,7 @@ export default { this.replyData = result.data; if (this.replyData.length > 0) { + this.editor.setContent(this.replyData[0].replyBody); this.formData.subject = this.replyData[0].replySubject; this.formData.body = this.replyData[0].replyBody; this.formData.relationmessage_id = newMessageId; @@ -273,19 +274,6 @@ export default { }) .catch(this.$fhcAlert.handleSystemError); - - //case of reply - if(this.messageId) { - this.$api - .call(ApiMessages.getReplyData(this.messageId)) - .then(result => { - this.replyData = result.data; - this.formData.subject = this.replyData[0].replySubject; - this.formData.body = this.replyData[0].replyBody; - this.formData.relationmessage_id = this.messageId; - }) - .catch(this.$fhcAlert.handleSystemError); - } }, async mounted() { this.initTinyMCE(); diff --git a/public/js/components/Messages/Details/NewMessage/NewDiv.js b/public/js/components/Messages/Details/NewMessage/NewDiv.js index 51da7bf94..2e6ef30c5 100644 --- a/public/js/components/Messages/Details/NewMessage/NewDiv.js +++ b/public/js/components/Messages/Details/NewMessage/NewDiv.js @@ -198,6 +198,18 @@ export default { this.previewBody = this.previewText; }); }, + loadReplyData(messageId){ + this.$api + .call(ApiMessages.getReplyData(messageId)) + .then(result => { + this.replyData = result.data; + this.editor.setContent(this.replyData[0].replyBody); + this.formData.subject = this.replyData[0].replySubject; + this.formData.body = this.replyData[0].replyBody; + this.formData.relationmessage_id = messageId; + }) + .catch(this.$fhcAlert.handleSystemError); + } }, created(){ const missingparamsmsgs = []; @@ -268,15 +280,7 @@ export default { //case of reply if(this.messageId) { - this.$api - .call(ApiMessages.getReplyData(this.messageId)) - .then(result => { - this.replyData = result.data; - this.formData.subject = this.replyData[0].replySubject; - this.formData.body = this.replyData[0].replyBody; - this.formData.relationmessage_id = this.messageId; - }) - .catch(this.$fhcAlert.handleSystemError); + this.loadReplyData(this.messageId); } }, diff --git a/public/js/components/Messages/Messages.js b/public/js/components/Messages/Messages.js index e1fb69dc3..3b02c4af6 100644 --- a/public/js/components/Messages/Messages.js +++ b/public/js/components/Messages/Messages.js @@ -82,8 +82,8 @@ export default { this.$refs.modalMsg.show(); } else if (this.openMode == "inSamePage"){ - console.log("in same Page"); this.isVisibleDiv = true; + if(messageId) this.$refs.templateNewDivMessage.loadReplyData(messageId); else @@ -170,7 +170,7 @@ export default { -
+
Date: Wed, 15 Apr 2026 17:02:58 +0200 Subject: [PATCH 4/5] revert to v-if to not render element when not necessary and use Vue.nextTick for dependent code --- public/js/components/Messages/Messages.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/public/js/components/Messages/Messages.js b/public/js/components/Messages/Messages.js index 3b02c4af6..bb69d2139 100644 --- a/public/js/components/Messages/Messages.js +++ b/public/js/components/Messages/Messages.js @@ -84,12 +84,14 @@ export default { else if (this.openMode == "inSamePage"){ this.isVisibleDiv = true; - if(messageId) - this.$refs.templateNewDivMessage.loadReplyData(messageId); - else - this.$refs.templateNewDivMessage.resetForm(); + this.$nextTick(() => { + if(messageId) + this.$refs.templateNewDivMessage.loadReplyData(messageId); + else + this.$refs.templateNewDivMessage.resetForm(); - this.$refs.templateNewDivMessage.showTemplate(); + this.$refs.templateNewDivMessage.showTemplate(); + }); } else console.log("no valid openMode"); @@ -170,7 +172,7 @@ export default { -
+
Date: Thu, 16 Apr 2026 11:23:57 +0200 Subject: [PATCH 5/5] deactivate pagination - since potentially msg threads are not shown completely --- .../api/frontend/v1/messages/Messages.php | 14 ++++++++++--- application/models/system/Message_model.php | 10 +++++---- public/js/api/factory/messages/messages.js | 13 +++++++----- .../Messages/Details/TableMessages.js | 21 ++++++++++++++++--- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/application/controllers/api/frontend/v1/messages/Messages.php b/application/controllers/api/frontend/v1/messages/Messages.php index 3035e532d..77b46f97b 100644 --- a/application/controllers/api/frontend/v1/messages/Messages.php +++ b/application/controllers/api/frontend/v1/messages/Messages.php @@ -42,14 +42,22 @@ class Messages extends FHCAPI_Controller ]); } - public function getMessages($id, $type_id, $size, $page) + public function getMessages($id, $type_id, $size=null, $page=null) { if($type_id != 'person_id'){ $id = $this->_getPersonId($id, $type_id); } - $offset = $size * ($page - 1); - $limit = $size; + if(!(is_null($size) && is_null($page))) + { + $offset = $size * ($page - 1); + $limit = $size; + } + else + { + $offset = null; + $limit = null; + } $result = $this->MessageModel->getMessagesForTable($id, $offset, $limit); diff --git a/application/models/system/Message_model.php b/application/models/system/Message_model.php index 3e59d7250..ba51e514e 100644 --- a/application/models/system/Message_model.php +++ b/application/models/system/Message_model.php @@ -242,6 +242,7 @@ class Message_model extends DB_Model */ public function getMessagesForTable($person_id, $offset, $limit) { + $limitoffset = (!is_null($offset) && !is_null($limit)) ? 'limit ? offset ?' : ''; $sql = <<execQuery($sql, $parametersArray); @@ -325,7 +327,7 @@ EOSQL; $data = getData($data); if($data) { - $count = ceil($data[0]->total_msgs / $limit); + $count = is_null($limit) ? 1 : ceil($data[0]->total_msgs / $limit); } return success(['data' => $data, 'count' => $count]); diff --git a/public/js/api/factory/messages/messages.js b/public/js/api/factory/messages/messages.js index b7b21dd8a..fb752cfb4 100644 --- a/public/js/api/factory/messages/messages.js +++ b/public/js/api/factory/messages/messages.js @@ -17,13 +17,16 @@ export default { getMessages(params) { + let url = 'api/frontend/v1/messages/messages/getMessages' + + '/' + params.id + + '/' + params.type; + if(params.size && params.page) { + url += '/' + params.size + + '/' + params.page; + } return { method: 'get', - url: 'api/frontend/v1/messages/messages/getMessages/' - + params.id + '/' - + params.type + '/' - + params.size + '/' - + params.page + url: url }; }, getVorlagen(){ diff --git a/public/js/components/Messages/Details/TableMessages.js b/public/js/components/Messages/Details/TableMessages.js index d2101e2cb..aefa8bb2a 100644 --- a/public/js/components/Messages/Details/TableMessages.js +++ b/public/js/components/Messages/Details/TableMessages.js @@ -65,7 +65,14 @@ export default { buildTreemap(messages) { if (!messages || !messages.data || messages.data.length === 0) { - return {data: [], last_page: 0}; + if(this.tabulatorOptions.pagination) + { + return {data: [], last_page: 0}; + } + else + { + return []; + } } const last_page = messages.meta.count; @@ -106,7 +113,15 @@ export default { // to avoid endless loop if (iteration > messages.length) break; } - return {data: messageNested, last_page: last_page}; + + if(this.tabulatorOptions.pagination) + { + return {data: messageNested, last_page: last_page}; + } + else + { + return messageNested; + } }, loadAjaxCall(url, config, params){ return this.$api.call( @@ -252,7 +267,7 @@ export default { frozen: true } ], - pagination: true, + pagination: false, paginationMode: "remote", paginationSize: 15, paginationInitialPage: 1,