From dfc8fdf44fbf1f137e662d7401c6a5ce18b6b740 Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Thu, 23 Apr 2026 17:33:55 +0200 Subject: [PATCH] added missing action buttons to search results --- public/js/apps/Cis/Menu.js | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/public/js/apps/Cis/Menu.js b/public/js/apps/Cis/Menu.js index a8779e32f..b05e68ee5 100644 --- a/public/js/apps/Cis/Menu.js +++ b/public/js/apps/Cis/Menu.js @@ -1,8 +1,9 @@ import FhcSearchbar from "../../components/searchbar/searchbar.js"; import CisMenu from "../../components/Cis/Menu.js"; import PluginsPhrasen from '../../plugins/Phrasen.js'; -import ApiSearchbar from '../../api/factory/searchbar.js'; import Theme from "../../plugins/Theme.js"; +import ApiSearchbar from '../../api/factory/searchbar.js'; +import ApiLvPlan from "../../api/factory/lvPlan.js"; const app = Vue.createApp({ name: 'CisMenuApp', @@ -152,7 +153,37 @@ const app = Vue.createApp({ searchfunction: function(searchsettings) { return this.$api.call(ApiSearchbar.searchCis(searchsettings)); } - } + }, + async mounted() { + const openOtherLvPlanAction = { + label: Vue.computed(() => this.$p.t("lehre/stundenplan")), + icon: "fas fa-calendar-days", + type: "link", + action: function (data) { + const uid = JSON.parse(data.data).uid; + const link = + FHC_JS_DATA_STORAGE_OBJECT.app_root + + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + "/Cis/OtherLvPlan/" + + uid; + return link; + }, + }; + let checkPermissionOtherLvPlanResult = await this.$api.call( + ApiLvPlan.checkPermissionOtherLvPlan(), + ); + if ( + checkPermissionOtherLvPlanResult.meta.status === "success" && + checkPermissionOtherLvPlanResult.data + ) { + this.searchbaroptions.actions.employee.childactions.push( + openOtherLvPlanAction, + ); + this.searchbaroptions.actions.student.childactions.push( + openOtherLvPlanAction, + ); + } + }, }); FhcApps.makeExtendable(app);