Bug 32910: (follow-up) Replace v4 icon names with v6
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / results.tt
1 [% USE raw %]
2 [% USE To %]
3 [% USE Asset %]
4 [% USE Koha %]
5 [% USE Biblio %]
6 [% USE KohaDates %]
7 [% USE KohaPlugins %]
8 [% USE To %]
9 [% PROCESS 'i18n.inc' %]
10 [% SET footerjs = 1 %]
11 [% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %]
12 [% USE AuthorisedValues %]
13 [% INCLUDE 'doc-head-open.inc' %]
14
15 <title>[% IF ( searchdesc ) %]Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %][% ELSE %]You did not specify any search criteria[% END %] &rsaquo; Catalog &rsaquo; Koha</title>
16 [% INCLUDE 'doc-head-close.inc' %]
17 </head>
18
19 <body id="catalog_results" class="catalog">
20 [% WRAPPER 'header.inc' %]
21     [% INCLUDE 'cat-search.inc' %]
22 [% END %]
23
24 [% IntranetCoce    = Koha.Preference('IntranetCoce') %]
25 [% CoceProviders   = Koha.Preference('CoceProviders') %]
26 [% CoceHost        = Koha.Preference('CoceHost') %]
27 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
28 [% SyndeticsCoverImageSize = Koha.Preference('SyndeticsCoverImageSize') %]
29
30 [% WRAPPER 'sub-header.inc' %]
31     [% WRAPPER breadcrumbs %]
32         [% WRAPPER breadcrumb_item %]
33             <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
34         [% END %]
35         [% WRAPPER breadcrumb_item bc_active= 1 %]
36             [% IF ( query_desc ) %]
37                 [% IF ( limit_desc ) %]
38                     <span>Search for '[% query_desc | html %]' with limit(s): '[% limit_desc | html %]'</span>
39                 [% ELSE %]
40                     <span>Search for '[% query_desc | html %]'</span>
41                 [% END %]
42             [% ELSE %]
43                 <span>Search</span>
44             [% END %]
45         [% END %]
46     [% END #/ WRAPPER breadcrumbs %]
47 [% END #/ WRAPPER sub-header.inc %]
48
49 <div class="main container-fluid">
50     <div class="row">
51         <div class="col-sm-10 col-sm-push-2">
52             <main>
53
54             <h1>Search results</h1>
55
56                 [% IF ( outer_sup_results_loop ) %]
57                     <div class="row">
58                         <div class="col-sm-8">
59                 [% END %]
60
61                 [% IF ( koha_spsuggest ) %]
62                     <div style="font-size: 12px;">Did you mean:
63                         <ul style="list-style: none;">
64                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
65                                 <li>
66                                     <a href="/cgi-bin/koha/catalogue/search.pl?q=[% SPELL_SUGGES.spsuggestion | uri %]">[% SPELL_SUGGES.spsuggestion | html %]</a>
67                                 </li>
68                             [% END %]
69                         </ul>
70                     </div>
71                 [% END %]
72
73                 [% IF ( total ) %]
74
75                     <h3>
76                         [% total | html %] result(s) found [% IF ( query_desc ) %]for <span class="results_query_desc">'[% query_desc | html %]'</span>[% END %][% IF limit_desc  %]&nbsp;with limit(s): <span class="results_limit_desc">'[% limit_desc | html %]'</span>[% END %][% IF ( LibraryName ) %] in [% LibraryName | html %] Catalog[% END %].
77                     </h3>
78
79                 [% UNLESS scan %]
80                     <a href="/cgi-bin/koha/catalogue/search.pl?advsearch=1&edit_search=1&[% query_cgi | $raw %]&[% limit_cgi | $raw %]&sort_by=[% sort_by | $raw %]">Edit this search</a>
81                     [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %]
82                         | <a href="#" id="save_search_filter">Save search as filter</a>
83                     [% END %]
84
85                     <div id="search_within_results">
86                         <form id="refine_search">
87                             <label for="limit">Search within results</label>
88                             [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %]
89                                 [% INCLUDE 'search_indexes.inc' ms_kw = 1 refiner = 1 %]
90                             [% END %]
91                             <input name="limit" id="refiner" type="text"  title="Search results">
92                             <input type="submit" id="refine" class="btn btn-primary btn-xs" value="Search" />
93                         </form>
94                     </div>
95
96                     <div class="searchheader" id="searchheader">
97                         <div id="selection_ops">
98                             <a href="#" class="btn btn-link" id="select_all"><i class="fa fa-check"></i> Select all</a>
99                             <a href="#" class="btn btn-link" id="clear_all"><i class="fa fa-times"></i> Clear all</a>
100                             |
101                             [% IF Koha.Preference("StaffHighlightedWords") == 1 %]
102                                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
103                                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
104                                 |
105                             [% END %]
106
107                             [% IF (Koha.Preference("intranetbookbag")) %]
108                                 <div class="btn-group">
109                                     <a id="cartsubmit" class="btn btn-default btn-xs" href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a>
110                                 </div>
111                             [% END %]
112
113                             [% IF Koha.Preference('virtualshelves') %]
114                                 <div class="btn-group">
115                                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
116                                         <i class="fa fa-list"></i> Add to list <span class="caret"></span>
117                                     </button>
118                                     <ul class="dropdown-menu">
119                                         [% IF add_to_some_private_shelves.count %]
120                                             <li class="dropdown-header">Your lists</li>
121                                             [% SET number_of_private_shelves = 0 %]
122                                             [% FOREACH s IN add_to_some_private_shelves %]
123                                                 [% IF shelfnumber != s.shelfnumber %]
124                                                     <li>
125                                                         <a href="#" class="addtolist" data-shelfnumber="[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
126                                                     </li>
127                                                     [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
128                                                     [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
129                                                 [% END %]
130                                             [% END %]
131                                         [% END %]
132                                         [% IF add_to_some_public_shelves.count %]
133                                             <li class="dropdown-header">Public lists</li>
134                                             [% SET number_of_public_shelves = 0 %]
135                                             [% FOREACH s IN add_to_some_public_shelves %]
136                                                 [% IF shelfnumber != s.shelfnumber %]
137                                                     <li>
138                                                         <a href="#" data-shelfnumber="[% s.shelfnumber | html %]" class="addtolist">[% s.shelfname | html %]</a>
139                                                     </li>
140                                                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
141                                                     [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
142                                                 [% END %]
143                                             [% END %]
144                                         [% END %]
145                                         <li role="separator" class="divider"></li>
146                                         [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
147                                             <li>
148                                                 <a href="#" class="addtolist morelists">More lists</a>
149                                             </li>
150                                         [% END %]
151                                         <li>
152                                             <a href="#" class="addtolist newlist">New list</a>
153                                         </li>
154                                     </ul>
155                                 </div>
156                             [% END # /IF virtualshelves %]
157
158                             [% IF ( CAN_user_reserveforothers_place_holds && DisplayMultiPlaceHold ) %]
159                                 [% IF ( holdfor or holdforclub ) %]
160                                     <div id="placeholdc" class="btn-group">
161                                         <button class="btn btn-default btn-xs placehold"><i class="fa-solid fa-bookmark"></i> Place hold</button>
162                                         <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
163                                         <span class="caret"></span>
164                                         </button>
165                                         <ul class="dropdown-menu">
166                                             <li><a href="#" class="placehold">Place hold</a></li>
167                                             [% IF holdfor %]
168                                             <li><a href="#" class="placeholdfor">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></li>
169                                                 <li class="divider"></li>
170                                                 <li><a href="#" id="forgetholdfor">Forget [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></li>
171                                             [% END %]
172                                             [% IF holdforclub %]
173                                                 <li><a href="#" class="placeholdforclub">Place hold for [% holdforclub_name | html %]</a></li>
174                                                 <li class="divider"></li>
175                                                 <li><a href="#" id="forgetholdforclub">Forget  [% holdforclub_name | html %]</a></li>
176                                             [% END %]
177                                         </ul>
178                                     </div>
179                                 [% ELSE %]
180                                     <div id="placeholdc" class="btn-group">
181                                         <a class="btn btn-default btn-xs placehold" href="#"><i class="fa-solid fa-bookmark"></i> Place hold</a>
182                                     </div>
183                                 [% END # /IF holfor %]
184                             [% END # /IF CAN_user_reserveforothers_place_holds %]
185
186                             [% IF Koha.Preference('BrowseResultSelection') %]
187                                 <div id="browse_selection" class="btn-group">
188                                     <a class="btn btn-default btn-xs browse_selection" href="#"><i class="fa-solid fa-note-sticky"></i> Browse selected records</a>
189                                 </div>
190                             [% END %]
191
192                             [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
193                                 <div class="btn-group">
194                                     <a class="btn btn-default btn-xs" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
195                                 </div>
196                                 <div class="btn-group">
197                                     <button type="button" id="results_batch_ops" class="btn btn-default btn-xs dropdown-toggle disabled" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
198                                         <i class="fa fa-pencil-alt"></i> Edit <span class="caret"></span>
199                                     </button>
200                                     [% IF ( CAN_user_tools_records_batchmod || CAN_user_tools_records_batchdel || CAN_user_editcatalogue_edit_catalogue ) %]
201                                     <ul class="dropdown-menu">
202                                         [% IF ( CAN_user_tools_records_batchmod ) %]
203                                         <li><a class="results_batch_op" data-op="edit" href="#">Batch edit records</a></li>
204                                         [% END %]
205                                         [% IF ( CAN_user_tools_records_batchdel ) %]
206                                         <li><a class="results_batch_op" data-op="delete" href="#">Batch delete records</a></li>
207                                         [% END %]
208                                         <li><a class="results_batch_op" data-op="merge" href="#">Merge records</a></li>
209                                     </ul>
210                                     [% END %]
211                                 </div>
212                             [% END %]
213
214                             [% IF ( searchdesc ) %]
215                                 [% BLOCK sort_search_query ~%]
216                                     [%~ FOREACH QUERY_INPUT IN QUERY_INPUTS ~%]
217                                         &amp;[% QUERY_INPUT.input_name | uri %]=[% QUERY_INPUT.input_value | uri %]
218                                     [%~ END ~%]
219                                     [%~ FOREACH LIMIT_INPUT IN LIMIT_INPUTS ~%]
220                                         &amp;[% LIMIT_INPUT.input_name | uri %]=[% LIMIT_INPUT.input_value | uri %]
221                                     [%~ END ~%]
222                                 [%~ END %]
223                             [% END %]
224
225                             <div class="btn-group">
226                                 <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
227                                     Sort <span class="caret"></span>
228                                 </button>
229                                 <ul class="dropdown-menu">
230                                     [% IF ( sort_by == "relevance" ) %]
231                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=relevance[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Relevance</a></li>
232                                     [% ELSE %]
233                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=relevance[% PROCESS sort_search_query %]">Relevance</a></li>
234                                     [% END %]
235                                     <li class="dropdown-header">Popularity</li>
236                                     [% IF ( sort_by == "popularity_dsc" ) %]
237                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=popularity_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Popularity (most to least)</a></li>
238                                     [% ELSE %]
239                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=popularity_dsc[% PROCESS sort_search_query %]">Popularity (most to least)</a></li>
240                                     [% END %]
241
242                                     [% IF ( sort_by == "popularity_asc" ) %]
243                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=popularity_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Popularity (least to most)</a></li>
244                                     [% ELSE %]
245                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=popularity_asc[% PROCESS sort_search_query %]">Popularity (least to most)</a></li>
246                                     [% END %]
247
248                                     <li class="dropdown-header">Author</li>
249
250                                     [% IF ( sort_by == "author_az" || sort_by == "author_asc" ) %]
251                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=author_a[% PROCESS sort_search_query %]z"><i class="fa fa-check"></i> Author (A-Z)</a></li>
252                                     [% ELSE %]
253                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=author_az[% PROCESS sort_search_query %]">Author (A-Z)</a></li>
254                                     [% END %]
255
256                                     [% IF ( sort_by == "author_za" || sort_by == "author_dsc" ) %]
257                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=author_za[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Author (Z-A)</a></li>
258                                     [% ELSE %]
259                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=author_za[% PROCESS sort_search_query %]">Author (Z-A)</a></li>
260                                     [% END %]
261
262                                     <li class="dropdown-header">Call number</li>
263
264                                     [% IF ( sort_by == "call_number_asc" ) %]
265                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=call_number_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Call number (0-9 to A-Z)</a></li>
266                                     [% ELSE %]
267                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=call_number_asc[% PROCESS sort_search_query %]">Call number (0-9 to A-Z)</a></li>
268                                     [% END %]
269
270                                     [% IF ( sort_by == "call_number_dsc" ) %]
271                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=call_number_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Call number (Z-A to 9-0)</a></li>
272                                     [% ELSE %]
273                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=call_number_dsc[% PROCESS sort_search_query %]">Call number (Z-A to 9-0)</a></li>
274                                     [% END %]
275
276                                     <li class="dropdown-header">Dates</li>
277                                     [% IF ( sort_by == "pubdate_dsc" ) %]
278                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=pubdate_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Publication/Copyright date: newest to oldest</a></li>
279                                     [% ELSE %]
280                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=pubdate_dsc[% PROCESS sort_search_query %]">Publication/Copyright date: newest to oldest</a></li>
281                                     [% END %]
282
283                                     [% IF ( sort_by == "pubdate_asc" ) %]
284                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=pubdate_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Publication/Copyright date: oldest to newest</a></li>
285                                     [% ELSE %]
286                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=pubdate_asc[% PROCESS sort_search_query %]">Publication/Copyright date: oldest to newest</a></li>
287                                     [% END %]
288
289                                     [% IF ( sort_by == "acqdate_dsc" ) %]
290                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=acqdate_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Acquisition date: newest to oldest</a></li>
291                                     [% ELSE %]
292                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=acqdate_dsc[% PROCESS sort_search_query %]">Acquisition date: newest to oldest</a></li>
293                                     [% END %]
294
295                                     [% IF ( sort_by == "acqdate_asc" ) %]
296                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=acqdate_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Acquisition date: oldest to newest</a></li>
297                                     [% ELSE %]
298                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=acqdate_asc[% PROCESS sort_search_query %]">Acquisition date: oldest to newest</a></li>
299                                     [% END %]
300
301                                     <li class="dropdown-header">Title</li>
302                                     [% IF ( sort_by == "title_az" || sort_by == "title_asc" ) %]
303                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=title_az[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Title (A-Z)</a></li>
304                                     [% ELSE %]
305                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=title_az[% PROCESS sort_search_query %]">Title (A-Z)</a></li>
306                                     [% END %]
307
308                                     [% IF ( sort_by == "title_za" || sort_by == "title_dsc" ) %]
309                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=title_za[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Title (Z-A)</a></li>
310                                     [% ELSE %]
311                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=title_za[% PROCESS sort_search_query %]">Title (Z-A)</a></li>
312                                     [% END %]
313                                 </ul>
314                             </div> <!-- /.btn-group -->
315
316                             [% IF Koha.Preference('numSearchResultsDropdown') %]
317                                 <div class="btn-group">
318                                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
319                                         Results per page: [% results_per_page | html %] <span class="caret"></span>
320                                     </button>
321                                     <ul class="dropdown-menu">
322                                         [% IF Koha.Preference('numSearchResults') %]
323                                             <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% Koha.Preference('numSearchResults') | uri %][% PROCESS sort_search_query %]" id="resultsperpage-default">
324                                                 [% IF results_per_page == Koha.Preference('numSearchResults') %]
325                                                     <i class="fa fa-check"></i>
326                                                 [% END %] [% Koha.Preference('numSearchResults') | html %] (default)
327                                             </a></li>
328                                         [% END %]
329                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=20[% PROCESS sort_search_query %]">[% IF results_per_page == '20' %]<i class="fa fa-check"></i>[% END %] 20</a></li>
330                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=40[% PROCESS sort_search_query %]" id="resultsperpage-40">[% IF results_per_page == '40' %]<i class="fa fa-check"></i>[% END %] 40</a></li>
331                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=60[% PROCESS sort_search_query %]" id="resultsperpage-60">[% IF results_per_page == '60' %]<i class="fa fa-check"></i>[% END %] 60</a></li>
332                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=80[% PROCESS sort_search_query %]" id="resultsperpage-80">[% IF results_per_page == '80' %]<i class="fa fa-check"></i>[% END %] 80</a></li>
333                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=100[% PROCESS sort_search_query %]" id="resultsperpage-100">[% IF results_per_page == '100' %]<i class="fa fa-check"></i>[% END %] 100</a></li>
334                                     </ul>
335                                 </div> <!-- /.btn-group -->
336                             [% END %]
337
338                         </div> <!-- /#selection_ops -->
339                     </div> <!-- /#searchheader -->
340                 [% END %]
341
342                 [% ELSE # /IF total %]
343                     <form method="post" name="fz3950" class="fz3950bigrpad">
344                         <div id="toolbar" class="btn-toolbar" style="background-color:transparent"><div>
345                             <button class="btn btn-default" type="button" id="z3950submit"><i class="fa fa-search"></i> Z39.50/SRU search</button>
346                         </div></div>
347                     </form>
348
349                     <div id="searchheader">
350                         <h3>No results found</h3>
351                         [% IF ( searchdesc ) %]
352                             <p>
353                                 No results match your search [% IF ( query_desc ) %]for <span style="font-weight: bold;">'[% query_desc | html %]'</span>[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s): <span style="font-weight: bold;">'[% limit_desc | html %]'</span>[% END %][% IF ( LibraryName ) %] in [% LibraryName | html %] Catalog[% END %].
354                             </p>
355                             [% IF CAN_user_acquisition_order_manage && searchtoorder_basketno && searchtoorder_vendorid %][%# Coming from the basket or vendor view %]
356                                 <p><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% searchtoorder_basketno | uri %]">View basket<a></p>
357                             [% END %]
358                             <a href="/cgi-bin/koha/catalogue/search.pl?advsearch=1&edit_search=1&[% query_cgi | $raw %]&[% limit_cgi | $raw %]&sort_by=[% sort_by | $raw %]">Edit this search</a>
359                             [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %]
360                                 | <a href="#" id="save_search_filter">Save search as filter</a>
361                             [% END %]
362                         [% ELSE %]
363                             <p>You did not specify any search criteria.</p>
364                         [% END %]
365                     </div>
366                 [% END # /IF total %]
367
368                 [% IF ( query_error ) %]
369                     <div class="dialog alert"><p><strong>Error:</strong> [% query_error | html %]</p></div>
370                 [% END %]
371
372                 <!-- Search Results Table -->
373                 [% IF ( total ) %]
374                     [% IF ( scan ) %]
375                     <div class="page-section">
376                         <h2>Scan index</h2>
377                         <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
378                            <label for="scan-index">Scan index:</label>
379                             <select name="idx" id="scan-index">
380                                 [% IF ( header_pulldown == "" ) %]<option selected="selected" value="">Any word</option>
381                                 [% ELSE %]<option selected="selected" value="">Any word</option>[% END %]
382                                 [% IF ( header_pulldown == "ms_anycommaphr" ) %]<option selected="selected" value="any,phr">Any phrase</option>
383                                 [% ELSE %]<option value="any,phr">Any phrase</option>[% END %]
384                                 [% IF ( header_pulldown == "ms_ti" ) %]<option selected="selected" value="ti">Title</option>
385                                 [% ELSE %]<option value="ti">Title</option>[% END %]
386                                 [% IF ( header_pulldown == "ms_ticommaphr" ) %]<option selected="selected" value="ti,phr">Title phrase</option>
387                                 [% ELSE %]<option value="ti,phr">Title phrase</option>[% END %]
388                                 [% IF ( header_pulldown == ( "ms_au" || "ms_aucommaphr" ) ) %]<option selected="selected" value="au,phr">Author</option>
389                                 [% ELSE %]<option value="au,phr">Author</option>[% END %]
390                                 [% IF ( header_pulldown == "ms_su" ) %]<option selected="selected" value="su">Subject</option>
391                                 [% ELSE %]<option value="su">Subject</option>[% END %]
392                                 [% IF ( header_pulldown == "ms_sucommaphr" ) %]<option selected="selected" value="su,phr">Subject phrase</option>
393                                 [% ELSE %]<option value="su,phr">Subject phrase</option>[% END %]
394                                 [% IF ( header_pulldown ==  "ms_se" ) %]<option selected="selected" value="se">Series</option>
395                                 [% ELSE %]<option value="se">Series</option>[% END %]
396                                 [% IF ( header_pulldown ==  "ms_pb" ) %]<option selected="selected" value="pb">Publisher</option>
397                                 [% ELSE %]<option value="pb">Publisher</option>[% END %]
398                                 [% IF ( header_pulldown ==  "ms_nt" ) %]<option selected="selected" value="nt">Notes</option>
399                                 [% ELSE %]<option value="nt">Notes</option>[% END %]
400                                 [% IF ( header_pulldown ==  "ms_sn" ) %]<option selected="selected" value="sn">ISBN</option>
401                                 [% ELSE %]<option value="sn">ISBN</option>[% END %]
402                                 [% IF ( header_pulldown ==  "ms_ss" ) %]<option selected="selected" value="ss">ISSN</option>
403                                 [% ELSE %]<option value="ss">ISSN</option>[% END %]
404                             </select>
405                             [% IF ( scan_search_term_to_use ) %]
406                                  <input type="text" name="q" id="scan-index-term" size="35" value="[% scan_search_term_to_use | html %]" />
407                             [% ELSE %]
408                                 Scan index for: <input type="text" name="q" id="scan-index-term" size="35" value="" />
409                             [% END %]
410                             <input type="hidden" name="scan" value="1" />
411                             <input class="submit" type="submit" value="Submit" />
412                         </form>
413
414                         <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
415                             <table>
416                                 <tr>
417                                     <th>Term/Phrase</th>
418                                     <th>Count</th>
419                                 </tr>
420                                 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
421                                     <tr>
422                                         <td>
423                                             <a href="/cgi-bin/koha/catalogue/search.pl?idx=[% scan_index_to_use | uri %]&amp;q=[% SEARCH_RESULT.scan_use |url %]&quot;[% SEARCH_RESULT.title | uri %]&quot;">[% SEARCH_RESULT.title | html %]</a>
424                                         </td>
425                                         <td>
426                                             [% SEARCH_RESULT.author | html %]
427                                         </td>
428                                     </tr>
429                                 [% END %]
430                             </table>
431                         </form>
432                     </div>
433                     [% ELSE # /IF scan %]
434
435                         <div id="searchresults">
436                             [% INCLUDE 'page-numbers.inc' %]
437
438                             <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
439                                 [% IF ( searchdesc ) %]
440                                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
441                                         <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
442                                     [% END %]
443                                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
444                                         <input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
445                                     [% END %]
446                                 [% END %]
447
448                                 <!-- TABLE RESULTS START -->
449                                 <table>
450                                     <thead>
451                                     <tr>
452                                         [% IF ( CoverImagePlugins || AmazonCoverImages  || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
453                                             <th>&nbsp;</th>
454                                         [% END %]
455                                         <th colspan="2">Results</th>
456                                         <th>Location</th>
457                                     </tr>
458                                     </thead>
459                                     <!-- Actual Search Results -->
460                                     [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %]
461                                     <tbody>
462                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
463                                         <tr id="row[% SEARCH_RESULT.biblionumber | html %]">
464                                             [% IF ( CoverImagePlugins || AmazonCoverImages  || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
465     <td class="bookcoverimg">
466         <div id="cover-slides-[% SEARCH_RESULT.biblionumber | html %]" class="cover-slides" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" data-isbn="[% To.json(SEARCH_RESULT.normalized_isbn) | $raw %]" data-processedbiblio="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber | $raw %]">
467             [% IF ( LocalCoverImages ) %][% SEARCH_RESULT.localimage | html %]
468                 <div id="local-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image local-coverimg">
469                     <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]">
470                         <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" alt="Local cover image" />
471                     </a>
472                     <div class="hint">Local cover image</div>
473                 </div>
474             [% END %]
475
476             [% IF ( AmazonCoverImages && SEARCH_RESULT.normalized_isbn ) %]
477                 <div id="amazon-bookcoverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image amazon-bookcoverimg">
478                     <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]">
479                         <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="Cover image from Amazon.com" />
480                     </a>
481                     <div class="hint">Amazon cover image</div>
482                 </div>
483             [% END # /IF AmazonCoverImages %]
484
485             [% IF ( SyndeticsCovers ) %]
486                     [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %]
487                         <div id="syndetics-bookcoverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image syndetics-bookcoverimg">
488                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">
489                                 <img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/[% SyndeticsCoverImageSize | uri %].GIF&amp;client=[% Koha.Preference('SyndeticsClientCode') | html %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc | html %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %]" alt="Cover from Syndetics" />
490                             </a>
491                             <div class="hint">Syndetics cover image</div>
492                         </div>
493                     [% END %]
494             [% END %]
495
496             [% IF ( IntranetCoce && CoceProviders && SEARCH_RESULT.normalized_isbn ) %]
497                 [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %]
498                 [% IF ( coce_id ) %]
499                     <div id="coce-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image coce-coverimg">
500                         <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]">
501                             <span style="block" title="[% SEARCH_RESULT.biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail[% SEARCH_RESULT.biblionumber | html %]"></span>
502                         </a>
503                         <div class="hint">Coce cover image</div>
504                     </div>
505                 [% END %]
506             [% END %]
507
508             [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
509                 [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
510                 [% IF custom_cover_image_url %]
511                     <div id="custom-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image custom-coverimg">
512                         <a class="custom_cover_image" href="[% custom_cover_image_url | url %]">
513                             <img alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
514                         </a>
515                         <div class="hint">Custom cover image</div>
516                     </div>
517                 [% END %]
518             [% END %]
519         </div>
520     </td>
521 [% END # /IF( AmazonCoverImages || LocalCoverImages || IntranetCoce )%]
522
523                                             <td>
524                                                 <input type="checkbox" class="selection" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" style="display:none" />
525                                             </td>
526
527                                             <td>
528                                                 [% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeInfo') %]
529                                                     <div class="result-biblio-itemtype">
530                                                         [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
531                                                             <img src="[% SEARCH_RESULT.imageurl | html %]" alt="[%  SEARCH_RESULT.description | html %]" />
532                                                         [% END %]
533                                                         <span class="itypetext">[% SEARCH_RESULT.description | html %]</span>
534                                                     </div>
535                                                 [% END %]
536
537                                                 [% SEARCH_RESULT.result_number | html %].
538                                                 [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
539
540                                                 <p class="hold">
541                                                     [% IF ( SEARCH_RESULT.norequests ) %]
542                                                         <span class="noholdstext">No holds allowed</span>
543                                                     [% ELSE %]
544                                                         [% IF CAN_user_reserveforothers_place_holds %]
545                                                             <a id="reserve_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %])</a>
546                                                             [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></span>[% END %]
547                                                             [% IF ( holdforclub ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;club=[% holdforclub | uri %]">Place hold for [% holdforclub_name | html %]</a></span>[% END %]
548                                                         [% ELSE %]
549                                                             <span>Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %])</span>
550                                                         [% END %]
551                                                     [% END # /IF SEARCH_RESULT.norequests %]
552                                                     [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
553                                                         | <a id="recall_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Recalls ([% Biblio.RecallsCount( SEARCH_RESULT.biblionumber ) | html %])</a>
554                                                     [% END %]
555
556                                                     [% IF Koha.Preference('intranetbookbag') == 1 %]
557                                                         [% IF ( SEARCH_RESULT.incart ) %]
558                                                             | <a class="addtocart" id="cart[% SEARCH_RESULT.biblionumber | html %]" href="#">In your cart</a> <a class="cartRemove" id="cartR[% SEARCH_RESULT.biblionumber | html %]" href="#">(remove)</a>
559                                                         [% ELSE %]
560                                                             | <a class="addtocart" id="cart[% SEARCH_RESULT.biblionumber | html %]" href="#">Add to cart</a> <a style="display:none;" class="cartRemove" id="cartR[% SEARCH_RESULT.biblionumber | html %]" href="#">(remove)</a>
561                                                         [% END %]
562                                                     [% END # / IF intranetbookbag %]
563
564                                                     [% IF Koha.Preference('ArticleRequests') %]
565                                                         | <a id="requst_article_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Request article</a>
566                                                     [% END %]
567
568                                                     [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
569                                                         | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Edit record</a>
570                                                     [% END %]
571                                                     [% IF ( CAN_user_editcatalogue_edit_items ) %]
572                                                         | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Edit items</a>
573                                                     [% END %]
574
575                                                     [% IF ( CAN_user_acquisition_order_manage ) %]
576                                                         [% IF ( searchtoorder_basketno && searchtoorder_vendorid ) %]
577                                                             | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% searchtoorder_vendorid | uri %]&amp;basketno=[% searchtoorder_basketno | uri %]&amp;biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Add order</a>
578                                                         [% END %]
579                                                     [% END %]
580
581                                                     [% IF ( OPACBaseURL ) %]
582                                                         <span class="view-in-opac">
583                                                             | <a href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" target="_blank">OPAC view</a>
584                                                         </span>
585                                                     [% END %]
586                                                 </p> <!-- /.holds -->
587                                             </td>
588
589                                             <td>
590                                                 <div class="availability">
591                                                     [% IF ( SEARCH_RESULT.items_count ) %]
592                                                         <div class="results_available_count">
593                                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
594                                                                 <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
595                                                             [% END %]
596
597                                                             [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] <span>available:</span>[% ELSE %], <span>None available</span>[% END %]
598
599                                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
600                                                                 </span>
601                                                             [% END %]
602                                                         </div> <!-- /.results_available_count -->
603
604                                                         [% BLOCK search_result_items %]
605                                                             [% IF status_count == "onloancount" %]
606                                                                 [% IF SEARCH_RESULT.${status_count} > 0 %]
607                                                                     <div class="results_checkedout">[% SEARCH_RESULT.${status_count} | html %] checked out:</div>
608                                                                 [% END %]
609                                                             [% ELSIF status_count == "othercount" %]
610                                                                 [% IF SEARCH_RESULT.${status_count} > 0 %]
611                                                                     <div class="results_unavailable">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div>
612                                                                 [% END %]
613                                                             [% END %]
614                                                             [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
615                                                                 <ul class="[% items_loop | html %]_items">
616                                                                     [% FOREACH items_loo IN SEARCH_RESULT.${items_loop} %]
617                                                                         [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %]
618                                                                             <li class="result_itype_image">
619                                                                                 <img src="[% items_loo.imageurl | html %]" title="[% items_loo.description | html %]" alt="[% items_loo.description | html %]" />
620                                                                         [% ELSE %]
621                                                                             <li>
622                                                                         [% END %]
623                                                                         [% IF ( items_loo.branchname ) %]
624                                                                             [% items_loo.branchname | html %]
625                                                                         [% END %]
626                                                                         [% IF ( items_loo.location ) %]
627                                                                             <span class="shelvingloc">[% items_loo.location | html %]</span>
628                                                                         [% END %]
629                                                                         [% IF ( items_loo.collectioncode ) %]
630                                                                             <span class="ccode">[% items_loo.collectioncode | html %]</span>
631                                                                         [% END %]
632
633                                                                             [% IF ( items_loo.itemcallnumber ) %]
634                                                                                 <a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% items_loo.itemcallnumber |uri %]%22">[% items_loo.itemcallnumber | html %]</a>
635                                                                             [% END %]
636                                                                             <div class="result_item_details">
637                                                                                 [% IF ( items_loo.withdrawn ) %]
638                                                                                     ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => items_loo.withdrawn ) | html %])
639                                                                                 [% END %]
640                                                                                 [% IF ( items_loo.itemlost ) %]
641                                                                                     ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => items_loo.itemlost ) | html %])
642                                                                                 [% END %]
643                                                                                 [% IF ( items_loo.damaged ) %]
644                                                                                     ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => items_loo.damaged ) | html %])
645                                                                                 [% END %]
646                                                                                 [% IF ( items_loo.intransit ) %]
647                                                                                     (<span>In transit</span>)
648                                                                                 [% END %]
649                                                                                 [% IF ( items_loo.onhold ) %]
650                                                                                     (<span>On hold</span>)
651                                                                                 [% END %]
652                                                                                 [% IF ( items_loo.notforloan ) %]
653                                                                                     [% items_loo.notforloan | html %]
654                                                                                 [% END %]
655                                                                                 <span class="item_count">[% items_loo.count | html %]</span>
656                                                                             </div> <!-- /.result_item_details -->
657
658                                                                             [% IF status_count == "onloancount" %]
659                                                                                 <span class="item-date-due">
660                                                                                     Due: [% items_loo.due_date | $KohaDates %]
661                                                                                 </span>
662                                                                             [% END %]
663
664                                                                             [% IF item_level_itypes && items_loo.description %]
665                                                                                 <span class="item-itype-desc itypetext">[% items_loo.description | html %]</span>
666                                                                             [% END %]
667                                                                         </li>
668                                                                     [% END # /FOREACH other_items_loo %]
669                                                                 </ul> <!-- /.[% items_loop | html %]_items -->
670                                                             [% END # /IF SEARCH_RESULT.${items_loop}.size %]
671                                                         [% END # /BLOCK search_result_items %]
672
673                                                         [% PROCESS search_result_items status_count="availablecount" items_loop="available_items_loop" %]
674
675                                                         [% PROCESS search_result_items status_count="onloancount" items_loop="onloan_items_loop" %]
676
677                                                         [% PROCESS search_result_items status_count="othercount" items_loop="other_items_loop" %]
678
679
680                                                     [% ELSE # /IF ( SEARCH_RESULT.items_count ) %]
681
682                                                         [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.size ) %]
683                                                             <strong id="altholdings_heading">Other holdings:</strong>
684                                                             <ul>
685                                                                 [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
686                                                                     <li id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</li>
687                                                                 [% END %]
688                                                             </ul>
689                                                         [% ELSE %]
690                                                             <span class="unavailable">No items</span>
691                                                         [% END %]
692                                                     [% END # /IF ( SEARCH_RESULT.items_count ) %]
693                                                 </div> <!-- /.availability -->
694                                             </td>
695                                         </tr>
696                                     [% END # /FOREACH SEARCH_RESULT %]
697                                     </tbody>
698                                 </table>
699                             </form>
700                         </div> <!-- /#bookbag_form -->
701                     [% END # /IF scan %]
702                     [% INCLUDE 'page-numbers.inc' %]
703                 [% ELSE #/IF total %]
704                     <!-- No Results Found -->
705                 [% END #/IF total %]
706
707                 [% IF ( outer_sup_results_loop ) %]
708                     </div>
709                     <div class="col-sm-4">
710                         [% FOREACH outer_sup_results_loo IN outer_sup_results_loop %]
711                             [% IF ( outer_sup_results_loo.inner_sup_results_loop ) %]
712                                 [% outer_sup_results_loo.servername | html %]
713                                 [% FOREACH inner_sup_results_loo IN outer_sup_results_loo.inner_sup_results_loop %]
714                                     <div>
715                                         <a href="/cgi-bin/koha/catalogue/search.pl?[% inner_sup_results_loo.query_cgi | $raw %][% inner_sup_results_loo.limit_cgi | $raw %][% inner_sup_results_loo.sort_by | uri %][% inner_sup_results_loo.link | uri %]">[% inner_sup_results_loo.title | html %]</a>
716                                     </div>
717                                 [% END %]
718                             [% END %]
719                         [% END # FOREACH outer_sup_results_loo %]
720                     </div> <!-- /.col-sm-4 -->
721                 </div>
722                 [% END #/IF outer_sup_results_loop %]
723
724                 [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %]
725                     <div id="search_filters_modal" class="modal" role="dialog" aria-hidden="true">
726                         <div class="modal-dialog">
727                         <div class="modal-content">
728                             <div class="modal-header">
729                                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
730                                 <h3 id="search_filters_label">Save: '[% query_desc | html %]' with limits '[% limit_desc | html %]' as filter</h3>
731                             </div>
732                             <div class="modal-body">
733                                 <h6>Visibility:</h6>
734                                 <label for="show_filter_opac">Show in OPAC?</label>
735                                 <input type="checkbox" id="show_filter_opac" name="show_filter_opac">
736                                 <label for="show_filter_staff_client">Show in staff interface?</label>
737                                 <input type="checkbox" id="show_filter_staff_client" name="show_filter_staff_client">
738                                 <hr>
739                                 <h6>Save as new search filter:</h6>
740                                 <label for="new_filter">Name:</label>
741                                 <input id="new_filter" name="new_filter" type="text">
742                                 <a id="save_new_filter" class="btn btn-default btn-xs" href="#">Save</a>
743                                 <span class="existing_filters_section">
744                                     </br>OR</br>
745                                     <h6>Replace existing search filter:</h6>
746                                     <label for="existing_filters">Choose</label>
747                                     <select id="existing_filters" name="existing_filters" class="search_filters_list"></select>
748                                     <a id="replace_existing_filter" class="btn btn-default btn-xs" href="#">Replace</a>
749                                 </span>
750                             </div>
751                             <div class="modal-footer">
752                                 <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
753                             </div>
754                         </div>
755                         </div>
756                     </div>
757                 [% END %]
758
759                 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
760                     <!-- Value will be set here by placeHold() -->
761                     <input type="hidden" name="findborrower" id="holdFor" value="" />
762                     <input type="hidden" name="club" id="holdForClub" value="" />
763                 </form>
764
765                 <form id="list_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
766                     <!-- Value will be set here by addToList() -->
767                     <input type="hidden" name="multi_listadd" value="1"/>
768                 </form>
769
770             </main>
771         </div> <!-- /.col-sm-10.col-sm-push-2 -->
772
773         <div class="col-sm-2 col-sm-pull-10">
774             <aside>
775                 [% INCLUDE 'facets.inc' %]
776             </aside>
777         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
778      </div> <!-- /.row -->
779
780 [% MACRO jsinclude BLOCK %]
781     [% Asset.js("js/browser.js") | $raw %]
782     [% Asset.js("lib/hc-sticky.js") | $raw %]
783     [% Asset.js("js/coce.js") | $raw %]
784     [% Asset.css("css/humanmsg.css") | $raw %]
785     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
786     [% INCLUDE 'select2.inc' %]
787     <script>
788         var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10);
789         var q_array = new Array();  // will hold search terms, if present
790         var PREF_LocalCoverImages = parseInt( "[% Koha.Preference('LocalCoverImages') | html %]", 10);
791         var PREF_IntranetCoce = parseInt( "[% Koha.Preference('IntranetCoce') | html %]", 10);
792         var PREF_CoceProviders = "[% Koha.Preference('CoceProviders') | html %]";
793         var CoceHost = "[% CoceHost | html %]";
794         var CoceProviders = "[% CoceProviders | html %]";
795         var PREF_BrowseResultSelection = parseInt( "[% Koha.Preference('BrowseResultSelection') | html %]", 10);
796         var PREF_StaffHighlightedWords = "[% Koha.Preference('StaffHighlightedWords') | html %]";
797         var PREF_NotHighlightedWords = "[% Koha.Preference('NotHighlightedWords') | html %]";
798         var biblionumber = "[% biblionumber | html %]";
799         var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]";
800         var holdforclub = "[% holdforclub | html %]";
801         [% IF SEARCH_RESULTS %]
802             var SEARCH_RESULTS = 1;
803         [% ELSE %]
804             var SEARCH_RESULTS = 0;
805         [% END %]
806         var new_results_browser = [
807             [%- FOREACH result IN SEARCH_RESULTS -%]
808                 [%- result.biblionumber | html -%],
809             [%- END -%]
810         ];
811         var strQuery="&frameworkcode=";
812         [%- FOREACH z3950_search_param IN z3950_search_params -%]
813             strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
814         [%- END -%]
815
816         var search_result = {
817             query_desc: "[% To.json( query_desc ) | html %]",
818             query_cgi: "[% query_cgi | html %]",
819             limit_cgi: "[% limit_cgi | html %]",
820             query_json: [% query_json | $raw %],
821             limit_json: [% limit_json | $raw %],
822             sort_by: "[% sort_by | html %]",
823             gotoPage: "[% gotoPage | html %]",
824             gotoNumber: "[% gotoNumber | html %]",
825             searchid: "[% searchid | html %]",
826             total: "[% total | html %]",
827             first_result_number: "[% SEARCH_RESULTS.first.result_number | html %]",
828             first_biblionumber: "[% SEARCH_RESULTS.first.biblionumber | html %]",
829             last_biblionumber: "[% SEARCH_RESULTS.last.biblionumber | html %]",
830         }
831
832         $("#refine_search").on('submit',function(e){
833             e.preventDefault();
834             var index = $("#refine_search #refiner_idx").val() || "";
835             if( index){index += ":";}
836             window.location.href = "/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %]&[% limit_cgi | $raw %]&[% sort_cgi | $raw %]&limit="+index+escape_str( $("#refiner").val() );
837         });
838
839         [% IF ( CAN_user_parameters_manage_search_filters ) %]
840             function getFilters(id) {
841                 const select = $("#existing_filters");
842                 $("option[value!='']", select).remove();
843                 return new Promise(function(resolve, reject) {
844                     $.ajax("/api/v1/search_filters")
845                     .then(resolve, reject);
846                 })
847                 .then(function(filters) {
848                     if( filters.length == 0 ){
849                        $(".existing_filters_section").hide();
850                     } else {
851                        $(".existing_filters_section").show();
852                     }
853                     filters.forEach(function(filter) {
854                         const opt = $("<option/>");
855                         select.append(opt);
856                         if(id && filter.search_filter_id == id) {
857                             opt.prop('selected', true);
858                         }
859                         opt.attr("value", filter.search_filter_id);
860                         opt.attr("title", "Query:" + filter.query + " Limit:"+filter.limits);
861                         opt.text(filter.name);
862                         opt.data("filter", filter);
863                     });
864                 })
865                 .then(function(){
866                     select.change();
867                 });
868             }
869             $("#save_search_filter").click(function(){
870                 getFilters();
871                 $("#search_filters_modal").modal('show');
872             });
873             $("#save_new_filter").click(function(){
874                 let name = $("#new_filter").val().trim();
875                 if(!name){
876                     humanMsg.displayAlert( _("You must provide a name for the new filter"), { className: 'human Error' } );
877                     return;
878                 }
879                 let opac = $("#show_filter_opac").prop('checked');
880                 let staff = $("#show_filter_staff_client").prop('checked');
881                 save_search_filter(name,null,opac,staff);
882             });
883             $("#replace_existing_filter").click(function(){
884                 let id = $("#existing_filters").val();
885                 let name = $("#existing_filters option[value="+id+"]").text();
886                 save_search_filter(name,id);
887             });
888             function save_search_filter(name,id,opac,staff){
889                 let options = {
890                     url: '/api/v1/search_filters',
891                     contentType: "application/json",
892                     data: JSON.stringify({
893                         name: name,
894                         query: JSON.stringify(search_result.query_json),
895                         limits: JSON.stringify(search_result.limit_json),
896                         opac: opac,
897                         staff_client: staff,
898                     })
899                 };
900                 if (id){
901                     options.method = "PUT";
902                     options.url = options.url+"/"+id
903                 } else {
904                     options.method = "POST";
905                 }
906                 $.ajax(options)
907                     .then(function(result) {
908                         $("#search_filters_modal").modal('hide');
909                         humanMsg.displayAlert( _("Saved filter: ") + name  , { className: 'human Success' } );
910                         getFilters();
911                     })
912                     .fail(function(err) {
913                         humanMsg.displayAlert( _("There was an error during saving:") + err.responseText, { className: 'humanError' } );
914                     });
915             }
916
917         [% END %]
918     </script>
919     [% Asset.js("js/pages/results.js") | $raw %]
920     [% CoverImagePlugins | $raw %]
921 [% END %]
922
923 [% INCLUDE 'intranet-bottom.inc' %]