From: Bill Erickson Date: Wed, 23 May 2012 15:44:28 +0000 (-0400) Subject: kpac : global filter config option X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=44b7d0f4368ca37022ae66e353e6dfe0bb89495f;p=evergreen%2Fequinox.git kpac : global filter config option Allows for configuration of an always-on global search filter. All searches, regardless of origin, in the kpac will be appended by this filter when configured. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/kpac.xml.example b/Open-ILS/examples/kpac.xml.example index d2f9c67172..fde9883967 100644 --- a/Open-ILS/examples/kpac.xml.example +++ b/Open-ILS/examples/kpac.xml.example @@ -1,4 +1,13 @@ + + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index e4e23e5757..4c05ec70be 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -53,6 +53,8 @@ sub _prepare_biblio_search { my $query = _prepare_biblio_search_basics($cgi) || ''; + $query .= ' ' . $ctx->{global_search_filter} if $ctx->{global_search_filter}; + foreach ($cgi->param('modifier')) { # The unless bit is to avoid stacking modifiers. $query = ('#' . $_ . ' ' . $query) unless $query =~ qr/\#\Q$_/; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm index 85269d39cd..2f0e49eb82 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGKPacLoader.pm @@ -242,6 +242,7 @@ sub load_kpac_config { $ctx->{kpac_config} = $kpac_config; $ctx->{kpac_root} = $ctx->{base_path} . "/kpac"; $ctx->{home_page} = 'http://' . $self->apache->hostname . $ctx->{kpac_root} . "/home"; + $ctx->{global_search_filter} = $kpac_config->{global_filter}; }