Propagate search scope through advanced search interfaces
authorDan Scott <dscott@laurentian.ca>
Fri, 2 Dec 2011 04:01:24 +0000 (23:01 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 6 Dec 2011 16:17:00 +0000 (11:17 -0500)
If a user had a chosen search scope (via the CGI "loc" parameter), it
would be lost when switching to the advanced search interfaces. Now we
progagate the search scope through the advanced search interfaces.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/advanced.tt2
Open-ILS/src/templates/opac/parts/advanced/expert.tt2
Open-ILS/src/templates/opac/parts/advanced/numeric.tt2
Open-ILS/src/templates/opac/parts/advanced/search.tt2

index 217a069..db609d2 100644 (file)
@@ -1,14 +1,16 @@
-[%  PROCESS "opac/parts/header.tt2";
+[%-  PROCESS "opac/parts/header.tt2";
     WRAPPER "opac/parts/base.tt2";
     INCLUDE "opac/parts/topnav.tt2";
     ctx.page_title = l("Advanced Search");
-    pane = CGI.param("pane") || "advanced" %]
+    pane = CGI.param("pane") || "advanced";
+    loc = CGI.param("loc");
+-%]
     <div id="search-wrapper">
         <div id="adv_search_parent">
             <div id="adv_search_tabs">
-                <a href="?pane=advanced" [% IF pane == 'advanced' %]class="on" [% END %]id="adv_search">[% l('Advanced Search') %]</a>
-                <a href="?pane=numeric" [% IF pane == 'numeric' %]class="on" [% END %]id="num_search">[% l('Numeric Search') %]</a>
-                <a href="?pane=expert" [% IF pane == 'expert' %]class="on" [% END %]id="expert_search">[% l('Expert Search') %]</a>
+                <a href="?pane=advanced[% IF loc %];loc=[% loc %][% END %]" [% IF pane == 'advanced' %]class="on" [% END %]id="adv_search">[% l('Advanced Search') %]</a>
+                <a href="?pane=numeric[% IF loc %];loc=[% loc %][% END %]" [% IF pane == 'numeric' %]class="on" [% END %]id="num_search">[% l('Numeric Search') %]</a>
+                <a href="?pane=expert[% IF loc %];loc=[% loc %][% END %]" [% IF pane == 'expert' %]class="on" [% END %]id="expert_search">[% l('Expert Search') %]</a>
             </div>
         </div>
     </div>
index a3f8f01..24fbd1c 100644 (file)
@@ -1,6 +1,8 @@
+[% loc = CGI.param("loc") %]
 <form action="[% ctx.opac_root %]/results" method="GET">
     <div class="header_middle">[% l("Expert Search") %]</div>
     <input type="hidden" name="_special" value="1" />
+    [% IF loc %]<input type="hidden" name="loc" value="[% loc %]" />[% END %]
     <table class="expert-search">
         <tbody id="adv_expert_rows_here">
             <tr id="adv_expert_row">
index 3bcf4c8..7262801 100644 (file)
@@ -2,6 +2,7 @@
     <div class="header_middle">[% l("Numeric Search") %]</div>
     <input type="hidden" name="contains" value="contains" />
     <input type="hidden" name="_special" value="1" />
+    [% IF loc %]<input type="hidden" name="loc" value="[% loc %]" />[% END %]
     <table>
         <tr>
             <td>
index 1c28bb5..378b9f6 100644 (file)
@@ -67,7 +67,7 @@
                         <td valign='top'>
                             <strong>[% l("Search Library") %]</strong><br />
                             [% PROCESS "opac/parts/org_selector.tt2";
-                                PROCESS build_org_selector name='loc' value=loc %]
+                                PROCESS build_org_selector name='loc' value=CGI.param('loc') %]
                             <div style="position:relative;top:7px;">
                                 <input type='checkbox' name="modifier"
                                     value="available"[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %]