use renderers in search config

This commit is contained in:
chfhtw
2025-07-29 16:07:15 +02:00
parent 7726850193
commit 30b895ad04
5 changed files with 42 additions and 31 deletions
+3
View File
@@ -225,6 +225,7 @@ $config['studentcis']['resultfields'] = [
AS photo_url",
"b.aktiv"
];
$config['studentcis']['renderer'] = 'student';
$config['prestudent'] = [
'primarykey' => 'prestudent_id',
@@ -538,6 +539,7 @@ $config['unassigned_employee']['searchfields']['tel']['join']['on'] = "
kontakttyp = 'telefon'
AND tbl_kontakt.standort_id = unassigned_employee.standort_id
";
$config['unassigned_employee']['renderer'] = 'employee';
$config['organisationunit'] = [
'alias' => ['ou', 'organisationseinheit', 'oe'],
@@ -674,6 +676,7 @@ $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['active_organisationunit']['renderer'] = 'organisationunit';
$config['room'] = [
'alias' => ['raum'],
+2
View File
@@ -231,8 +231,10 @@ class SearchLib
GROUP BY " . $this->_formatPrimarykeys($table_config['primarykey']) . "
)";
$renderer = $table_config['renderer'] ?? $type;
$selects[] = "
SELECT
" . $this->_ci->db->escape($renderer) . " AS renderer,
" . $this->_ci->db->escape($type) . " AS type,
rank,
TO_JSONB((SELECT x FROM (SELECT " . implode(", ", $table_config['resultfields'] ?? ['*']) . ") x)) AS data