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">
14 <ul class="breadcrumb">
15 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
16 <li><a href="#">Advanced search</a></li>
19 <div class="container-fluid">
20 <div class="row-fluid">
22 <!-- BOOLEAN SEARCH OPTIONS -->
23 <div id="booleansearch" class="maincontent">
25 <legend>Search for:</legend>
26 [% FOREACH search_box IN search_boxes_loop %]
28 [% IF ( expanded_options ) %]
29 [% IF ( search_box.boolean ) %]
31 <option value="and" selected="selected">and</option>
32 <option value="or">or</option>
33 <option value="not">not</option>
37 <label for="search-field_[% loop.index | html %]">
38 [% IF loop.index == 0 %]
39
45 [% IF ( expanded_options ) %][% left_content | html %][% END %]
46 <select name="idx" id="search-field_[% loop.index | html %]">
47 <option value="kw">Keyword</option>
48 <option value="su,wrdl">Subject</option>
49 [% IF ( expanded_options ) %]
50 <option value="su,phr"> Subject phrase</option>
51 <option value="su-br"> Subject and broader terms</option>
52 <option value="su-na"> Subject and narrower terms</option>
53 <option value="su-rl"> Subject and related terms</option>
55 <option value="ti">Title</option>
56 [% IF ( expanded_options ) %]
57 <option value="ti,phr"> Title phrase</option>
58 <option value="se,wrdl">Series title</option>
59 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
60 <option value="callnum,phr">Call number</option>
62 <option value="callnum">Call number</option>
66 <option value="au,wrdl">Author</option>
67 [% IF ( expanded_options ) %]
68 <option value="au,phr"> Author phrase</option>
69 <option value="cpn,wrdl"> Corporate name</option>
70 <option value="cfn,wrdl"> Conference name</option>
71 <option value="cfn,phr"> Conference name phrase</option>
72 <option value="pn,wrdl"> Personal name</option>
73 <option value="pn,phr"> Personal name phrase</option>
75 [% IF ( expanded_options ) %]
76 <option value="nt">Notes/Comments</option>
77 [% IF (marcflavour != 'UNIMARC') %]
78 <option value="curriculum">Curriculum</option>
81 <option value="pb,wrdl">Publisher</option>
82 <option value="pl,wrdl">Publisher location</option>
83 [% IF ( expanded_options ) %]
84 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
85 <option value="ident,phr">Standard number</option>
87 <option value="ident">Standard number</option>
89 <option value="nb"> ISBN</option>
90 <option value="ns"> ISSN</option>
92 <option value="nb">ISBN</option>
94 <option value="bc">Barcode</option>
96 <input type="text" size="30" name="q" title="Enter search terms" value="" />
97 [% IF ( expanded_options ) %]
98 [% IF ( !loop.first ) %]
99 <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
100 <a class="ButtonLess" title="Remove field" href="#">[-]</a>
104 [% END # FOREACH search_box %]
106 </div> <!-- /BOOLEAN SEARCH OPTIONS -->
107 </div> <!-- / .span12 -->
108 </div> <!-- / .row-fluid -->
109 <div class="text-center">
110 <!-- SEARCH BUTTONS -->
111 [% PROCESS searchbuttons %]
112 <!-- /SEARCH BUTTONS -->
115 <div class="row-fluid">
116 [%# Following on one line for translatability %]
117 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
119 <div id="advsearches" class="toptabs">
121 [% FOREACH advsearchloo IN advancedsearchesloop %]
122 <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
123 <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
124 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
125 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
126 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
127 [% ELSE %]Something else
133 [% FOREACH advsearchloo IN advancedsearchesloop %]
134 <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
136 <legend>Limit to any of the following:</legend>
137 <div class="row-fluid">
138 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
139 [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
141 <input type="checkbox"
142 id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"
143 name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
144 value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code | html %][% ELSE %]mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %][% END %]"
146 <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
147 [% UNLESS ( noItemTypeImages ) %]
148 [% IF ( itemtypeloo.imageurl ) %]
149 <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
153 [% itemtypeloo.description | html %]
156 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
160 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type | html %] -->
161 [% END # / FOREACH advancedsearchesloop %]
162 </div> <!-- / #advsearches -->
163 </div> <!-- / .span12 -->
166 <div class="row-fluid">
167 [%# Following on one line for translatability %]
168 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
171 <!-- PUB RANGE OPTION -->
173 <legend>Publication date range</legend>
174 <label for="limit-yr">Date range:</label>
175 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
176 <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>
178 <!-- /PUB RANGE OPTION -->
183 [%# Following on one line for translatability %]
184 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
186 <div id="langfilter">
188 <legend>Language</legend>
189 <!-- LANGUAGE LIMIT -->
191 <label for="language-limit">Language: </label>
192 <select id="language-limit" name="limit">
193 <option value="">No limit</option>
194 [% FOREACH search_languages_loo IN search_languages_loop %]
195 [% IF ( search_languages_loo.selected ) %]
196 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]" selected="selected">[% search_languages_loo.language_description | html %]</option>
198 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code | html %]">[% search_languages_loo.language_description | html %]</option>
203 <!-- /LANGUAGE LIMIT -->
205 </div> <!-- / #langfilter -->
206 </div> <!-- / .span3 -->
209 [%# Following on one line for translatability %]
210 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
211 [% UNLESS ( singleBranchMode ) %]
213 <!-- AVAILABILITY LIMITS -->
216 <legend>Location and availability: </legend>
217 <label for="branchloop">Library:</label>
218 <select name="limit" id="branchloop">
219 <option value="">All libraries</option>
220 [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
221 [% IF BranchesLoo.selected %]
222 <option value="branch:[% BranchesLoo.branchcode | html %]" selected="selected">[% BranchesLoo.branchname | html %]</option>
224 <option value="branch:[% BranchesLoo.branchcode | html %]">[% BranchesLoo.branchname | html %]</option>
228 [% IF search_groups %]
230 <label for="categoryloop">Groups of libraries</label>
231 <select name="multibranchlimit" id="categoryloop">
232 <option value=""> -- none -- </option>
233 [% FOREACH sg IN search_groups %]
234 <option value="[% sg.id | html %]">[% sg.title | html %]</option>
238 <div style="margin-top:.4em">
239 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
242 </div> <!-- / #location -->
243 <!-- /AVAILABILITY LIMITS -->
244 </div> <!-- / .span3 -->
245 [% END # / UNLESS singleBranchMode %]
248 [%# Following on one line for translatability %]
249 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
254 <legend>Sorting: </legend>
255 <label for="sort_by">Sort by:</label>
256 <select id="sort_by" name="sort_by">
257 [% INCLUDE 'resort_form.inc' %]
262 </div> <!-- / .span3 -->
264 </div> <!-- / .row-fluid -->
266 [%# Following on one line for translatability %]
267 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
268 <div class="row-fluid">
270 <!-- SUBTYPE LIMITS -->
274 <legend>Audience</legend>
275 <select id="subtype_audience" name="limit" class="subtype">
276 <option value="" selected="selected" class="menuheader">Any audience</option>
277 <option value="aud:a">Preschool</option>
278 <option value="aud:b">Primary</option>
279 <option value="aud:c">Pre-adolescent</option>
280 <option value="aud:d">Adolescent</option>
281 <option value="aud:e">Adult</option>
282 <option value="aud:f">Specialized</option>
283 <option value="aud:g">General</option>
284 <option value="aud:j">Juvenile</option>
287 </div> <!-- / .span3 -->
291 <legend>Content</legend>
292 <select id="subtype_content" name="limit" class="subtype">
293 <option value="" selected="selected" class="menuheader">Any content</option>
294 <option value="fic:1">Fiction</option>
295 <option value="fic:0">Non-fiction</option>
296 <option value="bio:b">Biography</option>
297 <option value="mus:j">Musical recording</option>
298 <option value="mus:i">Non-musical recording</option>
305 <legend>Format</legend>
306 <select id="subtype_format" name="limit" class="subtype">
307 <option value="" selected="selected" class="menuheader">Any format</option>
308 <option value="l-format:ta">Regular print</option>
309 <option value="l-format:tb">Large print</option>
310 <option value="l-format:fk">Braille</option>
311 <option value="">-----------</option>
312 <option value="l-format:sd">CD audio</option>
313 <option value="l-format:ss">Cassette recording</option>
314 <option value="l-format:vf">VHS tape / Videocassette</option>
315 <option value="l-format:vd">DVD video / Videodisc</option>
316 <option value="l-format:co">CD software</option>
317 <option value="l-format:cr">Website</option>
320 </div> <!-- / .span3 -->
324 <legend>Additional content types for books/printed materials</legend>
325 <select id="subtype_additional" name="limit" class="subtype">
326 <option value="">Any</option>
327 <option value="ctype:a">Abstracts/summaries</option>
328 <option value="ctype:b">Bibliographies</option>
329 <option value="ctype:c">Catalogs</option>
330 <option value="ctype:d">Dictionaries</option>
331 <option value="ctype:e">Encyclopedias </option>
332 <option value="ctype:f">Handbooks</option>
333 <option value="ctype:g">Legal articles</option>
334 <option value="ctype:i">Indexes</option>
335 <option value="ctype:j">Patent document</option>
336 <option value="ctype:k">Discographies</option>
337 <option value="ctype:l">Legislation</option>
338 <option value="ctype:m">Theses</option>
339 <option value="ctype:n">Surveys</option>
340 <option value="ctype:o">Reviews</option>
341 <option value="ctype:p">Programmed texts</option>
342 <option value="ctype:q">Filmographies</option>
343 <option value="ctype:r">Directories</option>
344 <option value="ctype:s">Statistics</option>
345 <option value="ctype:t">Technical reports</option>
346 <option value="ctype:v">Legal cases and case notes</option>
347 <option value="ctype:w">Law reports and digests</option>
348 <option value="ctype:z">Treaties </option>
351 </div> <!-- / .span3 -->
352 </div> <!-- / #subtypes -->
353 <!-- SUBTYPE LIMITS -->
354 [% END # / IF usmarc %]
357 <div id="subtypes_unimarc">
358 <!-- SUBTYPE LIMITS -->
359 [% INCLUDE 'subtypes_unimarc.inc' %]
363 </div> <!-- / .row-fluid -->
364 [% END # / IF expanded_options %]
365 </div> <!-- / .row-fluid -->
367 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
368 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
369 <div class="row-fluid">
371 <div class="text-center">
372 <!-- SEARCH BUTTONS -->
373 [% PROCESS searchbuttons %]
374 <!-- /SEARCH BUTTONS -->
376 </div> <!-- / .span12 -->
377 </div> <!-- / .row-fluid -->
379 </div> <!-- / .container-fluid -->
380 </div> <!-- / .main -->
383 [% INCLUDE 'opac-bottom.inc' %]
384 [% BLOCK searchbuttons %]
386 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
388 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
389 [% IF expanded_options %]
390 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
391 [% ELSIF not expanded_options %]
392 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
396 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
400 [% BLOCK jsinclude %]
401 [% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
402 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
404 $(document).ready(function() {
405 $('#advsearches').tabs();
406 jQuery.cookie.json = true;
407 //$('#advsearches > ul').tabs();
409 [% IF ( ReturnToSearch ) %]
410 if (form_serialized = jQuery.cookie("form_serialized")) {
411 $('#advsearch form').deserialize(form_serialized);
413 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
414 $('#language-limit') .val(form_serialized_limits[0]);
415 $('#branchloop') .val(form_serialized_limits[1]);
416 $('#subtype_audience') .val(form_serialized_limits[2]);
417 $('#subtype_content') .val(form_serialized_limits[3]);
418 $('#subtype_format') .val(form_serialized_limits[4]);
419 $('#subtype_additional') .val(form_serialized_limits[5]);
420 $('#locloop') .val(form_serialized_limits[6]);
423 //Clear all form cookies
424 jQuery.removeCookie("form_serialized", { path: '/'});
425 jQuery.removeCookie("form_serialized_limits", { path: '/'});
426 jQuery.removeCookie("num_paragraph", { path: '/'});
427 jQuery.removeCookie("search_path_code", { path: '/'});
429 $('#advsearch form').submit(function() {
430 form_serialized = $(this).serialize();
431 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
432 form_serialized_limits = [
433 $('#language-limit').val(), $('#branchloop').val(),
434 $('#subtype_audience').val(), $('#subtype_content').val(),
435 $('#subtype_format').val(), $('#subtype_additional').val(),
438 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
439 [% IF ( expanded_options ) %]
440 var numPar = $("#booleansearch fieldset p").size();
441 if (numPar > [% search_boxes_count | html %]){
442 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
444 jQuery.removeCookie("num_paragraph", { path: '/'});
446 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
448 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
449 jQuery.removeCookie("num_paragraph", { path: '/'});
454 /* This function allows to display a new field to search.
456 $(document).on("click", '.ButtonPlus', function(e) {
458 $('.ButtonLess').show();
459 var thisLine = $(this).parent();
460 var newLine = thisLine.clone();
461 newLine.find('input').val('');
462 thisLine.after(newLine);
465 $(document).on("click", '.ButtonLess', function(e) {
467 if($(this).parent().siblings().length <= 3 ) {
468 $('.ButtonLess').hide();
470 $(this).parent().remove();