From fe4351fc8729fa9b8673b15a14193451b62113b6 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Tue, 11 Feb 2025 11:23:50 +0100 Subject: [PATCH] lv info ort content link when content_id was expanded --- .../controllers/api/frontend/v1/Stundenplan.php | 17 +++++++++++++++++ public/js/components/Cis/Mylv/LvInfo.js | 3 +-- public/js/composables/CalendarDate.js | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/application/controllers/api/frontend/v1/Stundenplan.php b/application/controllers/api/frontend/v1/Stundenplan.php index 249f0fb3c..0a56dac71 100644 --- a/application/controllers/api/frontend/v1/Stundenplan.php +++ b/application/controllers/api/frontend/v1/Stundenplan.php @@ -278,6 +278,23 @@ class Stundenplan extends FHCAPI_Controller $gruppe_obj_array[] = $lv_gruppe_object; } + + if($item->ort_kurzbz) { + + $ort_content_object = $this->StundenplanModel->execReadOnlyQuery(" + SELECT content_id + FROM public.tbl_ort + WHERE ort_kurzbz = ?", [$item->ort_kurzbz]); + if (isError($ort_content_object)) { + $this->show_error(getError($ort_content_object)); + } + $ort_content_object = getData($ort_content_object)[0]; + if($ort_content_object) { + $item->ort_content_id = $ort_content_object->content_id; + } + + + } $item->gruppe = $gruppe_obj_array; $item->lektor = $lektor_obj_array; diff --git a/public/js/components/Cis/Mylv/LvInfo.js b/public/js/components/Cis/Mylv/LvInfo.js index e140a1a0b..df82f5cca 100644 --- a/public/js/components/Cis/Mylv/LvInfo.js +++ b/public/js/components/Cis/Mylv/LvInfo.js @@ -24,8 +24,7 @@ export default { { if (!this.event || !this.event.ort_content_id) return "a"; - // TODO: define/build link with content_id and/or roomname - // return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + `/CisVue/cms/content/${this.event.ort_content_id}` + return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + `/CisVue/Cms/content/${this.event.ort_content_id}` }, start_time: function () { if (!this.event.start) return 'N/A'; diff --git a/public/js/composables/CalendarDate.js b/public/js/composables/CalendarDate.js index 77dc07128..f2f8c93f0 100644 --- a/public/js/composables/CalendarDate.js +++ b/public/js/composables/CalendarDate.js @@ -3,7 +3,7 @@ import CalendarDates from "./CalendarDates.js"; const monthDayRanges = [] for(let i = 1; i < 13; i++) { - monthDayRanges.push(new Date(new Date(Date.now).getFullYear(), i, 0).getDate()) + monthDayRanges.push(new Date(new Date(Date.now()).getFullYear(), i, 0).getDate()) } class CalendarDate {