LP#1671635: Maintain search parameters throughout place hold process
authorKathy Lussier <klussier@masslnc.org>
Fri, 22 Sep 2017 19:18:12 +0000 (15:18 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 7 Nov 2017 19:33:58 +0000 (14:33 -0500)
Add hidden fields to the Place Hold form for the search query, type
and locg fields so that they will appear correctly in the search bar
on the holds confirmation page. This commit also keeps the query
parameter in the URL after clicking the Place Hold link from the search
results page.

Test Plan:
Log into the public catalog and perform a search that is limited to a library
that differs from the user's preferred search library and using a search type
that is not keyword (e.g. title or author). Place a hold on any title from
either the search results or record page. After submitting the form, look
at the search parameters in the search bar on the hold confirmation page.

Pre-patch, the query terms will not appear, the search type will revert back
to the default of keyword, and the search library will be the user's preferred
search library.

Post-patch, the query parameters will be maintained in the search bar.

Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

index 73192ba..fc59a0d 100644 (file)
@@ -54,6 +54,12 @@ function toggleActivationDate() {
         <input type="hidden" name="redirect_to" value="[% redirect | html %]" />
         <input type="hidden" name="hold_source_page" value="[% CGI.param('hold_source_page') | html %]" />
+        <!-- Adding hidden fields so that parameters are maintained in
+        searchbar throughout the place hold process. -->
+        <input type="hidden" name="locg" value="[% CGI.param('locg') %]" />
+        <input type="hidden" name="qtype" value="[% CGI.param('qtype') %]" />
+        <input type="hidden" name="query" value="[% CGI.param('query') %]" />
             usr_barcode = CGI.param('usr_barcode') | html;
             is_requestor = CGI.param('is_requestor');
index f9e710f..5ab8e9a 100644 (file)
@@ -389,7 +389,7 @@ END;
                                                         <div class="results_aux_utils place_hold"><a
                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold',
                                                                     {hold_target => rec.id, hold_type => hold_type, 
-                                                                      hold_source_page => mkurl()}, ['query','tag','subfield','term','_special','sort','page']) %]"
+                                                                      hold_source_page => mkurl()}, ['tag','subfield','term','_special','sort','page']) %]"
                                                                 [% html_text_attr('title', l('Place Hold on [_1]', attrs.title)) %]
                                                                     class="no-dec" rel="nofollow" vocab=""><img
                                                                 src="[% ctx.media_prefix %]/images/green_check.png[% ctx.cache_key %]"