From fcf803484d06972d4000795f94d7e4b8eda2b16a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 30 Sep 2011 12:19:35 -0400 Subject: [PATCH] TPac: propagate searches to advanced search page The link that takes users to the advanced searc page now propagates any existing (well, all) search URL params. The change required some minor augmentation to the code that builds the advanced search form. Signed-off-by: Bill Erickson --- Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 | 13 +++++++++++++ Open-ILS/src/templates/opac/parts/searchbar.tt2 | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 index 1598b69346..66ecea427e 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/global_row.tt2 @@ -9,6 +9,19 @@ queries = CGI.param('query'); bools = CGI.param('bool') || ['and' x 3]; qtypes = CGI.param('qtype') || ['keyword' x 3]; + + IF !qtypes.0; # not an array + qtypes = [qtypes]; + bools = [bools]; + queries = [queries]; + END; + + WHILE qtypes.size < 3; + qtypes.push('keyword'); + bools.push('and'); + queries.push(''); + END; + FOR qtype IN qtypes; c = contains.shift; b = bools.shift; diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 1f1f0a8303..79213d2a53 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -7,7 +7,7 @@ [% l('Search the Catalog') %] - [% l('Advanced Search') %] -- 2.11.0