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 <div class="span3"><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]" name="limit" value="mc-[% itemtypeloo.ccl %]:[% itemtypeloo.code %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') %]-[% itemtypeloo.number %]">[% UNLESS ( noItemTypeImages ) %][% IF ( itemtypeloo.imageurl ) %]<img src="[% itemtypeloo.imageurl %]" alt="[% itemtypeloo.description %]" />[% END %] [% END %]
137 [% itemtypeloo.description %]</label></div>
138 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
141 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type %] -->
142 [% END # / FOREACH advancedsearchesloop %]
143 </div> <!-- / #advsearches -->
144 </div> <!-- / .span12 -->
147 <div class="row-fluid">
148 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or
149 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
152 <!-- PUB RANGE OPTION -->
154 <legend>Publication date range</legend>
155 <label for="limit-yr">Date range:</label>
156 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
157 <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>
159 <!-- /PUB RANGE OPTION -->
164 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or
165 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
167 <div id="langfilter">
169 <legend>Language</legend>
170 <!-- LANGUAGE LIMIT -->
172 <label for="language-limit">Language: </label>
173 <select id="language-limit" name="limit">
174 <option value="">No limit</option>
175 [% FOREACH search_languages_loo IN search_languages_loop %]
176 [% IF ( search_languages_loo.selected ) %]
177 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
179 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
184 <!-- /LANGUAGE LIMIT -->
186 </div> <!-- / #langfilter -->
187 </div> <!-- / .span3 -->
190 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or
191 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
192 [% UNLESS ( singleBranchMode ) %]
194 <!-- AVAILABILITY LIMITS -->
197 <legend>Location and availability: </legend>
198 <label for="branchloop">Library:</label>
199 <select name="limit" id="branchloop">
200 <option value="">All libraries</option>
201 [% FOREACH BranchesLoo IN BranchesLoop %]
202 [% IF ( BranchesLoo.selected ) %]
203 <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
205 <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
209 [% IF ( searchdomainloop ) %]
211 <label for="categoryloop">Groups of libraries</label>
212 <select name="multibranchlimit" id="categoryloop">
213 <option value=""> -- none -- </option>
214 [% FOREACH searchdomainloo IN searchdomainloop %]
215 <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
219 <div style="margin-top:.4em">
220 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
223 </div> <!-- / #location -->
224 <!-- /AVAILABILITY LIMITS -->
225 </div> <!-- / .span3 -->
226 [% END # / UNLESS singleBranchMode %]
229 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or
230 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
235 <legend>Sorting: </legend>
236 <label for="sort_by">Sort by:</label>
237 <select id="sort_by" name="sort_by">
238 [% INCLUDE 'resort_form.inc' %]
243 </div> <!-- / .span3 -->
245 </div> <!-- / .row-fluid -->
247 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or
248 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
249 <div class="row-fluid">
251 <!-- SUBTYPE LIMITS -->
255 <legend>Audience</legend>
256 <select id="subtype_audience" name="limit" class="subtype">
257 <option value="" selected="selected" class="menuheader">Any audience</option>
258 <option value="aud:a">Preschool</option>
259 <option value="aud:b">Primary</option>
260 <option value="aud:c">Pre-adolescent</option>
261 <option value="aud:d">Adolescent</option>
262 <option value="aud:e">Adult</option>
263 <option value="aud:f">Specialized</option>
264 <option value="aud:g">General</option>
265 <option value="aud:j">Juvenile</option>
268 </div> <!-- / .span3 -->
272 <legend>Content</legend>
273 <select id="subtype_content" name="limit" class="subtype">
274 <option value="" selected="selected" class="menuheader">Any content</option>
275 <option value="fic:1">Fiction</option>
276 <option value="fic:0">Non fiction</option>
277 <option value="bio:b">Biography</option>
278 <option value="mus:j">Musical recording</option>
279 <option value="mus:i">Non-musical recording</option>
286 <legend>Format</legend>
287 <select id="subtype_format" name="limit" class="subtype">
288 <option value="" selected="selected" class="menuheader">Any format</option>
289 <option value="l-format:ta">Regular print</option>
290 <option value="l-format:tb">Large print</option>
291 <option value="l-format:fk">Braille</option>
292 <option value="">-----------</option>
293 <option value="l-format:sd">CD audio</option>
294 <option value="l-format:ss">Cassette recording</option>
295 <option value="l-format:vf">VHS tape / Videocassette</option>
296 <option value="l-format:vd">DVD video / Videodisc</option>
297 <option value="l-format:co">CD software</option>
298 <option value="l-format:cr">Website</option>
301 </div> <!-- / .span3 -->
305 <legend>Additional content types for books/printed materials</legend>
306 <select id="subtype_additional" name="limit" class="subtype">
307 <option value="">Any</option>
308 <option value="ctype:a">Abstracts/summaries</option>
309 <option value="ctype:b">Bibliographies</option>
310 <option value="ctype:c">Catalogs</option>
311 <option value="ctype:d">Dictionaries</option>
312 <option value="ctype:e">Encyclopedias </option>
313 <option value="ctype:f">Handbooks</option>
314 <option value="ctype:g">Legal articles</option>
315 <option value="ctype:i">Indexes</option>
316 <option value="ctype:j">Patent document</option>
317 <option value="ctype:k">Discographies</option>
318 <option value="ctype:l">Legislation</option>
319 <option value="ctype:m">Theses</option>
320 <option value="ctype:n">Surveys</option>
321 <option value="ctype:o">Reviews</option>
322 <option value="ctype:p">Programmed texts</option>
323 <option value="ctype:q">Filmographies</option>
324 <option value="ctype:r">Directories</option>
325 <option value="ctype:s">Statistics</option>
326 <option value="ctype:t">Technical reports</option>
327 <option value="ctype:v">Legal cases and case notes</option>
328 <option value="ctype:w">Law reports and digests</option>
329 <option value="ctype:z">Treaties </option>
332 </div> <!-- / .span3 -->
333 </div> <!-- / #subtypes -->
334 <!-- SUBTYPE LIMITS -->
335 [% END # / IF usmarc %]
338 <div id="subtypes_unimarc">
339 <!-- SUBTYPE LIMITS -->
340 [% INCLUDE 'subtypes_unimarc.inc' %]
344 </div> <!-- / .row-fluid -->
345 [% END # / IF expanded_options %]
346 </div> <!-- / .row-fluid -->
348 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
349 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
350 <div class="row-fluid">
352 <div class="text-center">
353 <!-- SEARCH BUTTONS -->
354 [% PROCESS searchbuttons %]
355 <!-- /SEARCH BUTTONS -->
357 </div> <!-- / .span12 -->
358 </div> <!-- / .row-fluid -->
360 </div> <!-- / .main -->
363 [% INCLUDE 'opac-bottom.inc' %]
364 [% BLOCK searchbuttons %]
366 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
368 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
369 [% IF expanded_options %]
370 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
371 [% ELSIF not expanded_options %]
372 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
376 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
380 [% BLOCK jsinclude %]
381 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.deserialize.min.js"></script>
382 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
383 <script type="text/javascript">//<![CDATA[
384 $(document).ready(function() {
385 $('#advsearches').tabs();
386 jQuery.cookie.json = true;
387 //$('#advsearches > ul').tabs();
389 [% IF ( ReturnToSearch ) %]
390 if (form_serialized = jQuery.cookie("form_serialized")) {
391 $('#advsearch form').deserialize(form_serialized);
393 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
394 $('#language-limit') .val(form_serialized_limits[0]);
395 $('#branchloop') .val(form_serialized_limits[1]);
396 $('#subtype_audience') .val(form_serialized_limits[2]);
397 $('#subtype_content') .val(form_serialized_limits[3]);
398 $('#subtype_format') .val(form_serialized_limits[4]);
399 $('#subtype_additional') .val(form_serialized_limits[5]);
400 $('#locloop') .val(form_serialized_limits[6]);
403 //Clear all form cookies
404 jQuery.removeCookie("form_serialized", { path: '/'});
405 jQuery.removeCookie("form_serialized_itype", { path: '/'});
406 jQuery.removeCookie("form_serialized_limits", { path: '/'});
407 jQuery.removeCookie("num_paragraph", { path: '/'});
408 jQuery.removeCookie("search_path_code", { path: '/'});
410 $('#advsearch form').submit(function() {
411 form_serialized = $(this).serialize();
412 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
413 form_serialized_limits = [
414 $('#language-limit').val(), $('#branchloop').val(),
415 $('#subtype_audience').val(), $('#subtype_content').val(),
416 $('#subtype_format').val(), $('#subtype_additional').val(),
419 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
420 [% IF ( expanded_options ) %]
421 var numPar = $("#booleansearch fieldset p").size();
422 if (numPar > [% search_boxes_count %]){
423 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
425 jQuery.removeCookie("num_paragraph", { path: '/'});
427 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
429 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
430 jQuery.removeCookie("num_paragraph", { path: '/'});
435 /* This function allows to display a new field to search.
437 $(document).on("click", '.ButtonPlus', function(e) {
439 $('.ButtonLess').show();
440 var thisLine = $(this).parent();
441 var newLine = thisLine.clone();
442 newLine.find('input').val('');
443 thisLine.after(newLine);
446 $(document).on("click", '.ButtonLess', function(e) {
448 if($(this).parent().siblings().length <= 3 ) {
449 $('.ButtonLess').hide();
451 $(this).parent().remove();