Bug 27846: (follow-up) Add id back to breadcrumbs container
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / advsearch.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Asset %]
4 [% USE Branches %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10
11 [%- BLOCK language_limit_select -%]
12 <select name="limit" id="[% ln_id | html %]">
13     <option value="">No limit</option>
14     [% FOREACH ln_loo IN ln_loop %]
15         [% IF ( ln_loo.selected ) %]
16             <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]" selected="selected">
17                 [% ln_loo.language_description | html %]
18             </option>
19         [% ELSE %]
20             <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]">
21                 [% ln_loo.language_description | html %]
22             </option>
23         [% END %]
24     [% END %]
25 </select>
26 [%- END -%]
27
28 <body id="catalog_advsearch" class="catalog">
29 [% INCLUDE 'header.inc' %]
30 [% INCLUDE 'adv-search.inc' %]
31
32 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
33     <ol>
34         <li>
35             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
36         </li>
37         <li>
38             <a href="#" aria-current="page">
39                 Advanced search
40             </a>
41         </li>
42     </ol>
43 </nav>
44
45 <div class="main container-fluid">
46     <div class="row">
47         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
48
49 <form action="search.pl" method="get">
50 <div id="advanced-search">
51 <input type="hidden" name="advsearch" value="1"/>
52 <h1>Advanced search</h1>
53 <p>
54   <a href="/cgi-bin/koha/catalogue/itemsearch.pl">Go to item search</a>
55   [% IF searchid %]
56       <div id="previous_search_link"></div>
57   [% END %]
58 </p>
59
60 <!-- SEARCH BUTTONS -->
61 <div id="toolbar" class="btn-toolbar">
62     <fieldset class="action" id="submit1">
63         <div class="btn-group">
64             <button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search</button>
65         </div>
66         <div class="btn-group">
67         [% IF ( expanded_options ) %]
68             <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=0" class="btn btn-link"><i class="fa fa-search-minus"></i> Fewer options</a>
69         </div>
70         [% ELSE %]
71             <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=1" class="btn btn-link"><i class="fa fa-search-plus"></i> More options</a>
72         </div>
73         [% END %]
74         <div class="btn-group">
75             <a href="/cgi-bin/koha/catalogue/search.pl?do=Clear&expanded_options=[% expanded_options | uri %]" class="btn btn-link"><i class="fa fa-trash"></i> Clear fields</a>
76         </div>
77     </fieldset>
78 </div>
79 <!-- /SEARCH BUTTONS -->
80
81
82 [% IF ( outer_servers_loop ) %]
83 <!-- DATABASES -->
84
85 <fieldset>
86         <legend>Select local databases</legend>
87                 [% FOREACH local_servers_loo IN local_servers_loop %]
88 [% IF ( local_servers_loo.checked ) %]<input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" checked="checked" value="[% local_servers_loo.value | html %]" />[% ELSE %]<input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" value="[% local_servers_loo.value | html %]" />[% END %]<label for="[% local_servers_loo.id | html %]"><img width="16" height="16" alt="[% local_servers_loo.id | html %]" src="[% themelang | html %]/img/[% local_servers_loo.icon | html %]" /> [% local_servers_loo.label | html %]</label>[% END %]
89 </fieldset>
90 <!-- /DATABASES -->
91 [% END %]
92
93 [% IF ( outer_servers_loop ) %]
94 <!-- REMOTE DATABASES -->
95 <fieldset id="databases">
96     <legend>Select remote databases</legend>
97                 [% FOREACH outer_servers_loo IN outer_servers_loop %]
98                 [% IF ( outer_servers_loo.checked ) %]<input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" checked="checked" value="[% outer_servers_loo.value | html %]" />[% ELSE %]<input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" value="[% outer_servers_loo.value | html %]" />[% END %]
99 <label for="[% outer_servers_loo.id | html %]"><img alt="[% outer_servers_loo.id | html %]" src="[% themelang | html %]/images/[% outer_servers_loo.icon | html %]" />[% outer_servers_loo.label | html %]</label>
100                 [% END %]
101     </fieldset>
102 <!-- /REMOTE DATABASES -->
103 [% END %]
104
105 <!-- BOOLEAN SEARCH OPTIONS -->
106     <fieldset id="searchterms">
107     <legend>Search for </legend>
108     [% FOREACH search_box IN search_boxes_loop %]
109         [% IF ( search_boxes_label ) %]
110         <div class="search-term-row" style="text-indent: 4.5em;">
111         [% ELSE %]
112         <div class="search-term-row">
113         [% END %]
114                         [% IF ( expanded_options ) %]
115             [% IF ( search_box.boolean ) %]
116                 <select name="op">
117                     <option value="and" selected="selected">and</option>
118                     <option value="or">or</option>
119                     <option value="not">not</option>
120                 </select>
121             [% END %] 
122                         [% END %]
123                         [% INCLUDE 'search_indexes.inc' %]
124                         <input type="text" size="30" name="q" title="Enter search terms" value="" />
125             [% IF ( expanded_options ) %]
126                 [% IF ( search_box.add_field ) %]
127                     <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
128                                 [% END %]
129               [% IF ( search_box.scan_index ) %]
130                 <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" />
131               [% END %]
132             [% END %]
133                 </div>
134     [% END %]
135     [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
136         [% IF ( expanded_options ) %]
137             <p>
138                 [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
139                     <label><input type="checkbox" name="whole_record" /> Search entire MARC record</label>
140                 [% END %]
141                 <span id="weight_search">
142                     <label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label>
143                 </span>
144             <p>
145         [% ELSE %]
146             <input type="hidden" name="weight_search" value="1" />
147         [% END %]
148     [% END %]
149     </fieldset>
150 <!-- /BOOLEAN SEARCH OPTIONS -->
151
152 </div>
153 <!-- MC-TYPE LIMITS -->
154       <div id="advsearches" class="toptabs">
155       <ul>
156       [% FOREACH advsearchloo IN advancedsearchesloop %]
157         <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
158            <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
159            [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
160            [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
161            [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
162            [% ELSE %]Something else
163            [% END %]
164            </a>
165         </li>
166       [% END %]
167       </ul>
168     [% FOREACH advsearchloo IN advancedsearchesloop %]
169     <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
170     <h4>Limit to any of the following:</h4>
171     <table>
172         <tr>
173     [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
174         <td><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">[% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %][% IF ( itemtypeloo.imageurl ) %]<img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />[% END %]&nbsp;[% END %]
175         [% itemtypeloo.description | html %]</label></td>
176         [% IF ( loop.last ) %]</tr>[% ELSE %][% UNLESS ( loop.count % 5 ) %]</tr><tr>[% END %][% END %]
177     [% END %]
178     </table>
179     </div>
180     [% END %]
181 <!-- /MC-TYPE LIMIT -->
182 [% IF ( expanded_options ) %]
183 <!-- BASIC LIMITS -->
184  <fieldset id="basiclimits">
185         <legend>Limits</legend>
186 <fieldset id="pubrange">
187 <!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options -->
188         <p><label for="limit-yr">Year: </label>
189                 <input type="text" size="15" name="limit-yr" id="limit-yr" value=""/>&nbsp;&nbsp;(format: yyyy-yyyy)</p>
190 <!-- /PUB / COPY YEAR LIMIT -->
191 </fieldset>
192 <fieldset id="language">
193 <!-- LANGUAGE LIMIT -->
194     <p>
195         <label for="language-limit">Language: </label>
196         [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' %]
197         <label for="language-original-limit">Language of original: </label>
198         [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' %]
199     </p>
200 <!-- /LANGUAGE LIMIT -->
201 </fieldset>
202 </fieldset>
203 <!-- /BASIC LIMITS -->
204 [% END %]
205
206
207 [% IF ( UNIMARC ) %]
208 [% INCLUDE 'subtypes_unimarc.inc' %]
209 [% ELSE %]
210 <!-- SUBTYPE LIMITS -->
211         <fieldset id="subtype">
212         <legend>Subtype limits</legend><p>
213         
214         <select name="limit" class="subtype">
215             <option value="" selected="selected" class="menuheader">Any audience</option>
216                         <option value="aud:a">Preschool</option>
217                         <option value="aud:b">Primary</option>
218                         <option value="aud:c">Pre-adolescent</option>
219                         <option value="aud:d">Adolescent</option>
220                         <option value="aud:e">Adult</option>
221                         <option value="aud:f">Specialized</option>
222                         <option value="aud:g">General</option>
223                         <option value="aud:j">Juvenile</option>
224         </select>
225         
226         <select name="limit" class="subtype">
227             <option value="" selected="selected" class="menuheader">Any content</option>
228             <option value="fic:1" >Fiction</option>
229             <option value="fic:0" >Non-fiction</option>
230             <option value="bio:b" >Biography</option>
231             <option value="mus:j" >Musical recording</option>
232             <option value="mus:i" >Non-musical recording</option>
233         </select>
234
235         
236         <select name="limit" class="subtype">
237             <option value="" selected="selected" class="menuheader">Any format</option>
238             <option value="l-format:ta" >Regular print</option>
239             <option value="l-format:tb" >Large print</option>
240             <option value="l-format:tc or l-format:fb">Braille</option>
241             <option value="" >-----------</option>
242             <option value="l-format:sd" >CD audio</option>
243             <option value="l-format:ss" >Cassette recording</option>
244             <option value="l-format:vf" >VHS tape / Videocassette</option>
245             <option value="l-format:vd" >DVD video / Videodisc</option>
246             <option value="l-format:co" >CD software</option>
247             <option value="l-format:cr" >Website</option>
248         </select>
249         
250         <select name="limit" class="subtype">
251             <option value="" >Additional content types</option>
252             <option value="ctype:a" >Abstracts / Summaries</option>
253             <option value="ctype:b" >Bibliographies</option>
254             <option value="ctype:c" >Catalogs</option>
255             <option value="ctype:d" >Dictionaries</option>
256             <option value="ctype:e" >Encyclopedias </option>
257             <option value="ctype:f" >Handbooks</option>
258             <option value="ctype:g" >Legal articles</option>
259             <option value="ctype:i" >Indexes</option>
260             <option value="ctype:j" >Patent document</option>
261             <option value="ctype:k" >Discographies</option>
262             <option value="ctype:l" >Legislation</option>
263             <option value="ctype:m" >Theses</option>
264             <option value="ctype:n" >Surveys</option>
265             <option value="ctype:o" >Reviews</option>
266             <option value="ctype:p" >Programmed texts</option>
267             <option value="ctype:q" >Filmographies</option>
268             <option value="ctype:r" >Directories</option>
269             <option value="ctype:s" >Statistics</option>
270             <option value="ctype:t" >Technical reports</option>
271             <option value="ctype:v" >Legal cases and case notes</option>
272             <option value="ctype:w" >Law reports and digests</option>
273             <option value="ctype:z" >Treaties </option>
274         </select>
275        </p>
276
277 </fieldset>
278 [% END %]
279
280 <!-- AVAILABILITY LIMITS -->
281     <fieldset id="availability"><legend>Location and availability</legend>
282 <fieldset id="currently-avail">
283         <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
284 </fieldset>
285
286 <fieldset id="select-libs">
287         <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
288         <option value="">All libraries</option>
289         [%# FIXME Should not we filter the libraries displayed? %]
290         [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]
291         </select></p>
292     <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
293         [% IF search_groups %]
294             <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
295
296             <p>
297                 <label for="categoryloop">Groups of libraries: </label>
298                 <select name="multibranchlimit" id="categoryloop">
299                     <option value=""> -- none -- </option>
300                     [% FOREACH sg IN search_groups %]
301                         [% UNLESS sg.branchcode %]
302                             <option value="[% sg.id | html %]">[% sg.title | html %]</option>
303                         [% END %]
304                     [% END %]
305                 </select>
306             </p>
307     [% END %]
308 </fieldset>
309     </fieldset>
310 <!-- /AVAILABILITY LIMITS -->
311
312 <!-- RANK LIMITS -->
313 <fieldset id="sortby"><legend>Sorting</legend>
314     <p>
315     <label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by">
316   [% INCLUDE 'resort_form.inc' %]
317     </select>
318         </p>
319 </fieldset>
320 </div>
321 <!-- /RANK LIMITS -->
322 </form>
323 </div>
324 </div>
325
326 [% MACRO jsinclude BLOCK %]
327     [% Asset.js("lib/hc-sticky.js") | $raw %]
328     [% Asset.js("js/browser.js") | $raw %]
329     <script>
330         /**
331          *  Function add_field();
332          *  This function allows to display a new field to search.
333          */
334         function add_field() {
335             var ButtonPlus = document.getElementById("ButtonPlus");
336             var line = ButtonPlus.parentNode;
337             var dad  = line.parentNode;
338             dad.appendChild(line.cloneNode(true));
339             line.removeChild(ButtonPlus);
340         }
341         var Sticky;
342         $(document).ready(function() {
343             $("input[name=q]:eq(0)").focus();
344             $('#advsearches').tabs();
345             Sticky = $("#toolbar");
346             Sticky.hcSticky({
347                 stickTo: ".main",
348                 stickyClass: "floating"
349             });
350             $("#branchloop").on("change",function(){
351                 if( this.value != ""){
352                     document.getElementById("categoryloop").disabled=true;
353                 } else {
354                     document.getElementById("categoryloop").disabled=false;
355                 }
356             });
357
358             [% IF searchid %]
359                 browser = KOHA.browser('[% searchid | html %]');
360                 browser.show_back_link();
361             [% END %]
362
363         });
364     </script>
365 [% END %]
366
367 [% INCLUDE 'intranet-bottom.inc' %]