From b8c885c8a4a25e777a1a52fce65d40a57b234b20 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 24 Jan 2024 09:04:53 +0100 Subject: [PATCH] Remove html-Tags in tabulator text --- .../controllers/components/stv/Notiz.php | 4 +--- application/models/person/Notiz_model.php | 3 ++- public/js/components/Notiz/Notiz.js | 17 ++++++++++++++--- .../Stv/Studentenverwaltung/Details/Notizen.js | 14 +++++++++----- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/application/controllers/components/stv/Notiz.php b/application/controllers/components/stv/Notiz.php index 4c999b7c1..a73014b59 100644 --- a/application/controllers/components/stv/Notiz.php +++ b/application/controllers/components/stv/Notiz.php @@ -107,11 +107,9 @@ class Notiz extends FHC_Controller if(isset($_POST['typeId'])) $type = $this->input->post('typeId'); - //var_dump($_POST); - if(!$type) { - $result = error('kein Type für ID vorhanden', EXIT_ERROR); + $result = error('kein Type für ID vorhanden', ERROR); $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); return $this->outputJson(getError($result)); diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 5684bf3ed..ea0d7d361 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -293,7 +293,8 @@ class Notiz_model extends DB_Model TO_CHAR (CASE WHEN n.updateamum >= n.insertamum THEN n.updateamum ELSE n.insertamum - END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate + END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate, + regexp_replace(n.text, '<[^>]*>', '', 'g') as text_stripped FROM public.tbl_notiz n JOIN diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index d965ce3ac..bafaa5479 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -140,8 +140,19 @@ export default { tinymce.init({ target: this.$refs.editor, //Important: not selector: to enable multiple import of component //height: 800, - plugins: ['lists'], - toolbar: "undo redo | blocks | bold italic | alignleft aligncenter alignright alignjustify | outdent indent", + //plugins: ['lists'], + //toolbar: " blocks | bold italic underline | alignleft aligncenter alignright alignjustify", + toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify', + style_formats: [ + { title: 'Blocks', block: 'div' }, + { title: 'Paragraph', block: 'p' }, + { title: 'Heading 1', block: 'h1' }, + { title: 'Heading 2', block: 'h2' }, + { title: 'Heading 3', block: 'h3' }, + { title: 'Heading 4', block: 'h4' }, + { title: 'Heading 5', block: 'h5' }, + { title: 'Heading 6', block: 'h6' }, + ], autoresize_bottom_margin: 16, setup: (editor) => { @@ -278,7 +289,7 @@ export default { - + ` diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js b/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js index f31cf745a..0b19280d3 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js @@ -24,15 +24,14 @@ export default { return { tabulatorOptions: { ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Notiz/getNotizen/' + this.modelValue.person_id + '/person_id'), - //ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Notiz/getNotizen/' + this.modelValue.person_id + '/' + this.typeId), + //ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Notiz/getNotizen/' + this.modelValue.person_id + '/' + this.formData.typeId), columns: [ {title: "Titel", field: "titel"}, - {title: "Text", field: "text", width: 350}, + {title: "Text", field: "text_stripped", width: 350}, {title: "VerfasserIn", field: "verfasser_uid"}, {title: "BearbeiterIn", field: "bearbeiter_uid", visible: false}, {title: "Start", field: "start", visible: false}, {title: "Ende", field: "ende", visible: false}, - /* {title: "Dokumente", field: "dms_id"},*/ {title: "Dokumente", field: "countdoc"}, {title: "Erledigt", field: "erledigt", visible: false}, {title: "Notiz_id", field: "notiz_id", visible: false}, @@ -54,8 +53,14 @@ export default { layout: 'fitDataFill', layoutColumnsOnNewData: false, height: '150', + selectableRangeMode: 'click', selectable: true, - index: 'notiz_id' + index: 'notiz_id', +/* rowClick: (e, row) => { + const notizId = row.getData().notiz_id; + console.log(notizId); + this.actionEditNotiz(notizId); + },*/ }, tabulatorEvents: [], notizen: [], @@ -132,7 +137,6 @@ export default { formData.append('data', JSON.stringify(this.formData)); Object.entries(this.formData.anhang).forEach(([k, v]) => formData.append(k, v)); - CoreRESTClient.post( 'components/stv/Notiz/addNewNotiz/' + this.modelValue.person_id, formData,