|
Lines 2-7
Link Here
|
| 2 |
[% USE Koha %] |
2 |
[% USE Koha %] |
| 3 |
[% USE Asset %] |
3 |
[% USE Asset %] |
| 4 |
[% USE Branches %] |
4 |
[% USE Branches %] |
|
|
5 |
[% USE Languages %] |
| 5 |
[% SET footerjs = 1 %] |
6 |
[% SET footerjs = 1 %] |
| 6 |
[% INCLUDE 'doc-head-open.inc' %] |
7 |
[% INCLUDE 'doc-head-open.inc' %] |
| 7 |
<title>Koha › Catalog › Advanced search</title> |
8 |
<title>Koha › Catalog › Advanced search</title> |
|
Lines 93-124
Link Here
|
| 93 |
<!-- BOOLEAN SEARCH OPTIONS --> |
94 |
<!-- BOOLEAN SEARCH OPTIONS --> |
| 94 |
<fieldset id="searchterms"> |
95 |
<fieldset id="searchterms"> |
| 95 |
<legend>Search for </legend> |
96 |
<legend>Search for </legend> |
| 96 |
[% FOREACH search_box IN search_boxes_loop %] |
97 |
[% FOREACH query IN queries %] |
| 97 |
[% IF ( search_boxes_label ) %] |
98 |
[% IF ( expanded_options ) %] |
| 98 |
<div class="search-term-row" style="text-indent: 4.5em;"> |
99 |
[% IF ( loop.first ) %] |
| 99 |
[% ELSE %] |
100 |
<div class="search-term-row" style="text-indent: 4.5em;"> |
| 100 |
<div class="search-term-row"> |
101 |
[% ELSE %] |
| 101 |
[% END %] |
102 |
<div class="search-term-row"> |
| 102 |
[% IF ( expanded_options ) %] |
103 |
[% SET opindex = loop.index - 1 %] |
| 103 |
[% IF ( search_box.boolean ) %] |
|
|
| 104 |
<select name="op"> |
104 |
<select name="op"> |
| 105 |
<option value="and" selected="selected">and</option> |
105 |
[% IF operators.$opindex == 'or' %] |
| 106 |
<option value="or">or</option> |
106 |
<option value="and">and</option> |
| 107 |
<option value="not">not</option> |
107 |
<option value="or" selected="selected">or</option> |
|
|
108 |
<option value="not">not</option> |
| 109 |
[% ELSIF operators.$opindex == 'not' %] |
| 110 |
<option value="and">and</option> |
| 111 |
<option value="or">or</option> |
| 112 |
<option value="not" selected="selected">not</option> |
| 113 |
[% ELSE %] |
| 114 |
<option value="and" selected="selected">and</option> |
| 115 |
<option value="or">or</option> |
| 116 |
<option value="not">not</option> |
| 117 |
[% END %] |
| 108 |
</select> |
118 |
</select> |
| 109 |
[% END %] |
119 |
[% END %] |
| 110 |
[% END %] |
120 |
[% ELSE %] |
| 111 |
[% INCLUDE 'search_indexes.inc' %] |
121 |
<div> |
| 112 |
<input type="text" size="30" name="q" title="Enter search terms" value="" /> |
122 |
[% END %] |
| 113 |
[% IF ( expanded_options ) %] |
123 |
[% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %] |
| 114 |
[% IF ( search_box.add_field ) %] |
124 |
[% INCLUDE 'search_indexes.inc' $preselect=1 %] |
| 115 |
<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a> |
125 |
<input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" /> |
| 116 |
[% END %] |
126 |
[% IF ( expanded_options ) %] |
| 117 |
[% IF ( search_box.scan_index ) %] |
127 |
[% IF ( loop.last ) %] |
|
|
128 |
<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a> |
| 129 |
[% END %] |
| 130 |
[% IF ( loop.first ) %] |
| 118 |
<label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" /> |
131 |
<label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" /> |
| 119 |
[% END %] |
|
|
| 120 |
[% END %] |
132 |
[% END %] |
| 121 |
</div> |
133 |
[% END %] |
|
|
134 |
</div> |
| 122 |
[% END %] |
135 |
[% END %] |
| 123 |
[% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %] |
136 |
[% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %] |
| 124 |
[% IF ( expanded_options ) %] |
137 |
[% IF ( expanded_options ) %] |
|
Lines 129-135
Link Here
|
| 129 |
<span id="weight_search"> |
142 |
<span id="weight_search"> |
| 130 |
<label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label> |
143 |
<label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label> |
| 131 |
</span> |
144 |
</span> |
| 132 |
<p> |
145 |
|
| 133 |
[% ELSE %] |
146 |
[% ELSE %] |
| 134 |
<input type="hidden" name="weight_search" value="1" /> |
147 |
<input type="hidden" name="weight_search" value="1" /> |
| 135 |
[% END %] |
148 |
[% END %] |
|
Lines 159-167
Link Here
|
| 159 |
<table> |
172 |
<table> |
| 160 |
<tr> |
173 |
<tr> |
| 161 |
[% FOREACH itemtypeloo IN advsearchloo.code_loop %] |
174 |
[% FOREACH itemtypeloo IN advsearchloo.code_loop %] |
| 162 |
<td><input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/><label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]">[% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %][% IF ( itemtypeloo.imageurl ) %]<img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" />[% END %] [% END %] |
175 |
<td> |
| 163 |
[% itemtypeloo.description | html %]</label></td> |
176 |
[% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %] |
| 164 |
[% IF ( loop.last ) %]</tr>[% ELSE %][% UNLESS ( loop.count % 5 ) %]</tr><tr>[% END %][% END %] |
177 |
[% IF limits.$limit_key.defined %] |
|
|
178 |
[% limits.delete( limit_key ) %] |
| 179 |
<input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/> |
| 180 |
[% ELSE %] |
| 181 |
<input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/> |
| 182 |
[% END %] |
| 183 |
<label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> |
| 184 |
[% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] |
| 185 |
[% IF ( itemtypeloo.imageurl ) %] |
| 186 |
<img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> |
| 187 |
[% END %] |
| 188 |
|
| 189 |
[% END %] |
| 190 |
[% itemtypeloo.description | html %] |
| 191 |
</label> |
| 192 |
</td> |
| 193 |
[% IF ( loop.last ) %] |
| 194 |
</tr> |
| 195 |
[% ELSE %] |
| 196 |
[% UNLESS ( loop.count % 5 ) %] |
| 197 |
</tr> |
| 198 |
<tr> |
| 199 |
[% END %] |
| 200 |
[% END %] |
| 165 |
[% END %] |
201 |
[% END %] |
| 166 |
</table> |
202 |
</table> |
| 167 |
</div> |
203 |
</div> |
|
Lines 174-185
Link Here
|
| 174 |
<fieldset id="pubrange"> |
210 |
<fieldset id="pubrange"> |
| 175 |
<!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options --> |
211 |
<!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options --> |
| 176 |
<p><label for="limit-yr">Year: </label> |
212 |
<p><label for="limit-yr">Year: </label> |
| 177 |
<input type="text" size="15" name="limit-yr" id="limit-yr" value=""/> (format: yyyy-yyyy)</p> |
213 |
[% SET year_limit_key = 'yr,st-numeric' %] |
|
|
214 |
<input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]"/> (format: yyyy-yyyy)</p> |
| 215 |
[% IF limits.$year_limit_key.defined %] |
| 216 |
[% limits.delete($year_limit_key) %] |
| 217 |
[% END %] |
| 178 |
<!-- /PUB / COPY YEAR LIMIT --> |
218 |
<!-- /PUB / COPY YEAR LIMIT --> |
| 179 |
</fieldset> |
219 |
</fieldset> |
| 180 |
<fieldset id="language"> |
220 |
<fieldset id="language"> |
| 181 |
<!-- LANGUAGE LIMIT --> |
221 |
<!-- LANGUAGE LIMIT --> |
| 182 |
<p> |
222 |
<p> |
|
|
223 |
<fieldset id="current_language_limits"><legend>Current language limits</legend> |
| 224 |
[% FOREACH langtype IN ['ln,rtrn','language-original,rtrn'] %] |
| 225 |
[% FOREACH limit IN limits.$langtype %] |
| 226 |
<span> |
| 227 |
<input name="limit" value="[% langtype | html %]:[% limit | html %]" type="hidden"> |
| 228 |
<label for="language_limit_[% loop.index() | html %]"> |
| 229 |
[% IF langtype == 'ln,rtrn' %]Language: [% ELSE %]Original language: [% END %] |
| 230 |
[% Languages.GetByISOCode( lang, limit ) | html %] |
| 231 |
</label> |
| 232 |
<input type="checkbox" class="toggle_limit" name="language_limit_[% loop.index() | html %]" checked="checked"> |
| 233 |
</span> |
| 234 |
[% END %] |
| 235 |
[% limits.delete( langtype ) %] |
| 236 |
[% END %] |
| 237 |
</fieldset> |
| 238 |
|
| 183 |
<label for="language-limit">Language: </label> |
239 |
<label for="language-limit">Language: </label> |
| 184 |
[% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' %] |
240 |
[% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' %] |
| 185 |
<label for="language-original-limit">Language of original: </label> |
241 |
<label for="language-original-limit">Language of original: </label> |
|
Lines 195-203
Link Here
|
| 195 |
[% IF ( UNIMARC ) %] |
251 |
[% IF ( UNIMARC ) %] |
| 196 |
[% INCLUDE 'subtypes_unimarc.inc' %] |
252 |
[% INCLUDE 'subtypes_unimarc.inc' %] |
| 197 |
[% ELSE %] |
253 |
[% ELSE %] |
|
|
254 |
[% PROCESS 'subtype_limits.inc' %] |
| 198 |
<!-- SUBTYPE LIMITS --> |
255 |
<!-- SUBTYPE LIMITS --> |
| 199 |
<fieldset id="subtype"> |
256 |
<fieldset id="subtype"> |
| 200 |
<legend>Subtype limits</legend><p> |
257 |
<legend>Subtype limits</legend><p> |
|
|
258 |
|
| 259 |
<fieldset id="current_subtype_limits"><legend>Current subtype limits</legend> |
| 260 |
[% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %] |
| 261 |
[% FOREACH limit IN limits.$subtype %] |
| 262 |
<span> |
| 263 |
<input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden"> |
| 264 |
<label for="subtype_limit_[% loop.index() | html %]">[% PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit %]</label> |
| 265 |
<input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked"> |
| 266 |
</span> |
| 267 |
[% END %] |
| 268 |
[% limits.delete( subtype ) %] |
| 269 |
[% END %] |
| 270 |
</fieldset> |
| 271 |
|
| 201 |
|
272 |
|
| 202 |
<select name="limit" class="subtype"> |
273 |
<select name="limit" class="subtype"> |
| 203 |
<option value="" selected="selected" class="menuheader">Any audience</option> |
274 |
<option value="" selected="selected" class="menuheader">Any audience</option> |
|
Lines 264-285
Link Here
|
| 264 |
|
335 |
|
| 265 |
</fieldset> |
336 |
</fieldset> |
| 266 |
[% END %] |
337 |
[% END %] |
| 267 |
|
|
|
| 268 |
<!-- AVAILABILITY LIMITS --> |
338 |
<!-- AVAILABILITY LIMITS --> |
| 269 |
<fieldset id="availability"><legend>Location and availability</legend> |
339 |
<fieldset id="availability"><legend>Location and availability</legend> |
| 270 |
<fieldset id="currently-avail"> |
340 |
<fieldset id="currently-avail"> |
| 271 |
<p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p> |
341 |
[% IF limit_available %] |
|
|
342 |
<p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /></p> |
| 343 |
[% ELSE %] |
| 344 |
<p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p> |
| 345 |
[% END %] |
| 272 |
</fieldset> |
346 |
</fieldset> |
| 273 |
|
347 |
|
| 274 |
<fieldset id="select-libs"> |
348 |
<fieldset id="select-libs"> |
|
|
349 |
<fieldset id="individual_branches"> |
| 350 |
<legend>Individual branches</legend> |
| 351 |
<p>If multiple branches are provided, only records with items from all of those branches will be returned</p> |
| 352 |
[% FOREACH branch IN limits.branch %] |
| 353 |
<span> |
| 354 |
<input name="limit" value="branch:[% branch | html %]" type="hidden"> |
| 355 |
<label for="branch_[% loop.index() | html %]">[% Branches.GetName(branch) | html %]</label> |
| 356 |
<input type="checkbox" class="toggle_limit" name="branch_[% loop.index() | html %]" checked="checked"> |
| 357 |
</span> |
| 358 |
[% END %] |
| 359 |
[% limits.delete('branch') %] |
| 275 |
<p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop"> |
360 |
<p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop"> |
| 276 |
<option value="">All libraries</option> |
361 |
<option value="">All libraries</option> |
| 277 |
[%# FIXME Should not we filter the libraries displayed? %] |
362 |
[%# FIXME Should not we filter the libraries displayed? %] |
| 278 |
[% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %] |
363 |
[% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all({ unfiltered => 1, selected ="" }) %] |
| 279 |
</select></p> |
364 |
</select></p> |
|
|
365 |
</fieldset> |
| 366 |
<p>OR</p> |
| 367 |
<fieldset id="multi_branches"> |
| 368 |
<legend>Multiple branches</legend> |
| 369 |
<p>If multiple branches are selected here records with items in any of these branches will be returned. Selecting a group when some libraries are already selected will add the group libraries to the list</p> |
| 370 |
<p>Selecting a group will disable the option to select individual libraries</p> |
| 280 |
<!-- <input type="hidden" name="limit" value="branch: MAIN" /> --> |
371 |
<!-- <input type="hidden" name="limit" value="branch: MAIN" /> --> |
| 281 |
[% IF search_groups %] |
372 |
[% IF search_groups %] |
| 282 |
<p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. --> |
373 |
[% FOREACH key IN limits.keys %] |
|
|
374 |
[% IF ( multibranch = key.match('^mc-homebranch_(.*)') ) %] |
| 375 |
<span> |
| 376 |
<input type="hidden" name="limit" value="mc-homebranch:[% multibranch.0 | html %]"> |
| 377 |
<label for="multibranch_[% loop.index() | html %]">[% Branches.GetName(multibranch) | html %]</label> |
| 378 |
<input type="checkbox" class="toggle_limit" name="multibranch_[% loop.index() | html %]" checked="checked"> |
| 379 |
</span> |
| 380 |
[% limits.delete(key) %] |
| 381 |
[% END %] |
| 382 |
[% END %] |
| 283 |
|
383 |
|
| 284 |
<p> |
384 |
<p> |
| 285 |
<label for="categoryloop">Groups of libraries: </label> |
385 |
<label for="categoryloop">Groups of libraries: </label> |
|
Lines 292-307
Link Here
|
| 292 |
[% END %] |
392 |
[% END %] |
| 293 |
</select> |
393 |
</select> |
| 294 |
</p> |
394 |
</p> |
|
|
395 |
</fieldset> |
| 295 |
[% END %] |
396 |
[% END %] |
| 296 |
</fieldset> |
397 |
</fieldset> |
| 297 |
</fieldset> |
398 |
</fieldset> |
| 298 |
<!-- /AVAILABILITY LIMITS --> |
399 |
<!-- /AVAILABILITY LIMITS --> |
| 299 |
|
400 |
|
|
|
401 |
<!-- OTHER LIMITS (facets, etc.) --> |
| 402 |
[% IF limits.size %] |
| 403 |
<fieldset id=""><legend>Other limits</legend> |
| 404 |
<p> |
| 405 |
[% FOREACH key IN limits.keys %] |
| 406 |
[% FOREACH limit IN limits.$key %] |
| 407 |
<span> |
| 408 |
<input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]"> |
| 409 |
<label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label> |
| 410 |
<input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked"> |
| 411 |
</span> |
| 412 |
[% END %] |
| 413 |
[% END %] |
| 414 |
</p> |
| 415 |
</fieldset> |
| 416 |
[% END %] |
| 417 |
<!-- /OTHER LIMITS (facets, etc.) --> |
| 418 |
|
| 300 |
<!-- RANK LIMITS --> |
419 |
<!-- RANK LIMITS --> |
| 301 |
<fieldset id="sortby"><legend>Sorting</legend> |
420 |
<fieldset id="sortby"><legend>Sorting</legend> |
| 302 |
<p> |
421 |
<p> |
| 303 |
<label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by"> |
422 |
<label for="sort_by">Sort by: </label><select id="sort_by" name="sort_by"> |
| 304 |
[% INCLUDE 'resort_form.inc' %] |
423 |
[% INCLUDE 'resort_form.inc' sort_by = sort %] |
| 305 |
</select> |
424 |
</select> |
| 306 |
</p> |
425 |
</p> |
| 307 |
</fieldset> |
426 |
</fieldset> |
|
Lines 342-347
Link Here
|
| 342 |
document.getElementById("categoryloop").disabled=false; |
461 |
document.getElementById("categoryloop").disabled=false; |
| 343 |
} |
462 |
} |
| 344 |
}); |
463 |
}); |
|
|
464 |
$(".toggle_limit").on('click',function(){ |
| 465 |
$(this).siblings("[type='hidden']").prop('disabled', !this.checked); |
| 466 |
}); |
| 467 |
$("#categoryloop").on('change',function(){ |
| 468 |
if( $(this).val() != "" ){ |
| 469 |
$("#individual_branches select,#individual_branches input").prop('disabled',true); |
| 470 |
} else { |
| 471 |
$("#individual_branches select,#individual_branches input").prop('disabled',false); |
| 472 |
} |
| 473 |
}); |
| 474 |
if( $("#current_language_limits input").length == 0 ){ |
| 475 |
$("#current_language_limits").hide(); |
| 476 |
} |
| 477 |
if( $("#current_subtype_limits input").length == 0 ){ |
| 478 |
$("#current_subtype_limits").hide(); |
| 479 |
} |
| 345 |
|
480 |
|
| 346 |
[% IF searchid %] |
481 |
[% IF searchid %] |
| 347 |
browser = KOHA.browser('[% searchid | html %]'); |
482 |
browser = KOHA.browser('[% searchid | html %]'); |