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