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 ) %]
111 <div class="search-term-row" style="text-indent: 4.25em;">
113 <div class="search-term-row">
114 [% SET opindex = loop.index - 1 %]
116 [% IF operators.$opindex == 'OR' %]
117 <option value="AND">and</option>
118 <option value="OR" selected="selected">or</option>
119 <option value="NOT">not</option>
120 [% ELSIF operators.$opindex == 'NOT' %]
121 <option value="AND">and</option>
122 <option value="OR">or</option>
123 <option value="NOT" selected="selected">not</option>
125 <option value="AND" selected="selected">and</option>
126 <option value="OR">or</option>
127 <option value="NOT">not</option>
134 [% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %]
135 [% INCLUDE 'search_indexes.inc' %]
136 <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" />
137 [% IF ( expanded_options ) %]
138 [% IF ( loop.last ) %]
139 <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>
141 [% IF ( loop.first ) %]
142 <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" />
147 [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
148 [% IF ( expanded_options ) %]
150 [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
151 <label><input type="checkbox" name="whole_record" /> Search entire MARC record</label>
153 <span id="weight_search">
154 <label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label>
158 <input type="hidden" name="weight_search" value="1" />
162 <!-- /BOOLEAN SEARCH OPTIONS -->
165 <!-- MC-TYPE LIMITS -->
166 <div id="advsearches" class="toptabs">
168 [% FOREACH advsearchloo IN advancedsearchesloop %]
169 <li id="advsearch-tab-[% advsearchloo.advanced_search_type | html %]">
170 <a href="#advsearch-[% advsearchloo.advanced_search_type | uri %]">
171 [% IF ( advsearchloo.advanced_search_type == 'itemtypes' ) %]Item type
172 [% ELSIF ( advsearchloo.advanced_search_type == 'ccode' ) %]Collection
173 [% ELSIF ( advsearchloo.advanced_search_type == 'loc' ) %]Shelving location
174 [% ELSE %]Something else
180 [% FOREACH advsearchloo IN advancedsearchesloop %]
181 <div id="advsearch-[% advsearchloo.advanced_search_type | html %]" class="advsearch">
182 <h4>Limit to any of the following:</h4>
185 [% FOREACH itemtypeloo IN advsearchloo.code_loop %]
187 [% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %]
188 [% IF limits.$limit_key.defined %]
189 [% limits.delete( limit_key ) %]
190 <input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
192 <input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/>
194 <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">
195 [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
196 [% IF ( itemtypeloo.imageurl ) %]
197 <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />
201 [% itemtypeloo.description | html %]
204 [% IF ( loop.last ) %]
207 [% UNLESS ( loop.count % 5 ) %]
216 <!-- /MC-TYPE LIMIT -->
217 [% IF ( expanded_options ) %]
218 <!-- BASIC LIMITS -->
219 <fieldset id="basiclimits">
220 <legend>Limits</legend>
221 <fieldset id="pubrange">
222 <!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options -->
223 <p><label for="limit-yr">Year: </label>
224 [% SET year_limit_key = 'yr,st-numeric' %]
225 <input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]"/> (format: yyyy-yyyy)</p>
226 [% IF limits.$year_limit_key.defined %]
227 [% limits.delete(year_limit_key) %]
229 <!-- /PUB / COPY YEAR LIMIT -->
231 <fieldset id="language">
232 <!-- LANGUAGE LIMIT -->
234 <label for="language-limit">Language: </label>
235 [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %]
236 [% limits.delete( 'ln,rtrn' ) %]
237 <label for="language-original-limit">Language of original: </label>
238 [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %]
239 [% limits.delete( 'language-original,rtrn' ) %]
241 <!-- /LANGUAGE LIMIT -->
244 <!-- /BASIC LIMITS -->
248 [% INCLUDE 'subtypes_unimarc.inc' %]
250 [% PROCESS 'subtype_limits.inc' %]
251 <!-- SUBTYPE LIMITS -->
252 <fieldset id="subtype">
253 <legend>Subtype limits</legend><p>
254 [% PROCESS subtype_dropdowns %]
255 <fieldset id="current_subtype_limits"><legend>Current subtype limits</legend>
256 [% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %]
257 [% FOREACH limit IN limits.$subtype %]
259 <input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden">
260 <label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label>
261 <input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked">
264 [% limits.delete( subtype ) %]
272 <!-- AVAILABILITY LIMITS -->
273 <fieldset id="availability"><legend>Location and availability</legend>
274 <fieldset id="currently-avail">
275 [% IF limit_available %]
276 <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /></p>
278 <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
282 <fieldset id="select-libs">
283 <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
284 <option value="">All libraries</option>
285 [%# FIXME Should not we filter the libraries displayed? %]
286 [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %]
287 [% limits.delete('branch') %]
289 [% IF search_groups %]
293 <label for="categoryloop">Groups of libraries: </label>
294 <select name="limit" id="categoryloop">
295 <option value=""> -- none -- </option>
296 [% FOREACH sg IN search_groups %]
297 [% UNLESS sg.branchcode %]
298 [% IF limits.multibranchlimit.0 == sg.id %]
299 <option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
301 <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option>
305 [% limits.delete('multibranchlimit') %]
311 <!-- /AVAILABILITY LIMITS -->
313 <!-- OTHER LIMITS (facets, etc.) -->
315 <fieldset id=""><legend>Other limits</legend>
317 [% FOREACH key IN limits.keys %]
318 [% FOREACH limit IN limits.$key %]
320 <input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]">
321 <label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label>
322 <input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked">
329 <!-- /OTHER LIMITS (facets, etc.) -->
332 <fieldset id="sortby"><legend>Sorting</legend>
334 <label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by">
335 [% INCLUDE 'resort_form.inc' sort_by = sort %]
340 <!-- /RANK LIMITS -->
345 [% MACRO jsinclude BLOCK %]
346 [% Asset.js("lib/hc-sticky.js") | $raw %]
347 [% Asset.js("js/browser.js") | $raw %]
350 * Function add_field();
351 * This function allows to display a new field to search.
353 function add_field() {
354 var ButtonPlus = document.getElementById("ButtonPlus");
355 var line = ButtonPlus.parentNode;
356 var dad = line.parentNode;
357 dad.appendChild(line.cloneNode(true));
358 line.removeChild(ButtonPlus);
362 $(document).ready(function() {
363 $("input[name=q]:eq(0)").focus();
364 $('#advsearches').tabs();
365 Sticky = $("#toolbar");
368 stickyClass: "floating"
370 [% IF search_groups %]
371 function branch_limit() {
372 if( $("#branchloop").val() != "" ){
373 $("#categoryloop").val("").prop('disabled',true);
375 $("#categoryloop").prop('disabled',false);
377 if ( $("#categoryloop").val() != "" ){
378 $("#branchloop").val("").prop('disabled',true);
380 $("#branchloop").prop('disabled',false);
384 $("#branchloop,#categoryloop").on("change",function(){
389 if( $("#current_subtype_limits input").length == 0 ){
390 $("#current_subtype_limits").hide();
392 $(".toggle_limit").on('click',function(){
393 $(this).siblings("[type='hidden']").prop('disabled', !this.checked);
397 browser = KOHA.browser('[% searchid | html %]');
398 browser.show_back_link();
405 [% INCLUDE 'intranet-bottom.inc' %]