From: Dan Scott Date: Thu, 12 Jul 2012 03:37:11 +0000 (-0400) Subject: Add Journal Title search to stock TPAC filters X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f53eaa32982199c2f87e40d32c987485afc8f6fd;p=working%2FEvergreen.git Add Journal Title search to stock TPAC filters Academics need access to a quick and easy Journal Title search, this gives it to them. Due to the requirement to combine search index + bib level, we define a special search index that can then be acted upon accordingly. Signed-off-by: Dan Scott --- 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..7d104d8185 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -25,6 +25,12 @@ sub _prepare_biblio_search_basics { next unless $query =~ /\S/; + # Hack for journal title + my $q = $qtype; + if ($q eq 'jtitle') { + $qtype = 'title'; + } + # This stuff probably will need refined or rethought to better handle # the weird things Real Users will surely type in. $contains = "" unless defined $contains; # silence warning @@ -41,6 +47,11 @@ sub _prepare_biblio_search_basics { } $query = "$qtype:$query" unless $qtype eq 'keyword' and $i == 0; + # Hack for journal title - completed! + if ($q eq 'jtitle') { + $query = "bib_level:s $query"; + } + $bool = ($bool and $bool eq 'or') ? '||' : '&&'; $full_query = $full_query ? "($full_query $bool $query)" : $query; } diff --git a/Open-ILS/src/templates/opac/parts/qtype_selector.tt2 b/Open-ILS/src/templates/opac/parts/qtype_selector.tt2 index 98567d4ce6..278111bc09 100644 --- a/Open-ILS/src/templates/opac/parts/qtype_selector.tt2 +++ b/Open-ILS/src/templates/opac/parts/qtype_selector.tt2 @@ -1,6 +1,7 @@ [% query_types = [ {value => "keyword", label => l("Keyword")}, {value => "title", label => l("Title")}, + {value => "jtitle", label => l("Journal Title")}, {value => "author", label => l("Author")}, {value => "subject", label => l("Subject")}, {value => "series", label => l("Series")},