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