6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Advanced search › Catalog › Koha</title>
8 [% INCLUDE 'doc-head-close.inc' %]
11 [%- BLOCK language_limit_select -%]
12 <select name="limit" id="[% ln_id | html %]">
13 <option value="">No limit</option>
14 [% FOREACH ln_loo IN ln_loop %]
15 [% IF ( ln_loo.selected or selected == ln_loo.iso639_2_code ) %]
16 <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]" selected="selected">
17 [% ln_loo.language_description | html %]
20 <option value="[% ln_index | html %],rtrn:[% ln_loo.iso639_2_code | html %]">
21 [% ln_loo.language_description | html %]
28 <body id="catalog_advsearch" class="catalog">
29 [% INCLUDE 'header.inc' %]
30 [% INCLUDE 'adv-search.inc' %]
32 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
35 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
38 <a href="#" aria-current="page">
45 <div class="main container-fluid">
47 <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
49 <form action="search.pl" method="get">
50 <div id="advanced-search">
51 <input type="hidden" name="advsearch" value="1"/>
52 <h1>Advanced search</h1>
54 <a href="/cgi-bin/koha/catalogue/itemsearch.pl">Go to item search</a>
56 <div id="previous_search_link"></div>
60 <!-- SEARCH BUTTONS -->
61 <div id="toolbar" class="btn-toolbar">
62 <fieldset class="action" id="submit1">
63 <div class="btn-group">
64 <button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search</button>
66 <div class="btn-group">
67 [% IF ( expanded_options ) %]
68 <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=0" class="btn btn-link"><i class="fa fa-search-minus"></i> Fewer options</a>
71 <a href="/cgi-bin/koha/catalogue/search.pl?expanded_options=1" class="btn btn-link"><i class="fa fa-search-plus"></i> More options</a>
74 <div class="btn-group">
75 <a href="/cgi-bin/koha/catalogue/search.pl?do=Clear&expanded_options=[% expanded_options | uri %]" class="btn btn-link"><i class="fa fa-trash"></i> Clear fields</a>
79 <!-- /SEARCH BUTTONS -->
82 [% IF ( outer_servers_loop ) %]
86 <legend>Select local databases</legend>
87 [% FOREACH local_servers_loo IN local_servers_loop %]
88 [% IF ( local_servers_loo.checked ) %]<input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" checked="checked" value="[% local_servers_loo.value | html %]" />[% ELSE %]<input type="checkbox" id="[% local_servers_loo.id | html %]" name="[% local_servers_loo.name | html %]" value="[% local_servers_loo.value | html %]" />[% END %]<label for="[% local_servers_loo.id | html %]"><img width="16" height="16" alt="[% local_servers_loo.id | html %]" src="[% themelang | html %]/img/[% local_servers_loo.icon | html %]" /> [% local_servers_loo.label | html %]</label>[% END %]
93 [% IF ( outer_servers_loop ) %]
94 <!-- REMOTE DATABASES -->
95 <fieldset id="databases">
96 <legend>Select remote databases</legend>
97 [% FOREACH outer_servers_loo IN outer_servers_loop %]
98 [% IF ( outer_servers_loo.checked ) %]<input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" checked="checked" value="[% outer_servers_loo.value | html %]" />[% ELSE %]<input type="checkbox" id="[% outer_servers_loo.id | html %]" name="[% outer_servers_loo.name | html %]" value="[% outer_servers_loo.value | html %]" />[% END %]
99 <label for="[% outer_servers_loo.id | html %]"><img alt="[% outer_servers_loo.id | html %]" src="[% themelang | html %]/images/[% outer_servers_loo.icon | html %]" />[% outer_servers_loo.label | html %]</label>
102 <!-- /REMOTE DATABASES -->
105 <!-- BOOLEAN SEARCH OPTIONS -->
106 <fieldset id="searchterms">
107 <legend>Search for </legend>
108 [% FOREACH query IN queries %]
109 [% IF ( expanded_options ) %]
110 <div class="search-term-row">
111 [% SET opindex = loop.index - 1 %]
113 [% IF operators.$opindex == 'OR' %]
114 <option value="AND">and</option>
115 <option value="OR" selected="selected">or</option>
116 <option value="NOT">not</option>
117 [% ELSIF operators.$opindex == 'NOT' %]
118 <option value="AND">and</option>
119 <option value="OR">or</option>
120 <option value="NOT" selected="selected">not</option>
122 <option value="AND" selected="selected">and</option>
123 <option value="OR">or</option>
124 <option value="NOT">not</option>
130 [% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %]
131 [% INCLUDE 'search_indexes.inc' %]
132 <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" />
133 [% IF ( expanded_options ) %]
134 <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
135 [% IF ( loop.first ) %]
136 <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" />
141 [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
142 [% IF ( expanded_options ) %]
144 [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
145 <label><input type="checkbox" name="whole_record" /> Search entire MARC record</label>
147 <span id="weight_search">
148 <label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label>
152 <input type="hidden" name="weight_search" value="1" />
156 <!-- /BOOLEAN SEARCH OPTIONS -->
159 <!-- MC-TYPE LIMITS -->
160 <div id="advsearches" class="toptabs">
162 [% FOREACH advsearchloo IN advancedsearchesloop %]
163 <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
164 <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
165 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
166 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
167 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
168 [% ELSE %]Something else
174 [% FOREACH advsearchloo IN advancedsearchesloop %]
175 <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
176 <h4>Limit to any of the following:</h4>
179 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
181 [% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %]
182 [% IF limits.$limit_key.defined %]
183 [% limits.delete( limit_key ) %]
184 <input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
186 <input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
188 <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
189 [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
190 [% IF ( itemtypeloo.imageurl ) %]
191 <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
195 [% itemtypeloo.description | html %]
198 [% IF ( loop.last ) %]
201 [% UNLESS ( loop.count % 5 ) %]
210 <!-- /MC-TYPE LIMIT -->
211 [% IF ( expanded_options ) %]
212 <!-- BASIC LIMITS -->
213 <fieldset id="basiclimits">
214 <legend>Limits</legend>
215 <fieldset id="pubrange">
216 <!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options -->
217 <p><label for="limit-yr">Year: </label>
218 [% SET year_limit_key = 'yr,st-numeric' %]
219 <input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]"/> (format: yyyy-yyyy)</p>
220 [% IF limits.$year_limit_key.defined %]
221 [% limits.delete(year_limit_key) %]
223 <!-- /PUB / COPY YEAR LIMIT -->
225 <fieldset id="language">
226 <!-- LANGUAGE LIMIT -->
228 <label for="language-limit">Language: </label>
229 [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %]
230 [% limits.delete( 'ln,rtrn' ) %]
231 <label for="language-original-limit">Language of original: </label>
232 [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %]
233 [% limits.delete( 'language-original,rtrn' ) %]
235 <!-- /LANGUAGE LIMIT -->
238 <!-- /BASIC LIMITS -->
243 [% INCLUDE 'subtypes_unimarc.inc' %]
245 [% PROCESS 'subtype_limits.inc' %]
246 <!-- SUBTYPE LIMITS -->
247 <fieldset id="subtype">
248 <legend>Subtype limits</legend><p>
250 <fieldset id="current_subtype_limits"><legend>Current subtype limits</legend>
251 [% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %]
252 [% FOREACH limit IN limits.$subtype %]
254 <input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden">
255 <label for="subtype_limit_[% loop.index() | html %]">[% PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit %]</label>
256 <input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked">
259 [% limits.delete( subtype ) %]
263 <select name="limit" class="subtype">
264 <option value="" selected="selected" class="menuheader">Any audience</option>
265 <option value="aud:a">Preschool</option>
266 <option value="aud:b">Primary</option>
267 <option value="aud:c">Pre-adolescent</option>
268 <option value="aud:d">Adolescent</option>
269 <option value="aud:e">Adult</option>
270 <option value="aud:f">Specialized</option>
271 <option value="aud:g">General</option>
272 <option value="aud:j">Juvenile</option>
275 <select name="limit" class="subtype">
276 <option value="" selected="selected" class="menuheader">Any content</option>
277 <option value="fic:1" >Fiction</option>
278 <option value="fic:0" >Non-fiction</option>
279 <option value="bio:b" >Biography</option>
280 <option value="mus:j" >Musical recording</option>
281 <option value="mus:i" >Non-musical recording</option>
285 <select name="limit" class="subtype">
286 <option value="" selected="selected" class="menuheader">Any format</option>
287 <option value="l-format:ta" >Regular print</option>
288 <option value="l-format:tb" >Large print</option>
289 <option value="l-format:tc or l-format:fb">Braille</option>
290 <option value="" >-----------</option>
291 <option value="l-format:sd" >CD audio</option>
292 <option value="l-format:ss" >Cassette recording</option>
293 <option value="l-format:vf" >VHS tape / Videocassette</option>
294 <option value="l-format:vd" >DVD video / Videodisc</option>
295 <option value="l-format:co" >CD software</option>
296 <option value="l-format:cr" >Website</option>
299 <select name="limit" class="subtype">
300 <option value="" >Additional content types</option>
301 <option value="ctype:a" >Abstracts / Summaries</option>
302 <option value="ctype:b" >Bibliographies</option>
303 <option value="ctype:c" >Catalogs</option>
304 <option value="ctype:d" >Dictionaries</option>
305 <option value="ctype:e" >Encyclopedias </option>
306 <option value="ctype:f" >Handbooks</option>
307 <option value="ctype:g" >Legal articles</option>
308 <option value="ctype:i" >Indexes</option>
309 <option value="ctype:j" >Patent document</option>
310 <option value="ctype:k" >Discographies</option>
311 <option value="ctype:l" >Legislation</option>
312 <option value="ctype:m" >Theses</option>
313 <option value="ctype:n" >Surveys</option>
314 <option value="ctype:o" >Reviews</option>
315 <option value="ctype:p" >Programmed texts</option>
316 <option value="ctype:q" >Filmographies</option>
317 <option value="ctype:r" >Directories</option>
318 <option value="ctype:s" >Statistics</option>
319 <option value="ctype:t" >Technical reports</option>
320 <option value="ctype:v" >Legal cases and case notes</option>
321 <option value="ctype:w" >Law reports and digests</option>
322 <option value="ctype:z" >Treaties </option>
329 <!-- AVAILABILITY LIMITS -->
330 <fieldset id="availability"><legend>Location and availability</legend>
331 <fieldset id="currently-avail">
332 [% IF limit_available %]
333 <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /></p>
335 <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
339 <fieldset id="select-libs">
340 <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
341 <option value="">All libraries</option>
342 [%# FIXME Should not we filter the libraries displayed? %]
343 [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %]
344 [% limits.delete('branch') %]
346 [% IF search_groups %]
350 <label for="categoryloop">Groups of libraries: </label>
351 <select name="limit" id="categoryloop">
352 <option value=""> -- none -- </option>
353 [% FOREACH sg IN search_groups %]
354 [% UNLESS sg.branchcode %]
355 [% IF limits.multibranchlimit.0 == sg.id %]
356 <option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
358 <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
362 [% limits.delete('multibranchlimit') %]
368 <!-- /AVAILABILITY LIMITS -->
370 <!-- OTHER LIMITS (facets, etc.) -->
372 <fieldset id=""><legend>Other limits</legend>
374 [% FOREACH key IN limits.keys %]
375 [% FOREACH limit IN limits.$key %]
377 <input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]">
378 <label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label>
379 <input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked">
386 <!-- /OTHER LIMITS (facets, etc.) -->
389 <fieldset id="sortby"><legend>Sorting</legend>
391 <label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by">
392 [% INCLUDE 'resort_form.inc' sort_by = sort %]
397 <!-- /RANK LIMITS -->
402 [% MACRO jsinclude BLOCK %]
403 [% Asset.js("lib/hc-sticky.js") | $raw %]
404 [% Asset.js("js/browser.js") | $raw %]
407 * Function add_field();
408 * This function allows to display a new field to search.
410 function add_field() {
411 var ButtonPlus = document.getElementById("ButtonPlus");
412 var line = ButtonPlus.parentNode;
413 var dad = line.parentNode;
414 dad.appendChild(line.cloneNode(true));
415 line.removeChild(ButtonPlus);
419 $(document).ready(function() {
420 $("input[name=q]:eq(0)").focus();
421 $('#advsearches').tabs();
422 Sticky = $("#toolbar");
425 stickyClass: "floating"
427 [% IF search_groups %]
428 function branch_limit() {
429 if( $("#branchloop").val() != "" ){
430 $("#categoryloop").val("").prop('disabled',true);
432 $("#categoryloop").prop('disabled',false);
434 if ( $("#categoryloop").val() != "" ){
435 $("#branchloop").val("").prop('disabled',true);
437 $("#branchloop").prop('disabled',false);
441 $("#branchloop,#categoryloop").on("change",function(){
446 if( $("#current_subtype_limits input").length == 0 ){
447 $("#current_subtype_limits").hide();
449 $(".toggle_limit").on('click',function(){
450 $(this).siblings("[type='hidden']").prop('disabled', !this.checked);
454 browser = KOHA.browser('[% searchid | html %]');
455 browser.show_back_link();
462 [% INCLUDE 'intranet-bottom.inc' %]