From 4653e070b186e6c484f308998a47ac76b91d03b4 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 25 Jan 2024 10:27:43 +0100 Subject: [PATCH] =?UTF-8?q?Notiztab:=20Phrasen=20f=C3=BCr=20Form=20und=20T?= =?UTF-8?q?abulator=20Notiz,=20Update=20Actionbuttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/views/Studentenverwaltung.php | 6 +- public/js/apps/Studentenverwaltung.js | 2 + public/js/components/Notiz/Notiz.js | 33 ++--- .../Studentenverwaltung/Details/Notizen.js | 96 +++++++++---- system/phrasesupdate.php | 133 ++++++++++++++++++ 5 files changed, 223 insertions(+), 47 deletions(-) diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php index 4fbc0fecd..01b616397 100644 --- a/application/views/Studentenverwaltung.php +++ b/application/views/Studentenverwaltung.php @@ -9,7 +9,11 @@ #'filtercomponent' => true, 'tabulator5' => true, 'tinymce5' => true, - 'phrases' => [], + 'phrases' => array( + 'global', + 'ui', + 'notiz', + ), 'customCSSs' => [ 'public/css/components/vue-datepicker.css', 'public/css/components/primevue.css', diff --git a/public/js/apps/Studentenverwaltung.js b/public/js/apps/Studentenverwaltung.js index a8eb5a578..e1dacf792 100644 --- a/public/js/apps/Studentenverwaltung.js +++ b/public/js/apps/Studentenverwaltung.js @@ -19,6 +19,7 @@ import FhcStudentenverwaltung from "../components/Stv/Studentenverwaltung.js"; import fhcapifactory from "./api/fhcapifactory.js"; import FhcAlert from "../plugin/FhcAlert.js"; +import FhcPhrasen from "../plugin/Phrasen.js"; //import PrimeVue form "../../../../index.ci.php/public/js/components/primevue/config/config.esm.min.js"); //const PrimeVue = await import(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/public/js/components/primevue/config/config.esm.min.js").default; @@ -47,5 +48,6 @@ import(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_route } }) .use(FhcAlert) + .use(FhcPhrasen) .mount('#main'); }); diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index bafaa5479..c3eead4bb 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -4,6 +4,7 @@ import File from '../Form/Upload/File.js'; import FormUploadDms from '../Form/Upload/Dms.js'; import {CoreRESTClient} from "../../RESTClient"; + export default { components: { VueDatePicker, @@ -115,7 +116,6 @@ export default { return this.anhang; }, set(value) { - //console.log(value); this.$emit('update:anhang', value); } } @@ -130,7 +130,6 @@ export default { return CoreRESTClient .get('components/stv/Notiz/getMitarbeiter/' + event.query) .then(result => { - //console.log(result); this.filteredMitarbeiter = CoreRESTClient.getData(result.data); }); }, @@ -195,20 +194,20 @@ export default {
-

Neue Notiz

-

Notiz bearbeiten

+

{{$p.t('notiz','notiz_new')}}

+

{{$p.t('notiz','notiz_edit')}}

