diff --git a/application/config/search.php b/application/config/search.php index b4fd4a42b..ea07f6e1c 100644 --- a/application/config/search.php +++ b/application/config/search.php @@ -705,7 +705,7 @@ $config['room'] = [ LEFT JOIN public.tbl_adresse address USING (adresse_id)" ]; - +$sprache = getUserLanguage(); $config['cms'] = [ 'primarykey' => 'contentsprache_id', 'table' => 'campus.tbl_contentsprache', @@ -785,7 +785,8 @@ $config['cms'] = [ SELECT content_id FROM cms_active_others ) - AND version = campus.get_highest_content_version(content_id)" + AND version = campus.get_highest_content_version(content_id) + AND contentsprache.sprache = '{$sprache}'" ]; $config['dms'] = [ diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index 994efbec8..dc32511c1 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -19,7 +19,9 @@ const app = Vue.createApp({ "employee", "studentcis", "room", - "active_organisationunit" + "active_organisationunit", + "cms", + "dms" ], actions: { employee: { @@ -105,7 +107,30 @@ const app = Vue.createApp({ } }, childactions: [] - } + }, + cms: { + defaultaction: { + type: "link", + action: function (data) { + const link = FHC_JS_DATA_STORAGE_OBJECT.app_root + + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + '/CisVue/Cms/content/' + data.content_id; + return link; + } + }, + childactions: [] + }, + dms: { + defaultaction: { + type: "link", + action: function (data) { + const link = FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'cms/dms.php?id=' + data.dms_id; + return link; + } + }, + childactions: [] + } } } }; diff --git a/public/js/components/searchbar/result/cms.js b/public/js/components/searchbar/result/cms.js index 591c7e79c..5eebc3826 100644 --- a/public/js/components/searchbar/result/cms.js +++ b/public/js/components/searchbar/result/cms.js @@ -10,7 +10,6 @@ export default { actions: Object }, inject: [ - 'languages', 'query' ], computed: { @@ -56,11 +55,6 @@ export default { else if (url.substr(0, 3) == '../') url = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/\/+$/, '') + url.substr(2); return '' + url + ''; - }, - flag() { - if (!this.languages || !this.languages[this.res.language]) - return ""; - return "data:image/jpeg;base64," + this.languages[this.res.language].flagge; } }, template: ` @@ -72,7 +66,6 @@ export default { image-fallback="fas fa-newspaper fa-4x" @actionexecuted="$emit('actionexecuted')" > -
{{ $p.t('search/result_content_none') }} diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index ec08dd178..09dab9ece 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -9,13 +9,10 @@ import cms from "./result/cms.js"; import mergedStudent from "./result/mergedstudent.js"; import mergedPerson from "./result/mergedperson.js"; -import ApiLanguage from "../../api/factory/language.js" - export default { props: [ "searchoptions", "searchfunction" ], provide() { return { - languages: Vue.computed(() => this.languages), query: Vue.computed(() => this.lastQuery) }; }, @@ -33,8 +30,7 @@ export default { searching: false, error: null, abortController: null, - settingsDropdown:null, - languages: null, + settingsDropdown: null, lastQuery: '' }; }, @@ -147,17 +143,6 @@ export default { }, }, - created() { - this.$api - .call(ApiLanguage.getAll()) - .then(result => { - this.languages = result.data.reduce((a, c) => { - a[c.sprache] = c; - return a; - }, {}); - }) - .catch(this.$fhcAlert.handleSystemError); - }, beforeMount: function() { this.$watch('searchsettings.types', newValue => { if (Array.isArray(newValue) && newValue.length === 0){