LP#1519055: Make electronic search filter optional
authorJake Litrell <jake@masslnc.org>
Fri, 26 Feb 2016 23:41:40 +0000 (18:41 -0500)
committerBen Shum <ben@evergreener.net>
Wed, 2 Mar 2016 02:22:58 +0000 (21:22 -0500)
Making checkboxes configurable, and off by default.  Release notes updated.

Signed-off-by: Jake Litrell <jake@masslnc.org>
Signed-off-by: Ben Shum <ben@evergreener.net>
Open-ILS/src/templates/opac/parts/advanced/search.tt2
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/results.tt2
docs/RELEASE_NOTES_NEXT/OPAC/exclude-electronic-limiter.adoc

index dd08cd2..79ae4c4 100644 (file)
                                         <option value="[% opt.code %]"[% CGI.param('pubdate') == opt.code ? ' selected="selected"' : '' %]>[% opt.label | html %]</option>
                                     [%  END %]
                             </select>
+                            [% IF !ctx.exclude_electronic_checkbox %]
                             <br/>
                             <div id='adv_special_block'>
+                            [% END %]
                                 <input title="[% l('Search date') %]"
                                   name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
                                    [% l("and") %] <input name='date2'
                                     title="[% l('Secondary search date') %]" type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
                                 </span>
+                            [% IF !ctx.exclude_electronic_checkbox %]
                             </div>
+                            [% END %]
+                            [% IF ctx.exclude_electronic_checkbox %]
                             <div class="adv_search_available">
                                 <input type='checkbox' name="fi:-search_format" value="electronic"
                                 [%- CGI.param('fi:-search_format').grep('electronic').size ?
                                     [% l("Exclude Electronic Resources") %]
                                 </label>
                             </div>
+                            [% END %]
 [%
                 CASE "sort_selector";
                     INCLUDE "opac/parts/filtersort.tt2"
index a95e54d..58d2c09 100644 (file)
@@ -192,6 +192,12 @@ ctx.depth_sel_tooltip = l('Select this option to expand your results to all libr
 ctx.depth_sel_resultshint = l('Showing results from all libraries');
 
 ##############################################################################
+# Exclude Electronic Resources Checkbox
+# One setting for both the advanced search page and the results bar.
+# Off by default; set to 1 to display.
+ctx.exclude_electronic_checkbox = 0;
+
+##############################################################################
 # Metarecords configuration
 # metarecords.disabled = 1; # disable all metarecord access points
 ##############################################################################
index 284fbb9..a89c7bf 100644 (file)
                     -%]
                         <input type="hidden" name="detail_record_view" value="1" />
                     [% END %]
+                    [% IF ctx.exclude_electronic_checkbox %]
                     <label class="results_header_lbl" for='opac.result.excludeelec'>
                         <input type='checkbox' id='opac.result.excludeelec' name="fi:-search_format" value="electronic"
                             onchange="exclude_onchange(this)"
                             [%- CGI.param('fi:-search_format').grep('electronic').size ? ' checked="checked"' : '' %] />
                         [% l("Exclude Electronic Resources") %]
                     </label>
+                    [% END %]
             </div>
         </div>
     </div>
index 5ba2378..302c69b 100644 (file)
@@ -5,3 +5,5 @@ on the advanced search screen and from the search results page. This limiter
 will exclude any search results with an item form of o or s. This limiter
 will be applied on top of any other format limiters used in the search.
 
+The checkboxes are disabled by default; to display them in both places, please
+toggle the 'ctx.exclude_electronic_checkbox' setting in config.tt2.