From 41143a6dfc66bf34bb6b454ae2c6e059de015fc8 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 19 Sep 2025 10:58:53 +0200 Subject: [PATCH] profile functions use tbl_benutzerfunktion.beschreibung in column description, format date columns in profile tabulators, fix vuejs dev version warnings --- application/libraries/ProfilLib.php | 2 +- .../Cis/Profil/MitarbeiterProfil.js | 35 ++++++++++++++----- .../Cis/Profil/MitarbeiterViewProfil.js | 27 +++++++++++--- .../ProfilComponents/RoleInformation.js | 19 ++++++++-- .../EditProfilComponents/ImageUpload.js | 4 +-- .../js/components/Cis/Profil/StudentProfil.js | 21 ++++++++--- 6 files changed, 85 insertions(+), 23 deletions(-) diff --git a/application/libraries/ProfilLib.php b/application/libraries/ProfilLib.php index e86a343e7..50b8bc264 100644 --- a/application/libraries/ProfilLib.php +++ b/application/libraries/ProfilLib.php @@ -304,7 +304,7 @@ class ProfilLib{ { $this->ci->load->model("person/Benutzerfunktion_model","BenutzerfunktionModel"); $this->ci->BenutzerfunktionModel->addSelect([ - "tbl_funktion.beschreibung as Bezeichnung", + "CASE WHEN (tbl_benutzerfunktion.bezeichnung IS NOT NULL AND tbl_benutzerfunktion.bezeichnung <> '' AND tbl_benutzerfunktion.bezeichnung <> tbl_funktion.beschreibung) THEN tbl_funktion.beschreibung || ' - ' || tbl_benutzerfunktion.bezeichnung ELSE tbl_funktion.beschreibung END as \"Bezeichnung\"", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 223b5c2b6..bf3c4cf49 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -11,6 +11,7 @@ import RoleInformation from "./ProfilComponents/RoleInformation.js"; import ProfilInformation from "./ProfilComponents/ProfilInformation.js"; import ApiProfilUpdate from '../../../api/factory/profilUpdate.js'; +import { dateFilter } from '../../../tabulator/filters/Dates.js'; export default { components: { @@ -40,7 +41,7 @@ export default { persistence: { columns: false }, - height: 300, + minHeight: 300, layout: "fitColumns", responsiveLayout: "collapse", responsiveLayoutCollapseUseFormatters: false, @@ -74,18 +75,24 @@ export default { { title: Vue.computed(() => this.preloadedPhrasen.gueltigVonPhrase), field: "Gültig_von", - headerFilter: true, + headerFilterFunc: 'dates', + headerFilter: dateFilter, resizable: true, minWidth: 200, - visible: true + visible: true, + formatter:"datetime", + formatterParams: this.datetimeFormatterParams() }, { title: Vue.computed(() => this.preloadedPhrasen.gueltigBisPhrase), field: "Gültig_bis", - headerFilter: true, + headerFilterFunc: 'dates', + headerFilter: dateFilter, resizable: true, minWidth: 200, - visible: true + visible: true, + formatter:"datetime", + formatterParams: this.datetimeFormatterParams() }, { title: Vue.computed(() => this.preloadedPhrasen.wochenstundenPhrase), @@ -102,7 +109,7 @@ export default { persistence: { columns: false }, - height: 300, + minHeight: 300, layout: "fitColumns", responsiveLayout: "collapse", responsiveLayoutCollapseUseFormatters: false, @@ -138,9 +145,12 @@ export default { { title: Vue.computed(() => this.preloadedPhrasen.ausgabedatumPhrase), field: "Ausgegeben_am", - headerFilter: true, + headerFilterFunc: 'dates', + headerFilter: dateFilter, minWidth: 200, - visible: true + visible: true, + formatter:"datetime", + formatterParams: this.datetimeFormatterParams() }, ], } @@ -211,6 +221,15 @@ export default { setTableColumnTitles() { // reevaluates computed phrasen if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns) if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setColumns(this.funktionen_table_options.columns) + }, + datetimeFormatterParams: function() { + const params = { + inputFormat:"yyyy-MM-dd", + outputFormat:"dd.MM.yyyy", + invalidPlaceholder:"(invalid date)", + timezone:FHC_JS_DATA_STORAGE_OBJECT.timezone + }; + return params; } }, diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index c1ce4ead6..481714590 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -5,6 +5,8 @@ import RoleInformation from "./ProfilComponents/RoleInformation.js"; import ProfilEmails from "./ProfilComponents/ProfilEmails.js"; import ProfilInformation from "./ProfilComponents/ProfilInformation.js"; +import { dateFilter } from '../../../tabulator/filters/Dates.js'; + export default { components: { CoreFilterCmpt, @@ -24,7 +26,7 @@ export default { persistence: { columns: false }, - height: 300, + minHeight: 300, layout: "fitColumns", responsiveLayout: "collapse", responsiveLayoutCollapseUseFormatters: false, @@ -60,18 +62,24 @@ export default { { title: Vue.computed(() => this.$p.t('global/gueltigVon')), field: "Gültig_von", - headerFilter: true, + headerFilterFunc: 'dates', + headerFilter: dateFilter, resizable: true, minWidth: 200, - visible: true + visible: true, + formatter:"datetime", + formatterParams: this.datetimeFormatterParams() }, { title: Vue.computed(() => this.$p.t('global/gueltigBis')), field: "Gültig_bis", - headerFilter: true, + headerFilterFunc: 'dates', + headerFilter: dateFilter, resizable: true, minWidth: 200, - visible: true + visible: true, + formatter:"datetime", + formatterParams: this.datetimeFormatterParams() }, { title: Vue.computed(() => this.$p.t('profil/wochenstunden')), @@ -91,6 +99,15 @@ export default { funktionenTableBuilt: function () { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }, + datetimeFormatterParams: function() { + const params = { + inputFormat:"yyyy-MM-dd", + outputFormat:"dd.MM.yyyy", + invalidPlaceholder:"(invalid date)", + timezone:FHC_JS_DATA_STORAGE_OBJECT.timezone + }; + return params; + } }, watch: { 'data.funktionen'(newVal) { diff --git a/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js b/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js index ae1a4f2b9..968fb2f83 100644 --- a/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js +++ b/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js @@ -10,21 +10,34 @@ export default { type: String, } }, - inject: [ - 'studiengang_kz', // inject info that should not be displayed - ], + inject: { + // inject info that should not be displayed + 'studiengang_kz': { + from: 'studiengang_kz', + default: false + }, + }, computed: { getLinkGruppeListe() { + if(this.studiengang_kz === false) { + return ''; + } return this.data.gruppe?.value && this.data.verband?.value && this.data.semester?.value ? FHC_JS_DATA_STORAGE_OBJECT.app_root + 'cis/private/stud_in_grp.php?kz='+this.studiengang_kz+'&sem=' + this.data.semester.value + '&verband=' + this.data.verband.value + '&grp=' + this.data.gruppe.value : '' }, getLinkVerbandListe() { + if(this.studiengang_kz === false) { + return ''; + } return this.data.verband?.value && this.data.semester?.value ? FHC_JS_DATA_STORAGE_OBJECT.app_root + 'cis/private/stud_in_grp.php?kz='+this.studiengang_kz+'&sem=' + this.data.semester.value + '&verband=' + this.data.verband.value : '' }, getLinkSemesterListe() { + if(this.studiengang_kz === false) { + return ''; + } return this.data.semester?.value ? FHC_JS_DATA_STORAGE_OBJECT.app_root + 'cis/private/stud_in_grp.php?kz='+this.studiengang_kz+'&sem=' + this.data.semester.value : '' } diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js index 672b4ce4a..2d2efb0fe 100644 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js @@ -16,7 +16,7 @@ export default { mixins: [BsModal], props: { titel: { - type: Object, + type: String, }, files: { type: Array, @@ -57,7 +57,7 @@ export default { }, template: /*html*/` - + diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 8d46377d5..3f8e8380d 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -11,6 +11,7 @@ import FetchProfilUpdates from "./ProfilComponents/FetchProfilUpdates.js"; import EditProfil from "./ProfilModal/EditProfil.js"; import ApiProfilUpdate from '../../../api/factory/profilUpdate.js'; +import { dateFilter } from '../../../tabulator/filters/Dates.js'; export default { components: { @@ -39,7 +40,7 @@ export default { persistence: { columns: false }, - height: 200, + minHeight: 200, layout: "fitColumns", columns: [{ title: Vue.computed(() => this.preloadedPhrasen.zutrittsGruppenPhrase), @@ -51,7 +52,7 @@ export default { persistence: { columns: false }, - height: 300, + minHeight: 300, layout: "fitColumns", responsiveLayout: "collapse", responsiveLayoutCollapseUseFormatters: false, @@ -85,9 +86,12 @@ export default { { title: Vue.computed(() =>this.preloadedPhrasen.ausgabedatum) , field: "Ausgegeben_am", - headerFilter: true, + headerFilterFunc: 'dates', + headerFilter: dateFilter, minWidth: 200, - visible: true + visible: true, + formatter:"datetime", + formatterParams: this.datetimeFormatterParams() }, ], }, @@ -160,6 +164,15 @@ export default { this.$refs.editModal.show(); }); }, + datetimeFormatterParams: function() { + const params = { + inputFormat:"yyyy-MM-dd", + outputFormat:"dd.MM.yyyy", + invalidPlaceholder:"(invalid date)", + timezone:FHC_JS_DATA_STORAGE_OBJECT.timezone + }; + return params; + } }, computed: {