From 1985c8c0f648de38af415d0e0f5794d989b8171f Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Fri, 3 Aug 2012 11:34:05 -0400 Subject: [PATCH] Expose ability to use filter groups in TPac Via config options for basic and advanced search. Signed-off-by: Thomas Berezansky Signed-off-by: Dan Scott --- .../src/templates/opac/parts/advanced/search.tt2 | 3 +++ Open-ILS/src/templates/opac/parts/config.tt2 | 16 ++++++++++++++++ Open-ILS/src/templates/opac/parts/searchbar.tt2 | 9 +++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 index 4328086a41..5af1d2ed36 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 @@ -87,6 +87,9 @@ ELSIF adv_chunk.adv_attr; INCLUDE "opac/parts/coded_value_selector.tt2" attr=adv_chunk.adv_attr multiple="multiple" size="4"; + ELSIF adv_chunk.adv_filter; + INCLUDE "opac/parts/filter_group_selector.tt2" + filter_group=adv_chunk.adv_filter multiple="multiple" size="4"; END; %] [% diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index f23ef4d492..2985f1fef8 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -83,6 +83,7 @@ facet.display = [ # adv_label is the (translated) label for the limiter # adv_attr is an array of possible limiters, the first one that has any # values will be used +# adv_filter is the same as adv_attr, but for search filter groups # adv_break will end the current row. If specified with a label/attr it # will do so *after* that limiter. # adv_special will drop in a special entry: @@ -111,4 +112,19 @@ search.adv_config = [ search.default_qtypes = ['keyword','title','author']; +############################################################################## +# Basic Search Box definition +# This allows selection of what, exactly, basic search uses for a selection +# box. Previously it was hardcoded to use an attr box of mattype or item_type. +# +# type can be "attr" or "filter" +# group is the attr or filter entries you want to check for +# none_label is the label for the default nothing selected entry. + +search.basic_config = { + type => 'attr', + group => ['mattype','item_type'], + none_label => l("All Formats"), +}; + %] diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index d20d36bbda..b75752f19a 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -10,8 +10,13 @@ class="adv_search_font">[% l('Advanced Search') %]