79ae4c45ba0d32a0f4d3dfe41c6823a653e905bd
[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 valign='top' 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 align='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         <span>
36             <input id='search-submit-go' type="submit" value="[% l('Search') %]" title="[% l('Search') %]" class="opac-button"
37                 onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
38             <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif'
39                 class='hidden' alt="[% l('Search in progress icon') %]"/>
40         </span>
41
42         <a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
43             class="opac-button" rel="nofollow" vocab="">[% l('Clear Form') %]</a>
44     </div>
45
46     <div id='adv_search_filters'>
47         <div class="header_middle">[% l('Search Filters') %]</div>
48
49 [%
50     in_row = 0;
51     FOR adv_chunk IN search.adv_config;
52         NEXT IF adv_chunk.adv_hide;
53         IF in_row == 0;
54             in_row = 1; %]
55             <div class='adv_filter_block'>
56 [%
57         END; %]
58             <div class='adv_filter_block_item'>
59             <div valign='top'[% IF adv_chunk.js_only %]
60                 id='adv_chunk_[% adv_chunk.adv_special %]'
61                 class='hidden'[% END %]>
62                 <strong><label for="[% adv_chunk.id %]">
63                   [% adv_chunk.adv_label %] </label></strong><br />
64 [%
65         IF adv_chunk.adv_special;
66             SWITCH adv_chunk.adv_special;
67                 CASE "lib_selector";
68                     PROCESS "opac/parts/org_selector.tt2";
69                         INCLUDE build_org_selector show_loc_groups=1 id=adv_chunk.id %]
70                             <div class="adv_search_available">
71                                 <input type='checkbox' name="modifier"
72                                     value="available"[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %]
73                                     id='opac.result.limit2avail' />
74                                 <label for='opac.result.limit2avail'>
75                                     [% l("Limit to Available") %]</label>
76                             </div>
77 [%
78                 CASE "pub_year"; %]
79                             <select name='pubdate'
80                                 id="[% adv_chunk.id %]"
81                                 onchange='if(this.selectedIndex == 3)
82                                     unHideMe($("adv_global_pub_date_2_span"));
83                                 else
84                                     hideMe($("adv_global_pub_date_2_span"));'>
85                                     [%  FOR opt IN [
86                                             {"code" => "is", "label" => l("Is")},
87                                             {"code" => "before", "label" => l("Before")},
88                                             {"code" => "after", "label" => l("After")},
89                                             {"code" => "between", "label" => l("Between")} ] %]
90                                         <option value="[% opt.code %]"[% CGI.param('pubdate') == opt.code ? ' selected="selected"' : '' %]>[% opt.label | html %]</option>
91                                     [%  END %]
92                             </select>
93                             [% IF !ctx.exclude_electronic_checkbox %]
94                             <br/>
95                             <div id='adv_special_block'>
96                             [% END %]
97                                 <input title="[% l('Search date') %]"
98                                   name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
99                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
100                                    [% l("and") %] <input name='date2'
101                                     title="[% l('Secondary search date') %]" type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
102                                 </span>
103                             [% IF !ctx.exclude_electronic_checkbox %]
104                             </div>
105                             [% END %]
106                             [% IF ctx.exclude_electronic_checkbox %]
107                             <div class="adv_search_available">
108                                 <input type='checkbox' name="fi:-search_format" value="electronic"
109                                 [%- CGI.param('fi:-search_format').grep('electronic').size ?
110                                     ' checked="checked"' : '' %]
111                                 id='opac.result.excludeelec' />
112                                 <label for='opac.result.excludeelec'>
113                                     [% l("Exclude Electronic Resources") %]
114                                 </label>
115                             </div>
116                             [% END %]
117 [%
118                 CASE "sort_selector";
119                     INCLUDE "opac/parts/filtersort.tt2"
120                         id=adv_chunk.id
121                         value=CGI.param('sort') class='results_header_sel';
122                     %]
123
124                     [% IF NOT metarecords.disabled %]
125                         <br/><!-- <br> may seem redundant, but it allows the
126                             <input> (below) to drop down inline w/ its label -->
127                         <div class="adv_search_available">
128                             <input type='checkbox' name="modifier" value="metabib"
129                               [%- CGI.param('modifier').grep('metabib').size ?
130                                     ' checked="checked"' : '' %]
131                                 id='opac.result.ismetabib' />
132                             <label for='opac.result.ismetabib'>
133                                 [% l("Group Formats and Editions") %]</label>
134                         </div>
135                     [% END %]
136
137                 [% CASE "copy_location" %]
138                     <select id="adv_copy_location_selector"
139                         title="[% l('Select Shelving Location') %]"
140                         name="fi:locations" size="3" multiple="multiple">
141                     </select>
142                 [%
143             END;
144         ELSIF adv_chunk.adv_attr;
145             INCLUDE "opac/parts/coded_value_selector.tt2"
146                 id=adv_chunk.id
147                 attr=adv_chunk.adv_attr multiple="multiple"
148                 size=adv_chunk.adv_size || search.default_adv_select_height || "4";
149         ELSIF adv_chunk.adv_filter;
150             INCLUDE "opac/parts/filter_group_selector.tt2"
151                 id=adv_chunk.id
152                 filter_group=adv_chunk.adv_filter multiple="multiple"
153                 size=adv_chunk.adv_size || search.default_adv_select_height || "4";
154         END; %]
155             </div>
156         </div>
157 [%
158         IF adv_chunk.adv_break;
159             in_row = 0; %]
160             </div>
161 [%
162         END;
163     END; %]
164
165         </div>
166     </div>
167 </div>
168 </form>