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 <ul class="breadcrumb">
16 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
17 <li><a href="#">Advanced search</a></li>
20 <div class="container-fluid">
21 <div class="row-fluid">
23 <!-- BOOLEAN SEARCH OPTIONS -->
24 <div id="booleansearch" class="maincontent">
26 <legend>Search for:</legend>
27 [% FOREACH search_box IN search_boxes_loop %]
29 [% IF ( expanded_options ) %]
30 [% IF ( search_box.boolean ) %]
32 <option value="and" selected="selected">and</option>
33 <option value="or">or</option>
34 <option value="not">not</option>
38 <label for="search-field_[% loop.index | html %]">
39 [% IF loop.index == 0 %]
40
46 [% IF ( expanded_options ) %][% left_content | html %][% END %]
47 <select name="idx" id="search-field_[% loop.index | html %]">
48 <option value="kw">Keyword</option>
49 [% IF ( expanded_options ) %]
50 <option value="kw,phr"> Keyword phrase</option>
52 <option value="su,wrdl">Subject</option>
53 [% IF ( expanded_options ) %]
54 <option value="su,phr"> Subject phrase</option>
55 <option value="su-br"> Subject and broader terms</option>
56 <option value="su-na"> Subject and narrower terms</option>
57 <option value="su-rl"> Subject and related terms</option>
59 <option value="ti">Title</option>
60 [% IF ( expanded_options ) %]
61 <option value="ti,phr"> Title phrase</option>
62 <option value="se,wrdl">Series title</option>
63 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
64 <option value="callnum,phr">Call number</option>
66 <option value="callnum">Call number</option>
70 <option value="au,wrdl">Author</option>
71 [% IF ( expanded_options ) %]
72 <option value="au,phr"> Author phrase</option>
73 <option value="cpn,wrdl"> Corporate name</option>
74 <option value="cfn,wrdl"> Conference name</option>
75 <option value="cfn,phr"> Conference name phrase</option>
76 <option value="pn,wrdl"> Personal name</option>
77 <option value="pn,phr"> Personal name phrase</option>
79 [% IF ( expanded_options ) %]
80 <option value="nt">Notes/Comments</option>
81 [% IF (marcflavour != 'UNIMARC') %]
82 <option value="curriculum">Curriculum</option>
85 <option value="pb,wrdl">Publisher</option>
86 <option value="pl,wrdl">Publisher location</option>
87 [% IF ( expanded_options ) %]
88 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
89 <option value="ident,phr">Standard number</option>
91 <option value="ident">Standard number</option>
93 <option value="nb"> ISBN</option>
94 <option value="ns"> ISSN</option>
96 <option value="nb">ISBN</option>
98 <option value="bc">Barcode</option>
100 <input type="text" size="30" name="q" title="Enter search terms" value="" />
101 [% IF ( expanded_options ) %]
102 [% IF ( !loop.first ) %]
103 <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
104 <a class="ButtonLess" title="Remove field" href="#">[-]</a>
108 [% END # FOREACH search_box %]
110 </div> <!-- /BOOLEAN SEARCH OPTIONS -->
111 </div> <!-- / .span12 -->
112 </div> <!-- / .row-fluid -->
113 <div class="text-center">
114 <!-- SEARCH BUTTONS -->
115 [% PROCESS searchbuttons %]
116 <!-- /SEARCH BUTTONS -->
119 <div class="row-fluid">
120 [%# Following on one line for translatability %]
121 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
123 <div id="advsearches" class="toptabs">
125 [% FOREACH advsearchloo IN advancedsearchesloop %]
126 <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
127 <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
128 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
129 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
130 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
131 [% ELSE %]Something else
137 [% FOREACH advsearchloo IN advancedsearchesloop %]
138 <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
140 <legend>Limit to any of the following:</legend>
141 <div class="row-fluid">
142 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
143 [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
145 <input type="checkbox"
146 id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"
147 name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
148 value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code | html %][% ELSE %]mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %][% END %]"
150 <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
151 [% UNLESS ( noItemTypeImages ) %]
152 [% IF ( itemtypeloo.imageurl ) %]
153 <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
157 [% itemtypeloo.description | html %]
160 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
164 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type | html %] -->
165 [% END # / FOREACH advancedsearchesloop %]
166 </div> <!-- / #advsearches -->
167 </div> <!-- / .span12 -->
170 <div class="row-fluid">
171 [%# Following on one line for translatability %]
172 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
175 <!-- PUB RANGE OPTION -->
177 <legend>Publication date range</legend>
178 <label for="limit-yr">Date range:</label>
179 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
180 <p>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.</p>
182 <!-- /PUB RANGE OPTION -->
187 [%# Following on one line for translatability %]
188 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
190 <div id="langfilter">
192 <legend>Language</legend>
193 <!-- LANGUAGE LIMIT -->
195 <label for="language-limit">Language: </label>
196 <select id="language-limit" name="limit">
197 <option value="">No limit</option>
198 [% FOREACH search_languages_loo IN search_languages_loop %]
199 [% IF ( search_languages_loo.selected ) %]
200 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]" selected="selected">[% search_languages_loo.language_description | html %]</option>
202 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]">[% search_languages_loo.language_description | html %]</option>
207 <!-- /LANGUAGE LIMIT -->
209 </div> <!-- / #langfilter -->
210 </div> <!-- / .span3 -->
213 [%# Following on one line for translatability %]
214 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
215 [% IF ( singleBranchMode ) %]
217 <!-- AVAILABILITY LIMITS -->
220 <legend>Availability: </legend>
221 <div style="margin-top:.4em">
222 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
225 </div> <!-- / #location -->
226 <!-- /AVAILABILITY LIMITS -->
227 </div> <!-- / .span3 -->
230 <!-- AVAILABILITY LIMITS -->
233 <legend>Location and availability: </legend>
234 <label for="branchloop">Library:</label>
235 <select name="limit" id="branchloop">
236 <option value="">All libraries</option>
237 [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
238 [% IF BranchesLoo.selected %]
239 <option value="branch:[% BranchesLoo.branchcode | html %]" selected="selected">[% BranchesLoo.branchname | html %]</option>
241 <option value="branch:[% BranchesLoo.branchcode | html %]">[% BranchesLoo.branchname | html %]</option>
245 [% IF search_groups %]
247 <label for="categoryloop">Groups of libraries</label>
248 <select name="multibranchlimit" id="categoryloop">
249 <option value=""> -- none -- </option>
250 [% FOREACH sg IN search_groups %]
251 <option value="[% sg.id | html %]">[% sg.title | html %]</option>
255 <div style="margin-top:.4em">
256 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
259 </div> <!-- / #location -->
260 <!-- /AVAILABILITY LIMITS -->
261 </div> <!-- / .span3 -->
262 [% END # / IF singleBranchMode %]
265 [%# Following on one line for translatability %]
266 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
271 <legend>Sorting: </legend>
272 <label for="sort_by">Sort by:</label>
273 <select id="sort_by" name="sort_by">
274 [% INCLUDE 'resort_form.inc' %]
279 </div> <!-- / .span3 -->
281 </div> <!-- / .row-fluid -->
283 [%# Following on one line for translatability %]
284 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
285 <div class="row-fluid">
287 <!-- SUBTYPE LIMITS -->
291 <legend>Audience</legend>
292 <select id="subtype_audience" name="limit" class="subtype">
293 <option value="" selected="selected" class="menuheader">Any audience</option>
294 <option value="aud:a">Preschool</option>
295 <option value="aud:b">Primary</option>
296 <option value="aud:c">Pre-adolescent</option>
297 <option value="aud:d">Adolescent</option>
298 <option value="aud:e">Adult</option>
299 <option value="aud:f">Specialized</option>
300 <option value="aud:g">General</option>
301 <option value="aud:j">Juvenile</option>
304 </div> <!-- / .span3 -->
308 <legend>Content</legend>
309 <select id="subtype_content" name="limit" class="subtype">
310 <option value="" selected="selected" class="menuheader">Any content</option>
311 <option value="fic:1">Fiction</option>
312 <option value="fic:0">Non-fiction</option>
313 <option value="bio:b">Biography</option>
314 <option value="mus:j">Musical recording</option>
315 <option value="mus:i">Non-musical recording</option>
322 <legend>Format</legend>
323 <select id="subtype_format" name="limit" class="subtype">
324 <option value="" selected="selected" class="menuheader">Any format</option>
325 <option value="l-format:ta">Regular print</option>
326 <option value="l-format:tb">Large print</option>
327 <option value="l-format:tc or l-format:fb">Braille</option>
328 <option value="">-----------</option>
329 <option value="l-format:sd">CD audio</option>
330 <option value="l-format:ss">Cassette recording</option>
331 <option value="l-format:vf">VHS tape / Videocassette</option>
332 <option value="l-format:vd">DVD video / Videodisc</option>
333 <option value="l-format:co">CD software</option>
334 <option value="l-format:cr">Website</option>
337 </div> <!-- / .span3 -->
341 <legend>Additional content types for books/printed materials</legend>
342 <select id="subtype_additional" name="limit" class="subtype">
343 <option value="">Any</option>
344 <option value="ctype:a">Abstracts/summaries</option>
345 <option value="ctype:b">Bibliographies</option>
346 <option value="ctype:c">Catalogs</option>
347 <option value="ctype:d">Dictionaries</option>
348 <option value="ctype:e">Encyclopedias </option>
349 <option value="ctype:f">Handbooks</option>
350 <option value="ctype:g">Legal articles</option>
351 <option value="ctype:i">Indexes</option>
352 <option value="ctype:j">Patent document</option>
353 <option value="ctype:k">Discographies</option>
354 <option value="ctype:l">Legislation</option>
355 <option value="ctype:m">Theses</option>
356 <option value="ctype:n">Surveys</option>
357 <option value="ctype:o">Reviews</option>
358 <option value="ctype:p">Programmed texts</option>
359 <option value="ctype:q">Filmographies</option>
360 <option value="ctype:r">Directories</option>
361 <option value="ctype:s">Statistics</option>
362 <option value="ctype:t">Technical reports</option>
363 <option value="ctype:v">Legal cases and case notes</option>
364 <option value="ctype:w">Law reports and digests</option>
365 <option value="ctype:z">Treaties </option>
368 </div> <!-- / .span3 -->
369 </div> <!-- / #subtypes -->
370 <!-- SUBTYPE LIMITS -->
371 [% END # / IF usmarc %]
374 <div id="subtypes_unimarc">
375 <!-- SUBTYPE LIMITS -->
376 [% INCLUDE 'subtypes_unimarc.inc' %]
380 </div> <!-- / .row-fluid -->
381 [% END # / IF expanded_options %]
382 </div> <!-- / .row-fluid -->
384 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
385 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
386 <div class="row-fluid">
388 <div class="text-center">
389 <!-- SEARCH BUTTONS -->
390 [% PROCESS searchbuttons %]
391 <!-- /SEARCH BUTTONS -->
393 </div> <!-- / .span12 -->
394 </div> <!-- / .row-fluid -->
396 </div> <!-- / .container-fluid -->
397 </div> <!-- / .main -->
400 [% INCLUDE 'opac-bottom.inc' %]
401 [% BLOCK searchbuttons %]
403 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
405 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
406 [% IF expanded_options %]
407 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
408 [% ELSIF not expanded_options %]
409 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
413 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
417 [% BLOCK jsinclude %]
418 [% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
419 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
421 $(document).ready(function() {
422 $('#advsearches').tabs();
423 jQuery.cookie.json = true;
424 //$('#advsearches > ul').tabs();
426 [% IF ( ReturnToSearch ) %]
427 if (form_serialized = jQuery.cookie("form_serialized")) {
428 $('#advsearch form').deserialize(form_serialized);
430 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
431 $('#language-limit') .val(form_serialized_limits[0]);
432 $('#branchloop') .val(form_serialized_limits[1]);
433 $('#subtype_audience') .val(form_serialized_limits[2]);
434 $('#subtype_content') .val(form_serialized_limits[3]);
435 $('#subtype_format') .val(form_serialized_limits[4]);
436 $('#subtype_additional') .val(form_serialized_limits[5]);
437 $('#locloop') .val(form_serialized_limits[6]);
440 //Clear all form cookies
441 jQuery.removeCookie("form_serialized", { path: '/'});
442 jQuery.removeCookie("form_serialized_limits", { path: '/'});
443 jQuery.removeCookie("num_paragraph", { path: '/'});
444 jQuery.removeCookie("search_path_code", { path: '/'});
446 $('#advsearch form').submit(function() {
447 form_serialized = $(this).serialize();
448 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
449 form_serialized_limits = [
450 $('#language-limit').val(), $('#branchloop').val(),
451 $('#subtype_audience').val(), $('#subtype_content').val(),
452 $('#subtype_format').val(), $('#subtype_additional').val(),
455 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
456 [% IF ( expanded_options ) %]
457 var numPar = $("#booleansearch fieldset p").size();
458 if (numPar > [% search_boxes_count | html %]){
459 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
461 jQuery.removeCookie("num_paragraph", { path: '/'});
463 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
465 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
466 jQuery.removeCookie("num_paragraph", { path: '/'});
471 /* This function allows to display a new field to search.
473 $(document).on("click", '.ButtonPlus', function(e) {
475 $('.ButtonLess').show();
476 var thisLine = $(this).parent();
477 var newLine = thisLine.clone();
478 newLine.find('input').val('');
479 thisLine.after(newLine);
482 $(document).on("click", '.ButtonLess', function(e) {
484 if($(this).parent().siblings().length <= 3 ) {
485 $('.ButtonLess').hide();
487 $(this).parent().remove();