mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
fix SearchLib bug, add searchtypes config studentcis and active_organisationunit, use new searchtype in cis4 searchoptions and searchbar result rendering
This commit is contained in:
@@ -209,6 +209,20 @@ $config['student'] = [
|
||||
JOIN public.tbl_person p USING(person_id)"
|
||||
];
|
||||
|
||||
$config['studentcis'] = $config['student'];
|
||||
unset($config['studentcis']['fields']['email']);
|
||||
$config['studentcis']['resultfields'] = [
|
||||
"s.student_uid AS uid",
|
||||
"s.matrikelnr",
|
||||
"p.person_id",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"ARRAY[s.student_uid || '@' || '" . DOMAIN . "'] AS email",
|
||||
"CASE
|
||||
WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
|
||||
ELSE NULL END
|
||||
AS photo_url"
|
||||
];
|
||||
|
||||
$config['prestudent'] = [
|
||||
'primarykey' => 'prestudent_id',
|
||||
'table' => 'public.tbl_prestudent',
|
||||
@@ -652,6 +666,11 @@ $config['organisationunit'] = [
|
||||
ON (oe_parent.organisationseinheittyp_kurzbz = type_parent.organisationseinheittyp_kurzbz)"
|
||||
];
|
||||
|
||||
$config['active_organisationunit'] = $config['organisationunit'];
|
||||
$config['active_organisationunit']['alias'] = ['aou', 'aktive organisationseinheit', 'aoe'];
|
||||
$config['active_organisationunit']['prepare'] = 'active_organisationseinheit AS (SELECT * FROM public.tbl_organisationseinheit WHERE aktiv = true)';
|
||||
$config['active_organisationunit']['table'] = 'active_organisationseinheit';
|
||||
|
||||
$config['room'] = [
|
||||
'alias' => ['raum'],
|
||||
'primarykey' => 'ort_kurzbz',
|
||||
|
||||
@@ -668,8 +668,9 @@ class SearchLib
|
||||
SELECT " . $this->_formatPrimarykeys($table_config['primarykey']) . ", rank / " . $count . " AS rank FROM " . $current_select;
|
||||
}
|
||||
|
||||
if ($or_with[0] === "RECURSIVE") {
|
||||
if ($sqlWith[0] !== "RECURSIVE")
|
||||
if ($or_with[0] === "RECURSIVE")
|
||||
{
|
||||
if (empty($sqlWith) || $sqlWith[0] !== "RECURSIVE")
|
||||
array_unshift($sqlWith, "RECURSIVE");
|
||||
array_shift($or_with);
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ const app = Vue.createApp({
|
||||
calcheightonly: true,
|
||||
types: [
|
||||
"employee",
|
||||
"student",
|
||||
"studentcis",
|
||||
"room",
|
||||
"organisationunit"
|
||||
"active_organisationunit"
|
||||
],
|
||||
actions: {
|
||||
employee: {
|
||||
|
||||
@@ -98,12 +98,12 @@ export default {
|
||||
<div v-else-if="searchresult.length < 1">{{ $p.t('search/error_no_results') }}</div>
|
||||
<template v-else="" v-for="res in searchresult">
|
||||
<person v-if="res.type === 'person'" :res="res" :actions="searchoptions.actions.person" @actionexecuted="hideresult"></person>
|
||||
<student v-else-if="res.type === 'student' || res.type === 'studentStv'" :mode="searchmode" :res="res" :actions="searchoptions.actions.student" @actionexecuted="hideresult"></student>
|
||||
<student v-else-if="res.type === 'student' || res.type === 'studentStv' || res.type === 'studentcis'" :mode="searchmode" :res="res" :actions="searchoptions.actions.student" @actionexecuted="hideresult"></student>
|
||||
<prestudent v-else-if="res.type === 'prestudent'" :mode="searchmode" :res="res" :actions="searchoptions.actions.prestudent" @actionexecuted="hideresult"></prestudent>
|
||||
<merged-student v-else-if="res.type === 'mergedstudent'" :mode="searchmode" :res="res" :actions="searchoptions.actions.mergedstudent" @actionexecuted="hideresult"></merged-student>
|
||||
<merged-person v-else-if="res.type === 'mergedperson'" :mode="searchmode" :res="res" :actions="searchoptions.actions.mergedperson" @actionexecuted="hideresult"></merged-person>
|
||||
<employee v-else-if="res.type === 'mitarbeiter' || res.type === 'mitarbeiter_ohne_zuordnung' || res.type === 'employee' || res.type === 'unassigned_employee'" :res="res" :actions="searchoptions.actions.employee" @actionexecuted="hideresult"></employee>
|
||||
<organisationunit v-else-if="res.type === 'organisationunit'" :res="res" :actions="searchoptions.actions.organisationunit" @actionexecuted="hideresult"></organisationunit>
|
||||
<organisationunit v-else-if="res.type === 'organisationunit' || res.type === 'active_organisationunit'" :res="res" :actions="searchoptions.actions.organisationunit" @actionexecuted="hideresult"></organisationunit>
|
||||
<raum v-else-if="res.type === 'raum' || res.type === 'room'" :mode="searchmode" :res="res" :actions="searchoptions.actions.raum || searchoptions.actions.room" @actionexecuted="hideresult"></raum>
|
||||
<dms v-else-if="res.type === 'dms'" :res="res" :actions="searchoptions.actions.dms" @actionexecuted="hideresult"></dms>
|
||||
<cms v-else-if="res.type === 'cms'" :res="res" :actions="searchoptions.actions.cms" @actionexecuted="hideresult"></cms>
|
||||
|
||||
Reference in New Issue
Block a user