Bug 26037: openlibrary.org is hit on every Koha requests
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-results.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
7 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
8
9 [% IF firstPage %]
10      [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
11      [% SET RecordedBooksEnabled = Koha.Preference('RecordedBooksLibraryID') && Koha.Preference('RecordedBooksClientSecret') %]
12 [% END %]
13
14 [% INCLUDE 'doc-head-open.inc' %]
15 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;
16 [% IF ( searchdesc ) %]
17     [% IF ( ms_value ) %]
18         Results of search for '[% ms_value | html %]'
19     [% ELSE %]
20         Search results
21     [% END %]
22 [% ELSE %]
23     You did not specify any search criteria.
24 [% END %]</title>
25 [% INCLUDE 'doc-head-close.inc' %]
26
27 <link rel="alternate" type="application/rss+xml" title="[% LibraryName | html %] Search RSS feed" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss" />
28 </head>
29 [% BLOCK cssinclude %][% END %]
30 [% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
31 [% INCLUDE 'masthead.inc' %]
32
33     <div class="main">
34         <ul class="breadcrumb">
35             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
36                 [% IF ( searchdesc ) %]
37                     [% IF ( ReturnPath ) %]
38                         <li>
39                             <a href="[% ReturnPath | url %]">Advanced search</a> <span class="divider">&rsaquo;</span>
40                         </li>
41                     [% END %]
42                     <li>
43                         [% IF ( ms_value ) %]
44                             <a href="#" title="You searched [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Results of search for '[% ms_value | html %]'</a>
45                         [% ELSE %]
46                             <a href="#" title="You searched [% IF ( query_desc ) %] for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]">Search results</a>
47                         [% END %]
48                     </li>
49                 [% ELSE %]
50                     <li>
51                         <a href="#">You did not specify any search criteria</a>
52                     </li>
53                 [% END %]
54         </ul>
55
56         [% UNLESS ( total ) %]
57             <div class="container-fluid">
58                 <div class="row-fluid">
59                     <div class="span12">
60                         <h2 id="numresults">No results found!</h2>
61                         <p>
62                             [% IF ( searchdesc ) %]
63                                 No results found for that in [% LibraryName | html %] catalog.
64                                 <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;format=rss" aria-label="Subscribe to this search" class="btn btn-link rsssearchlink noprint">
65                                     <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
66                                 </a>
67                             [% ELSE %]
68                                 You did not specify any search criteria.
69                             [% END %]
70                         </p>
71                         [% IF ( ReturnPath ) %]
72                            <div class="returntosearch">
73                                 <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
74                             </div>
75                         [% END %]
76                         [% IF ( OPACNoResultsFound ) %]
77                             <div id="noresultsfound">
78                                 [% OPACNoResultsFound | $raw %]
79                             </div>
80                         [% END %]
81                     </div> <!-- / .span12 -->
82                 </div> <!-- / .row-fluid -->
83             </div> <!-- / .container-fluid -->
84         [% END # / UNLESS searchdesc %]
85
86         <div class="container-fluid">
87             <div class="row-fluid">
88                 [% IF ( opacfacets && total ) %]
89                     <div class="span2">
90                         <div id="facetcontainer">
91                             <!-- FACETS START -->
92                             [% INCLUDE 'opac-facets.inc' %]
93                             <!-- FACETS END -->
94                         </div>
95                     </div>
96                 [% END %]
97
98                 [% IF ( total ) %]
99                    [% IF ( opacfacets ) %]
100                    <div class="span10 maincontent">
101                    [% ELSE %]
102                    <div class="span12 maincontent">
103                    [% END %]
104                 [% ELSE %]
105                    [% IF ( opacfacets ) %]
106                    <div class="span10">
107                    [% ELSE %]
108                    <div class="span12">
109                    [% END %]
110                 [% END %]
111
112                 [% IF ( searchdesc ) %]
113                     [% IF ( total ) %]
114                         <h2 id="numresults">
115                             Your search returned [% total | html %] results.
116                             <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;format=rss" class="btn btn-link rsssearchlink noprint" aria-label="Subscribe to this search">
117                                 <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i>
118                             </a>
119                         </h2>
120                         [% IF ( related ) %]
121                         <p>(related searches:[% FOREACH relate IN related %] [% relate.related_search | html %][% END %]).</p>
122                         [% END %]
123                     [% END # / IF total %]
124                 [% END # / IF searchdesc %]
125
126                 <div id="userresults">
127                     [% IF ( DidYouMean ) %]
128                         <div id="didyoumean">Not what you expected? Check for <a href="/cgi-bin/koha/svc/suggestion?render=standalone&amp;q=[% querystring | uri %]">suggestions</a></div>
129                     [% END %]
130
131                     [% IF ( koha_spsuggest ) %]
132                         Did you mean:
133                         <ul style="list-style: none;">
134                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
135                             <li>
136                                 <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion | uri %]">[% SPELL_SUGGES.spsuggestion | html %]</a>
137                             </li>
138                             [% END %]
139                         </ul>
140                     [% END # / IF koha_spsuggest%]
141                     [% IF ( total ) %]
142                         [% IF ( ReturnPath ) %]
143                             <div class="returntosearch">
144                                 <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
145                             </div>
146                         [% END %]
147                     [% END %]
148                     [% IF ( query_error ) %]
149                         <div class="dialog alert">
150                             <h4>Error:</h4>
151                             [% query_error | html %]
152                         </div>
153                     [% END %]
154
155                     <!-- Search Results Table -->
156                     [% IF ( total ) %]
157
158                         <div class="searchresults">
159                             <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
160                                 [% IF ( searchdesc ) %]
161                                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
162                                         <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
163                                     [% END %]
164                                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
165                                         <input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
166                                     [% END %]
167                                 [% END # IF /searchdesc %]
168
169                                 <div id="floating">
170                                     <div id="toolbar" class="toolbar clearfix">
171                                         <div id="top-pages" class="pull-left">[% INCLUDE 'page-numbers.inc' %]</div>
172                                         [% UNLESS tag %]
173                                             <div class="sort_by pull-right">
174                                                 <select id="sort_by" class="resort" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
175
176                                                 [% IF Koha.Preference('OPACnumSearchResultsDropdown') %]
177                                                     <label for="results_per_page">Results per page: </label>
178                                                     <select id="results_per_page" name="count">
179                                                         [% IF Koha.Preference('OPACnumSearchResults') %]
180                                                             [% IF results_per_page == Koha.Preference('OPACnumSearchResults') %]
181                                                                 <option value="[% Koha.Preference('OPACnumSearchResults') | html %]" selected="selected">Library default: [% Koha.Preference('OPACnumSearchResults') | html %]</option>
182                                                             [% ELSE %]
183                                                                 <option value="[% Koha.Preference('OPACnumSearchResults') | html %]">Library default: [% Koha.Preference('OPACnumSearchResults') | html %]</option>
184                                                             [% END %]
185                                                         [% END %]
186                                                         [% IF results_per_page == '20' %]<option value="20" selected="selected">20</option>[% ELSE %]<option value="20">20</option>[% END %]
187                                                         [% IF results_per_page == '40' %]<option value="40" selected="selected">40</option>[% ELSE %]<option value="40">40</option>[% END %]
188                                                         [% IF results_per_page == '60' %]<option value="60" selected="selected">60</option>[% ELSE %]<option value="60">60</option>[% END %]
189                                                         [% IF results_per_page == '80' %]<option value="80" selected="selected">80</option>[% ELSE %]<option value="80">80</option>[% END %]
190                                                         [% IF results_per_page == '100' %]<option value="100" selected="selected">100</option>[% ELSE %]<option value="100">100</option>[% END %]
191                                                     </select>
192                                                 [% END %]
193
194                                                 <input type="submit" class="btn btn-sm clearfix" id="sortsubmit" value="Go" />
195                                             </div>
196                                         [% END %]
197                                     </div> <!-- / #toolbar -->
198
199                                     <div id="selections-toolbar" class="toolbar noprint">
200                                         [% IF ( OpacHighlightedWords ) %]
201                                             <div class="highlight_controls noprint">
202                                                 <a href="#" class="btn btn-link highlight_toggle" id="highlight_toggle_off"><i class="fa fa-fw fa-pencil" aria-hidden="true"></i> Unhighlight</a>
203                                                 <a href="#" class="btn btn-link highlight_toggle" id="highlight_toggle_on"><i class="fa fa-fw fa-pencil" aria-hidden="true"></i> Highlight</a>
204                                             </div>
205                                             <span class="sep">|</span>
206                                         [% END %]
207                                         <!-- checkall, clearall are now needed for placehold -->
208                                         <span class="checkall"></span>
209                                         <span class="clearall"></span> <span class="sep">|</span>
210
211                                             <span class="links">
212                                                 [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
213                                                     <span class="addto"></span>
214                                                 [% END %]
215                                                 <span id="placehold"></span>
216
217                                                 [% IF ( TagsInputEnabled && loggedinusername ) %]
218                                                     <span id="tagsel_span">
219                                                         <button id="tagsel_tag" class="btn btn-link disabled" type="submit" style="display:none"><i class="fa fa-fw fa-tag" aria-hidden="true"></i> Tag</button>
220                                                     </span>
221                                                     <div id="tagsel_form" style="display:none">
222                                                         <label for="tagsel_new">New tag:</label>
223                                                         <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
224                                                         <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-small" title="Add" type="submit" value="Add" />
225                                                         <a href="#" id="tagsel_cancel">(done)</a>
226                                                     </div>
227                                                     <div id="tagsel_status" class="tagsel_tatus" style="display:none;">
228                                                         Tag status here.
229                                                     </div>
230                                                 [% END %]
231                                             </span> <!-- / .links -->
232                                     </div> <!-- / #selections-toolbar -->
233                                 </div> <!-- /#floating -->
234
235                                 <!-- TABLE RESULTS START -->
236                                 <table class="table table-striped">
237
238                                     <!-- Actual Search Results -->
239                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
240                                         <tr>
241                                             [% # Cell 1: Checkbox %]
242                                             [% IF ( SEARCH_RESULT.title ) %]
243                                                 [% check_title = SEARCH_RESULT.title %]
244                                             [% ELSE %]
245                                                 [% check_title = SEARCH_RESULT.biblionumber %]
246                                             [% END %]
247                                             <td class="select selectcol">
248                                                 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
249                                                     <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
250                                                 [% ELSE %]
251                                                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
252                                                         <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]"/> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
253                                                     [% ELSE %]
254                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
255                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
256                                                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" aria-label="Select search result: [% check_title | html %]"/> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
257                                                                 [% END %]
258                                                             [% END %]
259                                                         [% END # IF RequestOnOpac %]
260                                                     [% END # IF virtualshelves %]
261                                                 [% END # IF opacbookbag%]
262                                             </td>
263                                             [% # Cell 2: Show result number if OpacHiddenItems is empty %]
264                                             <td class="select selectcol">
265                                                 [% UNLESS suppress_result_number %]
266                                                     [% SEARCH_RESULT.result_number | html %].
267                                                 [% END %]
268                                             </td>
269
270                                             [% IF ( !item_level_itypes && !Koha.Preference('OpacNoItemTypeImages') ) %]
271                                                 [% # Cell 3: Show item type image %]
272                                                 <td class="itypecol">
273                                                     [% IF ( SEARCH_RESULT.imageurl ) %]
274                                                         <img src="[% SEARCH_RESULT.imageurl | html %]" title="[% SEARCH_RESULT.description | html %]" alt="[% SEARCH_RESULT.description | html %]" />
275                                                     [% END %]
276                                                     [% IF ( SEARCH_RESULT.score_avg ) %]
277                                                         <img src="[% themelang | html %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/>
278                                                     [% END %]
279                                                 </td>
280                                             [% END %]
281
282                                             [% # Cell 4: Search result details and controls %]
283                                             <td class="bibliocol">
284                                                 <div class="coverimages itemtype_[% SEARCH_RESULT.itemtype | html %]">
285                                                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">
286                                                         [% IF ( SEARCH_RESULT.title ) %]
287                                                             [% img_title = SEARCH_RESULT.title %]
288                                                         [% ELSE %]
289                                                             [% img_title = SEARCH_RESULT.biblionumber %]
290                                                         [% END %]
291                                                         [% IF ( OPACLocalCoverImages ) %]
292                                                             <span title="[% img_title | html %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
293                                                         [% END %]
294
295                                                         [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
296                                                             <span title="[% img_title | html %]" id="adlibris-thumbnail[% loop.count | html %]">
297                                                                 <img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]"
298                                                                      alt="Adlibris thumbnail for ISBN: [% SEARCH_RESULT.normalized_isbn | html %]" class="adlibris-cover" />
299                                                             </span>
300                                                         [% END %]
301                                                         [% IF ( OPACAmazonCoverImages ) %]
302                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
303                                                                     <span title="[% img_title | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span>
304                                                             [% ELSE %]
305                                                                 <span class="no-image">No cover image available</span>
306                                                             [% END %]
307                                                         [% END %]
308
309                                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
310                                                             [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %]
311                                                                     <span title="[% img_title | html %]" id="syndetics-thumbnail[% loop.count | html %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc | html %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %]" alt="" class="item-thumbnail" /></span>
312                                                             [% ELSE %]
313                                                                 <span class="no-image">No cover image available</span>
314                                                             [% END %]
315                                                         [% END %]
316
317                                                         [% IF ( GoogleJackets ) %]
318                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
319                                                                 <span title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></span>
320                                                             [% ELSE %]
321                                                                 <span class="no-image">No cover image available</span>
322                                                             [% END %]
323                                                         [% END %]
324
325                                                         [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
326                                                           [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn | html %]
327                                                           [% IF ( coce_id ) %]
328                                                             <span title="[% img_title | html %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
329                                                           [% ELSE %]
330                                                             <span class="no-image">No cover image available</span>
331                                                           [% END %]
332                                                         [% END %]
333
334                                                         [% IF OpenLibraryCovers %]
335                                                             [% IF SEARCH_RESULT.normalized_isbn %]
336                                                                 <span title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="openlibrary-thumbnail[% loop.count | html %]"></span>
337                                                             [% ELSE %]
338                                                                 <span class="no-image">No cover image available</span>
339                                                             [% END %]
340                                                         [% END %]
341
342                                                         [% IF ( BakerTaylorEnabled && !BakerTaylorBookstoreURL ) %]
343                                                             [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
344                                                             [% IF ( bt_id ) %]
345                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
346                                                             [% ELSE %]
347                                                                 <span class="no-image">No cover image available</span>
348                                                             [% END %]
349                                                         [% END %]
350                                                     </a>
351
352                                                     [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %]
353                                                         [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
354                                                         [% IF ( bt_id ) %]
355                                                             <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
356                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
357                                                             </a>
358                                                         [% ELSE %]
359                                                             <span class="no-image">No cover image available</span>
360                                                         [% END %]
361                                                     [% END %]
362
363                                                     [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
364                                                          [% IF ( OPACURLOpenInNewWindow ) %]
365                                                             <a class="custom_cover_image" href="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% SEARCH_RESULT.biblio_object.custom_cover_image_url | url %]" /></a>
366                                                         [% ELSE %]
367                                                             <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 %]" /></a>
368                                                         [% END %]
369                                                     [% END %]
370
371                                                 </div>
372                                                 [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
373                                                     <!-- COinS / Openurl -->
374                                                     <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
375                                                 [% END %]
376                                                 <div id="title_summary_[% SEARCH_RESULT.biblionumber | html %]" class="title_summary">
377                                                 [% IF ( OPACXSLTResultsDisplay ) %]
378                                                     [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
379                                                 [% ELSE %]
380                                                     [% IF ( BiblioDefaultViewmarc ) %]
381                                                         <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
382                                                     [% ELSE %]
383                                                         [% IF ( BiblioDefaultViewisbd ) %]
384                                                             <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
385                                                         [% ELSE %]
386                                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | url %]" title="View details for this title">
387                                                         [% END %]
388                                                     [% END %]
389
390                                                     [% INCLUDE 'biblio-title.inc' biblio=SEARCH_RESULT %]
391
392                                                     [% IF ( SEARCH_RESULT.author ) %]
393                                                         by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% SEARCH_RESULT.author | url %]" title="Search for works by this author" class="author">[% SEARCH_RESULT.author | html %]</a>
394                                                     [% ELSE %]
395                                                         &nbsp;
396                                                     [% END %]
397
398                                                     <span class="results_summary publisher">
399                                                         <span class="label">Publication:</span>
400                                                             [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %]
401                                                             [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %]
402                                                             [% IF ( SEARCH_RESULT.publicationyear ) %]
403                                                                 [% SEARCH_RESULT.publicationyear | html %]
404                                                             [% ELSE %]
405                                                                 [% IF ( SEARCH_RESULT.copyrightdate ) %]
406                                                                     [% SEARCH_RESULT.copyrightdate | html %]
407                                                                 [% END %]
408                                                             [% END %]
409                                                             [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
410                                                             [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
411                                                             [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %][% END %]
412                                                             [% IF ( SEARCH_RESULT.timestamp ) %] <em>(modified on [% SEARCH_RESULT.timestamp | html %])</em>[% END %]
413                                                     </span>
414
415                                                     [% IF ( SEARCH_RESULT.summary ) %]
416                                                         <span class="result_summary">
417                                                             [% SEARCH_RESULT.summary | html %]
418                                                         </span>
419                                                     [% END %]
420
421                                                     [% IF ( SEARCH_RESULT.copyrightdate ) %]
422                                                         <span class="results_summary date">
423                                                             <span class="label">Date:</span>
424                                                             [% SEARCH_RESULT.copyrightdate | html %]
425                                                         </span>
426                                                     [% END %]
427
428                                                     <span class="results_summary">
429                                                         <span class="label">Availability:</span>
430                                                             [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
431                                                                 <span class="available"><strong>Items available:</strong>
432                                                                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
433                                                                         [% IF available_items_loo.this_branch %]
434                                                                             <span class="highlight-row-results">
435                                                                         [% ELSE %]
436                                                                             <span>
437                                                                         [% END %]
438
439                                                                         [% IF ( singleBranchMode ) %]
440                                                                             <span class="shelvingloc">[% available_items_loo.location | html %]</span>
441                                                                         [% ELSE %]
442                                                                             [% available_items_loo.branchname | html %]
443                                                                         [% END %]
444
445                                                                         [% IF ( OPACItemsResultsDisplay ) %]
446                                                                             [% UNLESS ( singleBranchMode ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
447                                                                             [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber | url %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %]
448                                                                         [% END %]
449                                                                         ([% available_items_loo.count | html %]),
450                                                                         </span>
451                                                                     [% END # / FOREACH available_items_loo %]
452                                                                 </span>
453                                                             [% ELSE %]
454                                                                 [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
455                                                                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
456                                                                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</span>,
457                                                                     [% END %]
458                                                                 [% ELSE %]
459                                                                     <span class="unavailable">No items available:</span>
460                                                                 [% END %]
461                                                             [% END # / IF SEARCH_RESULT.available_items_loop.size %]
462
463                                                             <span class="unavailable">
464                                                                 [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount | html %]), [% END %]
465                                                                 [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount | html %]), [% END %]
466                                                                 [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
467                                                                 [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
468                                                                 [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
469                                                                 [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
470                                                                 [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
471                                                             </span>
472                                                     </span> <!-- / .results_summary -->
473                                                 [% END # / IF OPACXSLTResultsDisplay %]
474
475                                                 [% IF ( SEARCH_RESULT.score_avg ) %]
476                                                     <div class="results_summary">
477                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
478                                                             [% IF ( SEARCH_RESULT.score_int >= i ) %]
479                                                                 <div class="star-rating rater-[% i | html %] star star-rating-applied star-rating-readonly star-rating-on"><a title="[% i | html %]">[% i | html %]</a></div>
480                                                             [% ELSE   %]
481                                                                 <div class="star-rating rater-[% i | html %] star star-rating-applied star-rating-readonly"><a title="[% i | html %]">[% i | html %]</a></div>
482                                                             [% END %]
483                                                         [% END %]
484                                                         <span id="babeltheque-rating_total_[% SEARCH_RESULT.biblionumber | html %]">&nbsp;&nbsp; [% SEARCH_RESULT.score_avg | html %] / 5 (on [% SEARCH_RESULT.num_scores | html %] rates)</span>
485
486                                                         [% IF ( SEARCH_RESULT.num_critics ) %]
487                                                             <span class="social_data">[% SEARCH_RESULT.num_critics | html %] Internet user critics</span>
488                                                         [% END %]
489                                                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
490                                                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro | html %] Professional critics</span>
491                                                         [% END %]
492                                                         [% IF ( SEARCH_RESULT.num_videos ) %]
493                                                             <span class="social_data">[% SEARCH_RESULT.num_videos | html %] Video extracts</span>
494                                                         [% END %]
495                                                         [% IF ( SEARCH_RESULT.num_quotations ) %]
496                                                             <span class="social_data">[% SEARCH_RESULT.num_quotations | html %] Quotations</span>
497                                                         [% END %]
498                                                     </div> <!-- / .results_summary -->
499                                                 [% END # / IF SEARCH_RESULT.score_avg %]
500
501                                                 [% IF ( LibraryThingForLibrariesID ) %]
502                                                     <div class="ltfl_reviews"></div>
503                                                 [% END %]
504
505                                                 [% IF ( TagsShowEnabled && SEARCH_RESULT.TagLoop.size ) %]
506                                                     <div class="results_summary tags">
507                                                         <span class="label">Tags:</span>
508                                                         <ul>
509                                                             [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
510                                                                 <li>
511                                                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term | url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
512                                                                     <span class="weight">([% TagLoo.weight_total | html %])</span>
513                                                                 </li>
514                                                             [% END %]
515                                                         </ul>
516                                                     </div>
517                                                 [% END %]
518
519                                                 [% IF Koha.Preference('virtualshelves') AND SEARCH_RESULT.shelves.count %]
520                                                     <div class="results_summary shelves">
521                                                         <span class="label">Lists:</span>
522                                                         <ul>
523                                                             [% FOREACH shelf IN SEARCH_RESULT.shelves %]
524                                                                 <li>
525                                                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]">[% shelf.shelfname | html %]</a>
526                                                                     [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
527                                                                 </li>
528                                                             [% END %]
529                                                         </ul>
530                                                     </div>
531                                                 [% END %]
532
533                                                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]
534                                                     <span class="results_summary">
535                                                         <span class="label">Match:</span>
536                                                         [% SEARCH_RESULT.searchhighlightblob | html %]
537                                                     </span>
538                                                 [% END %]
539
540                                                 [% IF ( OpacStarRatings == 'all' ) %]
541                                                     <div class="results_summary ratings">
542                                                         [% SET rating_avg = SEARCH_RESULT.ratings.get_avg_rating() %]
543                                                         [% rating_avg_int = BLOCK %][% rating_avg | format("%.0f") %][% END %]
544                                                         <div class="br-wrapper br-theme-fontawesome-stars">
545                                                             <div class="br-widget br-readonly">
546                                                                 [% FOREACH i IN [ 1 2 3 4 5  ] %]
547                                                                     [% IF rating_avg_int == i %]
548                                                                         <a href="#" class="br-selected br-current"></a>
549                                                                     [% ELSIF rating_avg_int > i %]
550                                                                         <a href="#" class="br-selected"></a>
551                                                                     [% ELSE %]
552                                                                         <a href="#"></a>
553                                                                     [% END %]
554                                                                 [% END %]
555                                                             </div>
556                                                         </div>
557
558                                                         [% IF SEARCH_RESULT.ratings.count > 0  %]
559                                                             <span id="rating_total_[% SEARCH_RESULT.biblionumber | html %]">&nbsp;&nbsp;([% SEARCH_RESULT.ratings.count | html %] votes)</span>
560                                                         [% ELSE %]
561                                                             <br />
562                                                         [% END %]
563                                                     </div> <!-- / .results_summary -->
564                                                 [% END # / IF OpacStarRatings %]
565
566                                                     [% INCLUDE 'title-actions-menu.inc' items=SEARCH_RESULT %]
567
568                                                 </div>
569                                                 [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %]
570
571                                             </td>
572                                         </tr>
573                                     [% END # / FOREACH SEARCH_RESULT %]
574                                 </table>
575                             </form> <!-- / #bookbag_form -->
576
577                             <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
578                                 <!-- The value will be set by holdBiblioNums() in basket.js -->
579                                 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
580                             </form>
581                         </div> <!-- / .searchresults -->
582
583                         <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
584
585                     [% END # / IF total %]
586
587                     [%# Display "Not finding what you're looking for" for suggestion or ILL %]
588                     [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername ) || ( Koha.Preference( 'ILLModule' ) == 1 && loggedinusername ) %]
589                         <div class="suggestion">
590                             Not finding what you're looking for?
591                             <ul>
592                                 [% IF Koha.Preference( 'suggestion' ) == 1 %]
593                                     [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
594                                         <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
595                                     [% ELSIF loggedinusername %]
596                                         <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
597                                     [% END %]
598                                 [% END %]
599                                 [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
600                                     <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
601                                 [% END %]
602                             </ul>
603                         </div>
604                     [% END %]
605                     </div> <!-- / #userresults -->
606                 </div> <!-- /.span10/12 -->
607             </div> <!-- / .row-fluid -->
608         </div> <!-- / .container-fluid -->
609     </div><!-- / .main -->
610
611 [% INCLUDE 'opac-bottom.inc' %]
612 [% BLOCK jsinclude %]
613 [% IF ( LibraryThingForLibrariesID ) %]
614     <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID | html %]&amp;systype=koha"></script>
615 [% END %]
616 [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
617 [% IF ( RecordedBooksEnabled ) %][% Asset.js("js/recordedbooks.js") | $raw %][% END %]
618 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
619 [% Asset.js("js/authtoresults.js") | $raw %]
620 [% Asset.js("lib/hc-sticky.js") | $raw %]
621 [% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
622 [% END %]
623 [% IF OpenLibraryCovers || OpenLibrarySearch %]
624     [% Asset.js("js/openlibrary.js") | $raw %]
625 [% END %]
626
627 <script>
628 [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
629 function holdMultiple() {
630     var checkedBiblioNums = ""; // Separated by "/"
631     var checkedCount = 0;
632     if(document.bookbag_form.biblionumber.length > 0) {
633         for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
634             if (document.bookbag_form.biblionumber[i].checked) {
635                 checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
636                 checkedCount++;
637             }
638         }
639     }
640
641     if (checkedCount > 0) {
642         holdBiblioNums(checkedBiblioNums);
643     } else {
644         alert(MSG_NO_RECORD_SELECTED);
645     }
646 }
647
648 function holdBiblioNums(numList) {
649     // numList: biblio numbers separated by "/"
650     $("#hold_form_biblios").attr("value", numList);
651     $("#hold_form").submit();
652 }[% END %]
653
654 [% IF ( TagsInputEnabled && loggedinusername ) %]
655 function tagSelected() {
656     var checkedBoxes = $(".searchresults :checkbox:checked");
657     if ($(checkedBoxes).size() == 0) {
658         alert(MSG_NO_RECORD_SELECTED);
659     } else {
660         $("#tagsel_tag").hide();
661         $(".resort").hide();
662         $("#tagsel_form").show();
663     }
664 }
665
666 function tagCanceled() {
667     $("#tagsel_form").hide();
668     $("#tagsel_tag").show();
669     $(".resort").show();
670     $("#tagsel_new").val("");
671     $("#tagsel_status, .tagstatus").empty().hide();
672 }
673
674 function tagAdded() {
675     var checkedBoxes = $(".searchresults :checkbox:checked");
676     if ($(checkedBoxes).size() == 0) {
677         alert(MSG_NO_RECORD_SELECTED);
678         return false;
679     }
680
681     var tag = $("#tagsel_new").val();
682     if (!tag || (tag == "")) {
683         alert(MSG_NO_TAG_SPECIFIED);
684         return false;
685     }
686
687     var bibs = [];
688     for (var i = 0; i < $(checkedBoxes).size(); i++) {
689         var box = $(checkedBoxes).get(i);
690         bibs[i] = $(box).val();
691     }
692
693     KOHA.Tags.add_multitags_button(bibs, tag);
694     return false;
695 }[% END %]
696
697
698 function enableCheckboxActions(){
699     // Enable/disable controls if checkboxes are checked
700     var checkedBoxes = $(".checkboxed input:checkbox:checked");
701     var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, #selections-toolbar .links label, #selections-toolbar .links button");
702     if ($(checkedBoxes).size()) {
703       $("#selections").html(_("With selected titles: "));
704       $(controls).removeClass("disabled");
705     } else {
706       $("#selections").html(_("Select titles to: "));
707       $(controls).addClass("disabled");
708     }
709 }
710
711 [% IF ( OpacHighlightedWords ) %]
712 var q_array = new Array();  // holds search terms if available
713
714 function highlightOff() {
715     $("td").removeHighlight();
716     $(".highlight_toggle").toggle();
717 }
718 function highlightOn() {
719     var x;
720     for (x in q_array) {
721         q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
722         q_array[x] = q_array[x].toLowerCase();
723         var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
724         if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
725             $(".title").highlight(q_array[x]);
726             $(".author").highlight(q_array[x]);
727             $(".results_summary").highlight(q_array[x]);
728         }
729     }
730     $(".highlight_toggle").toggle();
731 }
732 [% END %]
733 $(document).ready(function(){
734
735     $(".moretoggle").click(function(e){
736         e.preventDefault();
737         $(this).siblings(".collapsible-facet").toggle();
738         $(this).siblings(".moretoggle").toggle();
739         $(this).toggle();
740     });
741
742     [% IF ( OpacHighlightedWords ) %]
743         $('a.title').each(function() {
744             $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
745         });
746     [% END %]
747
748     $(".cb").click(function(){
749       enableCheckboxActions();
750     });
751     enableCheckboxActions();
752
753     $(".br-readonly a").on("click", function(e){
754         e.preventDefault();
755     });
756
757     var param1 = "";
758     [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
759     param1 += "<span id=\"selections\">"+_("Select titles to: ")+"</span>";
760     [% END %]
761
762 [% IF Koha.Preference( 'opacbookbag' ) == 1 OR Koha.Preference('virtualshelves') %]
763     param1 += "<select class=\"disabled\" name=\"addto\" id=\"addto\"><option>"+_("Add to...")+"</option>";
764
765     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
766         param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
767     [% END %]
768     [% IF Koha.Preference('virtualshelves') %]
769         [% IF loggedinusername AND add_to_some_private_shelves.count %]
770             param1 += "<optgroup label=\""+_("Your lists:")+"\">";
771             [% SET number_of_private_shelves = 0 %]
772             [% FOREACH s IN add_to_some_private_shelves %]
773                 [% IF shelfnumber != s.shelfnumber %]
774                     param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
775                     [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
776                     [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
777                 [% END %]
778             [% END %]
779             param1 += "<\/optgroup>";
780         [% END %]
781         [% IF add_to_some_public_shelves.count %]
782             param1 += "<optgroup label=\""+_("Public lists:")+"\">";
783             [% SET number_of_public_shelves = 0 %]
784             [% FOREACH s IN add_to_some_public_shelves %]
785                 [% IF shelfnumber != s.shelfnumber %]
786                     param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
787                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
788                     [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
789                 [% END %]
790             [% END %]
791             param1 += "<\/optgroup>";
792         [% END %]
793         [% IF ( add_to_some_private_shelves and add_to_some_private_shelves.count > 10 ) or ( add_to_some_public_shelves and add_to_some_public_shelves.count > 10 ) %]
794             param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
795         [% END %]
796         param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
797     [% END %]
798     param1 += "<\/select> <input type=\"submit\" class=\"btn btn-small\" value=\""+_("Save")+"\" />";
799 [% END %]
800
801     $('.resort').change(function() {
802         $('#bookbag_form').submit();
803     });
804
805     $('#results_per_page').change(function() {
806         $('#bookbag_form').submit();
807     });
808
809     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
810     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
811
812 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
813     $("span.addto").html(param1);
814 [% ELSE %]
815     [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
816         $("span.addto").html(param1);
817     [% END %]
818 [% END %]
819
820 [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
821     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
822         $("#addto").on("change",function(){
823             cartList();
824         });
825         $(".addto").find("input:submit").click(function(){
826             cartList();
827             return false;
828         });
829     [% ELSE %]
830         $("#addto").on("click",function(){
831             cartList();
832             return false;
833         });
834     [% END %]
835 [% END %]
836
837     function cartList(){
838         addtoOption = $("#addto").find("option:selected");
839         addtoval = addtoOption.val();
840         if(addtoval == "addtolist"){
841             var shelfnumber = addtoOption.attr("id").replace("s","");
842             if (vShelfAdd()) {
843                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
844             }
845             return false;
846         } else if(addtoval == "newlist"){
847             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
848                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
849             }[% ELSE %]
850                 alert(_("You must be logged in to create or add to lists"));
851             [% END %]
852             return false;
853         } else if(addtoval == "morelists"){
854             [% IF ( loggedinusername ) %]
855                 if (vShelfAdd()) {
856                     Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
857                 }
858             [% ELSE %]
859                 alert(_("You must be logged in to create or add to lists"));
860             [% END %]
861             return false;
862         }
863         if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
864             addMultiple();
865             return false;
866          }
867     }
868     $("#CheckAll").click(function(){
869         $("#bookbag_form").checkCheckboxes();
870         enableCheckboxActions();
871         return false;
872     });
873     $("#CheckNone").click(function(){
874         $("#bookbag_form").unCheckCheckboxes();
875         enableCheckboxActions();
876         return false;
877     });
878
879 [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
880     $("#placehold").html("<button class=\"btn btn-link hold disabled\" type=\"submit\"><i class=\"fa fa-fw fa-bookmark\" aria-hidden=\"true\"></i>" + _("Place hold") + "</button>");
881     $("#placehold").find("button.hold").click(function(){
882         holdMultiple();
883         return false;
884     });
885 [% END %]
886
887 [% IF ( query_desc ) %]
888     var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
889     var querystring = "[% querystring |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
890     [% IF ( OpacHighlightedWords ) %]
891         q_array = query_desc.split(" ");
892         // ensure that we don't have "" at the end of the array, which can
893         // break the highlighter
894         while (q_array.length > 0 && q_array[q_array.length-1] == "") {
895             q_array = q_array.splice(0,-1);
896         }
897         highlightOn();
898         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
899         $("#highlight_toggle_off").show().click(function() {highlightOff();});
900     [% END %]
901     [% IF ( OverDriveEnabled ) %]
902         var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
903         $( '#numresults' ) .append( ' ' )
904             .append( $overdrive_results );
905         KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", querystring, 1, 0, function( data ) {
906             if ( data.error ) {
907                 $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') );
908                 return;
909             }
910
911             if ( data.totalItems ) {
912                 $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' );
913             } else {
914                 $overdrive_results.remove();
915             }
916         } );
917     [% END %]
918     [% IF ( RecordedBooksEnabled ) %]
919         var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
920         $( '#numresults' ) .append( ' ' )
921             .append( $recordedbooks_results );
922         KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" | html %], null, function( data ) {
923             if ( data.error ) {
924                 $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks')  + ': ' + data.error);
925                 return;
926             }
927
928             // data.total can be either 42 or "60+"
929             if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
930                 $recordedbooks_results.html( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' );
931             } else {
932                 $recordedbooks_results.remove();
933             }
934         } );
935     [% END %]
936     [% IF ( OpenLibrarySearch ) %]
937         var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
938         $( '#numresults' ) .append( ' ' )
939             .append( $openlibrary_results );
940         KOHA.OpenLibrary.search( querystring, null, function( data ) {
941             if ( data.error ) {
942                 $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') );
943                 return;
944             }
945
946             if ( data.numFound > 0 ) {
947                 $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' );
948             } else {
949                 $openlibrary_results.remove();
950             }
951         } );
952     [% END %]
953 [% END %]
954
955 [% IF ( TagsInputEnabled && loggedinusername ) %]
956     $("#tagsel_tag").show().click(function(){
957         tagSelected();
958         return false;
959     });
960     $("#tagsel_cancel").click(function(){
961         tagCanceled();
962         return false;
963     });
964     $("#tagsel_button").click(function(){
965         tagAdded();
966         return false;
967     });
968
969     $(".tag_add").click(function(){
970         var thisid = $(this).attr("id");
971         thisid = thisid.replace("tag_add","");
972         $(this).addClass("hidden");
973         $("#tagform"+thisid).show();
974         $("#newtag"+thisid).focus();
975         $("#newtag"+thisid+"_status").empty().hide();
976         return false;
977     });
978     $(".cancel_tag_add").click(function(){
979         var thisid = $(this).attr("id");
980         thisid = thisid.replace("cancel","");
981         $("#tagform"+thisid).hide();
982         $("#tag_add"+thisid).removeClass("hidden");
983         $("#newtag"+thisid).val("");
984         $("#newtag"+thisid+"_status").empty().hide();
985         return false;
986     });
987     $(".tagbutton").click(function(){
988         var thisid = $(this).attr("title");
989         var tag = $("#newtag"+thisid).val();
990         if (!tag || (tag == "")) {
991             alert(MSG_NO_TAG_SPECIFIED);
992             return false;
993         }
994         KOHA.Tags.add_tag_button(thisid, tag);
995         return false;
996     });
997 [% END %]
998
999 [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
1000 [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
1001 [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
1002 [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1003     KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]');
1004 [% END %]
1005
1006 [% IF ( DidYouMean ) %]
1007     $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
1008         function() {
1009             $(this).addClass("dym-loaded");
1010         });
1011 [% END %]
1012
1013 $("input.newtag").on('keydown', function(e){
1014     if (e.keyCode == 13) { e.preventDefault(); }
1015 });
1016
1017     Sticky = $("#floating");
1018     Sticky.hcSticky({
1019         stickTo: ".searchresults",
1020         stickyClass: "floating"
1021     });
1022
1023 });
1024 </script>
1025 [% END %]