LP#1930933: fix issue with over-escaping in search results title attributes
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / advanced / search.tt2
1 [%
2     PROCESS "opac/parts/misc_util.tt2";
3     PROCESS get_library;
4 %]
5 <form action="[% ctx.opac_root %]/results" method="get">
6 <div id='adv_global_search' class='data_grid data_grid_center'>
7     <div id='adv_search_rows'>
8         <!-- Contains the user-addable(?) rows to define search class, containment and text -->
9         <div class='adv_global_input_container'>
10             <table id='adv_global_input_table' role="presentation">
11                 <thead>
12                     <tr>
13                         <td>
14                             <div class="header_middle" id="adv_search_input">
15                                 [% l("Search Input") %]
16                             </div>
17                         </td>
18                     </tr>
19                 </thead>
20                 <tbody id='adv_global_tbody'>
21                     [% INCLUDE "opac/parts/advanced/global_row.tt2" %]
22                     <!-- add a new row -->
23                     <tr id='adv_global_addrow'>
24                         <td class="td-search-left">
25                             <a href="javascript:;" id="myopac_new_global_row" onclick='addSearchRow();'>[% l('Add Search Row') %]</a>
26                         </td>
27                     </tr>
28                 </tbody>
29             </table>
30         </div>
31     </div>
32
33     <div id='adv_search_submit'>
34         <input type="hidden" name="_adv" value="1" />
35         <input id="detail" type="hidden" name="detail_record_view"
36                value="[% show_detail_view %]"/>
37         <span>
38             <input id='search-submit-go' type="submit" value="[% l('Search') %]" title="[% l('Search') %]" class="opac-button"
39                 onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
40             <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
41                 class='hidden' alt="[% l('Search in progress icon') %]"/>
42         </span>
43
44         <a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
45             class="opac-button">[% l('Clear Form') %]</a>
46     </div>
47
48     <div id='adv_search_filters'>
49         <div class="header_middle">[% l('Search Filters') %]</div>
50
51 [%
52     in_row = 0;
53     FOR adv_chunk IN search.adv_config;
54         NEXT IF adv_chunk.adv_hide;
55         IF in_row == 0;
56             in_row = 1; %]
57             <div class='adv_filter_block'>
58 [%
59         END; %]
60             <div class='adv_filter_block_item'>
61             <div [% IF adv_chunk.js_only %]
62                 id='adv_chunk_[% adv_chunk.adv_special %]'
63                 class='hidden'[% END %]>
64                 <strong><label for="[% adv_chunk.id %]">
65                   [% adv_chunk.adv_label %] </label></strong><br />
66 [%
67         IF adv_chunk.adv_special;
68             SWITCH adv_chunk.adv_special;
69                 CASE "scope_selector";
70                     PROCESS "opac/parts/org_selector.tt2";
71                         select_scope_label = l("Select search scope");
72                         INCLUDE build_scope_selector arialabel=select_scope_label value=ctx.search_scope
73                           id=adv_chunk.id name='search_scope' show_loc_groups=1 show_lassos=1;
74
75                 CASE "lib_selector";
76                     PROCESS "opac/parts/org_selector.tt2";
77                         INCLUDE build_org_selector show_loc_groups=1 show_lassos=0 id=adv_chunk.id %]
78                             <div class="adv_search_available">
79                                 <input type='checkbox' name="modifier"
80                                     value="available"[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %]
81                                     id='opac.result.limit2avail' />
82                                 <label for='opac.result.limit2avail'>
83                                     [% l("Limit to Available") %]</label>
84                             </div>
85
86 [%
87                 CASE "pub_year"; %]
88                             <select name='pubdate'
89                                 id="[% adv_chunk.id %]"
90                                 onchange='if(this.selectedIndex == 3)
91                                     unHideMe($("adv_global_pub_date_2_span"));
92                                 else
93                                     hideMe($("adv_global_pub_date_2_span"));'>
94                                     [%  FOR opt IN [
95                                             {"code" => "is", "label" => l("Is")},
96                                             {"code" => "before", "label" => l("Before")},
97                                             {"code" => "after", "label" => l("After")},
98                                             {"code" => "between", "label" => l("Between")} ] %]
99                                         <option value="[% opt.code %]"[% CGI.param('pubdate') == opt.code ? ' selected="selected"' : '' %]>[% opt.label | html %]</option>
100                                     [%  END %]
101                             </select>
102                             [% IF !ctx.exclude_electronic_checkbox %]
103                             <br/>
104                             <div id='adv_special_block'>
105                             [% END %]
106                                 <input title="[% l('Search date') %]" aria-label="[% l('Search date') %]"
107                                   name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
108                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
109                                    [% l("and") %] <input name='date2' aria-label="[% l('Secondary search date') %]"
110                                     title="[% l('Secondary search date') %]" type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
111                                 </span>
112                             [% IF !ctx.exclude_electronic_checkbox %]
113                             </div>
114                             [% END %]
115                             [% IF ctx.exclude_electronic_checkbox %]
116                             <div class="adv_search_available">
117                                 <input type='checkbox' name="fi:-search_format" value="electronic"
118                                 [%- CGI.param('fi:-search_format').grep('electronic').size ?
119                                     ' checked="checked"' : '' %]
120                                 id='opac.result.excludeelec' />
121                                 <label for='opac.result.excludeelec'>
122                                     [% l("Exclude Electronic Resources") %]
123                                 </label>
124                             </div>
125                             [% END %]
126 [%
127                 CASE "sort_selector";
128                     default_sort=ctx.default_sort;
129                     IF CGI.param('sort');
130                         default_sort=CGI.param('sort');
131                     END;
132                     INCLUDE "opac/parts/filtersort.tt2"
133                         id=adv_chunk.id
134                         value=default_sort class='results_header_sel';
135                     %]
136
137                     [% IF NOT metarecords.disabled %]
138                         <br/><!-- <br> may seem redundant, but it allows the
139                             <input> (below) to drop down inline w/ its label -->
140                         <div class="adv_search_available">
141                             <input type='checkbox' name="modifier" value="metabib"
142                               [%- CGI.param('modifier').grep('metabib').size || search.metarecord_default ?
143                                     ' checked="checked"' : '' %]
144                                 id='opac.result.ismetabib' />
145                             <label for='opac.result.ismetabib'>
146                                 [% l("Group Formats and Editions") %]</label>
147                         </div>
148                     [% END %]
149
150                 [% CASE "copy_location" %]
151                     <select id="adv_copy_location_selector"
152                         title="[% l('Select Shelving Location') %]"
153                         name="fi:locations" size="4" multiple="multiple">
154                     </select>
155                 [%
156             END;
157         ELSIF adv_chunk.adv_attr;
158             INCLUDE "opac/parts/coded_value_selector.tt2"
159                 id=adv_chunk.id
160                 attr=adv_chunk.adv_attr multiple="multiple"
161                 size=adv_chunk.adv_size || search.default_adv_select_height || "4";
162         ELSIF adv_chunk.adv_filter;
163             INCLUDE "opac/parts/filter_group_selector.tt2"
164                 id=adv_chunk.id
165                 filter_group=adv_chunk.adv_filter multiple="multiple"
166                 size=adv_chunk.adv_size || search.default_adv_select_height || "4";
167         END; %]
168             </div>
169         </div>
170 [%
171         IF adv_chunk.adv_break;
172             in_row = 0; %]
173             </div>
174 [%
175         END;
176     END; %]
177
178         </div>
179     </div>
180 </div>
181 </form>