5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › Advanced search</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% BLOCK cssinclude %][% END %]
10 [% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %]
11 [% INCLUDE 'masthead.inc' %]
12 <form action="/cgi-bin/koha/opac-search.pl" method="get">
13 <input type="hidden" name="advsearch" value="1"/>
15 <nav aria-label="breadcrumb">
16 <ul class="breadcrumb">
17 <li class="breadcrumb-item">
18 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
20 <li class="breadcrumb-item active" aria-current="page">
21 <a href="#">Advanced search</a>
26 <div class="container-fluid">
28 <div class="col order-first order-md-first order-lg-2">
29 <!-- BOOLEAN SEARCH OPTIONS -->
30 <div id="booleansearch" class="maincontent">
32 <legend>Search for:</legend>
33 [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
34 <input type="checkbox" name="weight_search" checked>
35 <label for="weighted_search">Apply field weightings to search</label>
37 [% IF ( expanded_options ) %]
38 <div class="advanced-search-terms extended">
40 <div class="advanced-search-terms">
41 [% END # /IF ( expanded_options ) %]
42 [% FOREACH search_box IN search_boxes_loop %]
43 <div class="search-term-row">
44 <div class="search-term-input">
45 [% IF ( expanded_options ) %]
46 [% IF ( search_box.boolean ) %]
47 <select name="op" class="form-control">
48 <option value="and" selected="selected">and</option>
49 <option value="or">or</option>
50 <option value="not">not</option>
54 <label for="search-field_[% loop.index | html %]">
55 [% IF loop.index == 0 %]
56
61 [% END # /IF ( expanded_options ) %]
62 </div> <!-- .search-term-input -->
64 <div class="search-term-input">
65 <select class="form-control" name="idx" id="search-field_[% loop.index | html %]">
66 <option value="kw">Keyword</option>
67 [% IF ( expanded_options ) %]
68 <option value="kw,phr"> Keyword phrase</option>
70 <option value="su,wrdl">Subject</option>
71 [% IF ( expanded_options ) %]
72 <option value="su,phr"> Subject phrase</option>
73 <option value="su-br"> Subject and broader terms</option>
74 <option value="su-na"> Subject and narrower terms</option>
75 <option value="su-rl"> Subject and related terms</option>
77 <option value="ti">Title</option>
78 [% IF ( expanded_options ) %]
79 <option value="ti,phr"> Title phrase</option>
80 <option value="se,wrdl">Series title</option>
81 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
82 <option value="callnum,phr">Call number</option>
84 <option value="callnum">Call number</option>
88 <option value="au,wrdl">Author</option>
89 [% IF ( expanded_options ) %]
90 <option value="au,phr"> Author phrase</option>
91 <option value="cpn,wrdl"> Corporate name</option>
92 <option value="cfn,wrdl"> Conference name</option>
93 <option value="cfn,phr"> Conference name phrase</option>
94 <option value="pn,wrdl"> Personal name</option>
95 <option value="pn,phr"> Personal name phrase</option>
97 [% IF ( expanded_options ) %]
98 <option value="nt">Notes/Comments</option>
99 [% IF (marcflavour != 'UNIMARC') %]
100 <option value="curriculum">Curriculum</option>
103 <option value="pb,wrdl">Publisher</option>
104 <option value="pl,wrdl">Publisher location</option>
105 [% IF ( expanded_options ) %]
106 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
107 <option value="ident,phr">Standard number</option>
109 <option value="ident">Standard number</option>
111 <option value="nb"> ISBN</option>
112 <option value="ns"> ISSN</option>
114 <option value="nb">ISBN</option>
116 <option value="bc">Barcode</option>
117 </select> <!-- /#search-field_[% loop.index | html %] -->
118 </div> <!-- .search-term-input -->
119 <div class="search-term-input">
120 <input class="form-control" type="text" size="30" name="q" title="Enter search terms" value="" />
121 </div> <!-- .search-term-input -->
122 [% IF ( expanded_options ) %]
123 <div class="search-term-input">
124 [% IF ( !loop.first ) %]
125 <a class="ButtonPlus" title="Add another field" href="#">
126 <i class="fa fa-plus-square" aria-hidden="true"></i>
128 <a class="ButtonLess" title="Remove field" href="#">
129 <i class="fa fa-minus-square" aria-hidden="true"></i>
132 </div> <!-- .search-term-input -->
134 </div> <!-- /.search-term-row -->
135 [% END # FOREACH search_box %]
136 </div> <!-- /.search-terms -->
138 </div> <!-- /#booleansearch -->
139 </div> <!-- / .col -->
140 </div> <!-- / .row -->
142 <div class="text-center">
143 <!-- SEARCH BUTTONS -->
144 <fieldset class="action">
145 [% PROCESS searchbuttons %]
147 <!-- /SEARCH BUTTONS -->
151 [%# Following on one line for translatability %]
152 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
153 <div class="col order-first order-md-first order-lg-2">
154 <div id="advsearches" class="toptabs">
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
168 [% FOREACH advsearchloo IN advancedsearchesloop %]
169 <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
171 <legend>Limit to any of the following:</legend>
173 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
174 [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
175 <div class="col-sm-6 col-lg-3">
176 <input type="checkbox"
177 id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"
178 name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
179 value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code | html %][% ELSE %]mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %][% END %]"
181 <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
182 [% UNLESS ( Koha.Preference('OpacNoItemTypeImages')) %]
183 [% IF ( itemtypeloo.imageurl ) %]
184 <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
188 [% itemtypeloo.description | html %]
191 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row">[% END %][% END %]
195 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type | html %] -->
196 [% END # / FOREACH advancedsearchesloop %]
197 </div> <!-- / #advsearches -->
198 </div> <!-- / .col -->
199 [% END # /IF OpacAdvSearchOptions %]
202 <div id="advsearch_limits" class="row">
204 [%# Following on one line for translatability %]
205 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
206 [% IF ( singleBranchMode ) %]
207 <div class="col-sm-6 col-lg-3">
208 <!-- AVAILABILITY LIMITS -->
209 <div id="location" class="advsearch_limit">
211 <legend>Availability: </legend>
212 <div style="margin-top:.4em">
213 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
216 </div> <!-- / #location -->
217 <!-- /AVAILABILITY LIMITS -->
218 </div> <!-- / .col -->
220 <div class="col-sm-6 col-lg-3">
221 <!-- AVAILABILITY LIMITS -->
222 <div id="location" class="advsearch_limit">
224 <label for="branchloop">Location and availability:</label>
225 <select name="limit" id="branchloop">
226 <option value="">All libraries</option>
227 [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
228 [% IF BranchesLoo.selected %]
229 <option value="branch:[% BranchesLoo.branchcode | html %]" selected="selected">[% BranchesLoo.branchname | html %]</option>
231 <option value="branch:[% BranchesLoo.branchcode | html %]">[% BranchesLoo.branchname | html %]</option>
235 [% IF search_groups %]
237 <label for="categoryloop">Groups of libraries</label>
238 <select name="multibranchlimit" id="categoryloop">
239 <option value=""> -- none -- </option>
240 [% FOREACH sg IN search_groups %]
241 <option value="[% sg.id | html %]">[% sg.title | html %]</option>
245 <div style="margin-top:.4em">
246 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
249 </div> <!-- / #location -->
250 <!-- /AVAILABILITY LIMITS -->
251 </div> <!-- / .col -->
252 [% END # / IF singleBranchMode %]
255 [%# Following on one line for translatability %]
256 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
257 <div class="col-sm-6 col-lg-3">
259 <div id="sortby" class="advsearch_limit">
261 <label for="sort_by">Sort by:</label>
262 <select id="sort_by" name="sort_by">
263 [% INCLUDE 'resort_form.inc' %]
268 </div> <!-- / .col -->
271 [%# Following on one line for translatability %]
272 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
273 <div class="col-sm-6 col-lg-3">
274 <div id="pubrange" class="advsearch_limit">
275 <!-- PUB RANGE OPTION -->
277 <label for="limit-yr">Publication date range</label>
278 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
279 <div class="hint">For example: 1999-2001. You could also use "-1987" for everything published in and before 1987 or "2008-" for everything published in 2008 and after.</div>
281 <!-- /PUB RANGE OPTION -->
286 [%# Following on one line for translatability %]
287 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
288 <div class="col-sm-6 col-lg-3">
289 <div id="langfilter" class="advsearch_limit">
291 <!-- LANGUAGE LIMIT -->
292 <label for="language-limit">Language</label>
293 <select id="language-limit" name="limit">
294 <option value="">No limit</option>
295 [% FOREACH search_languages_loo IN search_languages_loop %]
296 [% IF ( search_languages_loo.selected ) %]
297 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]" selected="selected">[% search_languages_loo.language_description | html %]</option>
299 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]">[% search_languages_loo.language_description | html %]</option>
303 <!-- /LANGUAGE LIMIT -->
305 </div> <!-- / #langfilter -->
306 </div> <!-- / .col -->
308 </div> <!-- / .row -->
310 [%# Following on one line for translatability %]
311 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
313 <div id="subtypes" class="row">
314 <!-- SUBTYPE LIMITS -->
315 <div class="col-sm-6 col-lg-3">
316 <div class="advsearch_limit">
318 <label for="subtype_audience">Audience</label>
319 <select id="subtype_audience" name="limit" class="subtype">
320 <option value="" selected="selected" class="menuheader">Any audience</option>
321 <option value="aud:a">Preschool</option>
322 <option value="aud:b">Primary</option>
323 <option value="aud:c">Pre-adolescent</option>
324 <option value="aud:d">Adolescent</option>
325 <option value="aud:e">Adult</option>
326 <option value="aud:f">Specialized</option>
327 <option value="aud:g">General</option>
328 <option value="aud:j">Juvenile</option>
331 </div> <!-- /.advsearch_limit -->
332 </div> <!-- / .col-sm-6 col-lg-3 -->
334 <div class="col-sm-6 col-lg-3">
335 <div class="advsearch_limit">
337 <label for="subtype_content">Content</label>
338 <select id="subtype_content" name="limit" class="subtype">
339 <option value="" selected="selected" class="menuheader">Any content</option>
340 <option value="fic:1">Fiction</option>
341 <option value="fic:0">Non-fiction</option>
342 <option value="bio:b">Biography</option>
343 <option value="mus:j">Musical recording</option>
344 <option value="mus:i">Non-musical recording</option>
347 </div> <!-- /.advsearch_limit -->
350 <div class="col-sm-6 col-lg-3">
351 <div class="advsearch_limit">
353 <label for="subtype_format">Format</label>
354 <select id="subtype_format" name="limit" class="subtype">
355 <option value="" selected="selected" class="menuheader">Any format</option>
356 <option value="l-format:ta">Regular print</option>
357 <option value="l-format:tb">Large print</option>
358 <option value="l-format:tc or l-format:fb">Braille</option>
359 <option value="">-----------</option>
360 <option value="l-format:sd">CD audio</option>
361 <option value="l-format:ss">Cassette recording</option>
362 <option value="l-format:vf">VHS tape / Videocassette</option>
363 <option value="l-format:vd">DVD video / Videodisc</option>
364 <option value="l-format:co">CD software</option>
365 <option value="l-format:cr">Website</option>
368 </div> <!-- /.advsearch_limit -->
369 </div> <!-- / .col-sm-6 col-lg-3 -->
371 <div class="col-sm-6 col-lg-3">
372 <div class="advsearch_limit">
374 <label for="subtype_additional">Additional content types for books/printed materials</label>
375 <select id="subtype_additional" name="limit" class="subtype">
376 <option value="">Any</option>
377 <option value="ctype:a">Abstracts/summaries</option>
378 <option value="ctype:b">Bibliographies</option>
379 <option value="ctype:c">Catalogs</option>
380 <option value="ctype:d">Dictionaries</option>
381 <option value="ctype:e">Encyclopedias </option>
382 <option value="ctype:f">Handbooks</option>
383 <option value="ctype:g">Legal articles</option>
384 <option value="ctype:i">Indexes</option>
385 <option value="ctype:j">Patent document</option>
386 <option value="ctype:k">Discographies</option>
387 <option value="ctype:l">Legislation</option>
388 <option value="ctype:m">Theses</option>
389 <option value="ctype:n">Surveys</option>
390 <option value="ctype:o">Reviews</option>
391 <option value="ctype:p">Programmed texts</option>
392 <option value="ctype:q">Filmographies</option>
393 <option value="ctype:r">Directories</option>
394 <option value="ctype:s">Statistics</option>
395 <option value="ctype:t">Technical reports</option>
396 <option value="ctype:v">Legal cases and case notes</option>
397 <option value="ctype:w">Law reports and digests</option>
398 <option value="ctype:z">Treaties </option>
401 </div> <!-- /.advsearch_limit -->
402 </div> <!-- / .col-sm-6 col-lg-3 -->
403 </div> <!-- / #subtypes.row -->
404 <!-- SUBTYPE LIMITS -->
405 [% END # / IF usmarc %]
408 <div id="subtypes_unimarc" class="row">
409 <!-- SUBTYPE LIMITS -->
410 [% INCLUDE 'subtypes_unimarc.inc' %]
413 [% END # / IF expanded_options %]
415 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
416 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
417 <div class="text-center">
418 <fieldset class="action">
419 <!-- SEARCH BUTTONS -->
420 [% PROCESS searchbuttons %]
421 <!-- /SEARCH BUTTONS -->
425 </div> <!-- / .container-fluid -->
426 </div> <!-- / .main -->
429 [% INCLUDE 'opac-bottom.inc' %]
430 [% BLOCK searchbuttons %]
432 <input class="btn btn-primary" type="submit" accesskey="s" name="do" title="Search" value="Search" />
434 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
435 [% IF expanded_options %]
436 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
437 [% ELSIF not expanded_options %]
438 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
442 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
446 [% BLOCK jsinclude %]
447 [% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
448 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
450 $(document).ready(function() {
451 $('#advsearches').tabs();
452 jQuery.cookie.json = true;
453 //$('#advsearches > ul').tabs();
455 [% IF ( ReturnToSearch ) %]
456 if (form_serialized = jQuery.cookie("form_serialized")) {
457 $('#advsearch form').deserialize(form_serialized);
459 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
460 $('#language-limit') .val(form_serialized_limits[0]);
461 $('#branchloop') .val(form_serialized_limits[1]);
462 $('#subtype_audience') .val(form_serialized_limits[2]);
463 $('#subtype_content') .val(form_serialized_limits[3]);
464 $('#subtype_format') .val(form_serialized_limits[4]);
465 $('#subtype_additional') .val(form_serialized_limits[5]);
466 $('#locloop') .val(form_serialized_limits[6]);
469 //Clear all form cookies
470 jQuery.removeCookie("form_serialized", { path: '/'});
471 jQuery.removeCookie("form_serialized_limits", { path: '/'});
472 jQuery.removeCookie("num_paragraph", { path: '/'});
473 jQuery.removeCookie("search_path_code", { path: '/'});
475 $('#advsearch form').submit(function() {
476 form_serialized = $(this).serialize();
477 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
478 form_serialized_limits = [
479 $('#language-limit').val(), $('#branchloop').val(),
480 $('#subtype_audience').val(), $('#subtype_content').val(),
481 $('#subtype_format').val(), $('#subtype_additional').val(),
484 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
485 [% IF ( expanded_options ) %]
486 var numPar = $("#booleansearch fieldset p").size();
487 if (numPar > [% search_boxes_count | html %]){
488 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
490 jQuery.removeCookie("num_paragraph", { path: '/'});
492 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
494 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
495 jQuery.removeCookie("num_paragraph", { path: '/'});
500 /* This function allows to display a new field to search.
502 $(document).on("click", '.ButtonPlus', function(e) {
504 $('.ButtonLess').show();
505 var thisLine = $(this).parent().parent();
506 var newLine = thisLine.clone();
507 newLine.find('input').val('');
508 thisLine.after(newLine);
511 $(document).on("click", '.ButtonLess', function(e) {
513 if($(this).parent().parent().siblings().length <= 3 ) {
514 $('.ButtonLess').hide();
516 $(this).parent().parent().remove();