3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Advanced search</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
8 [% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %]
9 [% INCLUDE 'masthead.inc' %]
10 <form action="/cgi-bin/koha/opac-search.pl" method="get">
12 <ul class="breadcrumb">
13 <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
14 <li><a href="#">Advanced search</a></li>
17 <div class="container-fluid">
18 <div class="row-fluid">
20 <!-- BOOLEAN SEARCH OPTIONS -->
21 <div id="booleansearch" class="maincontent">
23 <legend>Search for:</legend>
24 [% FOREACH search_box IN search_boxes_loop %]
26 [% IF ( expanded_options ) %]
27 [% IF ( search_box.boolean ) %]
29 <option value="and" selected="selected">and</option>
30 <option value="or">or</option>
31 <option value="not">not</option>
35 <label for="search-field_[% loop.index %]">
36 [% IF loop.index == 0 %]
37
43 [% IF ( expanded_options ) %][% left_content %][% END %]
44 <select name="idx" id="search-field_[% loop.index %]">
45 <option value="kw">Keyword</option>
46 <option value="su,wrdl">Subject</option>
47 [% IF ( expanded_options ) %]
48 <option value="su,phr"> Subject phrase</option>
49 <option value="su-br"> Subject and broader terms</option>
50 <option value="su-na"> Subject and narrower terms</option>
51 <option value="su-rl"> Subject and related terms</option>
53 <option value="ti">Title</option>
54 [% IF ( expanded_options ) %]
55 <option value="ti,phr"> Title phrase</option>
56 <option value="se,wrdl">Series title</option>
57 [% IF ( numbersphr) %]
58 <option value="callnum,phr">Call number</option>
60 <option value="callnum">Call number</option>
64 <option value="au,wrdl">Author</option>
65 [% IF ( expanded_options ) %]
66 <option value="au,phr"> Author phrase</option>
67 <option value="cpn,wrdl"> Corporate name</option>
68 <option value="cfn,wrdl"> Conference name</option>
69 <option value="cfn,phr"> Conference name phrase</option>
70 <option value="pn,wrdl"> Personal name</option>
71 <option value="pn,phr"> Personal name phrase</option>
73 [% IF ( expanded_options ) %]
74 <option value="nt">Notes/Comments</option>
75 [% IF (marcflavour != 'UNIMARC') %]
76 <option value="curriculum">Curriculum</option>
79 <option value="pb,wrdl">Publisher</option>
80 <option value="pl,wrdl">Publisher location</option>
81 [% IF ( expanded_options ) %]
82 [% IF ( numbersphr) %]
83 <option value="sn,phr">Standard number</option>
85 <option value="sn">Standard number</option>
87 <option value="nb"> ISBN</option>
88 <option value="ns"> ISSN</option>
90 <option value="nb">ISBN</option>
92 <option value="bc">Barcode</option>
94 <input type="text" size="30" name="q" title="Enter search terms" value="" />
95 [% IF ( expanded_options ) %]
96 [% IF ( !loop.first ) %]
97 <a class="ButtonPlus" name="ButtonPlus" title="Add another field" href="#">[+]</a>
98 <a class="ButtonLess" title="Remove field" href="#">[-]</a>
102 [% END # FOREACH search_box %]
104 </div> <!-- /BOOLEAN SEARCH OPTIONS -->
105 </div> <!-- / .span12 -->
106 </div> <!-- / .row-fluid -->
107 <div class="text-center">
108 <!-- SEARCH BUTTONS -->
109 [% PROCESS searchbuttons %]
110 <!-- /SEARCH BUTTONS -->
113 <div class="row-fluid">
114 [%# Following on one line for translatability %]
115 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
117 <div id="advsearches" class="toptabs">
119 [% FOREACH advsearchloo IN advancedsearchesloop %]
120 <li id="advsearch-tab-[% advsearchloo.advanced_search_type %]">
121 <a href="#advsearch-[% advsearchloo.advanced_search_type %]">
122 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
123 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
124 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
125 [% ELSE %]Something else
131 [% FOREACH advsearchloo IN advancedsearchesloop %]
132 <div id="advsearch-[% advsearchloo.advanced_search_type %]" class="advsearch">
134 <legend>Limit to any of the following:</legend>
135 <div class="row-fluid">
136 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
137 [% IF (advsearchloo.advanced_search_type != 'itemtypes') OR (((!itemtypeloo.searchcategory) AND (itemtypeloo.cat == 0)) OR (itemtypeloo.cat == 1)) %]
139 <input type="checkbox"
140 id="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]"
141 name="[% IF ( itemtypeloo.cat == 1 ) %]searchcat[% ELSE %]limit[% END %]"
142 value="[% IF ( itemtypeloo.cat == 1 ) %][% itemtypeloo.code %][% ELSE %]mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code %][% END %]"
144 <label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]">
145 [% UNLESS ( noItemTypeImages ) %]
146 [% IF ( itemtypeloo.imageurl ) %]
147 <img src="[% itemtypeloo.imageurl %]" alt="[% itemtypeloo.description %]" />
151 [% itemtypeloo.description %]
154 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
158 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type %] -->
159 [% END # / FOREACH advancedsearchesloop %]
160 </div> <!-- / #advsearches -->
161 </div> <!-- / .span12 -->
164 <div class="row-fluid">
165 [%# Following on one line for translatability %]
166 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
169 <!-- PUB RANGE OPTION -->
171 <legend>Publication date range</legend>
172 <label for="limit-yr">Date range:</label>
173 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
174 <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>
176 <!-- /PUB RANGE OPTION -->
181 [%# Following on one line for translatability %]
182 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
184 <div id="langfilter">
186 <legend>Language</legend>
187 <!-- LANGUAGE LIMIT -->
189 <label for="language-limit">Language: </label>
190 <select id="language-limit" name="limit">
191 <option value="">No limit</option>
192 [% FOREACH search_languages_loo IN search_languages_loop %]
193 [% IF ( search_languages_loo.selected ) %]
194 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
196 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
201 <!-- /LANGUAGE LIMIT -->
203 </div> <!-- / #langfilter -->
204 </div> <!-- / .span3 -->
207 [%# Following on one line for translatability %]
208 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
209 [% UNLESS ( singleBranchMode ) %]
211 <!-- AVAILABILITY LIMITS -->
214 <legend>Location and availability: </legend>
215 <label for="branchloop">Library:</label>
216 <select name="limit" id="branchloop">
217 <option value="">All libraries</option>
218 [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
219 [% IF BranchesLoo.selected %]
220 <option value="branch:[% BranchesLoo.branchcode %]" selected="selected">[% BranchesLoo.branchname %]</option>
222 <option value="branch:[% BranchesLoo.branchcode %]">[% BranchesLoo.branchname %]</option>
226 [% IF ( searchdomainloop && searchdomainloop.count > 0) %]
228 <label for="categoryloop">Groups of libraries</label>
229 <select name="multibranchlimit" id="categoryloop">
230 <option value=""> -- none -- </option>
231 [% FOREACH searchdomainloo IN searchdomainloop %]
232 <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
236 <div style="margin-top:.4em">
237 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
240 </div> <!-- / #location -->
241 <!-- /AVAILABILITY LIMITS -->
242 </div> <!-- / .span3 -->
243 [% END # / UNLESS singleBranchMode %]
246 [%# Following on one line for translatability %]
247 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
252 <legend>Sorting: </legend>
253 <label for="sort_by">Sort by:</label>
254 <select id="sort_by" name="sort_by">
255 [% INCLUDE 'resort_form.inc' %]
260 </div> <!-- / .span3 -->
262 </div> <!-- / .row-fluid -->
264 [%# Following on one line for translatability %]
265 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
266 <div class="row-fluid">
268 <!-- SUBTYPE LIMITS -->
272 <legend>Audience</legend>
273 <select id="subtype_audience" name="limit" class="subtype">
274 <option value="" selected="selected" class="menuheader">Any audience</option>
275 <option value="aud:a">Preschool</option>
276 <option value="aud:b">Primary</option>
277 <option value="aud:c">Pre-adolescent</option>
278 <option value="aud:d">Adolescent</option>
279 <option value="aud:e">Adult</option>
280 <option value="aud:f">Specialized</option>
281 <option value="aud:g">General</option>
282 <option value="aud:j">Juvenile</option>
285 </div> <!-- / .span3 -->
289 <legend>Content</legend>
290 <select id="subtype_content" name="limit" class="subtype">
291 <option value="" selected="selected" class="menuheader">Any content</option>
292 <option value="fic:1">Fiction</option>
293 <option value="fic:0">Non-fiction</option>
294 <option value="bio:b">Biography</option>
295 <option value="mus:j">Musical recording</option>
296 <option value="mus:i">Non-musical recording</option>
303 <legend>Format</legend>
304 <select id="subtype_format" name="limit" class="subtype">
305 <option value="" selected="selected" class="menuheader">Any format</option>
306 <option value="l-format:ta">Regular print</option>
307 <option value="l-format:tb">Large print</option>
308 <option value="l-format:fk">Braille</option>
309 <option value="">-----------</option>
310 <option value="l-format:sd">CD audio</option>
311 <option value="l-format:ss">Cassette recording</option>
312 <option value="l-format:vf">VHS tape / Videocassette</option>
313 <option value="l-format:vd">DVD video / Videodisc</option>
314 <option value="l-format:co">CD software</option>
315 <option value="l-format:cr">Website</option>
318 </div> <!-- / .span3 -->
322 <legend>Additional content types for books/printed materials</legend>
323 <select id="subtype_additional" name="limit" class="subtype">
324 <option value="">Any</option>
325 <option value="ctype:a">Abstracts/summaries</option>
326 <option value="ctype:b">Bibliographies</option>
327 <option value="ctype:c">Catalogs</option>
328 <option value="ctype:d">Dictionaries</option>
329 <option value="ctype:e">Encyclopedias </option>
330 <option value="ctype:f">Handbooks</option>
331 <option value="ctype:g">Legal articles</option>
332 <option value="ctype:i">Indexes</option>
333 <option value="ctype:j">Patent document</option>
334 <option value="ctype:k">Discographies</option>
335 <option value="ctype:l">Legislation</option>
336 <option value="ctype:m">Theses</option>
337 <option value="ctype:n">Surveys</option>
338 <option value="ctype:o">Reviews</option>
339 <option value="ctype:p">Programmed texts</option>
340 <option value="ctype:q">Filmographies</option>
341 <option value="ctype:r">Directories</option>
342 <option value="ctype:s">Statistics</option>
343 <option value="ctype:t">Technical reports</option>
344 <option value="ctype:v">Legal cases and case notes</option>
345 <option value="ctype:w">Law reports and digests</option>
346 <option value="ctype:z">Treaties </option>
349 </div> <!-- / .span3 -->
350 </div> <!-- / #subtypes -->
351 <!-- SUBTYPE LIMITS -->
352 [% END # / IF usmarc %]
355 <div id="subtypes_unimarc">
356 <!-- SUBTYPE LIMITS -->
357 [% INCLUDE 'subtypes_unimarc.inc' %]
361 </div> <!-- / .row-fluid -->
362 [% END # / IF expanded_options %]
363 </div> <!-- / .row-fluid -->
365 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
366 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
367 <div class="row-fluid">
369 <div class="text-center">
370 <!-- SEARCH BUTTONS -->
371 [% PROCESS searchbuttons %]
372 <!-- /SEARCH BUTTONS -->
374 </div> <!-- / .span12 -->
375 </div> <!-- / .row-fluid -->
377 </div> <!-- / .container-fluid -->
378 </div> <!-- / .main -->
381 [% INCLUDE 'opac-bottom.inc' %]
382 [% BLOCK searchbuttons %]
384 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
386 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
387 [% IF expanded_options %]
388 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
389 [% ELSIF not expanded_options %]
390 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
394 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
398 [% BLOCK jsinclude %]
399 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.deserialize.min_[% KOHA_VERSION %].js"></script>
400 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min_[% KOHA_VERSION %].js"></script>
401 <script type="text/javascript">//<![CDATA[
402 $(document).ready(function() {
403 $('#advsearches').tabs();
404 jQuery.cookie.json = true;
405 //$('#advsearches > ul').tabs();
407 [% IF ( ReturnToSearch ) %]
408 if (form_serialized = jQuery.cookie("form_serialized")) {
409 $('#advsearch form').deserialize(form_serialized);
411 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
412 $('#language-limit') .val(form_serialized_limits[0]);
413 $('#branchloop') .val(form_serialized_limits[1]);
414 $('#subtype_audience') .val(form_serialized_limits[2]);
415 $('#subtype_content') .val(form_serialized_limits[3]);
416 $('#subtype_format') .val(form_serialized_limits[4]);
417 $('#subtype_additional') .val(form_serialized_limits[5]);
418 $('#locloop') .val(form_serialized_limits[6]);
421 //Clear all form cookies
422 jQuery.removeCookie("form_serialized", { path: '/'});
423 jQuery.removeCookie("form_serialized_itype", { path: '/'});
424 jQuery.removeCookie("form_serialized_limits", { path: '/'});
425 jQuery.removeCookie("num_paragraph", { path: '/'});
426 jQuery.removeCookie("search_path_code", { path: '/'});
428 $('#advsearch form').submit(function() {
429 form_serialized = $(this).serialize();
430 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
431 form_serialized_limits = [
432 $('#language-limit').val(), $('#branchloop').val(),
433 $('#subtype_audience').val(), $('#subtype_content').val(),
434 $('#subtype_format').val(), $('#subtype_additional').val(),
437 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
438 [% IF ( expanded_options ) %]
439 var numPar = $("#booleansearch fieldset p").size();
440 if (numPar > [% search_boxes_count %]){
441 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
443 jQuery.removeCookie("num_paragraph", { path: '/'});
445 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
447 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
448 jQuery.removeCookie("num_paragraph", { path: '/'});
453 /* This function allows to display a new field to search.
455 $(document).on("click", '.ButtonPlus', function(e) {
457 $('.ButtonLess').show();
458 var thisLine = $(this).parent();
459 var newLine = thisLine.clone();
460 newLine.find('input').val('');
461 thisLine.after(newLine);
464 $(document).on("click", '.ButtonLess', function(e) {
466 if($(this).parent().siblings().length <= 3 ) {
467 $('.ButtonLess').hide();
469 $(this).parent().remove();