2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Advanced search</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% BLOCK cssinclude %][% END %]
7 [% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %]
8 [% INCLUDE 'masthead.inc' %]
9 <form action="/cgi-bin/koha/opac-search.pl" method="get">
11 <ul class="breadcrumb">
12 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
13 <li><a href="#">Advanced search</a></li>
16 <div class="container-fluid">
17 <div class="row-fluid">
19 <!-- BOOLEAN SEARCH OPTIONS -->
20 <div id="booleansearch" class="maincontent">
22 <legend>Search for:</legend>
23 [% FOREACH search_box IN search_boxes_loop %]
25 [% IF ( expanded_options ) %]
26 [% IF ( search_box.boolean ) %]
28 <option value="and" selected="selected">and</option>
29 <option value="or">or</option>
30 <option value="not">not</option>
34 <label for="search-field_[% loop.index %]">
35 [% IF loop.index == 0 %]
36
42 [% IF ( expanded_options ) %][% left_content %][% END %]
43 <select name="idx" id="search-field_[% loop.index %]">
44 <option value="kw">Keyword</option>
45 <option value="su,wrdl">Subject</option>
46 [% IF ( expanded_options ) %]
47 <option value="su,phr"> Subject phrase</option>
48 <option value="su-br"> Subject and broader terms</option>
49 <option value="su-na"> Subject and narrower terms</option>
50 <option value="su-rl"> Subject and related terms</option>
52 <option value="ti">Title</option>
53 [% IF ( expanded_options ) %]
54 <option value="ti,phr"> Title phrase</option>
55 <option value="se,wrdl">Series title</option>
56 [% IF ( numbersphr) %]
57 <option value="callnum,phr">Call number</option>
59 <option value="callnum">Call number</option>
61 <option value="location">Shelving location</option>
63 <option value="au,wrdl">Author</option>
64 [% IF ( expanded_options ) %]
65 <option value="au,phr"> Author phrase</option>
66 <option value="cpn,wrdl"> Corporate name</option>
67 <option value="cfn,wrdl"> Conference name</option>
68 <option value="cfn,phr"> Conference name phrase</option>
69 <option value="pn,wrdl"> Personal name</option>
70 <option value="pn,phr"> Personal name phrase</option>
72 [% IF ( expanded_options ) %]
73 <option value="nt">Notes/Comments</option>
74 [% IF (marcflavour != 'UNIMARC') %]
75 <option value="curriculum">Curriculum</option>
78 <option value="pb,wrdl">Publisher</option>
79 <option value="pl,wrdl">Publisher location</option>
80 [% IF ( expanded_options ) %]
81 [% IF ( numbersphr) %]
82 <option value="sn,phr">Standard number</option>
84 <option value="sn">Standard number</option>
86 <option value="nb"> ISBN</option>
87 <option value="ns"> ISSN</option>
89 <option value="nb">ISBN</option>
91 <option value="bc">Barcode</option>
93 <input type="text" size="30" name="q" title="Enter search terms" value="" />
94 [% IF ( expanded_options ) %]
95 [% IF ( !loop.first ) %]
96 <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
97 <a class="ButtonLess" title="Remove field" href="#">[-]</a>
101 [% END # FOREACH search_box %]
103 </div> <!-- /BOOLEAN SEARCH OPTIONS -->
104 </div> <!-- / .span12 -->
105 </div> <!-- / .row-fluid -->
106 <div class="text-center">
107 <!-- SEARCH BUTTONS -->
108 [% PROCESS searchbuttons %]
109 <!-- /SEARCH BUTTONS -->
112 <div class="row-fluid">
113 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or
114 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
116 <div id="advsearches" class="toptabs">
118 [% FOREACH advsearchloo IN advancedsearchesloop %]
119 <li id="advsearch-tab-[% advsearchloo.advanced_search_type %]">
120 <a href="#advsearch-[% advsearchloo.advanced_search_type %]">
121 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
122 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
123 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
124 [% ELSE %]Something else
130 [% FOREACH advsearchloo IN advancedsearchesloop %]
131 <div id="advsearch-[% advsearchloo.advanced_search_type %]" class="advsearch">
133 <legend>Limit to any of the following:</legend>
134 <div class="row-fluid">
135 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
136 [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
138 <input type="checkbox"
139 id="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]"
140 name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
141 value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code %][% ELSE %]mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code %][% END %]"
143 <label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]">
144 [% UNLESS ( noItemTypeImages ) %]
145 [% IF ( itemtypeloo.imageurl ) %]
146 <img border="0" src="[% itemtypeloo.imageurl %]" alt="[% itemtypeloo.description %]" />
150 [% itemtypeloo.description %]
153 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
157 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type %] -->
158 [% END # / FOREACH advancedsearchesloop %]
159 </div> <!-- / #advsearches -->
160 </div> <!-- / .span12 -->
163 <div class="row-fluid">
164 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or
165 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
168 <!-- PUB RANGE OPTION -->
170 <legend>Publication date range</legend>
171 <label for="limit-yr">Date range:</label>
172 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
173 <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>
175 <!-- /PUB RANGE OPTION -->
180 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or
181 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
183 <div id="langfilter">
185 <legend>Language</legend>
186 <!-- LANGUAGE LIMIT -->
188 <label for="language-limit">Language: </label>
189 <select id="language-limit" name="limit">
190 <option value="">No limit</option>
191 [% FOREACH search_languages_loo IN search_languages_loop %]
192 [% IF ( search_languages_loo.selected ) %]
193 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
195 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
200 <!-- /LANGUAGE LIMIT -->
202 </div> <!-- / #langfilter -->
203 </div> <!-- / .span3 -->
206 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or
207 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
208 [% UNLESS ( singleBranchMode ) %]
210 <!-- AVAILABILITY LIMITS -->
213 <legend>Location and availability: </legend>
214 <label for="branchloop">Library:</label>
215 <select name="limit" id="branchloop">
216 <option value="">All libraries</option>
217 [% FOREACH BranchesLoo IN BranchesLoop %]
218 [% IF ( BranchesLoo.selected ) %]
219 <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
221 <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
225 [% IF ( searchdomainloop ) %]
227 <label for="categoryloop">Groups of libraries</label>
228 <select name="multibranchlimit" id="categoryloop">
229 <option value=""> -- none -- </option>
230 [% FOREACH searchdomainloo IN searchdomainloop %]
231 <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
235 <div style="margin-top:.4em">
236 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
239 </div> <!-- / #location -->
240 <!-- /AVAILABILITY LIMITS -->
241 </div> <!-- / .span3 -->
242 [% END # / UNLESS singleBranchMode %]
245 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or
246 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
251 <legend>Sorting: </legend>
252 <label for="sort_by">Sort by:</label>
253 <select id="sort_by" name="sort_by">
254 [% INCLUDE 'resort_form.inc' %]
259 </div> <!-- / .span3 -->
261 </div> <!-- / .row-fluid -->
263 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or
264 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
265 <div class="row-fluid">
267 <!-- SUBTYPE LIMITS -->
271 <legend>Audience</legend>
272 <select id="subtype_audience" name="limit" class="subtype">
273 <option value="" selected="selected" class="menuheader">Any audience</option>
274 <option value="aud:a">Preschool</option>
275 <option value="aud:b">Primary</option>
276 <option value="aud:c">Pre-adolescent</option>
277 <option value="aud:d">Adolescent</option>
278 <option value="aud:e">Adult</option>
279 <option value="aud:f">Specialized</option>
280 <option value="aud:g">General</option>
281 <option value="aud:j">Juvenile</option>
284 </div> <!-- / .span3 -->
288 <legend>Content</legend>
289 <select id="subtype_content" name="limit" class="subtype">
290 <option value="" selected="selected" class="menuheader">Any content</option>
291 <option value="fic:1">Fiction</option>
292 <option value="fic:0">Non-fiction</option>
293 <option value="bio:b">Biography</option>
294 <option value="mus:j">Musical recording</option>
295 <option value="mus:i">Non-musical recording</option>
302 <legend>Format</legend>
303 <select id="subtype_format" name="limit" class="subtype">
304 <option value="" selected="selected" class="menuheader">Any format</option>
305 <option value="l-format:ta">Regular print</option>
306 <option value="l-format:tb">Large print</option>
307 <option value="l-format:fk">Braille</option>
308 <option value="">-----------</option>
309 <option value="l-format:sd">CD audio</option>
310 <option value="l-format:ss">Cassette recording</option>
311 <option value="l-format:vf">VHS tape / Videocassette</option>
312 <option value="l-format:vd">DVD video / Videodisc</option>
313 <option value="l-format:co">CD software</option>
314 <option value="l-format:cr">Website</option>
317 </div> <!-- / .span3 -->
321 <legend>Additional content types for books/printed materials</legend>
322 <select id="subtype_additional" name="limit" class="subtype">
323 <option value="">Any</option>
324 <option value="ctype:a">Abstracts/summaries</option>
325 <option value="ctype:b">Bibliographies</option>
326 <option value="ctype:c">Catalogs</option>
327 <option value="ctype:d">Dictionaries</option>
328 <option value="ctype:e">Encyclopedias </option>
329 <option value="ctype:f">Handbooks</option>
330 <option value="ctype:g">Legal articles</option>
331 <option value="ctype:i">Indexes</option>
332 <option value="ctype:j">Patent document</option>
333 <option value="ctype:k">Discographies</option>
334 <option value="ctype:l">Legislation</option>
335 <option value="ctype:m">Theses</option>
336 <option value="ctype:n">Surveys</option>
337 <option value="ctype:o">Reviews</option>
338 <option value="ctype:p">Programmed texts</option>
339 <option value="ctype:q">Filmographies</option>
340 <option value="ctype:r">Directories</option>
341 <option value="ctype:s">Statistics</option>
342 <option value="ctype:t">Technical reports</option>
343 <option value="ctype:v">Legal cases and case notes</option>
344 <option value="ctype:w">Law reports and digests</option>
345 <option value="ctype:z">Treaties </option>
348 </div> <!-- / .span3 -->
349 </div> <!-- / #subtypes -->
350 <!-- SUBTYPE LIMITS -->
351 [% END # / IF usmarc %]
354 <div id="subtypes_unimarc">
355 <!-- SUBTYPE LIMITS -->
356 [% INCLUDE 'subtypes_unimarc.inc' %]
360 </div> <!-- / .row-fluid -->
361 [% END # / IF expanded_options %]
362 </div> <!-- / .row-fluid -->
364 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
365 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
366 <div class="row-fluid">
368 <div class="text-center">
369 <!-- SEARCH BUTTONS -->
370 [% PROCESS searchbuttons %]
371 <!-- /SEARCH BUTTONS -->
373 </div> <!-- / .span12 -->
374 </div> <!-- / .row-fluid -->
376 </div> <!-- / .main -->
379 [% INCLUDE 'opac-bottom.inc' %]
380 [% BLOCK searchbuttons %]
382 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
384 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
385 [% IF expanded_options %]
386 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
387 [% ELSIF not expanded_options %]
388 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
392 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
396 [% BLOCK jsinclude %]
397 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.deserialize.min.js"></script>
398 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
399 <script type="text/javascript">//<![CDATA[
400 $(document).ready(function() {
401 $('#advsearches').tabs();
402 jQuery.cookie.json = true;
403 //$('#advsearches > ul').tabs();
405 [% IF ( ReturnToSearch ) %]
406 if (form_serialized = jQuery.cookie("form_serialized")) {
407 $('#advsearch form').deserialize(form_serialized);
409 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
410 $('#language-limit') .val(form_serialized_limits[0]);
411 $('#branchloop') .val(form_serialized_limits[1]);
412 $('#subtype_audience') .val(form_serialized_limits[2]);
413 $('#subtype_content') .val(form_serialized_limits[3]);
414 $('#subtype_format') .val(form_serialized_limits[4]);
415 $('#subtype_additional') .val(form_serialized_limits[5]);
416 $('#locloop') .val(form_serialized_limits[6]);
419 //Clear all form cookies
420 jQuery.removeCookie("form_serialized", { path: '/'});
421 jQuery.removeCookie("form_serialized_itype", { path: '/'});
422 jQuery.removeCookie("form_serialized_limits", { path: '/'});
423 jQuery.removeCookie("num_paragraph", { path: '/'});
424 jQuery.removeCookie("search_path_code", { path: '/'});
426 $('#advsearch form').submit(function() {
427 form_serialized = $(this).serialize();
428 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
429 form_serialized_limits = [
430 $('#language-limit').val(), $('#branchloop').val(),
431 $('#subtype_audience').val(), $('#subtype_content').val(),
432 $('#subtype_format').val(), $('#subtype_additional').val(),
435 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
436 [% IF ( expanded_options ) %]
437 var numPar = $("#booleansearch fieldset p").size();
438 if (numPar > [% search_boxes_count %]){
439 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
441 jQuery.removeCookie("num_paragraph", { path: '/'});
443 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
445 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
446 jQuery.removeCookie("num_paragraph", { path: '/'});
451 /* This function allows to display a new field to search.
453 $(document).on("click", '.ButtonPlus', function(e) {
455 $('.ButtonLess').show();
456 var thisLine = $(this).parent();
457 var newLine = thisLine.clone();
458 newLine.find('input').val('');
459 thisLine.after(newLine);
462 $(document).on("click", '.ButtonLess', function(e) {
464 if($(this).parent().siblings().length <= 3 ) {
465 $('.ButtonLess').hide();
467 $(this).parent().remove();