|
Lines 12-17
Link Here
|
| 12 |
[% END %]</title |
12 |
[% END %]</title |
| 13 |
> |
13 |
> |
| 14 |
[% INCLUDE 'doc-head-close.inc' %] |
14 |
[% INCLUDE 'doc-head-close.inc' %] |
|
|
15 |
[% FILTER collapse %] |
| 16 |
<style> |
| 17 |
#advanced-search { |
| 18 |
select, |
| 19 |
input[type="text"] { |
| 20 |
background-color: #fff; |
| 21 |
border: 1px solid #aaaaaa; |
| 22 |
border-radius: 4px; |
| 23 |
color: #495057; |
| 24 |
display: inline-block; |
| 25 |
height: calc(1.5em + 0.75rem + 2px); |
| 26 |
line-height: 1.5; |
| 27 |
padding: 0.375rem 0.75rem; |
| 28 |
width: 100%; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
#advsearches { |
| 33 |
margin-bottom: 0.375rem; |
| 34 |
} |
| 35 |
|
| 36 |
#advsearches .tab-pane { |
| 37 |
} |
| 38 |
|
| 39 |
#advsearches table { |
| 40 |
border-collapse: separate; |
| 41 |
border-spacing: 5px; |
| 42 |
border-width: 0; |
| 43 |
} |
| 44 |
|
| 45 |
#advsearches td { |
| 46 |
border: 1px solid #eee; |
| 47 |
padding: 0.3em 0.4em; |
| 48 |
} |
| 49 |
|
| 50 |
#searchterms .search-term-input { |
| 51 |
margin: 0.375rem; |
| 52 |
} |
| 53 |
|
| 54 |
#searchterms .search-term-input.search-more-options { |
| 55 |
grid-column-end: 4; |
| 56 |
grid-column-start: 2; |
| 57 |
margin-left: -1.2rem; |
| 58 |
} |
| 59 |
|
| 60 |
@media only screen and (min-width: 608px) { |
| 61 |
#searchterms { |
| 62 |
.search-term-row { |
| 63 |
column-gap: 0.5rem; |
| 64 |
display: grid; |
| 65 |
grid-template-columns: 30% 40% 30%; |
| 66 |
margin-bottom: 0.5rem; |
| 67 |
|
| 68 |
&.extended { |
| 69 |
grid-template-columns: 10% 30% 40% 20%; |
| 70 |
} |
| 71 |
} |
| 72 |
|
| 73 |
.search-term-input { |
| 74 |
margin: 0; |
| 75 |
} |
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
@media only screen and (min-width: 608px) { |
| 80 |
.search-limits { |
| 81 |
align-items: stretch; |
| 82 |
display: grid; |
| 83 |
gap: 0.5rem; |
| 84 |
grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); |
| 85 |
} |
| 86 |
} |
| 87 |
|
| 88 |
@media only screen and (min-width: 769px) { |
| 89 |
.search-limits { |
| 90 |
} |
| 91 |
} |
| 92 |
|
| 93 |
.search-limits { |
| 94 |
margin-bottom: 0.375rem; |
| 95 |
} |
| 96 |
|
| 97 |
.search-limits div { |
| 98 |
background-color: #fff; |
| 99 |
flex: 1; |
| 100 |
} |
| 101 |
|
| 102 |
.search-limits fieldset { |
| 103 |
margin: 0; |
| 104 |
} |
| 105 |
|
| 106 |
.search-limits label { |
| 107 |
display: block; |
| 108 |
font-weight: bold; |
| 109 |
margin: 0.375rem 0; |
| 110 |
} |
| 111 |
|
| 112 |
.search-limit-check { |
| 113 |
display: flex; |
| 114 |
gap: 0.375rem; |
| 115 |
margin-bottom: 1rem; |
| 116 |
} |
| 117 |
.search-limit-check input[type="checkbox"] { |
| 118 |
flex-shrink: 1; |
| 119 |
} |
| 120 |
.search-limit-check label { |
| 121 |
display: inline-block; |
| 122 |
} |
| 123 |
|
| 124 |
.limit-grid { |
| 125 |
display: grid; |
| 126 |
gap: 0.5rem; |
| 127 |
grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); |
| 128 |
} |
| 129 |
|
| 130 |
.itemtypeimages { |
| 131 |
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); |
| 132 |
} |
| 133 |
|
| 134 |
.limit-grid-cell { |
| 135 |
align-items: flex-start; |
| 136 |
border: 1px solid #eee; |
| 137 |
display: flex; |
| 138 |
flex-direction: row; |
| 139 |
padding: 0.375rem; |
| 140 |
} |
| 141 |
|
| 142 |
.limit-grid-cell:has(img) { |
| 143 |
flex-direction: column; |
| 144 |
} |
| 145 |
|
| 146 |
.limit-grid-cell img, |
| 147 |
.limit-grid-cell input { |
| 148 |
flex-shrink: 1; |
| 149 |
flex-grow: 0; |
| 150 |
} |
| 151 |
|
| 152 |
.limit-grid-input { |
| 153 |
border: 0; |
| 154 |
display: flex; |
| 155 |
flex-direction: row; |
| 156 |
gap: 0.5rem; |
| 157 |
justify-content: center; |
| 158 |
} |
| 159 |
|
| 160 |
.limit-grid-input + label { |
| 161 |
display: block; |
| 162 |
margin-left: 0.5rem; |
| 163 |
text-align: left; |
| 164 |
} |
| 165 |
|
| 166 |
.ButtonLess .fa, |
| 167 |
.ButtonPlus .fa { |
| 168 |
padding: 3px 3px 0 5px; |
| 169 |
} |
| 170 |
|
| 171 |
.ButtonPlus { |
| 172 |
padding: 0.375rem 0.75rem; |
| 173 |
} |
| 174 |
</style> |
| 175 |
[% END %] |
| 15 |
</head> |
176 |
</head> |
| 16 |
|
177 |
|
| 17 |
[%- BLOCK language_limit_select -%] |
178 |
[%- BLOCK language_limit_select -%] |
|
Lines 44-71
Link Here
|
| 44 |
<form action="search.pl" method="get"> |
205 |
<form action="search.pl" method="get"> |
| 45 |
<div id="advanced-search"> |
206 |
<div id="advanced-search"> |
| 46 |
[% IF edit_filter %] |
207 |
[% IF edit_filter %] |
| 47 |
<div id="toolbar" class="btn-toolbar"> |
208 |
<div id="edit_search_filter" class="page-section"> |
| 48 |
<legend>Editing filter: [% edit_filter.name | html %]</legend> |
209 |
<h2>Editing filter: [% edit_filter.name | html %]</h2> |
| 49 |
<div class="p-2"> |
210 |
<div class="d-inline-flex gap-1"> |
| 50 |
<label for="filter_edit_opac">Show in OPAC?</label> |
211 |
<div class="btn-group"> |
| 51 |
[% IF edit_filter.opac %] |
212 |
<label class="btn label-btn"> |
| 52 |
<input type="checkbox" id="show_filter_opac" name="show_filter_opac" checked="checked" /> |
213 |
[% IF edit_filter.opac %] |
| 53 |
[% ELSE %] |
214 |
<input type="checkbox" id="show_filter_opac" name="show_filter_opac" checked="checked" /> |
| 54 |
<input type="checkbox" id="show_filter_opac" name="show_filter_opac" /> |
215 |
[% ELSE %] |
| 55 |
[% END %] |
216 |
<input type="checkbox" id="show_filter_opac" name="show_filter_opac" /> |
| 56 |
<label for="filter_edit_staff_client">Show in staff interface?</label> |
217 |
[% END %] |
| 57 |
[% IF edit_filter.staff_client %] |
218 |
Show in OPAC? |
| 58 |
<input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" checked="checked" /> |
219 |
</label> |
| 59 |
[% ELSE %] |
220 |
</div> |
| 60 |
<input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" /> |
221 |
|
| 61 |
[% END %] |
222 |
<label class="btn label-btn"> |
| 62 |
</div> |
223 |
[% IF edit_filter.staff_client %] |
| 63 |
<hr /> |
224 |
<input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" checked="checked" /> |
| 64 |
<div class="btn-group"> |
225 |
[% ELSE %] |
| 65 |
<button id="save_filter" class="btn btn-default"><i class="fa fa-save"></i> Save filter</button> |
226 |
<input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" /> |
|
|
227 |
[% END %] |
| 228 |
Show in staff interface? |
| 229 |
</label> |
| 230 |
<button id="save_filter" class="btn btn-primary"><i class="fa fa-save"></i> Save filter</button> |
| 66 |
<button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search using filter</button> |
231 |
<button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search using filter</button> |
| 67 |
</div> |
|
|
| 68 |
<div class="btn-group"> |
| 69 |
<a href="/cgi-bin/koha/catalogue/search.pl?do=Clear&expanded_options=[% expanded_options | uri %]" class="btn btn-link"><i class="fa fa-trash-can"></i> Cancel</a> |
232 |
<a href="/cgi-bin/koha/catalogue/search.pl?do=Clear&expanded_options=[% expanded_options | uri %]" class="btn btn-link"><i class="fa fa-trash-can"></i> Cancel</a> |
| 70 |
</div> |
233 |
</div> |
| 71 |
</div> |
234 |
</div> |
|
Lines 106-124
Link Here
|
| 106 |
<fieldset id="searchterms"> |
269 |
<fieldset id="searchterms"> |
| 107 |
<legend>Search for </legend> |
270 |
<legend>Search for </legend> |
| 108 |
[% FOREACH query IN operands %] |
271 |
[% FOREACH query IN operands %] |
| 109 |
[% SET div_style = '' %] |
272 |
[% SET div_class = 'search-term-row' %] |
| 110 |
[% SET div_class = '' %] |
|
|
| 111 |
[% IF expanded_options %] |
273 |
[% IF expanded_options %] |
| 112 |
[% div_class='search-term-row' %] |
274 |
[% div_class='search-term-row extended' %] |
| 113 |
[% END %] |
|
|
| 114 |
[% IF expanded_options && loop.first %] |
| 115 |
[% div_style = 'text-indent: 4.25em;' %] |
| 116 |
[% END %] |
275 |
[% END %] |
| 117 |
|
276 |
|
| 118 |
<div class="[% div_class | html %]" style="[% div_style | html %]"> |
277 |
<div class="[% div_class | html %]" style="[% div_style | html %]"> |
| 119 |
[% IF ( expanded_options ) %] |
278 |
[% IF ( expanded_options ) %] |
| 120 |
[% IF loop.first %] |
279 |
[% SET opindex = loop.index - 1 %] |
| 121 |
[% SET opindex = loop.index - 1 %] |
280 |
<div class="search-term-input"> |
| 122 |
<select name="op"> |
281 |
<select name="op"> |
| 123 |
[% IF operators.$opindex == 'OR' %] |
282 |
[% IF operators.$opindex == 'OR' %] |
| 124 |
<option value="AND">and</option> |
283 |
<option value="AND">and</option> |
|
Lines 134-172
Link Here
|
| 134 |
<option value="NOT">not</option> |
293 |
<option value="NOT">not</option> |
| 135 |
[% END %] |
294 |
[% END %] |
| 136 |
</select> |
295 |
</select> |
| 137 |
[% END %] |
296 |
</div> |
| 138 |
[% END %] |
297 |
[% END %] |
| 139 |
[% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %] |
298 |
[% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %] |
| 140 |
[% INCLUDE 'search_indexes.inc' ${preselect} = 1 index = loop.index %] |
299 |
[% INCLUDE 'search_indexes.inc' ${preselect} = 1 index = loop.index %] |
| 141 |
<input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" /> |
300 |
<div class="search-term-input"> |
|
|
301 |
<input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" /> |
| 302 |
</div> |
| 142 |
[% IF ( expanded_options ) %] |
303 |
[% IF ( expanded_options ) %] |
| 143 |
[% IF ( loop.last ) %] |
304 |
<div class="search-term-input"> |
| 144 |
<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a> |
305 |
[% UNLESS ( loop.first ) %] |
| 145 |
[% END %] |
306 |
<a class="ButtonPlus" title="Add another field" href="#"><i class="fa fa-xl fa-plus-square" aria-hidden="true"></i></a> |
| 146 |
[% IF ( loop.first ) %] |
307 |
<a class="ButtonLess" title="Remove field" href="#"><i class="fa fa-xl fa-minus-square" aria-hidden="true"></i></a> |
| 147 |
<label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" /> |
308 |
[% END %] |
| 148 |
[% END %] |
309 |
</div> |
| 149 |
[% END %] |
310 |
[% END %] |
| 150 |
</div> |
311 |
</div> |
| 151 |
[% END %] |
312 |
<div class="[% div_class | html %]" style="[% div_style | html %]"> |
| 152 |
[% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %] |
313 |
<div class="search-term-input search-more-options"> |
| 153 |
[% IF ( expanded_options ) %] |
314 |
[% IF ( expanded_options ) %] |
| 154 |
<p> |
315 |
[% IF ( loop.last ) %] |
| 155 |
[% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %] |
316 |
[% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %] |
| 156 |
<label><input type="checkbox" name="whole_record" /> Search entire MARC record</label> |
317 |
[% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %] |
|
|
318 |
<label class="btn label-btn"><input type="checkbox" name="whole_record" /> Search entire MARC record</label> |
| 319 |
[% END %] |
| 320 |
<label id="weight_search" class="btn label-btn"><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label> |
| 321 |
[% END %] |
| 322 |
<label class="btn label-btn"><input type="checkbox" name="scan" id="scan" value="1" /> Scan indexes</label> |
| 323 |
[% END %] |
| 324 |
[% ELSE %] |
| 325 |
<input type="hidden" name="weight_search" value="1" /> |
| 157 |
[% END %] |
326 |
[% END %] |
| 158 |
<span id="weight_search"> |
327 |
</div> |
| 159 |
<label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label> |
328 |
</div> |
| 160 |
</span> |
|
|
| 161 |
</p> |
| 162 |
[% ELSE %] |
| 163 |
<input type="hidden" name="weight_search" value="1" /> |
| 164 |
[% END %] |
| 165 |
[% END %] |
329 |
[% END %] |
| 166 |
[% IF Koha.Preference('IncludeSeeFromInSearches') %] |
330 |
[% IF Koha.Preference('IncludeSeeFromInSearches') %] |
| 167 |
<div class="hint included-see-from-headings-info"> |
331 |
<div class="[% div_class | html %]" style="[% div_style | html %]"> |
| 168 |
<i class="fa fa-info-circle" aria-hidden="true"></i> |
332 |
<div class="search-term-input hint included-see-from-headings-info" style="grid-column-start:2;grid-column-end:4"> |
| 169 |
See from (non-preferred form) headings are included |
333 |
<i class="fa fa-info-circle" aria-hidden="true"></i> |
|
|
334 |
See from (non-preferred form) headings are included |
| 335 |
</div> |
| 170 |
</div> |
336 |
</div> |
| 171 |
[% END %] |
337 |
[% END %] |
| 172 |
</fieldset> |
338 |
</fieldset> |
|
Lines 189-378
Link Here
|
| 189 |
[% END # /tab_item#advsearch-tab-... %] |
355 |
[% END # /tab_item#advsearch-tab-... %] |
| 190 |
[% END # /FOREACH advsearchloo %] |
356 |
[% END # /FOREACH advsearchloo %] |
| 191 |
[% END # /WRAPPER tabs_nav %] |
357 |
[% END # /WRAPPER tabs_nav %] |
| 192 |
<!-- prettier-ignore-start --> |
358 |
[% WRAPPER tab_panels %] |
| 193 |
[% WRAPPER tab_panels %] |
359 |
[% FOREACH advsearchloo IN advancedsearchesloop %] |
| 194 |
[% FOREACH advsearchloo IN advancedsearchesloop %] |
360 |
[% WRAPPER tab_panel tabname="advsearch-tab-${advsearchloo.advanced_search_type}" %] |
| 195 |
[% WRAPPER tab_panel tabname="advsearch-tab-${advsearchloo.advanced_search_type}" %] |
361 |
<h4>Limit to any of the following:</h4> |
| 196 |
<h4>Limit to any of the following:</h4> |
362 |
[% SET with_img = Koha.Preference('noItemTypeImages') ? "" : "itemtypeimages" %] |
| 197 |
<table> |
363 |
<div id="[% advsearchloo.advanced_search_type | html %]_grid" class="limit-grid [% with_img | html %]"> |
| 198 |
<tr> |
364 |
[% FOREACH itemtypeloo IN advsearchloo.code_loop %] |
| 199 |
[% FOREACH itemtypeloo IN advsearchloo.code_loop %] |
365 |
<div class="limit-grid-cell"> |
| 200 |
<td> |
366 |
[% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %] |
| 201 |
[% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %] |
367 |
<div class="limit-grid-input"> |
| 202 |
[% IF limits.$limit_key.defined %] |
368 |
[% IF limits.$limit_key.defined %] |
| 203 |
[% limits.delete( limit_key ) %] |
369 |
[% limits.delete( limit_key ) %] |
| 204 |
<input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/> |
370 |
<input |
| 205 |
[% ELSE %] |
371 |
type="checkbox" |
| 206 |
<input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/> |
372 |
checked="checked" |
| 207 |
[% END # /IF limits.$limit_key.defined %] |
373 |
id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" |
| 208 |
<label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> |
374 |
name="limit" |
| 209 |
[% UNLESS ( Koha.Preference('noItemTypeImages') ) %] |
375 |
value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]" |
| 210 |
[% IF ( itemtypeloo.imageurl ) %] |
376 |
/> |
| 211 |
<img class="itemtype-image" src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> |
|
|
| 212 |
[% END %] |
| 213 |
|
| 214 |
[% END %] |
| 215 |
<span class="itypetext">[% itemtypeloo.description | html %]</span> |
| 216 |
</label> |
| 217 |
</td> |
| 218 |
[% IF ( loop.last ) %] |
| 219 |
</tr> |
| 220 |
[% ELSE %] |
377 |
[% ELSE %] |
| 221 |
[% UNLESS ( loop.count % 5 ) %] |
378 |
<input |
| 222 |
</tr> |
379 |
type="checkbox" |
| 223 |
<tr> |
380 |
id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" |
|
|
381 |
name="limit" |
| 382 |
value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]" |
| 383 |
/> |
| 384 |
[% END # /IF limits.$limit_key.defined %] |
| 385 |
[% UNLESS ( Koha.Preference('noItemTypeImages') ) %] |
| 386 |
[% IF ( itemtypeloo.imageurl ) %] |
| 387 |
<img class="itemtype-image" src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> |
| 224 |
[% END %] |
388 |
[% END %] |
| 225 |
[% END # /IF ( loop.last ) %] |
389 |
[% END %] |
| 226 |
[% END # /FOREACH itemtypeloo %] |
390 |
</div> |
| 227 |
</table> |
391 |
<label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> |
| 228 |
[% END # tab_panel/#advsearch-... %] |
392 |
<span class="itypetext">[% itemtypeloo.description | html %]</span> |
| 229 |
[% END # /FOREACH advsearchloo %] |
393 |
</label> |
| 230 |
[% END # /WRAPPER tab_panels %] |
394 |
</div> |
| 231 |
<!-- prettier-ignore-end --> |
395 |
[% END # /FOREACH itemtypeloo %] |
|
|
396 |
</div> |
| 397 |
[% END # tab_panel/#advsearch-... %] |
| 398 |
[% END # /FOREACH advsearchloo %] |
| 399 |
[% END # /WRAPPER tab_panels %] |
| 232 |
[% END # /WRAPPER tabs %] |
400 |
[% END # /WRAPPER tabs %] |
| 233 |
<!-- /MC-TYPE LIMIT --> |
401 |
<!-- /MC-TYPE LIMIT --> |
| 234 |
|
402 |
|
| 235 |
[% IF ( expanded_options ) %] |
403 |
<div class="search-limits"> |
| 236 |
<!-- BASIC LIMITS --> |
404 |
<!-- BASIC LIMITS --> |
| 237 |
<fieldset id="basiclimits"> |
405 |
<div id="basiclimits"> |
| 238 |
<legend>Limits</legend> |
406 |
<fieldset> |
| 239 |
<fieldset id="pubrange"> |
407 |
<legend>Limits</legend> |
| 240 |
<!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options --> |
408 |
<!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options --> |
| 241 |
<p> |
409 |
<p> |
| 242 |
<label for="limit-yr">Year: </label> |
410 |
<label for="limit-yr">Year</label> |
| 243 |
[% SET year_limit_key = 'yr,st-numeric' %] |
411 |
[% SET year_limit_key = 'yr,st-numeric' %] |
| 244 |
<input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]" /> (format: yyyy-yyyy) |
412 |
<input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]" /> |
|
|
413 |
<span class="hint">(format: yyyy-yyyy)</span> |
| 245 |
[% IF limits.$year_limit_key.defined %] |
414 |
[% IF limits.$year_limit_key.defined %] |
| 246 |
[% limits.delete(year_limit_key) %] |
415 |
[% limits.delete(year_limit_key) %] |
| 247 |
[% END %] |
416 |
[% END %] |
| 248 |
</p> |
417 |
</p> |
| 249 |
<!-- /PUB / COPY YEAR LIMIT --> |
418 |
<!-- /PUB / COPY YEAR LIMIT --> |
| 250 |
</fieldset> |
|
|
| 251 |
<!-- /#pubrange --> |
| 252 |
|
| 253 |
<fieldset id="language"> |
| 254 |
<!-- LANGUAGE LIMIT --> |
419 |
<!-- LANGUAGE LIMIT --> |
| 255 |
<p> |
420 |
<p> |
| 256 |
<label for="language-limit">Language: </label> |
421 |
<label for="language-limit">Language</label> |
| 257 |
[% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %] |
422 |
[% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %] |
| 258 |
[% limits.delete( 'ln,rtrn' ) %] |
423 |
[% limits.delete( 'ln,rtrn' ) %] |
| 259 |
<label for="language-original-limit">Language of original: </label> |
424 |
</p> |
|
|
425 |
<p> |
| 426 |
<label for="language-original-limit">Language of original</label> |
| 260 |
[% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %] |
427 |
[% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %] |
| 261 |
[% limits.delete( 'language-original,rtrn' ) %] |
428 |
[% limits.delete( 'language-original,rtrn' ) %] |
| 262 |
</p> |
429 |
</p> |
| 263 |
<!-- /LANGUAGE LIMIT --> |
430 |
<!-- /LANGUAGE LIMIT --> |
|
|
431 |
<!-- /#language --> |
| 264 |
</fieldset> |
432 |
</fieldset> |
| 265 |
<!-- /#language --> |
433 |
</div> |
| 266 |
</fieldset> |
|
|
| 267 |
<!-- /#basiclimits --> |
434 |
<!-- /#basiclimits --> |
| 268 |
<!-- /BASIC LIMITS --> |
435 |
<!-- /BASIC LIMITS --> |
| 269 |
[% END # /IF ( expanded_options ) %] |
|
|
| 270 |
|
436 |
|
| 271 |
[% IF ( UNIMARC ) %] |
437 |
[% UNLESS ( UNIMARC ) %] |
| 272 |
[% INCLUDE 'subtypes_unimarc.inc' %] |
438 |
[% PROCESS 'subtype_limits.inc' %] |
| 273 |
[% ELSE %] |
439 |
<!-- SUBTYPE LIMITS --> |
| 274 |
[% PROCESS 'subtype_limits.inc' %] |
440 |
<div> |
| 275 |
<!-- SUBTYPE LIMITS --> |
441 |
<fieldset id="subtype"> |
| 276 |
<fieldset id="subtype"> |
442 |
<legend>Subtype limits</legend> |
| 277 |
<legend>Subtype limits</legend><p> [% PROCESS subtype_dropdowns %] </p |
443 |
<p> [% PROCESS subtype_dropdowns %] </p> |
| 278 |
><fieldset id="current_subtype_limits"> |
444 |
<fieldset id="current_subtype_limits"> |
| 279 |
<legend>Current subtype limits</legend> |
445 |
<legend>Current subtype limits</legend> |
| 280 |
[% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %] |
446 |
[% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %] |
| 281 |
[% FOREACH limit IN limits.$subtype %] |
447 |
[% FOREACH limit IN limits.$subtype %] |
| 282 |
<span> |
448 |
<span> |
| 283 |
<input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden" /> |
449 |
<input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden" /> |
| 284 |
<label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label> |
450 |
<label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label> |
| 285 |
<input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked" /> |
451 |
<input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked" /> |
| 286 |
</span> |
452 |
</span> |
|
|
453 |
[% END %] |
| 454 |
[% limits.delete( subtype ) %] |
| 455 |
[% END # /FOREACH subtype %] |
| 456 |
</fieldset> |
| 457 |
<!-- #current_subtype_limits --> |
| 458 |
</fieldset> |
| 459 |
</div> |
| 460 |
<!-- /#subtype --> |
| 461 |
[% END # /IF ( UNIMARC ) %] |
| 462 |
|
| 463 |
<!-- AVAILABILITY LIMITS --> |
| 464 |
<div> |
| 465 |
<fieldset id="availability"> |
| 466 |
<legend>Location and availability</legend> |
| 467 |
<fieldset id="currently-avail"> |
| 468 |
[% IF limit_available %] |
| 469 |
<div class="search-limit-check"> |
| 470 |
<input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /> |
| 471 |
<label for="available-items"> Only items currently available </label> |
| 472 |
</div> |
| 473 |
[% ELSE %] |
| 474 |
<div class="search-limit-check"> |
| 475 |
<input type="checkbox" id="available-items" name="limit" value="available" /> |
| 476 |
<label for="available-items"> Only items currently available </label> |
| 477 |
</div> |
| 287 |
[% END %] |
478 |
[% END %] |
| 288 |
[% limits.delete( subtype ) %] |
479 |
</fieldset> |
| 289 |
[% END # /FOREACH subtype %] |
480 |
<!-- /#currently-avail --> |
|
|
481 |
|
| 482 |
<fieldset id="select-libs"> |
| 483 |
<p> |
| 484 |
<label for="branchloop">Individual libraries:</label> |
| 485 |
<select name="limit" id="branchloop"> |
| 486 |
<option value="">All libraries</option> |
| 487 |
[%# FIXME Should not we filter the libraries displayed? %] |
| 488 |
[% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %] |
| 489 |
[% limits.delete('branch') %] |
| 490 |
</select> |
| 491 |
<!-- /#branchloop --> |
| 492 |
</p> |
| 493 |
[% IF search_groups %] |
| 494 |
<p>OR</p> |
| 495 |
<p> |
| 496 |
<label for="categoryloop">Groups of libraries</label> |
| 497 |
<select name="limit" id="categoryloop"> |
| 498 |
<option value=""> -- none -- </option> |
| 499 |
[% FOREACH sg IN search_groups %] |
| 500 |
[% UNLESS sg.branchcode %] |
| 501 |
[% IF limits.multibranchlimit.0 == sg.id %] |
| 502 |
<option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> |
| 503 |
[% ELSE %] |
| 504 |
<option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> |
| 505 |
[% END %] |
| 506 |
[% END %] |
| 507 |
[% END %] |
| 508 |
[% limits.delete('multibranchlimit') %] |
| 509 |
</select> |
| 510 |
<!-- /#categoryloop --> |
| 511 |
</p> |
| 512 |
[% END # /search_groups %] |
| 513 |
</fieldset> |
| 514 |
<!-- /#select-libs --> |
| 290 |
</fieldset> |
515 |
</fieldset> |
| 291 |
<!-- #current_subtype_limits --> |
516 |
</div> |
| 292 |
</fieldset> |
517 |
<!-- /#availability --> |
| 293 |
<!-- /#subtype --> |
518 |
<!-- /AVAILABILITY LIMITS --> |
| 294 |
[% END # /IF ( UNIMARC ) %] |
519 |
|
| 295 |
|
520 |
<!-- OTHER LIMITS (facets, etc.) --> |
| 296 |
<!-- AVAILABILITY LIMITS --> |
521 |
[% IF limits.size %] |
| 297 |
<fieldset id="availability"> |
522 |
<fieldset id=""> |
| 298 |
<legend>Location and availability</legend> |
523 |
<legend>Other limits</legend> |
| 299 |
<fieldset id="currently-avail"> |
|
|
| 300 |
[% IF limit_available %] |
| 301 |
<p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /></p> |
| 302 |
[% ELSE %] |
| 303 |
<p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p> |
| 304 |
[% END %] |
| 305 |
</fieldset> |
| 306 |
<!-- /#currently-avail --> |
| 307 |
|
| 308 |
<fieldset id="select-libs"> |
| 309 |
<p> |
| 310 |
<label for="branchloop">Individual libraries:</label> |
| 311 |
<select name="limit" id="branchloop"> |
| 312 |
<option value="">All libraries</option> |
| 313 |
[%# FIXME Should not we filter the libraries displayed? %] |
| 314 |
[% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %] |
| 315 |
[% limits.delete('branch') %] |
| 316 |
</select> |
| 317 |
<!-- /#branchloop --> |
| 318 |
</p> |
| 319 |
[% IF search_groups %] |
| 320 |
<p>OR</p> |
| 321 |
<p> |
524 |
<p> |
| 322 |
<label for="categoryloop">Groups of libraries: </label> |
525 |
[% FOREACH key IN limits.keys %] |
| 323 |
<select name="limit" id="categoryloop"> |
526 |
[% FOREACH limit IN limits.$key %] |
| 324 |
<option value=""> -- none -- </option> |
527 |
<span> |
| 325 |
[% FOREACH sg IN search_groups %] |
528 |
<input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]" /> |
| 326 |
[% UNLESS sg.branchcode %] |
529 |
<label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label> |
| 327 |
[% IF limits.multibranchlimit.0 == sg.id %] |
530 |
<input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked" /> |
| 328 |
<option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> |
531 |
</span> |
| 329 |
[% ELSE %] |
|
|
| 330 |
<option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> |
| 331 |
[% END %] |
| 332 |
[% END %] |
| 333 |
[% END %] |
532 |
[% END %] |
| 334 |
[% limits.delete('multibranchlimit') %] |
533 |
[% END %] |
|
|
534 |
</p> |
| 535 |
</fieldset> |
| 536 |
[% END # /IF limits.size %] |
| 537 |
<!-- /OTHER LIMITS (facets, etc.) --> |
| 538 |
|
| 539 |
<!-- RANK LIMITS --> |
| 540 |
<div> |
| 541 |
<fieldset id="sortby"> |
| 542 |
<legend>Sorting</legend> |
| 543 |
<p> |
| 544 |
<label for="sort_by">Sort by</label> |
| 545 |
<select id="sort_by" name="sort_by"> |
| 546 |
[% INCLUDE 'resort_form.inc' sort_by = sort || sort_by %] |
| 335 |
</select> |
547 |
</select> |
| 336 |
<!-- /#categoryloop --> |
|
|
| 337 |
</p> |
548 |
</p> |
| 338 |
[% END # /search_groups %] |
549 |
</fieldset> |
| 339 |
</fieldset> |
550 |
</div> |
| 340 |
<!-- /#select-libs --> |
551 |
<!-- /#sortby --> |
| 341 |
</fieldset> |
552 |
<!-- /RANK LIMITS --> |
| 342 |
<!-- /#availability --> |
553 |
<!-- /.search-limits --> |
| 343 |
<!-- /AVAILABILITY LIMITS --> |
554 |
[% IF ( UNIMARC ) %] |
| 344 |
|
555 |
[% INCLUDE 'subtypes_unimarc.inc' %] |
| 345 |
<!-- OTHER LIMITS (facets, etc.) --> |
556 |
[% END %] |
| 346 |
[% IF limits.size %] |
557 |
</div> |
| 347 |
<fieldset id=""> |
|
|
| 348 |
<legend>Other limits</legend> |
| 349 |
<p> |
| 350 |
[% FOREACH key IN limits.keys %] |
| 351 |
[% FOREACH limit IN limits.$key %] |
| 352 |
<span> |
| 353 |
<input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]" /> |
| 354 |
<label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label> |
| 355 |
<input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked" /> |
| 356 |
</span> |
| 357 |
[% END %] |
| 358 |
[% END %] |
| 359 |
</p> |
| 360 |
</fieldset> |
| 361 |
[% END # /IF limits.size %] |
| 362 |
<!-- /OTHER LIMITS (facets, etc.) --> |
| 363 |
|
| 364 |
<!-- RANK LIMITS --> |
| 365 |
<fieldset id="sortby"> |
| 366 |
<legend>Sorting</legend> |
| 367 |
<p> |
| 368 |
<label for="sort_by">Sort by: </label> |
| 369 |
<select id="sort_by" name="sort_by"> |
| 370 |
[% INCLUDE 'resort_form.inc' sort_by = sort || sort_by %] |
| 371 |
</select> |
| 372 |
</p> |
| 373 |
</fieldset> |
| 374 |
<!-- /#sortby --> |
| 375 |
<!-- /RANK LIMITS --> |
| 376 |
</div> |
558 |
</div> |
| 377 |
<!-- /#advanced-search --> |
559 |
<!-- /#advanced-search --> |
| 378 |
</form> |
560 |
</form> |
|
Lines 383-402
Link Here
|
| 383 |
[% Asset.css("css/humanmsg.css") | $raw %] |
565 |
[% Asset.css("css/humanmsg.css") | $raw %] |
| 384 |
[% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] |
566 |
[% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] |
| 385 |
<script> |
567 |
<script> |
| 386 |
/** |
568 |
window.addEventListener('pageshow', function( e ){ |
| 387 |
* Function add_field(); |
569 |
$('.form-control:visible').prop('disabled' , false ); |
| 388 |
* This function allows to display a new field to search. |
570 |
}); |
| 389 |
*/ |
|
|
| 390 |
function add_field() { |
| 391 |
var ButtonPlus = document.getElementById("ButtonPlus"); |
| 392 |
var line = ButtonPlus.parentNode; |
| 393 |
var dad = line.parentNode; |
| 394 |
dad.appendChild(line.cloneNode(true)); |
| 395 |
line.removeChild(ButtonPlus); |
| 396 |
} |
| 397 |
|
571 |
|
| 398 |
$(document).ready(function() { |
572 |
$(document).ready(function() { |
| 399 |
$("input[name=q]:eq(0)").focus(); |
573 |
|
|
|
574 |
/* This function allows to display a new field to search. |
| 575 |
*/ |
| 576 |
$(document).on("click", '.ButtonPlus', function(e) { |
| 577 |
e.preventDefault(); |
| 578 |
$('.ButtonLess').show(); |
| 579 |
var thisLine = $(this).parent().parent(); |
| 580 |
var newLine = thisLine.clone(); |
| 581 |
$(newLine).find('.search-term-input select[name="op"]').first().prop("disabled",false).show(); |
| 582 |
newLine.find('input').val(''); |
| 583 |
thisLine.after(newLine); |
| 584 |
}); |
| 585 |
|
| 586 |
$(document).on("click", '.ButtonLess', function(e) { |
| 587 |
e.preventDefault(); |
| 588 |
$(this).parent().parent().remove(); |
| 589 |
if( $(".ButtonLess").length < 2 ) { |
| 590 |
$('.ButtonLess').hide(); |
| 591 |
} |
| 592 |
$('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); |
| 593 |
}); |
| 594 |
|
| 595 |
$('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); |
| 596 |
|
| 400 |
if( $("#advsearches .tab-pane.active").length < 1 ){ |
597 |
if( $("#advsearches .tab-pane.active").length < 1 ){ |
| 401 |
$("#advsearches a:first").tab("show"); |
598 |
$("#advsearches a:first").tab("show"); |
| 402 |
} |
599 |
} |
|
Lines 431-488
Link Here
|
| 431 |
browser.show_back_link(); |
628 |
browser.show_back_link(); |
| 432 |
[% END %] |
629 |
[% END %] |
| 433 |
|
630 |
|
| 434 |
[% IF edit_filter %] |
631 |
$(".limit-grid > *").on("click", function(e){ |
| 435 |
$("#save_filter").click(function(e){ |
632 |
const checkbox = $(this).find("input"); |
| 436 |
e.preventDefault(); |
633 |
if( checkbox.prop("checked") ){ |
| 437 |
let operators = []; |
634 |
checkbox.prop("checked", false ); |
| 438 |
let indexes = []; |
635 |
} else { |
| 439 |
let operands = []; |
636 |
checkbox.prop("checked", true ); |
| 440 |
let limits =[]; |
|
|
| 441 |
let opac = $("#show_filter_opac").prop('checked'); |
| 442 |
let staff_client = $("#show_filter_staff_client").prop('checked'); |
| 443 |
$("select[name='op']").each(function(){ |
| 444 |
operators.push( $(this).val() ); |
| 445 |
}); |
| 446 |
$("select[name='idx']").each(function(){ |
| 447 |
indexes.push( $(this).val() ); |
| 448 |
}); |
| 449 |
$("input[name='q']").each(function(){ |
| 450 |
operands.push( $(this).val() ); |
| 451 |
}); |
| 452 |
$("select[name='limit'],input[name='limit']:checked").each(function(){ |
| 453 |
if( $(this).val() != ""){ |
| 454 |
limits.push( $(this).val() ); |
| 455 |
} |
| 456 |
}); |
| 457 |
let year_limit = $("#limit-yr").val(); |
| 458 |
if( year_limit ){ |
| 459 |
limits.push( "yr,st-numeric:"+year_limit ); |
| 460 |
} |
637 |
} |
| 461 |
let options = { |
638 |
}); |
| 462 |
url: '/api/v1/search_filters/'+ [% edit_filter.id | html %], |
639 |
|
| 463 |
method: "PUT", |
640 |
[% IF edit_filter %] |
| 464 |
contentType: "application/json", |
641 |
$("#save_filter").click(function(e){ |
| 465 |
data: JSON.stringify({ |
642 |
e.preventDefault(); |
| 466 |
name: "[% edit_filter.name | html %]", |
643 |
let operators = []; |
| 467 |
query: JSON.stringify({ operands: operands, indexes: indexes, operators:operators }), |
644 |
let indexes = []; |
| 468 |
limits: JSON.stringify({ limits: limits }), |
645 |
let operands = []; |
| 469 |
opac: opac, |
646 |
let limits =[]; |
| 470 |
staff_client: staff_client, |
647 |
let opac = $("#show_filter_opac").prop('checked'); |
| 471 |
}) |
648 |
let staff_client = $("#show_filter_staff_client").prop('checked'); |
| 472 |
}; |
649 |
$("select[name='op']").each(function(){ |
| 473 |
$.ajax(options) |
650 |
operators.push( $(this).val() ); |
| 474 |
.then(function(result) { |
651 |
}); |
| 475 |
humanMsg.displayAlert( _("Saved filter: ") + result.name , { className: 'human Success' } ); |
652 |
$("select[name='idx']").each(function(){ |
| 476 |
}) |
653 |
indexes.push( $(this).val() ); |
| 477 |
.fail( function(err){ |
654 |
}); |
| 478 |
humanMsg.displayAlert( _("There was an error during saving:") + err.responseText, { className: 'humanError' } ); |
655 |
$("input[name='q']").each(function(){ |
|
|
656 |
operands.push( $(this).val() ); |
| 479 |
}); |
657 |
}); |
|
|
658 |
$("select[name='limit'],input[name='limit']:checked").each(function(){ |
| 659 |
if( $(this).val() != ""){ |
| 660 |
limits.push( $(this).val() ); |
| 661 |
} |
| 662 |
}); |
| 663 |
let year_limit = $("#limit-yr").val(); |
| 664 |
if( year_limit ){ |
| 665 |
limits.push( "yr,st-numeric:"+year_limit ); |
| 666 |
} |
| 667 |
let options = { |
| 668 |
url: '/api/v1/search_filters/'+ [% edit_filter.id | html %], |
| 669 |
method: "PUT", |
| 670 |
contentType: "application/json", |
| 671 |
data: JSON.stringify({ |
| 672 |
name: "[% edit_filter.name | html %]", |
| 673 |
query: JSON.stringify({ operands: operands, indexes: indexes, operators:operators }), |
| 674 |
limits: JSON.stringify({ limits: limits }), |
| 675 |
opac: opac, |
| 676 |
staff_client: staff_client, |
| 677 |
}) |
| 678 |
}; |
| 679 |
$.ajax(options) |
| 680 |
.then(function(result) { |
| 681 |
humanMsg.displayAlert( _("Saved filter: ") + result.name , { className: 'human Success' } ); |
| 682 |
}) |
| 683 |
.fail( function(err){ |
| 684 |
humanMsg.displayAlert( _("There was an error during saving:") + err.responseText, { className: 'humanError' } ); |
| 685 |
}); |
| 480 |
|
686 |
|
| 481 |
|
687 |
|
| 482 |
}); |
688 |
}); |
| 483 |
[% END %] |
689 |
[% END %] |
| 484 |
|
|
|
| 485 |
|
| 486 |
}); |
690 |
}); |
| 487 |
</script> |
691 |
</script> |
| 488 |
[% END %] |
692 |
[% END %] |