- +
- +
@@ -221,7 +220,7 @@ export default {
- +
@@ -234,12 +233,12 @@ export default {
- +
- +
- +
- +
- + +
-
+
- +
@@ -281,7 +281,7 @@ export default {
- +

{{this.lastChange}}

@@ -289,9 +289,6 @@ export default { - - -
` } diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js b/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js index 0b19280d3..131b4fd55 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js @@ -3,13 +3,6 @@ import {CoreFilterCmpt} from "../../../filter/Filter.js"; import Notiz from "../../../Notiz/Notiz.js"; import BsModal from "../../../Bootstrap/Modal"; -var editIcon = function (cell, formatterParams) { - return ""; -}; -var deleteIcon = function (cell, formatterParams) { - return ""; -}; - export default { components: { CoreRESTClient, @@ -27,8 +20,8 @@ export default { //ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Notiz/getNotizen/' + this.modelValue.person_id + '/' + this.formData.typeId), columns: [ {title: "Titel", field: "titel"}, - {title: "Text", field: "text_stripped", width: 350}, - {title: "VerfasserIn", field: "verfasser_uid"}, + {title: "Text", field: "text_stripped", width: 250}, + {title: "VerfasserIn", field: "verfasser_uid"}, {title: "BearbeiterIn", field: "bearbeiter_uid", visible: false}, {title: "Start", field: "start", visible: false}, {title: "Ende", field: "ende", visible: false}, @@ -37,22 +30,37 @@ export default { {title: "Notiz_id", field: "notiz_id", visible: false}, {title: "Notizzuordnung_id", field: "notizzuordnung_id", visible: false}, {title: "letzte Änderung", field: "lastupdate", visible: false}, - { - formatter: editIcon, cellClick: (e, cell) => { - this.actionEditNotiz(cell.getData().notiz_id); - //console.log(cell.getRow().getIndex(), cell.getData(), this); - }, width: 50, headerSort: false, headerVisible: false - }, - { - formatter: deleteIcon, cellClick: (e, cell) => { - this.actionDeleteNotiz(cell.getData().notiz_id); + {title: 'Aktionen', field: 'actions', + minWidth: 150, // Ensures Action-buttons will be always fully displayed + formatter: (cell, formatterParams, onRendered) => { + let container = document.createElement('div'); + container.className = "d-flex gap-2"; - }, width: 50, headerSort: false, headerVisible: false - }, + let button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.addEventListener('click', (event) => + this.actionEditNotiz(cell.getData().notiz_id) + ); + container.append(button); + + button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.addEventListener('click', () => + this.actionDeleteNotiz(cell.getData().notiz_id) + ); + container.append(button); + + return container; + }, + frozen: true + } ], + layout: 'fitDataFill', layoutColumnsOnNewData: false, - height: '150', + height: '250', selectableRangeMode: 'click', selectable: true, index: 'notiz_id', @@ -82,8 +90,7 @@ export default { anhang: [] }, showErweitert: true, //show details verfasser, bearbeiter, von, bis, erledigt - showDocument: true //show upload documents - + showDocument: true, //show upload documents }; }, methods:{ @@ -113,7 +120,6 @@ export default { if(this.notizen.dms_id){ console.log("loadEntries with " + this.notizen.notiz_id); this.loadDocEntries(this.notizen.notiz_id); - //console.log(this.formData.anhang); } }); }, @@ -271,7 +277,41 @@ export default { }) .catch(this.$fhcAlert.handleSystemError); }, - computed: { }, + async mounted() { + await this.$p.loadCategory(['notiz','global']); + + let cm = this.$refs.table.tabulator.columnManager; + + cm.getColumnByField('verfasser_uid').component.updateDefinition({ + title: this.$p.t('notiz', 'verfasser') + }); + cm.getColumnByField('titel').component.updateDefinition({ + title: this.$p.t('global', 'titel') + }); + cm.getColumnByField('text_stripped').component.updateDefinition({ + title: this.$p.t('global', 'text') + }); + cm.getColumnByField('bearbeiter_uid').component.updateDefinition({ + title: this.$p.t('notiz', 'bearbeiter') + }); + cm.getColumnByField('start').component.updateDefinition({ + title: this.$p.t('global', 'gueltigVon') + }); + cm.getColumnByField('ende').component.updateDefinition({ + title: this.$p.t('global', 'gueltigBis') + }); + cm.getColumnByField('countdoc').component.updateDefinition({ + title: this.$p.t('notiz', 'document') + }); + cm.getColumnByField('erledigt').component.updateDefinition({ + title: this.$p.t('notiz', 'erledigt') + }); + cm.getColumnByField('lastupdate').component.updateDefinition({ + title: this.$p.t('notiz', 'letzte_aenderung') + }); + }, +/* computed: { + },*/ template: `
@@ -321,9 +361,9 @@ export default { > - - - + + +
` }; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 971b9dab1..c7f3659fb 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -21782,6 +21782,139 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'document', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anhänge', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Attachments', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'notiz_new', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Neue Notiz', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'New Note', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'notiz_edit', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notiz bearbeiten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Edit Note', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'verfasser', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Verfasser*in', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'author', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'bearbeiter', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bearbeiter*in', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'editor', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'erledigt', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'erledigt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'completed', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'notiz', + 'phrase' => 'letzte_aenderung', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'letzte Änderung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Last updated', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );