From ff8d1c78fdb35b7d8df083a298e6823903c68b4e Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Fri, 14 Feb 2025 13:34:52 +0100 Subject: [PATCH 1/6] funktionen/betriebsmittel table in profil & viewprofil got computed phrasen title; provide computed language reference in fhc app from phrasen plugin to watch for language changes to reevaluate computed phrasen in columns with; added some phrasen; --- public/js/apps/Dashboard/Fhc.js | 5 ++ .../Cis/Profil/MitarbeiterProfil.js | 48 +++++++++------ .../Cis/Profil/MitarbeiterViewProfil.js | 15 +++-- system/phrasesupdate.php | 60 +++++++++++++++++++ 4 files changed, 104 insertions(+), 24 deletions(-) diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 703563283..9f77d4b9b 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -89,6 +89,11 @@ const app = Vue.createApp({ return /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); } }, + provide() { + return { // provide injectable & watchable language property + language: Vue.computed(() => this.$p.user_language) + } + }, methods: { isInternalRoute(href) { const internalBase = window.location.origin diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 8bba26ea2..a31594755 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -25,7 +25,7 @@ export default { ProfilInformation, }, - inject: ["sortProfilUpdates", "collapseFunction"], + inject: ["sortProfilUpdates", "collapseFunction", "language"], data() { return { @@ -56,21 +56,21 @@ export default { visible: true }, { - title: "Bezeichnung", + title: Vue.computed(() => this.$p.t('ui/bezeichnung')), field: "Bezeichnung", headerFilter: true, minWidth: 200, visible: true }, { - title: "Organisationseinheit", + title: Vue.computed(() => this.$p.t('lehre/organisationseinheit')), field: "Organisationseinheit", headerFilter: true, minWidth: 200, visible: true }, { - title: "Gültig_von", + title: Vue.computed(() => this.$p.t('global/gueltigVon')), field: "Gültig_von", headerFilter: true, resizable: true, @@ -78,7 +78,7 @@ export default { visible: true }, { - title: "Gültig_bis", + title: Vue.computed(() => this.$p.t('global/gueltigBis')), field: "Gültig_bis", headerFilter: true, resizable: true, @@ -86,7 +86,7 @@ export default { visible: true }, { - title: "Wochenstunden", + title: Vue.computed(() => this.$p.t('profil/wochenstunden')), field: "Wochenstunden", headerFilter: true, minWidth: 200, @@ -96,6 +96,10 @@ export default { }, betriebsmittel_table_options: { + persistenceID: "filterTableMaProfilBetriebsmittel", + persistence: { + columns: false + }, height: 300, layout: "fitColumns", responsiveLayout: "collapse", @@ -115,14 +119,14 @@ export default { visible: true }, { - title: "Betriebsmittel", + title: Vue.computed(() => this.$p.t('profil/entlehnteBetriebsmittel')), field: "betriebsmittel", headerFilter: true, minWidth: 200, visible: true }, { - title: "Nummer", + title: Vue.computed(() => this.$p.t('profil/inventarnummer')), field: "Nummer", headerFilter: true, resizable: true, @@ -130,7 +134,7 @@ export default { visible: true }, { - title: "Ausgegeben_am", + title: Vue.computed(() => this.$p.t('profil/ausgabedatum')), field: "Ausgegeben_am", headerFilter: true, minWidth: 200, @@ -145,17 +149,14 @@ export default { data: Object, editData: Object, }, - 'data.funktionen'(newVal) { - if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setData(newVal); - }, - 'data.mittel'(newVal) { - if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setData(newVal); - }, + methods: { betriebsmittelTableBuilt: function () { + this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns) this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); }, funktionenTableBuilt: function () { + this.$refs.funktionenTable.tabulator.setColumns(this.funktionen_table_options.columns) this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }, hideEditProfilModal: function () { @@ -202,6 +203,10 @@ 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) + } }, computed: { @@ -274,10 +279,17 @@ export default { this.data.profilUpdates?.sort(this.sortProfilUpdates); }, - mounted() { - + watch: { + 'data.funktionen'(newVal) { + if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setData(newVal); + }, + 'data.mittel'(newVal) { + if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setData(newVal); + }, + 'language.value'(newVal) { + this.setTableColumnTitles() + } }, - template: /*html*/ `
diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index baf6fe745..cef970ec2 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -14,7 +14,7 @@ export default { ProfilEmails, ProfilInformation, }, - inject: ["collapseFunction"], + inject: ["collapseFunction", "language"], data() { return { collapseIconFunktionen: true, @@ -44,21 +44,21 @@ export default { visible: true }, { - title: "Bezeichnung", + title: Vue.computed(() => this.$p.t('ui/bezeichnung')), field: "Bezeichnung", headerFilter: true, minWidth: 200, visible: true }, { - title: "Organisationseinheit", + title: Vue.computed(() => this.$p.t('lehre/organisationseinheit')), field: "Organisationseinheit", headerFilter: true, minWidth: 200, visible: true }, { - title: "Gültig_von", + title: Vue.computed(() => this.$p.t('global/gueltigVon')), field: "Gültig_von", headerFilter: true, resizable: true, @@ -66,7 +66,7 @@ export default { visible: true }, { - title: "Gültig_bis", + title: Vue.computed(() => this.$p.t('global/gueltigBis')), field: "Gültig_bis", headerFilter: true, resizable: true, @@ -74,7 +74,7 @@ export default { visible: true }, { - title: "Wochenstunden", + title: Vue.computed(() => this.$p.t('profil/wochenstunden')), field: "Wochenstunden", headerFilter: true, minWidth: 200, @@ -96,6 +96,9 @@ export default { 'data.funktionen'(newVal) { if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setData(newVal); }, + 'language.value'(newVal) { // reevaluates computed phrasen + if(this.$refs.funktionenTable) this.$refs.funktionenTable.tabulator.setColumns(this.funktionen_table_options.columns) + } }, computed: { getTelefonValue() { diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 14002a580..d841acc85 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -27536,6 +27536,66 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'profil', + 'phrase' => 'inventarnummer', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Inventarnummer', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'inventory number', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'profil', + 'phrase' => 'ausgabedatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ausgabedatum', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'issue date', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'profil', + 'phrase' => 'wochenstunden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Wochenstunden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'working hours', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), //Profil Phrasen ende //ProfilUpdate Phrasen start array( From 3a1055d87ea05524e72e83861be6a7d0e347db8e Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Fri, 14 Feb 2025 13:54:02 +0100 Subject: [PATCH 2/6] computed phrasen in column titles student profil for zutrittsgruppen/betriebsmittel; samilar to mitarbeiter profil --- .../js/components/Cis/Profil/StudentProfil.js | 51 +++++++++++++++---- 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 5b4609e5f..364feecd2 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -24,7 +24,7 @@ export default { FetchProfilUpdates, EditProfil, }, - inject: ["sortProfilUpdates", "collapseFunction"], + inject: ["sortProfilUpdates", "collapseFunction", "language"], data() { return { showModal: false, @@ -33,18 +33,27 @@ export default { // tabulator options zutrittsgruppen_table_options: { + persistenceID: "filterTableStudentProfilZutrittsgruppen", + persistence: { + columns: false + }, height: 200, layout: "fitColumns", - data: [{bezeichnung: ""}], - columns: [{title: "Zutritt", field: "bezeichnung"}], + columns: [{ + title: Vue.computed(() => this.$p.t('profil/zutrittsGruppen')), + field: "bezeichnung" + }], }, betriebsmittel_table_options: { + persistenceID: "filterTableStudentProfilBetriebsmittel", + persistence: { + columns: false + }, height: 300, layout: "fitColumns", responsiveLayout: "collapse", responsiveLayoutCollapseUseFormatters: false, responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, - data: [{betriebsmittel: "", Nummer: "", Ausgegeben_am: ""}], columns: [ { title: @@ -57,23 +66,26 @@ export default { headerClick: this.collapseFunction, }, { - title: "Betriebsmittel", + title: Vue.computed(() => this.$p.t('profil/entlehnteBetriebsmittel')), field: "betriebsmittel", headerFilter: true, minWidth: 200, + visible: true }, { - title: "Nummer", + title: Vue.computed(() => this.$p.t('profil/inventarnummer')), field: "Nummer", headerFilter: true, resizable: true, minWidth: 200, + visible: true }, { - title: "Ausgegeben_am", + title: Vue.computed(() => this.$p.t('profil/ausgabedatum')), field: "Ausgegeben_am", headerFilter: true, minWidth: 200, + visible: true }, ], }, @@ -92,9 +104,11 @@ export default { methods: { betriebsmittelTableBuilt: function () { + this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns) this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); }, zutrittsgruppenTableBuilt: function () { + this.$refs.zutrittsgruppenTable.tabulator.setColumns(this.zutrittsgruppen_table_options.columns) this.$refs.zutrittsgruppenTable.tabulator.setData( this.data.zuttritsgruppen ); @@ -212,6 +226,12 @@ export default { //? sorts the profil Updates: pending -> accepted -> rejected this.data.profilUpdates?.sort(this.sortProfilUpdates); }, + watch: { + 'language.value'(newVal) { + if(this.$refs.betriebsmittelTable) this.$refs.betriebsmittelTable.tabulator.setColumns(this.betriebsmittel_table_options.columns) + if(this.$refs.zutrittsgruppenTable) this.$refs.zutrittsgruppenTable.tabulator.setColumns(this.zutrittsgruppen_table_options.columns) + } + }, template: /*html*/ `
- +
- +
From 7fed1d231ca3c0dd2444f61ad307ac86ca269aed Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Fri, 14 Feb 2025 14:49:28 +0100 Subject: [PATCH 3/6] p.t( -> $p.t( in stundenplan & mylv components, added missing phrasen; WIP adding phrasen keys for noten, maybe for lva titles --- public/js/components/Calendar/Day/Page.js | 2 +- public/js/components/Cis/Mylv/LvMenu.js | 4 +- public/js/components/Cis/Mylv/LvModal.js | 2 +- .../Cis/Mylv/Semester/Studiengang/Lv.js | 7 ++-- public/js/components/Cis/Mylv/Student.js | 4 +- .../components/Cis/Stundenplan/Stundenplan.js | 10 ++--- .../components/DashboardWidget/Stundenplan.js | 4 +- system/phrasesupdate.php | 40 +++++++++++++++++++ 8 files changed, 57 insertions(+), 16 deletions(-) diff --git a/public/js/components/Calendar/Day/Page.js b/public/js/components/Calendar/Day/Page.js index 3d5cc5f02..70bccc49d 100644 --- a/public/js/components/Calendar/Day/Page.js +++ b/public/js/components/Calendar/Day/Page.js @@ -368,7 +368,7 @@ export default {
-

Keine Lehrveranstaltungen

+

{{ $p.t('lehre/noLvFound') }}

diff --git a/public/js/components/Cis/Mylv/LvMenu.js b/public/js/components/Cis/Mylv/LvMenu.js index e64dbd667..1183c6ff0 100644 --- a/public/js/components/Cis/Mylv/LvMenu.js +++ b/public/js/components/Cis/Mylv/LvMenu.js @@ -56,11 +56,11 @@ export default { }, }, template:/*html*/` -
No Menu available
+
{{$p.t('lehre','lehrveranstaltungsUnavailable')}}
diff --git a/public/js/components/Cis/Stundenplan/Stundenplan.js b/public/js/components/Cis/Stundenplan/Stundenplan.js index d35c9c536..8fc9b77d4 100644 --- a/public/js/components/Cis/Stundenplan/Stundenplan.js +++ b/public/js/components/Cis/Stundenplan/Stundenplan.js @@ -206,15 +206,15 @@ export const Stundenplan = {
-

Lehrveranstaltung:

+

{{ $p.t('lehre/lehrveranstaltung') }}:

{{event?.orig.topic}}

-

Lektor:

+

{{ $p.t('lehre/lektor') }}:

{{lektor.kurzbz}}

-

Ort:

+

{{ $p.t('profil/Ort') }}:

{{event?.orig.ort_kurzbz}}

@@ -224,11 +224,11 @@ export const Stundenplan = {
-

Lehrveranstaltungs Menu

+

{{$p.t('lehre','lehrveranstaltungsmenue')}}

` diff --git a/public/js/components/DashboardWidget/Stundenplan.js b/public/js/components/DashboardWidget/Stundenplan.js index bf4324f4a..7bb972590 100644 --- a/public/js/components/DashboardWidget/Stundenplan.js +++ b/public/js/components/DashboardWidget/Stundenplan.js @@ -192,11 +192,11 @@ export default {
- {{ p.t('lehre/noLvFound') }} + {{ $p.t('lehre/noLvFound') }}
- {{ p.t('lehre/noLvFound') }} + {{ $p.t('lehre/noLvFound') }}
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d841acc85..f34f32b9f 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -37237,6 +37237,46 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'lehrveranstaltungsmenue', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Lehrveranstaltungsmenü', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Course Menu', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'lehrveranstaltungsmenueUnavailable', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kein Lehrveranstaltungsmenü verfügbar', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'No Course Menu available', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'lehre', From 92ba4aea9a222ce16ba11bbe710764ce610b29a7 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 14 Feb 2025 14:53:19 +0100 Subject: [PATCH 4/6] return year as number not as string --- public/js/composables/CalendarDate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/composables/CalendarDate.js b/public/js/composables/CalendarDate.js index f2f8c93f0..e85cbeeac 100644 --- a/public/js/composables/CalendarDate.js +++ b/public/js/composables/CalendarDate.js @@ -71,9 +71,9 @@ class CalendarDate { } get wYear() { if( this.w === 1 ) { - return this.cdLastDayOfWeek.format({ year: 'numeric' }); + return this.cdLastDayOfWeek.y; } - return this.cdFirstDayOfWeek.format({ year: 'numeric' }); + return this.cdFirstDayOfWeek.y; } get wd() { if (this._wd === null) { @@ -271,4 +271,4 @@ CalendarDate.getWeekStart = function(locale) { } } -export default CalendarDate \ No newline at end of file +export default CalendarDate From b01400d21c91ee98b9963f83a65c6c1f6fd37844 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 14 Feb 2025 14:55:57 +0100 Subject: [PATCH 5/6] remove unused data declaration --- public/js/components/Calendar/Weeks.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/js/components/Calendar/Weeks.js b/public/js/components/Calendar/Weeks.js index 530cfe90e..844101b88 100644 --- a/public/js/components/Calendar/Weeks.js +++ b/public/js/components/Calendar/Weeks.js @@ -8,8 +8,6 @@ export default { 'size', 'focusDate' ], - data() { - }, computed: { weeks(){ return [...Array(this.focusDate.numWeeks).keys()].map(i => i + 1); From f6f06c4d5e7ea05dfa5fe4b36aebfeeb319713f1 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 14 Feb 2025 14:58:12 +0100 Subject: [PATCH 6/6] use attribute binding since value should be boolean --- public/js/components/Cis/Mylv/LvModal.js | 4 ++-- public/js/components/Cis/Profil/ProfilModal/EditProfil.js | 2 +- public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/components/Cis/Mylv/LvModal.js b/public/js/components/Cis/Mylv/LvModal.js index ee843ecb6..9c42e312f 100644 --- a/public/js/components/Cis/Mylv/LvModal.js +++ b/public/js/components/Cis/Mylv/LvModal.js @@ -68,7 +68,7 @@ export default { return BsModal.popup.bind(this)(null, options); }, template: /*html*/ ` - + `, -}; \ No newline at end of file +}; diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js index ba5702bc9..cbfde34be 100644 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js @@ -181,7 +181,7 @@ export default { return BsModal.popup(null, options); }, template: /*html*/ ` - +