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