4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Advanced search</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
9 [% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %]
10 [% INCLUDE 'masthead.inc' %]
11 <form action="/cgi-bin/koha/opac-search.pl" method="get">
13 <ul class="breadcrumb">
14 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
15 <li><a href="#">Advanced search</a></li>
18 <div class="container-fluid">
19 <div class="row-fluid">
21 <!-- BOOLEAN SEARCH OPTIONS -->
22 <div id="booleansearch" class="maincontent">
24 <legend>Search for:</legend>
25 [% FOREACH search_box IN search_boxes_loop %]
27 [% IF ( expanded_options ) %]
28 [% IF ( search_box.boolean ) %]
30 <option value="and" selected="selected">and</option>
31 <option value="or">or</option>
32 <option value="not">not</option>
36 <label for="search-field_[% loop.index %]">
37 [% IF loop.index == 0 %]
38
44 [% IF ( expanded_options ) %][% left_content %][% END %]
45 <select name="idx" id="search-field_[% loop.index %]">
46 <option value="kw">Keyword</option>
47 <option value="su,wrdl">Subject</option>
48 [% IF ( expanded_options ) %]
49 <option value="su,phr"> Subject phrase</option>
50 <option value="su-br"> Subject and broader terms</option>
51 <option value="su-na"> Subject and narrower terms</option>
52 <option value="su-rl"> Subject and related terms</option>
54 <option value="ti">Title</option>
55 [% IF ( expanded_options ) %]
56 <option value="ti,phr"> Title phrase</option>
57 <option value="se,wrdl">Series title</option>
58 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
59 <option value="callnum,phr">Call number</option>
61 <option value="callnum">Call number</option>
65 <option value="au,wrdl">Author</option>
66 [% IF ( expanded_options ) %]
67 <option value="au,phr"> Author phrase</option>
68 <option value="cpn,wrdl"> Corporate name</option>
69 <option value="cfn,wrdl"> Conference name</option>
70 <option value="cfn,phr"> Conference name phrase</option>
71 <option value="pn,wrdl"> Personal name</option>
72 <option value="pn,phr"> Personal name phrase</option>
74 [% IF ( expanded_options ) %]
75 <option value="nt">Notes/Comments</option>
76 [% IF (marcflavour != 'UNIMARC') %]
77 <option value="curriculum">Curriculum</option>
80 <option value="pb,wrdl">Publisher</option>
81 <option value="pl,wrdl">Publisher location</option>
82 [% IF ( expanded_options ) %]
83 [% IF ( Koha.Preference('OPACNumbersPreferPhrase') ) %]
84 <option value="sn,phr">Standard number</option>
86 <option value="sn">Standard number</option>
88 <option value="nb"> ISBN</option>
89 <option value="ns"> ISSN</option>
91 <option value="nb">ISBN</option>
93 <option value="bc">Barcode</option>
95 <input type="text" size="30" name="q" title="Enter search terms" value="" />
96 [% IF ( expanded_options ) %]
97 [% IF ( !loop.first ) %]
98 <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
99 <a class="ButtonLess" title="Remove field" href="#">[-]</a>
103 [% END # FOREACH search_box %]
105 </div> <!-- /BOOLEAN SEARCH OPTIONS -->
106 </div> <!-- / .span12 -->
107 </div> <!-- / .row-fluid -->
108 <div class="text-center">
109 <!-- SEARCH BUTTONS -->
110 [% PROCESS searchbuttons %]
111 <!-- /SEARCH BUTTONS -->
114 <div class="row-fluid">
115 [%# Following on one line for translatability %]
116 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
118 <div id="advsearches" class="toptabs">
120 [% FOREACH advsearchloo IN advancedsearchesloop %]
121 <li id="advsearch-tab-[% advsearchloo.advanced_search_type %]">
122 <a href="#advsearch-[% advsearchloo.advanced_search_type %]">
123 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
124 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
125 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
126 [% ELSE %]Something else
132 [% FOREACH advsearchloo IN advancedsearchesloop %]
133 <div id="advsearch-[% advsearchloo.advanced_search_type %]" class="advsearch">
135 <legend>Limit to any of the following:</legend>
136 <div class="row-fluid">
137 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
138 [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
140 <input type="checkbox"
141 id="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]"
142 name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
143 value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code %][% ELSE %]mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code %][% END %]"
145 <label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]">
146 [% UNLESS ( noItemTypeImages ) %]
147 [% IF ( itemtypeloo.imageurl ) %]
148 <img src="[% itemtypeloo.imageurl %]" alt="[% itemtypeloo.description %]" />
152 [% itemtypeloo.description %]
155 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
159 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type %] -->
160 [% END # / FOREACH advancedsearchesloop %]
161 </div> <!-- / #advsearches -->
162 </div> <!-- / .span12 -->
165 <div class="row-fluid">
166 [%# Following on one line for translatability %]
167 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
170 <!-- PUB RANGE OPTION -->
172 <legend>Publication date range</legend>
173 <label for="limit-yr">Date range:</label>
174 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
175 <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>
177 <!-- /PUB RANGE OPTION -->
182 [%# Following on one line for translatability %]
183 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
185 <div id="langfilter">
187 <legend>Language</legend>
188 <!-- LANGUAGE LIMIT -->
190 <label for="language-limit">Language: </label>
191 <select id="language-limit" name="limit">
192 <option value="">No limit</option>
193 [% FOREACH search_languages_loo IN search_languages_loop %]
194 [% IF ( search_languages_loo.selected ) %]
195 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
197 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
202 <!-- /LANGUAGE LIMIT -->
204 </div> <!-- / #langfilter -->
205 </div> <!-- / .span3 -->
208 [%# Following on one line for translatability %]
209 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
210 [% UNLESS ( singleBranchMode ) %]
212 <!-- AVAILABILITY LIMITS -->
215 <legend>Location and availability: </legend>
216 <label for="branchloop">Library:</label>
217 <select name="limit" id="branchloop">
218 <option value="">All libraries</option>
219 [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
220 [% IF BranchesLoo.selected %]
221 <option value="branch:[% BranchesLoo.branchcode %]" selected="selected">[% BranchesLoo.branchname %]</option>
223 <option value="branch:[% BranchesLoo.branchcode %]">[% BranchesLoo.branchname %]</option>
227 [% IF search_groups %]
229 <label for="categoryloop">Groups of libraries</label>
230 <select name="multibranchlimit" id="categoryloop">
231 <option value=""> -- none -- </option>
232 [% FOREACH sg IN search_groups %]
233 <option value="[% sg.id %]">[% sg.title %]</option>
237 <div style="margin-top:.4em">
238 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
241 </div> <!-- / #location -->
242 <!-- /AVAILABILITY LIMITS -->
243 </div> <!-- / .span3 -->
244 [% END # / UNLESS singleBranchMode %]
247 [%# Following on one line for translatability %]
248 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
253 <legend>Sorting: </legend>
254 <label for="sort_by">Sort by:</label>
255 <select id="sort_by" name="sort_by">
256 [% INCLUDE 'resort_form.inc' %]
261 </div> <!-- / .span3 -->
263 </div> <!-- / .row-fluid -->
265 [%# Following on one line for translatability %]
266 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
267 <div class="row-fluid">
269 <!-- SUBTYPE LIMITS -->
273 <legend>Audience</legend>
274 <select id="subtype_audience" name="limit" class="subtype">
275 <option value="" selected="selected" class="menuheader">Any audience</option>
276 <option value="aud:a">Preschool</option>
277 <option value="aud:b">Primary</option>
278 <option value="aud:c">Pre-adolescent</option>
279 <option value="aud:d">Adolescent</option>
280 <option value="aud:e">Adult</option>
281 <option value="aud:f">Specialized</option>
282 <option value="aud:g">General</option>
283 <option value="aud:j">Juvenile</option>
286 </div> <!-- / .span3 -->
290 <legend>Content</legend>
291 <select id="subtype_content" name="limit" class="subtype">
292 <option value="" selected="selected" class="menuheader">Any content</option>
293 <option value="fic:1">Fiction</option>
294 <option value="fic:0">Non-fiction</option>
295 <option value="bio:b">Biography</option>
296 <option value="mus:j">Musical recording</option>
297 <option value="mus:i">Non-musical recording</option>
304 <legend>Format</legend>
305 <select id="subtype_format" name="limit" class="subtype">
306 <option value="" selected="selected" class="menuheader">Any format</option>
307 <option value="l-format:ta">Regular print</option>
308 <option value="l-format:tb">Large print</option>
309 <option value="l-format:fk">Braille</option>
310 <option value="">-----------</option>
311 <option value="l-format:sd">CD audio</option>
312 <option value="l-format:ss">Cassette recording</option>
313 <option value="l-format:vf">VHS tape / Videocassette</option>
314 <option value="l-format:vd">DVD video / Videodisc</option>
315 <option value="l-format:co">CD software</option>
316 <option value="l-format:cr">Website</option>
319 </div> <!-- / .span3 -->
323 <legend>Additional content types for books/printed materials</legend>
324 <select id="subtype_additional" name="limit" class="subtype">
325 <option value="">Any</option>
326 <option value="ctype:a">Abstracts/summaries</option>
327 <option value="ctype:b">Bibliographies</option>
328 <option value="ctype:c">Catalogs</option>
329 <option value="ctype:d">Dictionaries</option>
330 <option value="ctype:e">Encyclopedias </option>
331 <option value="ctype:f">Handbooks</option>
332 <option value="ctype:g">Legal articles</option>
333 <option value="ctype:i">Indexes</option>
334 <option value="ctype:j">Patent document</option>
335 <option value="ctype:k">Discographies</option>
336 <option value="ctype:l">Legislation</option>
337 <option value="ctype:m">Theses</option>
338 <option value="ctype:n">Surveys</option>
339 <option value="ctype:o">Reviews</option>
340 <option value="ctype:p">Programmed texts</option>
341 <option value="ctype:q">Filmographies</option>
342 <option value="ctype:r">Directories</option>
343 <option value="ctype:s">Statistics</option>
344 <option value="ctype:t">Technical reports</option>
345 <option value="ctype:v">Legal cases and case notes</option>
346 <option value="ctype:w">Law reports and digests</option>
347 <option value="ctype:z">Treaties </option>
350 </div> <!-- / .span3 -->
351 </div> <!-- / #subtypes -->
352 <!-- SUBTYPE LIMITS -->
353 [% END # / IF usmarc %]
356 <div id="subtypes_unimarc">
357 <!-- SUBTYPE LIMITS -->
358 [% INCLUDE 'subtypes_unimarc.inc' %]
362 </div> <!-- / .row-fluid -->
363 [% END # / IF expanded_options %]
364 </div> <!-- / .row-fluid -->
366 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
367 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
368 <div class="row-fluid">
370 <div class="text-center">
371 <!-- SEARCH BUTTONS -->
372 [% PROCESS searchbuttons %]
373 <!-- /SEARCH BUTTONS -->
375 </div> <!-- / .span12 -->
376 </div> <!-- / .row-fluid -->
378 </div> <!-- / .container-fluid -->
379 </div> <!-- / .main -->
382 [% INCLUDE 'opac-bottom.inc' %]
383 [% BLOCK searchbuttons %]
385 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
387 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
388 [% IF expanded_options %]
389 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
390 [% ELSIF not expanded_options %]
391 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
395 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
399 [% BLOCK jsinclude %]
400 [% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") %]
401 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") %]
402 <script type="text/javascript">//<![CDATA[
403 $(document).ready(function() {
404 $('#advsearches').tabs();
405 jQuery.cookie.json = true;
406 //$('#advsearches > ul').tabs();
408 [% IF ( ReturnToSearch ) %]
409 if (form_serialized = jQuery.cookie("form_serialized")) {
410 $('#advsearch form').deserialize(form_serialized);
412 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
413 $('#language-limit') .val(form_serialized_limits[0]);
414 $('#branchloop') .val(form_serialized_limits[1]);
415 $('#subtype_audience') .val(form_serialized_limits[2]);
416 $('#subtype_content') .val(form_serialized_limits[3]);
417 $('#subtype_format') .val(form_serialized_limits[4]);
418 $('#subtype_additional') .val(form_serialized_limits[5]);
419 $('#locloop') .val(form_serialized_limits[6]);
422 //Clear all form cookies
423 jQuery.removeCookie("form_serialized", { path: '/'});
424 jQuery.removeCookie("form_serialized_itype", { 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 %]){
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();