Bug 22445: (follow-up) Use CSS to set a max-width for images - Staff client
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / results.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Biblio %]
5 [% USE KohaDates %]
6 [% PROCESS 'i18n.inc' %]
7 [% SET footerjs = 1 %]
8 [% USE AuthorisedValues %]
9 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
10 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
11 [% IF BiblioDefaultViewmarc %]
12     [% SET DetailPage="MARCdetail.pl" %]
13 [% ELSIF BiblioDefaultViewlabeled_marc %]
14     [% SET DetailPage="labeledMARCdetail.pl" %]
15 [% ELSIF BiblioDefaultViewisbd %]
16     [% SET DetailPage="ISBDdetail.pl" %]
17 [% ELSE %]
18     [% SET DetailPage="detail.pl" %]
19 [% END %]
20 [% INCLUDE 'doc-head-open.inc' %]
21
22 <title>Koha &rsaquo; Catalog &rsaquo; [% 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 %]</title>
23 [% INCLUDE 'doc-head-close.inc' %]
24 </head>
25
26 <body id="catalog_results" class="catalog">
27 [% INCLUDE 'header.inc' %]
28 [% INCLUDE 'cat-search.inc' %]
29
30 [% IntranetCoce    = Koha.Preference('IntranetCoce') %]
31 [% CoceProviders   = Koha.Preference('CoceProviders') %]
32 [% CoceHost        = Koha.Preference('CoceHost') %]
33
34 <div id="breadcrumbs">
35     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
36     &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
37     &rsaquo; Search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
38 </div>
39
40 <div class="main container-fluid">
41     <div class="row">
42         <div class="col-sm-10 col-sm-push-2">
43             <main>
44
45                 [% IF ( outer_sup_results_loop ) %]
46                     <div class="row">
47                         <div class="col-sm-8">
48                 [% END %]
49
50                 [% IF ( koha_spsuggest ) %]
51                     <div style="font-size: 12px;">Did you mean:
52                         <ul style="list-style: none;">
53                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
54                                 <li>
55                                     <a href="/cgi-bin/koha/catalogue/search.pl?q=[% SPELL_SUGGES.spsuggestion | uri %]">[% SPELL_SUGGES.spsuggestion | html %]</a>
56                                 </li>
57                             [% END %]
58                         </ul>
59                     </div>
60                 [% END %]
61
62                 [% IF ( total ) %]
63
64                     <h3>
65                         [% 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 %].
66                     </h3>
67
68                     <div id="searchheader">
69                         <div id="selection_ops">
70                             <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a>
71                             |
72                             <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
73                             |
74                             <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
75                             <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
76                             |
77
78                             [% IF ( intranetbookbag ) %]
79                                 <div class="btn-group">
80                                     <a id="cartsubmit" class="btn btn-default btn-xs" href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a>
81                                 </div>
82                             [% END %]
83
84                             [% IF Koha.Preference('virtualshelves') %]
85                                 <div class="btn-group">
86                                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
87                                         <i class="fa fa-list"></i> Add to list <span class="caret"></span>
88                                     </button>
89                                     <ul class="dropdown-menu">
90                                         [% IF add_to_some_private_shelves.count %]
91                                             <li class="dropdown-header">Your lists</li>
92                                             [% SET number_of_private_shelves = 0 %]
93                                             [% FOREACH s IN add_to_some_private_shelves %]
94                                                 [% IF shelfnumber != s.shelfnumber %]
95                                                     <li>
96                                                         <a href="#" class="addtolist" data-shelfnumber="[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
97                                                     </li>
98                                                     [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
99                                                     [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
100                                                 [% END %]
101                                             [% END %]
102                                         [% END %]
103                                         [% IF add_to_some_public_shelves.count %]
104                                             <li class="dropdown-header">Public lists</li>
105                                             [% SET number_of_public_shelves = 0 %]
106                                             [% FOREACH s IN add_to_some_public_shelves %]
107                                                 [% IF shelfnumber != s.shelfnumber %]
108                                                     <li>
109                                                         <a href="#" data-shelfnumber="[% s.shelfnumber | html %]" class="addtolist">[% s.shelfname | html %]</a>
110                                                     </li>
111                                                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
112                                                     [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
113                                                 [% END %]
114                                             [% END %]
115                                         [% END %]
116                                         <li role="separator" class="divider"></li>
117                                         [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
118                                             <li>
119                                                 <a href="#" class="addtolist morelists">More lists</a>
120                                             </li>
121                                         [% END %]
122                                         <li>
123                                             <a href="#" class="addtolist newlist">New list</a>
124                                         </li>
125                                     </ul>
126                                 </div>
127                             [% END # /IF virtualshelves %]
128
129                             [% IF ( CAN_user_reserveforothers_place_holds && DisplayMultiPlaceHold ) %]
130                                 [% IF ( holdfor or holdforclub ) %]
131                                     <div id="placeholdc" class="btn-group">
132                                         <button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button>
133                                         <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
134                                         <span class="caret"></span>
135                                         </button>
136                                         <ul class="dropdown-menu">
137                                             <li><a href="#" class="placehold">Place hold</a></li>
138                                             [% IF holdfor %]
139                                                 <li><a href="#" class="placeholdfor">Place hold for [% holdfor_firstname | html %] [% holdfor_surname | html %] ([% holdfor_cardnumber | html %])</a></li>
140                                                 <li class="divider"></li>
141                                                 <li><a href="#" id="forgetholdfor">Forget  [% holdfor_firstname | html %] [% holdfor_surname | html %] ([% holdfor_cardnumber | html %])</a></li>
142                                             [% END %]
143                                             [% IF holdforclub %]
144                                                 <li><a href="#" class="placeholdforclub">Place hold for [% holdforclub_name | html %]</a></li>
145                                                 <li class="divider"></li>
146                                                 <li><a href="#" id="forgetholdforclub">Forget  [% holdforclub_name | html %]</a></li>
147                                             [% END %]
148                                         </ul>
149                                     </div>
150                                 [% ELSE %]
151                                     <div id="placeholdc" class="btn-group">
152                                         <a class="btn btn-default btn-xs placehold" href="#"><i class="fa fa-sticky-note-o"></i> Place hold</a>
153                                     </div>
154                                 [% END # /IF holfor %]
155                             [% END # /IF CAN_user_reserveforothers_place_holds %]
156
157                             [% IF Koha.Preference('BrowseResultSelection') %]
158                                 <div id="browse_selection" class="btn-group">
159                                     <a class="btn btn-default btn-xs browse_selection" href="#"><i class="fa fa-sticky-note-o"></i> Browse selected records</a>
160                                 </div>
161                             [% END %]
162
163                             [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
164                                 <div class="btn-group">
165                                     <a class="btn btn-default btn-xs" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a>
166                                 </div>
167                             [% END %]
168
169                             [% IF ( searchdesc ) %]
170                                 [% BLOCK sort_search_query ~%]
171                                     [%~ FOREACH QUERY_INPUT IN QUERY_INPUTS ~%]
172                                         &amp;[% QUERY_INPUT.input_name | html %]=[% QUERY_INPUT.input_value | html %]
173                                     [%~ END ~%]
174                                     [%~ FOREACH LIMIT_INPUT IN LIMIT_INPUTS ~%]
175                                         &amp;[% LIMIT_INPUT.input_name | html %]=[% LIMIT_INPUT.input_value | html %]
176                                     [%~ END ~%]
177                                 [%~ END %]
178                             [% END %]
179
180                             <div class="btn-group">
181                                 <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
182                                     Sort <span class="caret"></span>
183                                 </button>
184                                 <ul class="dropdown-menu">
185                                     [% IF ( sort_by == "relevance_dsc" ) %]
186                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=relevance[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Relevance</a></li>
187                                     [% ELSE %]
188                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=relevance[% PROCESS sort_search_query %]">Relevance</a></li>
189                                     [% END %]
190                                     <li class="dropdown-header">Popularity</li>
191                                     [% IF ( sort_by == "popularity_dsc" ) %]
192                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Popularity (most to least)</a></li>
193                                     [% ELSE %]
194                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_dsc[% PROCESS sort_search_query %]">Popularity (most to least)</a></li>
195                                     [% END %]
196
197                                     [% IF ( sort_by == "popularity_asc" ) %]
198                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Popularity (least to most)</a></li>
199                                     [% ELSE %]
200                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_asc[% PROCESS sort_search_query %]">Popularity (least to most)</a></li>
201                                     [% END %]
202
203                                     <li class="dropdown-header">Author</li>
204
205                                     [% IF ( sort_by == "author_az" || sort_by == "author_asc" ) %]
206                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_a[% PROCESS sort_search_query %]z"><i class="fa fa-check"></i> Author (A-Z)</a></li>
207                                     [% ELSE %]
208                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_az[% PROCESS sort_search_query %]">Author (A-Z)</a></li>
209                                     [% END %]
210
211                                     [% IF ( sort_by == "author_za" || sort_by == "author_dsc" ) %]
212                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_za[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Author (Z-A)</a></li>
213                                     [% ELSE %]
214                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_za[% PROCESS sort_search_query %]">Author (Z-A)</a></li>
215                                     [% END %]
216
217                                     <li class="dropdown-header">Call number</li>
218
219                                     [% IF ( sort_by == "call_number_asc" ) %]
220                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Call Number (0-9 to A-Z)</a></li>
221                                     [% ELSE %]
222                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_asc[% PROCESS sort_search_query %]">Call Number (0-9 to A-Z)</a></li>
223                                     [% END %]
224
225                                     [% IF ( sort_by == "call_number_dsc" ) %]
226                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Call number (Z-A to 9-0)</a></li>
227                                     [% ELSE %]
228                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_dsc[% PROCESS sort_search_query %]">Call number (Z-A to 9-0)</a></li>
229                                     [% END %]
230
231                                     <li class="dropdown-header">Dates</li>
232                                     [% IF ( sort_by == "pubdate_dsc" ) %]
233                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Publication/Copyright date: newest to oldest</a></li>
234                                     [% ELSE %]
235                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_dsc[% PROCESS sort_search_query %]">Publication/Copyright date: newest to oldest</a></li>
236                                     [% END %]
237
238                                     [% IF ( sort_by == "pubdate_asc" ) %]
239                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Publication/Copyright date: oldest to newest</a></li>
240                                     [% ELSE %]
241                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_asc[% PROCESS sort_search_query %]">Publication/Copyright date: oldest to newest</a></li>
242                                     [% END %]
243
244                                     [% IF ( sort_by == "acqdate_dsc" ) %]
245                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Acquisition date: newest to oldest</a></li>
246                                     [% ELSE %]
247                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_dsc[% PROCESS sort_search_query %]">Acquisition date: newest to oldest</a></li>
248                                     [% END %]
249
250                                     [% IF ( sort_by == "acqdate_asc" ) %]
251                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Acquisition date: oldest to newest</a></li>
252                                     [% ELSE %]
253                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_asc[% PROCESS sort_search_query %]">Acquisition date: oldest to newest</a></li>
254                                     [% END %]
255
256                                     <li class="dropdown-header">Title</li>
257                                     [% IF ( sort_by == "title_az" || sort_by == "title_asc" ) %]
258                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_az[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Title (A-Z)</a></li>
259                                     [% ELSE %]
260                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_az[% PROCESS sort_search_query %]">Title (A-Z)</a></li>
261                                     [% END %]
262
263                                     [% IF ( sort_by == "title_za" || sort_by == "title_dsc" ) %]
264                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_za[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Title (Z-A)</a></li>
265                                     [% ELSE %]
266                                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_za[% PROCESS sort_search_query %]">Title (Z-A)</a></li>
267                                     [% END %]
268                                 </ul>
269                             </div> <!-- /.btn-group -->
270                         </div> <!-- /#selection_ops -->
271                     </div> <!-- /#searchheader -->
272
273                 [% ELSE # /IF total %]
274
275                     <div id="searchheader">
276                         <form method="post" name="fz3950" class="fz3950bigrpad">
277                             <button class="btn btn-default" type="button" id="z3950submit"><i class="fa fa-search"></i> Z39.50/SRU search</button>
278                         </form>
279                         <h3>No results found</h3>
280                         [% IF ( searchdesc ) %]
281                             <p>
282                                 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 %].
283                             </p>
284                         [% ELSE %]
285                             <p>You did not specify any search criteria.</p>
286                         [% END %]
287                     </div>
288                 [% END # /IF total %]
289
290                 [% IF ( query_error ) %]
291                     <div class="dialog alert"><p><strong>Error:</strong> [% query_error | html %]</p></div>
292                 [% END %]
293
294                 <!-- Search Results Table -->
295                 [% IF ( total ) %]
296                     [% IF ( scan ) %]
297                         <h1>Scan index:</h1>
298                         <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
299                             <table>
300                                 <tr>
301                                     <td>
302                                         [% IF ( scan_search_term_to_use ) %]
303                                             Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="[% scan_search_term_to_use | html %]" />
304                                         [% ELSE %]
305                                             Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="" />
306                                         [% END %]
307                                     </td>
308                                 </tr>
309                                 <tr>
310                                     <td>
311                                         <label for="scan-index">Indexed in:</label>
312                                         <select name="idx" id="scan-index">
313                                             <option value="">Any word</option>
314                                             [% IF ( ms_anycommaphr) %]<option selected="selected" value="any,phr">Any phrase</option>
315                                             [% ELSE %]<option value="any,phr">Any phrase</option>[% END %]
316                                             [% IF ( ms_ti ) %]<option selected="selected" value="ti">Title</option>
317                                             [% ELSE %]<option value="ti">Title</option>[% END %]
318                                             [% IF ( ms_ticommaphr ) %]<option selected="selected" value="ti,phr">Title phrase</option>
319                                             [% ELSE %]<option value="ti,phr">Title phrase</option>[% END %]
320                                             [% IF ( ms_aucommaphr ) %]<option selected="selected" value="au,phr">Author</option>
321                                             [% ELSE %]<option value="au,phr">Author</option>[% END %]
322                                             [% IF ( ms_su ) %]<option selected="selected" value="su">Subject</option>
323                                             [% ELSE %]<option value="su">Subject</option>[% END %]
324                                             [% IF ( ms_sucommaphr ) %]<option selected="selected" value="su,phr">Subject phrase</option>
325                                             [% ELSE %]<option value="su,phr">Subject phrase</option>[% END %]
326                                             [% IF ( ms_se ) %]<option selected="selected" value="se">Series</option>
327                                             [% ELSE %]<option value="su">Series</option>[% END %]
328                                             [% IF ( ms_pb ) %]<option selected="selected" value="pb">Publisher</option>
329                                             [% ELSE %]<option value="pb">Publisher</option>[% END %]
330                                             [% IF ( ms_nt ) %]<option selected="selected" value="nt">Notes</option>
331                                             [% ELSE %]<option value="nt">Notes</option>[% END %]
332                                             [% IF ( ms_sn ) %]<option selected="selected" value="sn">ISBN</option>
333                                             [% ELSE %]<option value="sn">ISBN</option>[% END %]
334                                             [% IF ( ms_ss ) %]<option selected="selected" value="ss">ISSN</option>
335                                             [% ELSE %]<option value="ss">ISSN</option>[% END %]
336                                         </select>
337                                         <input type="hidden" name="scan" value="1" />
338                                     </td>
339                                 </tr>
340                             </table>
341                         </form>
342
343                         <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
344                             <table>
345                                 <tr>
346                                     <th>Term/Phrase</th>
347                                     <th>Count</th>
348                                 </tr>
349                                 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
350                                     <tr>
351                                         <td>
352                                             <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>
353                                         </td>
354                                         <td>
355                                             [% SEARCH_RESULT.author | html %]
356                                         </td>
357                                     </tr>
358                                 [% END %]
359                             </table>
360                         </form>
361                     [% ELSE # /IF scan %]
362
363                         <div id="searchresults">
364                             [% INCLUDE 'page-numbers.inc' %]
365
366                             <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
367                                 [% IF ( searchdesc ) %]
368                                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
369                                         <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
370                                     [% END %]
371                                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
372                                         <input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
373                                     [% END %]
374                                 [% END %]
375
376                                 <!-- TABLE RESULTS START -->
377                                 <table>
378                                     <tr>
379                                         [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
380                                             <th>&nbsp;</th>
381                                         [% END %]
382                                         <th colspan="2">Results</th>
383                                         <th>Location</th>
384                                     </tr>
385                                     <!-- Actual Search Results -->
386                                     [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %]
387                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
388                                         <tr>
389                                             [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
390                                                 <td>
391                                                     [% IF ( LocalCoverImages) %]
392                                                         <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
393                                                             <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
394                                                         </a>
395                                                     [% END %]
396                                                     [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
397                                                         <a href="[% AdlibrisURL | url %]?isbn=[% SEARCH_RESULT.normalized_isbn | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% SEARCH_RESULT.normalized_isbn | uri %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
398                                                     [% END %]
399                                                     [% IF ( AmazonCoverImages ) %]
400                                                         [% IF ( SEARCH_RESULT.normalized_isbn ) %]
401                                                             <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
402                                                             <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
403                                                         [% ELSIF ( !LocalCoverImages ) %]
404                                                             <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
405                                                             <span class="no-image">No cover image available</span>
406                                                         [% END %]
407                                                         </a>
408                                                     [% END # /IF AmazonCoverImages %]
409                                                     [% IF ( IntranetCoce && CoceProviders ) %]
410                                                         [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %]
411                                                             <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% SEARCH_RESULT.biblionumber | url %]">
412                                                         [% IF ( coce_id ) %]
413                                                             <span style="block" title="[% SEARCH_RESULT.biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
414                                                         [% ELSE %]
415                                                             <span class="no-image">No cover image available</span>
416                                                         [% END %]
417                                                             </a>
418                                                     [% END %]
419
420                                                     [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
421                                                         <a class="custom_cover_image" href="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" />
422                                                     [% END %]
423                                                 </td>
424                                             [% END # /IF( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce )%]
425
426                                             <td>
427                                                 <input type="checkbox" class="selection" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" style="display:none" />
428                                             </td>
429
430                                             <td>
431                                                 [% UNLESS ( item_level_itypes ) %]
432                                                     <div class="result-biblio-itemtype">
433                                                         [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
434                                                             <img src="[% SEARCH_RESULT.imageurl | html %]" alt="[%  SEARCH_RESULT.description | html %]" />
435                                                         [% END %]
436                                                         [% SEARCH_RESULT.description | html %]
437                                                     </div>
438                                                 [% END %]
439
440                                                 [% SEARCH_RESULT.result_number | html %].
441                                                 [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
442
443                                                 <p class="hold">
444                                                     [% IF ( SEARCH_RESULT.norequests ) %]
445                                                         <span class="noholdstext">No holds allowed</span>
446                                                     [% ELSE %]
447                                                         [% IF CAN_user_reserveforothers_place_holds %]
448                                                             <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>
449                                                             [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;findborrower=[% holdfor_cardnumber | uri %]">Place hold for [% holdfor_firstname | html %] [% holdfor_surname | html %] ([% holdfor_cardnumber | html %])</a></span>[% END %]
450                                                             [% 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 %]
451                                                         [% ELSE %]
452                                                             Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %])
453                                                         [% END %]
454                                                     [% END # /IF SEARCH_RESULT.norequests %]
455
456                                                     [% IF Koha.Preference('intranetbookbag') == 1 %]
457                                                         [% IF ( SEARCH_RESULT.incart ) %]
458                                                             | <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>
459                                                         [% ELSE %]
460                                                             | <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>
461                                                         [% END %]
462                                                     [% END # / IF intranetbookbag %]
463
464                                                     [% IF Koha.Preference('ArticleRequests') %]
465                                                         | <a id="requst_article_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Request article</a>
466                                                     [% END %]
467
468                                                     [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
469                                                         | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Edit record</a>
470                                                     [% END %]
471                                                     [% IF ( CAN_user_editcatalogue_edit_items ) %]
472                                                         | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">Edit items</a>
473                                                     [% END %]
474
475                                                     [% IF ( OPACBaseURL ) %]
476                                                         <span class="view-in-opac">
477                                                             | <a href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" target="_blank">OPAC view</a>
478                                                         </span>
479                                                     [% END %]
480                                                 </p> <!-- /.holds -->
481                                             </td>
482
483                                             <td>
484                                                 <div class="availability">
485                                                     [% IF ( SEARCH_RESULT.items_count ) %]
486                                                         <strong>
487                                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
488                                                                 <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
489                                                             [% END %]
490
491                                                             [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] available:[% ELSE %], None available[% END %]
492
493                                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
494                                                                 </span>
495                                                             [% END %]
496                                                         </strong>
497
498                                                         [% IF ( SEARCH_RESULT.availablecount ) %]
499                                                             <ul>
500                                                                 [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
501                                                                     [% IF item_level_itypes && !noItemTypeImages && available_items_loo.imageurl %]
502                                                                         <li style="list-style: none; list-style-type: none;">
503                                                                             <img src="[% available_items_loo.imageurl | html %]" title="[% available_items_loo.description | html %]" alt="[% available_items_loo.description | html %]" />
504                                                                     [% ELSE %]
505                                                                         <li>
506                                                                     [% END %]
507                                                                     [% IF ( available_items_loo.branchname ) %]
508                                                                         [% available_items_loo.branchname | html %]
509                                                                     [% END %]
510                                                                     [% IF ( available_items_loo.location ) %]
511                                                                         <span class="shelvingloc">[% available_items_loo.location | html %]</span>
512                                                                     [% END %]
513                                                                     [% IF ( available_items_loo.itemcallnumber ) %]
514                                                                         [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% available_items_loo.itemcallnumber |uri %]%22">[% available_items_loo.itemcallnumber | html %]</a>]
515                                                                     [% END %]
516                                                                     ([% available_items_loo.count | html %])
517                                                                     [% IF item_level_itypes && available_items_loo.description %]
518                                                                         <br/>[% available_items_loo.description | html %]
519                                                                     [% END %]
520                                                                     </li>
521                                                                 [% END # /FOREACH available_items_loo %]
522                                                             </ul>
523                                                         [% END # /IF SEARCH_RESULT.availablecount %]
524
525                                                         [% IF ( SEARCH_RESULT.onloancount ) %]
526                                                             <span class="status">[% SEARCH_RESULT.onloancount | html %] on loan:</span>
527                                                             <ul>
528                                                                 [% FOREACH onloan_items_loo IN SEARCH_RESULT.onloan_items_loop %]
529                                                                     [% IF item_level_itypes && !noItemTypeImages && onloan_items_loo.imageurl %]
530                                                                         <li style="list-style: none; list-style-type: none;">
531                                                                             <img src="[% onloan_items_loo.imageurl | html %]" title="[% onloan_items_loo.description | html %]" alt="[% onloan_items_loo.description | html %]" />
532                                                                     [% ELSE %]
533                                                                         <li>
534                                                                     [% END %]
535                                                                     [% IF ( onloan_items_loo.branchname ) %]
536                                                                         [% onloan_items_loo.branchname | html %]
537                                                                     [% END %]
538                                                                     [% IF ( onloan_items_loo.location ) %]
539                                                                         <span class="shelvingloc">[% onloan_items_loo.location | html %]</span>
540                                                                     [% END %]
541                                                                     [% IF ( onloan_items_loo.itemcallnumber ) %]
542                                                                         [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% onloan_items_loo.itemcallnumber |uri %]%22">[% onloan_items_loo.itemcallnumber | html %]</a>]
543                                                                     [% END %]
544                                                                     ([% onloan_items_loo.count | html %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue | html %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %]
545                                                                     [% IF item_level_itypes && onloan_items_loo.description %]
546                                                                     <br/>[% onloan_items_loo.description | html %]
547                                                                 [% END %]
548                                                                 </li>
549                                                                 [% END # /FOREACH onloan_items_loo %]
550                                                             </ul>
551                                                         [% END # IF SEARCH_RESULT.onloancount %]
552
553                                                         [% IF ( SEARCH_RESULT.othercount ) %]
554                                                             <span class="unavailable">[% SEARCH_RESULT.othercount | html %] unavailable:</span>
555                                                             <ul>
556                                                                 [% FOREACH other_items_loo IN SEARCH_RESULT.other_items_loop %]
557                                                                     [% IF item_level_itypes && !noItemTypeImages && other_items_loo.imageurl %]
558                                                                         <li style="list-style: none; list-style-type: none;">
559                                                                             <img src="[% other_items_loo.imageurl | html %]" title="[% other_items_loo.description | html %]" alt="[% other_items_loo.description | html %]" />
560                                                                     [% ELSE %]
561                                                                         <li>
562                                                                     [% END %]
563                                                                     [% IF ( other_items_loo.branchname ) %]
564                                                                         [% other_items_loo.branchname | html %]
565                                                                     [% END %]
566                                                                     [% IF ( other_items_loo.location ) %]
567                                                                         <span class="shelvingloc">[% other_items_loo.location | html %]</span>
568                                                                     [% END %]
569                                                                     [% IF ( other_items_loo.itemcallnumber ) %]
570                                                                         [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% other_items_loo.itemcallnumber |uri %]%22">[% other_items_loo.itemcallnumber | html %]</a>]
571                                                                     [% END %]
572                                                                     [% IF ( other_items_loo.withdrawn ) %]
573                                                                         ([% AuthorisedValues.GetByCode( 'WITHDRAWN', other_items_loo.withdrawn ) | html %])
574                                                                     [% END %]
575                                                                     [% IF ( other_items_loo.itemlost ) %]
576                                                                         ([% AuthorisedValues.GetByCode( 'LOST', other_items_loo.itemlost ) | html %])
577                                                                     [% END %]
578                                                                     [% IF ( other_items_loo.damaged ) %]
579                                                                         ([% AuthorisedValues.GetByCode( 'DAMAGED', other_items_loo.damaged ) | html %])
580                                                                     [% END %]
581                                                                     [% IF ( other_items_loo.intransit ) %]
582                                                                         (In transit)
583                                                                     [% END %]
584                                                                     [% IF ( other_items_loo.onhold ) %]
585                                                                         (On hold)
586                                                                     [% END %]
587                                                                     [% IF ( other_items_loo.notforloan ) %]
588                                                                         [% other_items_loo.notforloan | html %]
589                                                                     [% END %]
590                                                                     ([% other_items_loo.count | html %])
591                                                                     [% IF item_level_itypes && other_items_loo.description %]
592                                                                         <br/>[% other_items_loo.description | html %]
593                                                                     [% END %]
594                                                                     </li>
595                                                                 [% END # /FOREACH other_items_loo %]
596                                                             </ul>
597                                                         [% END # /IF SEARCH_RESULT.othercount %]
598
599                                                     [% ELSE # /IF ( SEARCH_RESULT.items_count ) %]
600
601                                                         [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.count ) %]
602                                                             <strong id="altholdings_heading">Other holdings:</strong>
603                                                             <ul>
604                                                                 [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
605                                                                     <li id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</li>
606                                                                 [% END %]
607                                                             </ul>
608                                                         [% ELSE %]
609                                                             <span class="unavailable">No items</span>
610                                                         [% END %]
611                                                     [% END # /IF ( SEARCH_RESULT.items_count ) %]
612                                                 </div> <!-- /.availability -->
613                                             </td>
614                                         </tr>
615                                     [% END # /FOREACH SEARCH_RESULT %]
616                                 </table>
617                             </form>
618                         </div> <!-- /#bookbag_form -->
619                     [% END # /IF scan %]
620                     [% INCLUDE 'page-numbers.inc' %]
621                 [% ELSE #/IF total %]
622                     <!-- No Results Found -->
623                 [% END #/IF total %]
624
625                 [% IF ( outer_sup_results_loop ) %]
626                     </div>
627                     <div class="col-sm-4">
628                         [% FOREACH outer_sup_results_loo IN outer_sup_results_loop %]
629                             [% IF ( outer_sup_results_loo.inner_sup_results_loop ) %]
630                                 [% outer_sup_results_loo.servername | html %]
631                                 [% FOREACH inner_sup_results_loo IN outer_sup_results_loo.inner_sup_results_loop %]
632                                     <div>
633                                         <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>
634                                     </div>
635                                 [% END %]
636                             [% END %]
637                         [% END # FOREACH outer_sup_results_loo %]
638                     </div> <!-- /.col-sm-4 -->
639                 </div>
640                 [% END #/IF outer_sup_results_loop %]
641
642                 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
643                     <!-- Value will be set here by placeHold() -->
644                     <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
645                     <input type="hidden" name="findborrower" id="holdFor" value="" />
646                     <input type="hidden" name="club" id="holdForClub" value="" />
647                     <input type="hidden" name="multi_hold" value="1"/>
648                 </form>
649
650                 <form id="list_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
651                     <!-- Value will be set here by addToList() -->
652                     <input id="list_form_biblios" type="hidden" name="biblionumbers" value="" />
653                     <input type="hidden" name="multi_listadd" value="1"/>
654                 </form>
655
656             </main>
657         </div> <!-- /.col-sm-10.col-sm-push-2 -->
658
659         <div class="col-sm-2 col-sm-pull-10">
660             <aside>
661                 [% INCLUDE 'facets.inc' %]
662             </aside>
663         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
664      </div> <!-- /.row -->
665
666 [% MACRO jsinclude BLOCK %]
667     [% INCLUDE 'browser-strings.inc' %]
668     [% Asset.js("js/browser.js") | $raw %]
669     [% Asset.js("lib/hc-sticky.js") | $raw %]
670     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
671     [% Asset.js("js/coce.js") | $raw %]
672     <script>
673         var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
674         var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be placed on hold.");
675         var q_array = new Array();  // will hold search terms, if present
676         [% IF ( AmazonCoverImages ) %]
677             // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
678             function verify_images() {
679                 $("img").each(function(i){
680                     if ((this.src.indexOf('images-amazon.com') >= 0) || (this.src.indexOf('images.amazon.com') >=0)) {
681                         w = this.width;
682                         h = this.height;
683                         if ((w == 1) || (h == 1)) {
684                             $(this).parent().html('<span class="no-image">No cover image available</span>');
685                         } else if ((this.complete != null) && (!this.complete)) {
686                             $(this).parent().html('<span class="no-image">No cover image available</span>');
687                         }
688                     }
689                 });
690             }
691
692             $(window).load(function() {
693                 verify_images();
694             });
695         [% END %]
696         var Sticky;
697         $(document).ready(function() {
698
699             $(".moretoggle").click(function(e) {
700                 e.preventDefault();
701                 $(this).siblings(".collapsible-facet").toggle();
702                 $(this).siblings(".moretoggle").toggle();
703                 $(this).toggle();
704             });
705
706             Sticky = $("#searchheader");
707             Sticky.hcSticky({
708                 stickTo: "main",
709                 stickyClass: "floating"
710             });
711
712             $("#cartsubmit").click(function(e){
713                 e.preventDefault();
714                 addMultiple();
715             });
716
717             $(".addtolist").on("click",function(e){
718                 e.preventDefault();
719                 var shelfnumber = $(this).data("shelfnumber");
720                 var vshelf = vShelfAdd();
721                 if( vshelf ){
722                     if( $(this).hasClass("morelists") ){
723                         openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf);
724                     } else if( $(this).hasClass("newlist") ){
725                         openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf);
726                     } else {
727                         openWindow('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf);
728                     }
729                 }
730             });
731
732             $("#z3950submit").click(function(){
733                 PopupZ3950();
734                 return false;
735             });
736
737             $("#searchheader").on("click", ".browse_selection", function(){
738                 browse_selection();
739                 return false;
740             });
741
742             $("#searchheader").on("click",".placehold", function(){
743                 $("#holdFor").val("");
744                 $("#holdForClub").val("");
745                 placeHold();
746                 $(".btn-group").removeClass("open");
747                 return false;
748             });
749
750             $(".placeholdfor").click(function(){
751                 holdForPatron();
752                 $(".btn-group").removeClass("open");
753                 return false;
754             });
755
756             $(".placeholdforclub").click(function(){
757                 holdForClub();
758                 $(".btn-group").removeClass("open");
759                 return false;
760             });
761
762             $("#forgetholdfor, #forgetholdforclub").click(function(){
763                 forgetPatronAndClub();
764                 $(".btn-group").removeClass("open");
765                 return false;
766             });
767
768             $("#tagsel_span").html("<input id=\"tagsel_tag\" class=\"submit\" type=\"submit\" value=\"Tag\"/>");
769
770             $(".selection").show();
771
772             [% IF ( query_desc ) %]
773                 toHighlight = $("p,span.results_summary,a.title");
774                 var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
775                 q_array = query_desc.split(" ");
776                 // ensure that we don't have "" at the end of the array, which can
777                 // break the highlighter
778                 while (q_array.length > 0 && q_array[q_array.length-1] == "") {
779                     q_array = q_array.splice(0,-1);
780                 }
781                 highlightOn();
782                 $("#highlight_toggle_on" ).hide().click(function(e) {
783                     e.preventDefault();
784                      highlightOn();
785                 });
786                 $("#highlight_toggle_off").show().click(function(e) {
787                     e.preventDefault();
788                     highlightOff();
789                 });
790             [% END %]
791
792             [% IF (SEARCH_RESULTS) %]
793                 var newresults = [
794                     [%- FOREACH result IN SEARCH_RESULTS -%]
795                         [%- result.biblionumber | html %],
796                     [%- END -%]
797                 ];
798                 var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
799                 browser.create([% SEARCH_RESULTS.first.result_number | html %], '[% query_cgi | html %]', '[% limit_cgi | html %]','[% sort_cgi | html %]',
800                        newresults, '[% total | html %]');
801             [% END %]
802
803             [% IF (gotoPage && gotoNumber) %]
804                 [% IF (gotoNumber == 'first') %]
805                     window.location = '/cgi-bin/koha/catalogue/[% gotoPage | html %]?biblionumber=' + [% SEARCH_RESULTS.first.biblionumber | html %] + '&searchid=[% searchid | html %]';
806                 [% ELSIF (gotoNumber == 'last') %]
807                     window.location = '/cgi-bin/koha/catalogue/[% gotoPage | html %]?biblionumber=' + [% SEARCH_RESULTS.last.biblionumber | html %] + '&searchid=[% searchid | html %]';
808                 [% END %]
809             [% END %]
810
811             [% IF LocalCoverImages %]
812                 KOHA.LocalCover.LoadResultsCovers();
813             [% END %]
814
815             [% IF ( IntranetCoce && CoceProviders ) %]
816                 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
817             [% END %]
818
819             $("#select_all").on("click",function(e){
820                 e.preventDefault();
821                 selectAll();
822             });
823
824             $("#clear_all").on("click",function(e){
825                 e.preventDefault();
826                 clearAll();
827             });
828
829             $("#searchresults").on("click",".addtocart",function(e){
830                 e.preventDefault();
831                 var selection_id = this.id;
832                 var biblionumber = selection_id.replace("cart","");
833                 addRecord(biblionumber);
834             });
835
836             $("#searchresults").on("click",".cartRemove",function(e){
837                 e.preventDefault();
838                 var selection_id = this.id;
839                 var biblionumber = selection_id.replace("cartR","");
840                 delSingleRecord(biblionumber);
841             });
842
843             [% UNLESS Koha.Preference('BrowseResultSelection') %]
844                 resetSearchContext();
845             [% END %]
846             $(".selection").change(function(){
847                 if ( $(this).is(':checked') == true ) {
848                   addBibToContext( $(this).val() );
849                 } else {
850                   delBibToContext( $(this).val() );
851                 }
852             });
853             $("#bookbag_form").ready(function(){
854                 $("#bookbag_form").unCheckCheckboxes();
855                 var bibnums = getContextBiblioNumbers();
856                 if (bibnums) {
857                     for (var i=0; i < bibnums.length; i++) {
858                         var id = ('#bib' + bibnums[i]);
859                         if ($(id)) {
860                             $(id).attr('checked', true);
861                         }
862                     }
863                 }
864             });
865
866         });
867
868
869         [% IF ( query_desc ) %]
870             function highlightOff() {
871                 toHighlight.removeHighlight();
872                 $(".highlight_toggle").toggle();
873             }
874             function highlightOn() {
875                 var x;
876                 for (x in q_array) {
877                     q_array[x] = q_array[x].toLowerCase();
878                     var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
879                     if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
880                         toHighlight.highlight(q_array[x]);
881                     }
882                 }
883                 $(".highlight_toggle").toggle();
884             }
885         [% END %]
886
887         function selectAll () {
888             $("#bookbag_form").checkCheckboxes();
889             $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){
890                 $(this).change();
891             } );
892             return false;
893         }
894         function clearAll () {
895             $("#bookbag_form").unCheckCheckboxes();
896             $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){
897                 $(this).change();
898             } );
899             return false;
900         }
901         function placeHold () {
902             var checkedItems = $(".selection:checked");
903             if ($(checkedItems).size() == 0) {
904                 alert(MSG_NO_ITEM_SELECTED);
905                 return false;
906             }
907             var bibs = "";
908             var badBibs = false;
909             $(checkedItems).each(function() {
910                 var bib = $(this).val();
911                 if ($("#reserve_" + bib).size() == 0) {
912                     alert(MSG_NON_RESERVES_SELECTED);
913                     badBibs = true;
914                     return false;
915                 }
916                 bibs += bib + "/";
917             });
918             if (badBibs) {
919                 return false;
920             }
921             $("#hold_form_biblios").val(bibs);
922             $("#hold_form").submit();
923             return false;
924         }
925
926         function forgetPatronAndClub(){
927             $.removeCookie("holdfor", { path: '/' });
928             $.removeCookie("holdforclub", { path: '/' });
929             $(".holdforlink").remove();
930             $("#placeholdc").html("<a class=\"btn btn-default btn-xs placehold\" href=\"#\"><i class=\"fa fa-sticky-note-o\"></i> "+_("Place hold")+"</a>");
931         }
932
933         function browse_selection () {
934             var bibnums = getContextBiblioNumbers();
935             if ( bibnums && bibnums.length > 0 ) {
936                 var browser = KOHA.browser('', parseInt('[% biblionumber | html %]', 10));
937                 browser.create(1, '[% query_cgi | html %]', '[% limit_cgi | html %]','[% sort_cgi | html %]', bibnums, bibnums.length);
938                 window.location = '/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + bibnums[0] + '&searchid='+browser.searchid;
939             } else {
940                 alert(MSG_NO_ITEM_SELECTED);
941             }
942             return false;
943         }
944
945         function addToList () {
946             var checkedItems = $(".selection:checked");
947             if ($(checkedItems).size() == 0) {
948                 alert(MSG_NO_ITEM_SELECTED);
949                 return false;
950             }
951             var bibs = "";
952             $(checkedItems).each(function() {
953                 bibs += $(this).val() + "/";
954             });
955
956             var url = "/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumbers=" + bibs;
957             window.open(url, 'Add_to_virtualshelf', 'width=500, height=400, toolbar=false, scrollbars=yes');
958             return false;
959         }
960
961         /* this function open a popup to search on z3950 server.  */
962         function PopupZ3950() {
963             var strQuery = GetZ3950Terms();
964             if(strQuery){
965                 window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber | html %]"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
966             }
967         }
968         /* provide Z3950 search points */
969         function GetZ3950Terms(){
970             var strQuery="&frameworkcode=";
971             [% FOREACH z3950_search_param IN z3950_search_params %]
972                 strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
973             [% END %]
974             return strQuery;
975         }
976
977         function holdfor(){
978             $("#holdFor").val("");
979             $("#holdForClub").val("");
980             placeHold();
981         }
982
983         function holdForPatron() {
984             $("#holdFor").val("[% holdfor_cardnumber | html %]");
985             placeHold();
986         }
987
988         function holdForClub() {
989             $("#holdForClub").val("[% holdforclub | html %]");
990             placeHold();
991         }
992     </script>
993 [% END %]
994
995 [% INCLUDE 'intranet-bottom.inc' %]