diff --git a/application/config/search.php b/application/config/search.php index 451ae656d..220d5e435 100644 --- a/application/config/search.php +++ b/application/config/search.php @@ -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'], diff --git a/application/libraries/SearchLib.php b/application/libraries/SearchLib.php index 0c942c436..659e5e78c 100644 --- a/application/libraries/SearchLib.php +++ b/application/libraries/SearchLib.php @@ -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 diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index dc32511c1..65ee6c45a 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -45,7 +45,7 @@ const app = Vue.createApp({ }, childactions: [] }, - raum: { + room: { defaultaction: { type: "link", renderif: function(data) { diff --git a/public/js/components/Stv/Studentenverwaltung.js b/public/js/components/Stv/Studentenverwaltung.js index 13a0369ba..c7a4ce15a 100644 --- a/public/js/components/Stv/Studentenverwaltung.js +++ b/public/js/components/Stv/Studentenverwaltung.js @@ -100,7 +100,7 @@ export default { childactions: [ ] }, - mergedperson: { + mergedPerson: { defaultaction: { type: "link", action: data => this.$fhcApi.getUri('/studentenverwaltung/person/' + data.person_id) diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index 09dab9ece..0b30bd12f 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -1,5 +1,5 @@ import person from "./result/person.js"; -import raum from "./result/room.js"; +import room from "./result/room.js"; import employee from "./result/employee.js"; import organisationunit from "./result/organisationunit.js"; import student from "./result/student.js"; @@ -34,19 +34,19 @@ export default { lastQuery: '' }; }, - components: { - person: person, - raum: raum, - employee: employee, - organisationunit: organisationunit, - student: student, - prestudent: prestudent, - dms, - cms, - mergedStudent, - mergedPerson - }, - template: /*html*/` + components: { + person, + room, + employee, + organisationunit, + student, + prestudent, + dms, + cms, + mergedStudent, + mergedPerson + }, + template: /*html*/`