Bug 32389: Fix Syndetics link on staff results page
[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 [% PROCESS 'i18n.inc' %]
8 [% SET footerjs = 1 %]
9 [% USE AuthorisedValues %]
10 [% INCLUDE 'doc-head-open.inc' %]
11
12 <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>
13 [% INCLUDE 'doc-head-close.inc' %]
14 </head>
15
16 <body id="catalog_results" class="catalog">
17 [% WRAPPER 'header.inc' %]
18     [% INCLUDE 'cat-search.inc' %]
19 [% END %]
20
21 [% IntranetCoce    = Koha.Preference('IntranetCoce') %]
22 [% CoceProviders   = Koha.Preference('CoceProviders') %]
23 [% CoceHost        = Koha.Preference('CoceHost') %]
24 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
25
26 [% WRAPPER 'sub-header.inc' %]
27 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
28     <ol>
29         <li>
30             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
31         </li>
32         <li>
33             <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
34         </li>
35         <li>
36             <a href="#" aria-current="page">
37                 Search [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %]
38                 [% IF ( limit_desc ) %] &nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
39             </a>
40         </li>
41     </ol>
42 </nav>
43 [% END %]
44
45 <div class="main container-fluid">
46     <div class="row">
47         <div class="col-sm-10 col-sm-push-2">
48             <main>
49
50             <h1>Search results</h1>
51
52                 [% IF ( outer_sup_results_loop ) %]
53                     <div class="row">
54                         <div class="col-sm-8">
55                 [% END %]
56
57                 [% IF ( koha_spsuggest ) %]
58                     <div style="font-size: 12px;">Did you mean:
59                         <ul style="list-style: none;">
60                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
61                                 <li>
62                                     <a href="/cgi-bin/koha/catalogue/search.pl?q=[% SPELL_SUGGES.spsuggestion | uri %]">[% SPELL_SUGGES.spsuggestion | html %]</a>
63                                 </li>
64                             [% END %]
65                         </ul>
66                     </div>
67                 [% END %]
68
69                 [% IF ( total ) %]
70
71                     <h3>
72                         [% 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 %].
73                     </h3>
74                     <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>
75                     [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %]
76                         | <a href="#" id="save_search_filter">Save search as filter</a>
77                     [% END %]
78
79                     <div id="search_within_results">
80                         <form id="refine_search">
81                             <label for="limit">Search within results</label>
82                             [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %]
83                                 [% INCLUDE 'search_indexes.inc' ms_kw = 1 refiner = 1 %]
84                             [% END %]
85                             <input name="limit" id="refiner" type="text"  title="Search results">
86                             <input type="submit" id="refine" class="btn btn-primary btn-xs" value="Search" />
87                         </form>
88                     </div>
89
90                     <div class="searchheader" id="searchheader">
91                         <div id="selection_ops">
92                             <a href="#" class="btn btn-link" id="select_all"><i class="fa fa-check"></i> Select all</a>
93                             <a href="#" class="btn btn-link" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
94                             |
95                             [% IF Koha.Preference("StaffHighlightedWords") == 1 %]
96                                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
97                                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
98                                 |
99                             [% END %]
100
101                             [% IF (Koha.Preference("intranetbookbag")) %]
102                                 <div class="btn-group">
103                                     <a id="cartsubmit" class="btn btn-default btn-xs" href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a>
104                                 </div>
105                             [% END %]
106
107                             [% IF Koha.Preference('virtualshelves') %]
108                                 <div class="btn-group">
109                                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
110                                         <i class="fa fa-list"></i> Add to list <span class="caret"></span>
111                                     </button>
112                                     <ul class="dropdown-menu">
113                                         [% IF add_to_some_private_shelves.count %]
114                                             <li class="dropdown-header">Your lists</li>
115                                             [% SET number_of_private_shelves = 0 %]
116                                             [% FOREACH s IN add_to_some_private_shelves %]
117                                                 [% IF shelfnumber != s.shelfnumber %]
118                                                     <li>
119                                                         <a href="#" class="addtolist" data-shelfnumber="[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
120                                                     </li>
121                                                     [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
122                                                     [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
123                                                 [% END %]
124                                             [% END %]
125                                         [% END %]
126                                         [% IF add_to_some_public_shelves.count %]
127                                             <li class="dropdown-header">Public lists</li>
128                                             [% SET number_of_public_shelves = 0 %]
129                                             [% FOREACH s IN add_to_some_public_shelves %]
130                                                 [% IF shelfnumber != s.shelfnumber %]
131                                                     <li>
132                                                         <a href="#" data-shelfnumber="[% s.shelfnumber | html %]" class="addtolist">[% s.shelfname | html %]</a>
133                                                     </li>
134                                                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
135                                                     [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
136                                                 [% END %]
137                                             [% END %]
138                                         [% END %]
139                                         <li role="separator" class="divider"></li>
140                                         [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
141                                             <li>
142                                                 <a href="#" class="addtolist morelists">More lists</a>
143                                             </li>
144                                         [% END %]
145                                         <li>
146                                             <a href="#" class="addtolist newlist">New list</a>
147                                         </li>
148                                     </ul>
149                                 </div>
150                             [% END # /IF virtualshelves %]
151
152                             [% IF ( CAN_user_reserveforothers_place_holds && DisplayMultiPlaceHold ) %]
153                                 [% IF ( holdfor or holdforclub ) %]
154                                     <div id="placeholdc" class="btn-group">
155                                         <button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button>
156                                         <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
157                                         <span class="caret"></span>
158                                         </button>
159                                         <ul class="dropdown-menu">
160                                             <li><a href="#" class="placehold">Place hold</a></li>
161                                             [% IF holdfor %]
162                                             <li><a href="#" class="placeholdfor">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></li>
163                                                 <li class="divider"></li>
164                                                 <li><a href="#" id="forgetholdfor">Forget [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %]</a></li>
165                                             [% END %]
166                                             [% IF holdforclub %]
167                                                 <li><a href="#" class="placeholdforclub">Place hold for [% holdforclub_name | html %]</a></li>
168                                                 <li class="divider"></li>
169                                                 <li><a href="#" id="forgetholdforclub">Forget  [% holdforclub_name | html %]</a></li>
170                                             [% END %]
171                                         </ul>
172                                     </div>
173                                 [% ELSE %]
174                                     <div id="placeholdc" class="btn-group">
175                                         <a class="btn btn-default btn-xs placehold" href="#"><i class="fa fa-sticky-note-o"></i> Place hold</a>
176                                     </div>
177                                 [% END # /IF holfor %]
178                             [% END # /IF CAN_user_reserveforothers_place_holds %]
179
180                             [% IF Koha.Preference('BrowseResultSelection') %]
181                                 <div id="browse_selection" class="btn-group">
182                                     <a class="btn btn-default btn-xs browse_selection" href="#"><i class="fa fa-sticky-note-o"></i> Browse selected records</a>
183                                 </div>
184                             [% END %]
185
186                             [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
187                                 <div class="btn-group">
188                                     <a class="btn btn-default btn-xs" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
189                                 </div>
190                                 <div class="btn-group">
191                                     <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">
192                                         <i class="fa fa-pencil"></i> Edit <span class="caret"></span>
193                                     </button>
194                                     [% IF ( CAN_user_tools_records_batchmod || CAN_user_tools_records_batchdel || CAN_user_editcatalogue_edit_catalogue ) %]
195                                     <ul class="dropdown-menu">
196                                         [% IF ( CAN_user_tools_records_batchmod ) %]
197                                         <li><a class="results_batch_op" data-op="edit" href="#">Batch edit records</a></li>
198                                         [% END %]
199                                         [% IF ( CAN_user_tools_records_batchdel ) %]
200                                         <li><a class="results_batch_op" data-op="delete" href="#">Batch delete records</a></li>
201                                         [% END %]
202                                         <li><a class="results_batch_op" data-op="merge" href="#">Merge records</a></li>
203                                     </ul>
204                                     [% END %]
205                                 </div>
206                             [% END %]
207
208                             [% IF ( searchdesc ) %]
209                                 [% BLOCK sort_search_query ~%]
210                                     [%~ FOREACH QUERY_INPUT IN QUERY_INPUTS ~%]
211                                         &amp;[% QUERY_INPUT.input_name | uri %]=[% QUERY_INPUT.input_value | uri %]
212                                     [%~ END ~%]
213                                     [%~ FOREACH LIMIT_INPUT IN LIMIT_INPUTS ~%]
214                                         &amp;[% LIMIT_INPUT.input_name | uri %]=[% LIMIT_INPUT.input_value | uri %]
215                                     [%~ END ~%]
216                                 [%~ END %]
217                             [% END %]
218
219                             <div class="btn-group">
220                                 <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
221                                     Sort <span class="caret"></span>
222                                 </button>
223                                 <ul class="dropdown-menu">
224                                     [% IF ( sort_by == "relevance_dsc" ) %]
225                                         <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>
226                                     [% ELSE %]
227                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% results_per_page | uri %]&sort_by=relevance[% PROCESS sort_search_query %]">Relevance</a></li>
228                                     [% END %]
229                                     <li class="dropdown-header">Popularity</li>
230                                     [% IF ( sort_by == "popularity_dsc" ) %]
231                                         <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>
232                                     [% ELSE %]
233                                         <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>
234                                     [% END %]
235
236                                     [% IF ( sort_by == "popularity_asc" ) %]
237                                         <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>
238                                     [% ELSE %]
239                                         <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>
240                                     [% END %]
241
242                                     <li class="dropdown-header">Author</li>
243
244                                     [% IF ( sort_by == "author_az" || sort_by == "author_asc" ) %]
245                                         <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>
246                                     [% ELSE %]
247                                         <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>
248                                     [% END %]
249
250                                     [% IF ( sort_by == "author_za" || sort_by == "author_dsc" ) %]
251                                         <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>
252                                     [% ELSE %]
253                                         <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>
254                                     [% END %]
255
256                                     <li class="dropdown-header">Call number</li>
257
258                                     [% IF ( sort_by == "call_number_asc" ) %]
259                                         <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>
260                                     [% ELSE %]
261                                         <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>
262                                     [% END %]
263
264                                     [% IF ( sort_by == "call_number_dsc" ) %]
265                                         <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>
266                                     [% ELSE %]
267                                         <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>
268                                     [% END %]
269
270                                     <li class="dropdown-header">Dates</li>
271                                     [% IF ( sort_by == "pubdate_dsc" ) %]
272                                         <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>
273                                     [% ELSE %]
274                                         <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>
275                                     [% END %]
276
277                                     [% IF ( sort_by == "pubdate_asc" ) %]
278                                         <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>
279                                     [% ELSE %]
280                                         <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>
281                                     [% END %]
282
283                                     [% IF ( sort_by == "acqdate_dsc" ) %]
284                                         <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>
285                                     [% ELSE %]
286                                         <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>
287                                     [% END %]
288
289                                     [% IF ( sort_by == "acqdate_asc" ) %]
290                                         <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>
291                                     [% ELSE %]
292                                         <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>
293                                     [% END %]
294
295                                     <li class="dropdown-header">Title</li>
296                                     [% IF ( sort_by == "title_az" || sort_by == "title_asc" ) %]
297                                         <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>
298                                     [% ELSE %]
299                                         <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>
300                                     [% END %]
301
302                                     [% IF ( sort_by == "title_za" || sort_by == "title_dsc" ) %]
303                                         <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>
304                                     [% ELSE %]
305                                         <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>
306                                     [% END %]
307                                 </ul>
308                             </div> <!-- /.btn-group -->
309
310                             [% IF Koha.Preference('numSearchResultsDropdown') %]
311                                 <div class="btn-group">
312                                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
313                                         Results per page: [% results_per_page | html %] <span class="caret"></span>
314                                     </button>
315                                     <ul class="dropdown-menu">
316                                         [% IF Koha.Preference('numSearchResults') %]
317                                             <li><a href="/cgi-bin/koha/catalogue/search.pl?count=[% Koha.Preference('numSearchResults') | uri %][% PROCESS sort_search_query %]" id="resultsperpage-default">
318                                                 [% IF results_per_page == Koha.Preference('numSearchResults') %]
319                                                     <i class="fa fa-check"></i>
320                                                 [% END %] [% Koha.Preference('numSearchResults') | html %] (default)
321                                             </a></li>
322                                         [% END %]
323                                         <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>
324                                         <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>
325                                         <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>
326                                         <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>
327                                         <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>
328                                     </ul>
329                                 </div> <!-- /.btn-group -->
330                             [% END %]
331
332                         </div> <!-- /#selection_ops -->
333                     </div> <!-- /#searchheader -->
334
335                 [% ELSE # /IF total %]
336                     <form method="post" name="fz3950" class="fz3950bigrpad">
337                         <div id="toolbar" class="btn-toolbar" style="background-color:transparent"><div>
338                             <button class="btn btn-default" type="button" id="z3950submit"><i class="fa fa-search"></i> Z39.50/SRU search</button>
339                         </div></div>
340                     </form>
341
342                     <div id="searchheader">
343                         <h3>No results found</h3>
344                         [% IF ( searchdesc ) %]
345                             <p>
346                                 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 %].
347                             </p>
348                             [% IF CAN_user_acquisition_order_manage && searchtoorder_basketno && searchtoorder_vendorid %][%# Coming from the basket or vendor view %]
349                                 <p><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% searchtoorder_basketno | uri %]">View basket<a></p>
350                             [% END %]
351                             <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>
352                             [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %]
353                                 | <a href="#" id="save_search_filter">Save search as filter</a>
354                             [% END %]
355                         [% ELSE %]
356                             <p>You did not specify any search criteria.</p>
357                         [% END %]
358                     </div>
359                 [% END # /IF total %]
360
361                 [% IF ( query_error ) %]
362                     <div class="dialog alert"><p><strong>Error:</strong> [% query_error | html %]</p></div>
363                 [% END %]
364
365                 <!-- Search Results Table -->
366                 [% IF ( total ) %]
367                     [% IF ( scan ) %]
368                         <h1>Scan index:</h1>
369                         <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
370                             <table>
371                                 <tr>
372                                     <td>
373                                         [% IF ( scan_search_term_to_use ) %]
374                                             Scan index for: <input type="text" name="q" id="scan-index" size="35" value="[% scan_search_term_to_use | html %]" />
375                                         [% ELSE %]
376                                             Scan index for: <input type="text" name="q" id="scan-index" size="35" value="" />
377                                         [% END %]
378                                     </td>
379                                 </tr>
380                                 <tr>
381                                     <td>
382                                         <label for="scan-index">Indexed in:</label>
383                                         <select name="idx" id="scan-index">
384                                             <option value="">Any word</option>
385                                             [% IF ( ms_anycommaphr) %]<option selected="selected" value="any,phr">Any phrase</option>
386                                             [% ELSE %]<option value="any,phr">Any phrase</option>[% END %]
387                                             [% IF ( ms_ti ) %]<option selected="selected" value="ti">Title</option>
388                                             [% ELSE %]<option value="ti">Title</option>[% END %]
389                                             [% IF ( ms_ticommaphr ) %]<option selected="selected" value="ti,phr">Title phrase</option>
390                                             [% ELSE %]<option value="ti,phr">Title phrase</option>[% END %]
391                                             [% IF ( ms_au || ms_aucommaphr ) %]<option selected="selected" value="au,phr">Author</option>
392                                             [% ELSE %]<option value="au,phr">Author</option>[% END %]
393                                             [% IF ( ms_su ) %]<option selected="selected" value="su">Subject</option>
394                                             [% ELSE %]<option value="su">Subject</option>[% END %]
395                                             [% IF ( ms_sucommaphr ) %]<option selected="selected" value="su,phr">Subject phrase</option>
396                                             [% ELSE %]<option value="su,phr">Subject phrase</option>[% END %]
397                                             [% IF ( ms_se ) %]<option selected="selected" value="se">Series</option>
398                                             [% ELSE %]<option value="su">Series</option>[% END %]
399                                             [% IF ( ms_pb ) %]<option selected="selected" value="pb">Publisher</option>
400                                             [% ELSE %]<option value="pb">Publisher</option>[% END %]
401                                             [% IF ( ms_nt ) %]<option selected="selected" value="nt">Notes</option>
402                                             [% ELSE %]<option value="nt">Notes</option>[% END %]
403                                             [% IF ( ms_sn ) %]<option selected="selected" value="sn">ISBN</option>
404                                             [% ELSE %]<option value="sn">ISBN</option>[% END %]
405                                             [% IF ( ms_ss ) %]<option selected="selected" value="ss">ISSN</option>
406                                             [% ELSE %]<option value="ss">ISSN</option>[% END %]
407                                         </select>
408                                         <input type="hidden" name="scan" value="1" />
409                                         <input class="submit" type="submit" value="Submit" />
410                                     </td>
411                                 </tr>
412                             </table>
413                         </form>
414
415                         <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
416                             <table>
417                                 <tr>
418                                     <th>Term/Phrase</th>
419                                     <th>Count</th>
420                                 </tr>
421                                 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
422                                     <tr>
423                                         <td>
424                                             <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>
425                                         </td>
426                                         <td>
427                                             [% SEARCH_RESULT.author | html %]
428                                         </td>
429                                     </tr>
430                                 [% END %]
431                             </table>
432                         </form>
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 ( 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 ( 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 %]">
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 %]/SC.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
630                                                                             [% IF ( items_loo.itemcallnumber ) %]
631                                                                                 <a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% items_loo.itemcallnumber |uri %]%22">[% items_loo.itemcallnumber | html %]</a>
632                                                                             [% END %]
633                                                                             <div class="result_item_details">
634                                                                                 [% IF ( items_loo.withdrawn ) %]
635                                                                                     ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => items_loo.withdrawn ) | html %])
636                                                                                 [% END %]
637                                                                                 [% IF ( items_loo.itemlost ) %]
638                                                                                     ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => items_loo.itemlost ) | html %])
639                                                                                 [% END %]
640                                                                                 [% IF ( items_loo.damaged ) %]
641                                                                                     ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => items_loo.damaged ) | html %])
642                                                                                 [% END %]
643                                                                                 [% IF ( items_loo.intransit ) %]
644                                                                                     (<span>In transit</span>)
645                                                                                 [% END %]
646                                                                                 [% IF ( items_loo.onhold ) %]
647                                                                                     (<span>On hold</span>)
648                                                                                 [% END %]
649                                                                                 [% IF ( items_loo.notforloan ) %]
650                                                                                     [% items_loo.notforloan | html %]
651                                                                                 [% END %]
652                                                                                 <span class="item_count">[% items_loo.count | html %]</span>
653                                                                             </div> <!-- /.result_item_details -->
654
655                                                                             [% IF status_count == "onloancount" %]
656                                                                                 <span class="item-date-due">
657                                                                                     Due: [% items_loo.due_date | $KohaDates %]
658                                                                                 </span>
659                                                                             [% END %]
660
661                                                                             [% IF item_level_itypes && items_loo.description %]
662                                                                                 <span class="item-itype-desc itypetext">[% items_loo.description | html %]</span>
663                                                                             [% END %]
664                                                                         </li>
665                                                                     [% END # /FOREACH other_items_loo %]
666                                                                 </ul> <!-- /.[% items_loop | html %]_items -->
667                                                             [% END # /IF SEARCH_RESULT.${items_loop}.size %]
668                                                         [% END # /BLOCK search_result_items %]
669
670                                                         [% PROCESS search_result_items status_count="availablecount" items_loop="available_items_loop" %]
671
672                                                         [% PROCESS search_result_items status_count="onloancount" items_loop="onloan_items_loop" %]
673
674                                                         [% PROCESS search_result_items status_count="othercount" items_loop="other_items_loop" %]
675
676
677                                                     [% ELSE # /IF ( SEARCH_RESULT.items_count ) %]
678
679                                                         [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.count ) %]
680                                                             <strong id="altholdings_heading">Other holdings:</strong>
681                                                             <ul>
682                                                                 [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
683                                                                     <li id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</li>
684                                                                 [% END %]
685                                                             </ul>
686                                                         [% ELSE %]
687                                                             <span class="unavailable">No items</span>
688                                                         [% END %]
689                                                     [% END # /IF ( SEARCH_RESULT.items_count ) %]
690                                                 </div> <!-- /.availability -->
691                                             </td>
692                                         </tr>
693                                     [% END # /FOREACH SEARCH_RESULT %]
694                                     </tbody>
695                                 </table>
696                             </form>
697                         </div> <!-- /#bookbag_form -->
698                     [% END # /IF scan %]
699                     [% INCLUDE 'page-numbers.inc' %]
700                 [% ELSE #/IF total %]
701                     <!-- No Results Found -->
702                 [% END #/IF total %]
703
704                 [% IF ( outer_sup_results_loop ) %]
705                     </div>
706                     <div class="col-sm-4">
707                         [% FOREACH outer_sup_results_loo IN outer_sup_results_loop %]
708                             [% IF ( outer_sup_results_loo.inner_sup_results_loop ) %]
709                                 [% outer_sup_results_loo.servername | html %]
710                                 [% FOREACH inner_sup_results_loo IN outer_sup_results_loo.inner_sup_results_loop %]
711                                     <div>
712                                         <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>
713                                     </div>
714                                 [% END %]
715                             [% END %]
716                         [% END # FOREACH outer_sup_results_loo %]
717                     </div> <!-- /.col-sm-4 -->
718                 </div>
719                 [% END #/IF outer_sup_results_loop %]
720
721                 [% IF ( Koha.Preference('SavedSearchFilters') && CAN_user_parameters_manage_search_filters ) %]
722                     <div id="search_filters_modal" class="modal" role="dialog" aria-hidden="true">
723                         <div class="modal-dialog">
724                         <div class="modal-content">
725                             <div class="modal-header">
726                                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
727                                 <h3 id="search_filters_label">Save: '[% query_desc | html %]' with limits '[% limit_desc | html %]' as filter</h3>
728                             </div>
729                             <div class="modal-body">
730                                 <h6>Visibility:</h6>
731                                 <label for="show_filter_opac">Show in OPAC?</label>
732                                 <input type="checkbox" id="show_filter_opac" name="show_filter_opac">
733                                 <label for="show_filter_staff_client">Show in Staff client?</label>
734                                 <input type="checkbox" id="show_filter_staff_client" name="show_filter_staff_client">
735                                 <hr>
736                                 <h6>Save as new search filter:</h6>
737                                 <label for="new_filter">Name:</label>
738                                 <input id="new_filter" name="new_filter" type="text">
739                                 <a id="save_new_filter" class="btn btn-default btn-xs" href="#">Save</a>
740                                 <span class="existing_filters_section">
741                                     </br>OR</br>
742                                     <h6>Replace existing search filter:</h6>
743                                     <label for="existing_filters">Choose</label>
744                                     <select id="existing_filters" name="existing_filters" class="search_filters_list"></select>
745                                     <a id="replace_existing_filter" class="btn btn-default btn-xs" href="#">Replace</a>
746                                 </span>
747                             </div>
748                             <div class="modal-footer">
749                                 <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
750                             </div>
751                         </div>
752                         </div>
753                     </div>
754                 [% END %]
755
756                 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
757                     <!-- Value will be set here by placeHold() -->
758                     <input type="hidden" name="findborrower" id="holdFor" value="" />
759                     <input type="hidden" name="club" id="holdForClub" value="" />
760                 </form>
761
762                 <form id="list_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
763                     <!-- Value will be set here by addToList() -->
764                     <input type="hidden" name="multi_listadd" value="1"/>
765                 </form>
766
767             </main>
768         </div> <!-- /.col-sm-10.col-sm-push-2 -->
769
770         <div class="col-sm-2 col-sm-pull-10">
771             <aside>
772                 [% INCLUDE 'facets.inc' %]
773             </aside>
774         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
775      </div> <!-- /.row -->
776
777 [% MACRO jsinclude BLOCK %]
778     [% Asset.js("js/browser.js") | $raw %]
779     [% Asset.js("lib/hc-sticky.js") | $raw %]
780     [% Asset.js("js/coce.js") | $raw %]
781     [% Asset.css("css/humanmsg.css") | $raw %]
782     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
783     [% INCLUDE 'select2.inc' %]
784     <script>
785         var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10);
786         var q_array = new Array();  // will hold search terms, if present
787         var PREF_LocalCoverImages = parseInt( "[% Koha.Preference('LocalCoverImages') | html %]", 10);
788         var PREF_IntranetCoce = parseInt( "[% Koha.Preference('IntranetCoce') | html %]", 10);
789         var PREF_CoceProviders = "[% Koha.Preference('CoceProviders') | html %]";
790         var CoceHost = "[% CoceHost | html %]";
791         var CoceProviders = "[% CoceProviders | html %]";
792         var PREF_BrowseResultSelection = parseInt( "[% Koha.Preference('BrowseResultSelection') | html %]", 10);
793         var PREF_StaffHighlightedWords = "[% Koha.Preference('StaffHighlightedWords') | html %]";
794         var PREF_NotHighlightedWords = "[% Koha.Preference('NotHighlightedWords') | html %]";
795         var biblionumber = "[% biblionumber | html %]";
796         var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]";
797         var holdforclub = "[% holdforclub | html %]";
798         [% IF SEARCH_RESULTS %]
799             var SEARCH_RESULTS = 1;
800         [% ELSE %]
801             var SEARCH_RESULTS = 0;
802         [% END %]
803         var new_results_browser = [
804             [%- FOREACH result IN SEARCH_RESULTS -%]
805                 [%- result.biblionumber | html -%],
806             [%- END -%]
807         ];
808         var strQuery="&frameworkcode=";
809         [%- FOREACH z3950_search_param IN z3950_search_params -%]
810             strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
811         [%- END -%]
812
813         var search_result = {
814             query_desc: "[% To.json( query_desc ) | html %]",
815             query_cgi: "[% query_cgi | html %]",
816             limit_cgi: "[% limit_cgi | html %]",
817             query_json: [% query_json | $raw %],
818             limit_json: [% limit_json | $raw %],
819             sort_by: "[% sort_by | html %]",
820             gotoPage: "[% gotoPage | html %]",
821             gotoNumber: "[% gotoNumber | html %]",
822             searchid: "[% searchid | html %]",
823             total: "[% total | html %]",
824             first_result_number: "[% SEARCH_RESULTS.first.result_number | html %]",
825             first_biblionumber: "[% SEARCH_RESULTS.first.biblionumber | html %]",
826             last_biblionumber: "[% SEARCH_RESULTS.last.biblionumber | html %]",
827         }
828
829         $("#refine_search").on('submit',function(e){
830             e.preventDefault();
831             var index = $("#refine_search #refiner_idx").val() || "";
832             if( index){index += ":";}
833             window.location.href = "/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %]&[% limit_cgi | $raw %]&[% sort_cgi | $raw %]&limit="+index+escape_str( $("#refiner").val() );
834         });
835
836         [% IF ( CAN_user_parameters_manage_search_filters ) %]
837             function getFilters(id) {
838                 const select = $("#existing_filters");
839                 $("option[value!='']", select).remove();
840                 return new Promise(function(resolve, reject) {
841                     $.ajax("/api/v1/search_filters")
842                     .then(resolve, reject);
843                 })
844                 .then(function(filters) {
845                     if( filters.length == 0 ){
846                        $(".existing_filters_section").hide();
847                     } else {
848                        $(".existing_filters_section").show();
849                     }
850                     filters.forEach(function(filter) {
851                         const opt = $("<option/>");
852                         select.append(opt);
853                         if(id && filter.search_filter_id == id) {
854                             opt.prop('selected', true);
855                         }
856                         opt.attr("value", filter.search_filter_id);
857                         opt.attr("title", "Query:" + filter.query + " Limit:"+filter.limits);
858                         opt.text(filter.name);
859                         opt.data("filter", filter);
860                     });
861                 })
862                 .then(function(){
863                     select.change();
864                 });
865             }
866             $("#save_search_filter").click(function(){
867                 getFilters();
868                 $("#search_filters_modal").modal('show');
869             });
870             $("#save_new_filter").click(function(){
871                 let name = $("#new_filter").val().trim();
872                 if(!name){
873                     humanMsg.displayAlert( _("You must provide a name for the new filter"), { className: 'human Error' } );
874                     return;
875                 }
876                 let opac = $("#show_filter_opac").prop('checked');
877                 let staff = $("#show_filter_staff_client").prop('checked');
878                 save_search_filter(name,null,opac,staff);
879             });
880             $("#replace_existing_filter").click(function(){
881                 let id = $("#existing_filters").val();
882                 let name = $("#existing_filters option[value="+id+"]").text();
883                 save_search_filter(name,id);
884             });
885             function save_search_filter(name,id,opac,staff){
886                 let options = {
887                     url: '/api/v1/search_filters',
888                     contentType: "application/json",
889                     data: JSON.stringify({
890                         name: name,
891                         query: JSON.stringify(search_result.query_json),
892                         limits: JSON.stringify(search_result.limit_json),
893                         opac: opac,
894                         staff_client: staff,
895                     })
896                 };
897                 if (id){
898                     options.method = "PUT";
899                     options.url = options.url+"/"+id
900                 } else {
901                     options.method = "POST";
902                 }
903                 $.ajax(options)
904                     .then(function(result) {
905                         $("#search_filters_modal").modal('hide');
906                         humanMsg.displayAlert( _("Saved filter: ") + name  , { className: 'human Success' } );
907                         getFilters();
908                     })
909                     .fail(function(err) {
910                         humanMsg.displayAlert( _("There was an error during saving:") + err.responseText, { className: 'humanError' } );
911                     });
912             }
913
914         [% END %]
915     </script>
916     [% Asset.js("js/pages/results.js") | $raw %]
917 [% END %]
918
919 [% INCLUDE 'intranet-bottom.inc' %]