From 71330c861fd025f81e7150b770e28f16114493a7 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 17 Feb 2011 15:15:33 -0500 Subject: [PATCH] basic search classes work (except cn) Not sure what would happen on a KCLS environment. Need to test. bibcn nor cn do what I mean in my dev environment. --- .../lib/OpenILS/WWW/EGCatLoader/Search.pm | 5 ++++ .../opac/parts/advanced/global_row.tt2 | 13 +++------- .../default/opac/parts/stypes_selector.tt2 | 24 ++++++++++++------- 3 files changed, 23 insertions(+), 19 deletions(-) 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 ad9526a992..2d826cd30d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -23,6 +23,7 @@ sub load_rresults { my $item_type = $cgi->param('item_type'); my $facet = $cgi->param('facet'); my $query = $cgi->param('query'); + my $search_class = $cgi->param('class'); my $limit = $cgi->param('limit') || 10; # TODO user settings my $loc = $cgi->param('loc') || $ctx->{aou_tree}->()->id; @@ -35,6 +36,10 @@ sub load_rresults { }; $query = "$query $facet" if $facet; # TODO + # XXX Since open-ils.search is a public service, it is responsible for + # being wary of injection/bad input, not us, right? + $query = $search_class . ':' . $query if $search_class; + my $results; try { diff --git a/Open-ILS/web/templates/default/opac/parts/advanced/global_row.tt2 b/Open-ILS/web/templates/default/opac/parts/advanced/global_row.tt2 index dd413b70dd..941cf7cc73 100644 --- a/Open-ILS/web/templates/default/opac/parts/advanced/global_row.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/advanced/global_row.tt2 @@ -1,15 +1,9 @@ - - + + [% INCLUDE "default/opac/parts/stypes_selector.tt2" %] + - - - - - - +[% search_classes = [ + {value => "", label => l("Keyword")}, + {value => "title", label => l("Title")}, + {value => "author", label => l("Author")}, + {value => "subject", label => l("Subject")}, + {value => "series", label => l("Series")}, + {value => "cn", label => l("Call Number")} # XXX or should this be bibcn? +] %] + - -- 2.43.2