2 [% INCLUDE 'doc-head-open.inc' %]
3 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %]
4 catalog › Advanced search
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>
62 <option value="location">Shelving location</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 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or
115 ( 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 <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 %]
138 [% itemtypeloo.description %]</label></div>
139 [% IF ( loop.last ) %]</div>[% ELSE %][% UNLESS ( loop.count % 4 ) %]</div><div class="row-fluid">[% END %][% END %]
142 </div> <!-- / #advsearch-[% advsearchloo.advanced_search_type %] -->
143 [% END # / FOREACH advancedsearchesloop %]
144 </div> <!-- / #advsearches -->
145 </div> <!-- / .span12 -->
148 <div class="row-fluid">
149 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or
150 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
153 <!-- PUB RANGE OPTION -->
155 <legend>Publication date range</legend>
156 <label for="limit-yr">Date range:</label>
157 <input type="text" size="30" id="limit-yr" name="limit-yr" title="Enter search terms" value="" />
158 <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>
160 <!-- /PUB RANGE OPTION -->
165 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or
166 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
168 <div id="langfilter">
170 <legend>Language</legend>
171 <!-- LANGUAGE LIMIT -->
173 <label for="language-limit">Language: </label>
174 <select id="language-limit" name="limit">
175 <option value="">No limit</option>
176 [% FOREACH search_languages_loo IN search_languages_loop %]
177 [% IF ( search_languages_loo.selected ) %]
178 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]" selected="selected">[% search_languages_loo.language_description %]</option>
180 <option value="ln,rtrn:[% search_languages_loo.iso639_2_code %]">[% search_languages_loo.language_description %]</option>
185 <!-- /LANGUAGE LIMIT -->
187 </div> <!-- / #langfilter -->
188 </div> <!-- / .span3 -->
191 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or
192 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
193 [% UNLESS ( singleBranchMode ) %]
195 <!-- AVAILABILITY LIMITS -->
198 <legend>Location and availability: </legend>
199 <label for="branchloop">Library:</label>
200 <select name="limit" id="branchloop">
201 <option value="">All libraries</option>
202 [% FOREACH BranchesLoo IN BranchesLoop %]
203 [% IF ( BranchesLoo.selected ) %]
204 <option value="branch:[% BranchesLoo.value %]" selected="selected">[% BranchesLoo.branchname %]</option>
206 <option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
210 [% IF ( searchdomainloop ) %]
212 <label for="categoryloop">Groups of libraries</label>
213 <select name="multibranchlimit" id="categoryloop">
214 <option value=""> -- none -- </option>
215 [% FOREACH searchdomainloo IN searchdomainloop %]
216 <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
220 <div style="margin-top:.4em">
221 <label for="available-items"><input type="checkbox" id="available-items" name="limit" value="available" /> Only items currently available for loan or reference</label>
224 </div> <!-- / #location -->
225 <!-- /AVAILABILITY LIMITS -->
226 </div> <!-- / .span3 -->
227 [% END # / UNLESS singleBranchMode %]
230 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or
231 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
236 <legend>Sorting: </legend>
237 <label for="sort_by">Sort by:</label>
238 <select id="sort_by" name="sort_by">
239 [% INCLUDE 'resort_form.inc' %]
244 </div> <!-- / .span3 -->
246 </div> <!-- / .row-fluid -->
248 [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or
249 ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
250 <div class="row-fluid">
252 <!-- SUBTYPE LIMITS -->
256 <legend>Audience</legend>
257 <select id="subtype_audience" name="limit" class="subtype">
258 <option value="" selected="selected" class="menuheader">Any audience</option>
259 <option value="aud:a">Preschool</option>
260 <option value="aud:b">Primary</option>
261 <option value="aud:c">Pre-adolescent</option>
262 <option value="aud:d">Adolescent</option>
263 <option value="aud:e">Adult</option>
264 <option value="aud:f">Specialized</option>
265 <option value="aud:g">General</option>
266 <option value="aud:j">Juvenile</option>
269 </div> <!-- / .span3 -->
273 <legend>Content</legend>
274 <select id="subtype_content" name="limit" class="subtype">
275 <option value="" selected="selected" class="menuheader">Any content</option>
276 <option value="fic:1">Fiction</option>
277 <option value="fic:0">Non fiction</option>
278 <option value="bio:b">Biography</option>
279 <option value="mus:j">Musical recording</option>
280 <option value="mus:i">Non-musical recording</option>
287 <legend>Format</legend>
288 <select id="subtype_format" name="limit" class="subtype">
289 <option value="" selected="selected" class="menuheader">Any format</option>
290 <option value="l-format:ta">Regular print</option>
291 <option value="l-format:tb">Large print</option>
292 <option value="l-format:fk">Braille</option>
293 <option value="">-----------</option>
294 <option value="l-format:sd">CD audio</option>
295 <option value="l-format:ss">Cassette recording</option>
296 <option value="l-format:vf">VHS tape / Videocassette</option>
297 <option value="l-format:vd">DVD video / Videodisc</option>
298 <option value="l-format:co">CD software</option>
299 <option value="l-format:cr">Website</option>
302 </div> <!-- / .span3 -->
306 <legend>Additional content types for books/printed materials</legend>
307 <select id="subtype_additional" name="limit" class="subtype">
308 <option value="">Any</option>
309 <option value="ctype:a">Abstracts/summaries</option>
310 <option value="ctype:b">Bibliographies</option>
311 <option value="ctype:c">Catalogs</option>
312 <option value="ctype:d">Dictionaries</option>
313 <option value="ctype:e">Encyclopedias </option>
314 <option value="ctype:f">Handbooks</option>
315 <option value="ctype:g">Legal articles</option>
316 <option value="ctype:i">Indexes</option>
317 <option value="ctype:j">Patent document</option>
318 <option value="ctype:k">Discographies</option>
319 <option value="ctype:l">Legislation</option>
320 <option value="ctype:m">Theses</option>
321 <option value="ctype:n">Surveys</option>
322 <option value="ctype:o">Reviews</option>
323 <option value="ctype:p">Programmed texts</option>
324 <option value="ctype:q">Filmographies</option>
325 <option value="ctype:r">Directories</option>
326 <option value="ctype:s">Statistics</option>
327 <option value="ctype:t">Technical reports</option>
328 <option value="ctype:v">Legal cases and case notes</option>
329 <option value="ctype:w">Law reports and digests</option>
330 <option value="ctype:z">Treaties </option>
333 </div> <!-- / .span3 -->
334 </div> <!-- / #subtypes -->
335 <!-- SUBTYPE LIMITS -->
336 [% END # / IF usmarc %]
339 <div id="subtypes_unimarc">
340 <!-- SUBTYPE LIMITS -->
341 [% INCLUDE 'subtypes_unimarc.inc' %]
345 </div> <!-- / .row-fluid -->
346 [% END # / IF expanded_options %]
347 </div> <!-- / .row-fluid -->
349 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or
350 ( OpacAdvSearchOptions and OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
351 <div class="row-fluid">
353 <div class="text-center">
354 <!-- SEARCH BUTTONS -->
355 [% PROCESS searchbuttons %]
356 <!-- /SEARCH BUTTONS -->
358 </div> <!-- / .span12 -->
359 </div> <!-- / .row-fluid -->
361 </div> <!-- / .main -->
364 [% INCLUDE 'opac-bottom.inc' %]
365 [% BLOCK searchbuttons %]
367 <input class="btn btn-success" type="submit" accesskey="s" name="do" title="Search" value="Search" />
369 [% IF ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.size > 0 ) %]
370 [% IF expanded_options %]
371 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=0" class="btn btn-default more-less-options">Fewer options</a>
372 [% ELSIF not expanded_options %]
373 <a href="/cgi-bin/koha/opac-search.pl?expanded_options=1" class="btn btn-default more-less-options">More options</a>
377 <a href="/cgi-bin/koha/opac-search.pl?do=Clear" class="btn btn-default new-search">New search</a>
381 [% BLOCK jsinclude %]
382 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.deserialize.min.js"></script>
383 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
384 <script type="text/javascript">//<![CDATA[
385 $(document).ready(function() {
386 $('#advsearches').tabs();
387 jQuery.cookie.json = true;
388 //$('#advsearches > ul').tabs();
390 [% IF ( ReturnToSearch ) %]
391 if (form_serialized = jQuery.cookie("form_serialized")) {
392 $('#advsearch form').deserialize(form_serialized);
394 if (form_serialized_limits = jQuery.cookie("form_serialized_limits")) {
395 $('#language-limit') .val(form_serialized_limits[0]);
396 $('#branchloop') .val(form_serialized_limits[1]);
397 $('#subtype_audience') .val(form_serialized_limits[2]);
398 $('#subtype_content') .val(form_serialized_limits[3]);
399 $('#subtype_format') .val(form_serialized_limits[4]);
400 $('#subtype_additional') .val(form_serialized_limits[5]);
401 $('#locloop') .val(form_serialized_limits[6]);
404 //Clear all form cookies
405 jQuery.removeCookie("form_serialized", { path: '/'});
406 jQuery.removeCookie("form_serialized_itype", { path: '/'});
407 jQuery.removeCookie("form_serialized_limits", { path: '/'});
408 jQuery.removeCookie("num_paragraph", { path: '/'});
409 jQuery.removeCookie("search_path_code", { path: '/'});
411 $('#advsearch form').submit(function() {
412 form_serialized = $(this).serialize();
413 jQuery.cookie("form_serialized", form_serialized,{ path: '/'});
414 form_serialized_limits = [
415 $('#language-limit').val(), $('#branchloop').val(),
416 $('#subtype_audience').val(), $('#subtype_content').val(),
417 $('#subtype_format').val(), $('#subtype_additional').val(),
420 jQuery.cookie("form_serialized_limits", form_serialized_limits,{ path: '/'});
421 [% IF ( expanded_options ) %]
422 var numPar = $("#booleansearch fieldset p").size();
423 if (numPar > [% search_boxes_count %]){
424 jQuery.cookie("num_paragraph", numPar,{ path: '/'});
426 jQuery.removeCookie("num_paragraph", { path: '/'});
428 jQuery.cookie("search_path_code", 'exs',{ path: '/'});
430 jQuery.cookie("search_path_code", 'ads',{ path: '/'});
431 jQuery.removeCookie("num_paragraph", { path: '/'});
436 /* This function allows to display a new field to search.
438 $(document).on("click", '.ButtonPlus', function(e) {
440 $('.ButtonLess').show();
441 var thisLine = $(this).parent();
442 var newLine = thisLine.clone();
443 newLine.find('input').val('');
444 thisLine.after(newLine);
447 $(document).on("click", '.ButtonLess', function(e) {
449 if($(this).parent().siblings().length <= 3 ) {
450 $('.ButtonLess').hide();
452 $(this).parent().remove();