diff --git a/application/config/search.php b/application/config/search.php index 3a2c27a18..e4876ec8f 100644 --- a/application/config/search.php +++ b/application/config/search.php @@ -516,7 +516,10 @@ $config['unassigned_employee']['prepare'] = "unassigned_employee AS ( WHERE tbl_benutzerfunktion.bezeichnung IS NULL )"; $config['unassigned_employee']['table'] = "unassigned_employee"; -$config['unassigned_employee']['searchfields']['tel']['join']['on'] = "kontakttyp = 'telefon' AND tbl_kontakt.standort_id = unassigned_employee.standort_id"; +$config['unassigned_employee']['searchfields']['tel']['join']['on'] = " + kontakttyp = 'telefon' + AND tbl_kontakt.standort_id = unassigned_employee.standort_id +"; $config['organisationunit'] = [ 'alias' => ['ou', 'organisationseinheit', 'oe'], @@ -722,7 +725,11 @@ $config['cms'] = [ 'content' => [ 'alias' => ['inhalt'], 'comparison' => "vector", - 'field' => "(setweight(to_tsvector('simple', COALESCE(titel, '')), 'A') || setweight(to_tsvector('simple', COALESCE(content, '')::text), 'B'))" + 'field' => "( + setweight(to_tsvector('simple', COALESCE(titel, '')), 'A') + || + setweight(to_tsvector('simple', COALESCE(content, '')::text), 'B') + )" ], 'content_id' => [ 'alias' => ['id'], diff --git a/public/js/components/searchbar/searchbar.js b/public/js/components/searchbar/searchbar.js index 362a96bb9..1bfb26032 100644 --- a/public/js/components/searchbar/searchbar.js +++ b/public/js/components/searchbar/searchbar.js @@ -131,7 +131,7 @@ export default { `, watch:{ - 'searchsettings.searchstr': function (newSearchValue, oldSearchValue) { + 'searchsettings.searchstr': function (newSearchValue) { if(this.searchoptions.origin){ sessionStorage.setItem(`${this.searchoptions.origin}_searchstr`,newSearchValue); } @@ -159,7 +159,7 @@ export default { .catch(this.$fhcAlert.handleSystemError); }, beforeMount: function() { - this.$watch('searchsettings.types', (newValue, oldValue) => { + this.$watch('searchsettings.types', newValue => { if (Array.isArray(newValue) && newValue.length === 0){ this.searchsettings.types = this.allSearchTypes(); } diff --git a/system/dbupdate_3.4/40128_search.php b/system/dbupdate_3.4/40128_search.php index 8ca0fd246..f207d77dd 100644 --- a/system/dbupdate_3.4/40128_search.php +++ b/system/dbupdate_3.4/40128_search.php @@ -37,9 +37,15 @@ if (!$db->db_num_rows(@$db->db_query("SELECT 1 FROM pg_proc WHERE proname = 'tr_ $$ BEGIN IF TG_TABLE_NAME = 'tbl_organisationseinheit' THEN - NEW.fts_bezeichnung := to_tsvector('simple', COALESCE((SELECT bezeichnung FROM public.tbl_organisationseinheittyp WHERE organisationseinheittyp_kurzbz = NEW.organisationseinheittyp_kurzbz), '') || ' ' || COALESCE(NEW.bezeichnung, '')); + NEW.fts_bezeichnung := to_tsvector('simple', COALESCE(( + SELECT bezeichnung + FROM public.tbl_organisationseinheittyp + WHERE organisationseinheittyp_kurzbz = NEW.organisationseinheittyp_kurzbz + ), '') || ' ' || COALESCE(NEW.bezeichnung, '')); ELSIF TG_TABLE_NAME = 'tbl_organisationseinheittyp' THEN - UPDATE public.tbl_organisationseinheit SET fts_bezeichnung = to_tsvector('simple', COALESCE(NEW.bezeichnung, '') || ' ' || COALESCE(bezeichnung, '')) WHERE organisationseinheittyp_kurzbz = NEW.organisationseinheittyp_kurzbz; + UPDATE public.tbl_organisationseinheit + SET fts_bezeichnung = to_tsvector('simple', COALESCE(NEW.bezeichnung, '') || ' ' || COALESCE(bezeichnung, '')) + WHERE organisationseinheittyp_kurzbz = NEW.organisationseinheittyp_kurzbz; END IF; RETURN NEW; END; @@ -53,7 +59,13 @@ if (!$db->db_num_rows(@$db->db_query("SELECT 1 FROM pg_proc WHERE proname = 'tr_ $update_column = false; // Add trigger tr_organisationseinheit_update_organisationseinheittyp_kurzbz to public.tbl_organisationseinheit -if (!$db->db_num_rows(@$db->db_query("SELECT 1 FROM information_schema.triggers WHERE event_object_table ='tbl_organisationseinheit' AND trigger_name = 'tr_organisationseinheit_update_organisationseinheittyp_kurzbz' LIMIT 1;"))) +if (!$db->db_num_rows(@$db->db_query(" + SELECT 1 + FROM information_schema.triggers + WHERE event_object_table ='tbl_organisationseinheit' + AND trigger_name = 'tr_organisationseinheit_update_organisationseinheittyp_kurzbz' + LIMIT 1; +"))) { $qry = "CREATE TRIGGER tr_organisationseinheit_update_organisationseinheittyp_kurzbz BEFORE UPDATE OF organisationseinheittyp_kurzbz OR INSERT @@ -70,7 +82,13 @@ if (!$db->db_num_rows(@$db->db_query("SELECT 1 FROM information_schema.triggers } // Add trigger tr_organisationseinheittyp_update_bezeichnung to public.tbl_organisationseinheittyp -if (!$db->db_num_rows(@$db->db_query("SELECT 1 FROM information_schema.triggers WHERE event_object_table ='tbl_organisationseinheittyp' AND trigger_name = 'tr_organisationseinheittyp_update_bezeichnung' LIMIT 1;"))) +if (!$db->db_num_rows(@$db->db_query(" + SELECT 1 + FROM information_schema.triggers + WHERE event_object_table ='tbl_organisationseinheittyp' + AND trigger_name = 'tr_organisationseinheittyp_update_bezeichnung' + LIMIT 1; +"))) { $qry = "CREATE TRIGGER tr_organisationseinheittyp_update_bezeichnung BEFORE UPDATE OF bezeichnung @@ -176,7 +194,10 @@ FROM pg_indexes WHERE indexname = 'idx_tbl_contentsprache_fts_titel_content_vect $qry = " CREATE INDEX idx_tbl_contentsprache_fts_titel_content_vector ON campus.tbl_contentsprache - USING GIN ((setweight(to_tsvector('simple', COALESCE(titel, '')), 'A') || setweight(to_tsvector('simple', COALESCE(content, '')::text), 'B'))); + USING GIN (( + setweight(to_tsvector('simple', COALESCE(titel, '')), 'A') + || setweight(to_tsvector('simple', COALESCE(content, '')::text), 'B') + )); "; if (!$db->db_query($qry)) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index bd674e514..88ef35fff 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -42565,7 +42565,9 @@ and represent the current state of research on the topic. The prescribed citatio 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Such-Konfiguration $config["{type}"]["searchfields"]["{searchfield}"] ist ungültig: Feld "{field}" fehlt oder ist unglültig.', + 'text' => 'Such-Konfiguration ' . + '$config["{type}"]["searchfields"]["{searchfield}"] ' . + 'ist ungültig: Feld "{field}" fehlt oder ist unglültig.', 'description' => '', 'insertvon' => 'system' ),