use uselanguge when searching cms content, remove flags from cms content results, use cms and dms searchtypes in cis4

This commit is contained in:
Harald Bamberger
2025-07-14 15:51:42 +02:00
parent 3ed2bb4d78
commit 7aa074cdf6
4 changed files with 31 additions and 27 deletions
+3 -2
View File
@@ -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'] = [
+27 -2
View File
@@ -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: []
}
}
}
};
@@ -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 '<a href="' + url + '">' + url + '</a>';
},
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')"
>
<img v-if="flag" :src="flag" class="ms-2">
<div v-if="preview" class="searchbar_table" v-html="preview"></div>
<div v-else class="searchbar_table text-muted">
{{ $p.t('search/result_content_none') }}
+1 -16
View File
@@ -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){