Bug 9737 - Local Covers sometimes appear then disappear on OPAC Search Results/Lists
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-results.tt
1 [% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
2 [% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
3
4 [% INCLUDE 'doc-head-open.inc' %]
5 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›
6 [% IF ( searchdesc ) %]
7     Results of search [% IF ( query_desc ) %]for '[% query_desc | html%]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]
8 [% ELSE %]
9     You did not specify any search criteria.
10 [% END %]
11 [% INCLUDE 'doc-head-close.inc' %]
12 <link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
13 [% IF ( OpacStarRatings == 'all' ) %]<script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/plugins/jquery.rating.js"></script>
14 <link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />[% END %]
15
16 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
17 [% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.highlight-3.js"></script>
18 [% END %]<script type="text/javascript">
19 //<![CDATA[
20 [% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
21 function holdMultiple() {
22     var checkedBiblioNums = ""; // Separated by "/"
23     var checkedCount = 0;
24     if(document.bookbag_form.biblionumber.length > 0) {
25         for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
26             if (document.bookbag_form.biblionumber[i].checked) {
27                 checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
28                 checkedCount++;
29             }
30         }
31     }
32
33     if (checkedCount > 0) {
34         holdBiblioNums(checkedBiblioNums);
35     } else {
36         alert(MSG_NO_RECORD_SELECTED);
37     }
38 }
39
40 function holdBiblioNums(numList) {
41     // numList: biblio numbers separated by "/"
42     $("#hold_form_biblios").attr("value", numList);
43     $("#hold_form").submit();
44 }[% END %][% END %]
45
46 [% IF ( TagsInputEnabled && loggedinusername ) %]
47 function tagSelected() {
48     var checkedBoxes = $(".searchresults :checkbox:checked");
49     if ($(checkedBoxes).size() == 0) {
50         alert(MSG_NO_RECORD_SELECTED);
51     } else {
52         $("#tagsel_tag").hide();
53         $("#sort_by").hide();
54         $("#tagsel_form").show();
55     }
56 }
57
58 function tagCanceled() {
59     $("#tagsel_form").hide();
60     $("#tagsel_tag").show();
61     $("#sort_by").show();
62     $("#tagsel_new").val("");
63     $("#tagsel_status, .tagstatus").empty().hide();
64 }
65
66 function tagAdded() {
67     var checkedBoxes = $(".searchresults :checkbox:checked");
68     if ($(checkedBoxes).size() == 0) {
69         alert(MSG_NO_RECORD_SELECTED);
70         return false;
71     }
72
73     var tag = $("#tagsel_new").val();
74     if (!tag || (tag == "")) {
75         alert(MSG_NO_TAG_SPECIFIED);
76         return false;
77     }
78
79     var bibs = [];
80     for (var i = 0; i < $(checkedBoxes).size(); i++) {
81         var box = $(checkedBoxes).get(i);
82         bibs[i] = $(box).val();
83     }
84
85     KOHA.Tags.add_multitags_button(bibs, tag);
86     return false;
87 }[% END %]
88 [% IF ( OpacHighlightedWords ) %]
89 var q_array = new Array();  // holds search terms if available
90
91 function highlightOff() {
92     $("td").removeHighlight();
93     $(".highlight_toggle").toggle();
94 }
95 function highlightOn() {
96     var x;
97     for (x in q_array) {
98         if ( q_array[x].length > 0 ) {
99             $(".title").highlight(q_array[x]);
100             $(".author").highlight(q_array[x]);
101             $(".results_summary").highlight(q_array[x]);
102         }
103     }
104     $(".highlight_toggle").toggle();
105 }
106 [% END %]
107 $(document).ready(function(){
108     [% IF ( OpacHighlightedWords ) %]
109         $('a.title').each(function() {
110             $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
111         });
112     [% END %]
113
114     [% IF ( IDreamBooksResults ) %]
115         $('.idbresult').each(function() {
116             var isbn = $(this).children('a').text().replace(/\s*/,'');
117             var element = this;
118
119             if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
120             // Use Microsoft XDR for IE version 8 or above
121                 var xdr = new XDomainRequest();
122                 xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
123                 xdr.onload = function() {
124                     json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
125                     eval(json); // json is now a regular JSON object
126                     if(json.total_results > 0 && json.book.rating > 0){
127                         $(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+"%");
128                         $(element).show();
129                     } else {
130                         $(element).remove();
131                     }
132                 }
133                 xdr.send();
134             } else {
135                 $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
136                     if(json.total_results > 0 && json.book.rating > 0){
137                         $(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+"%");
138                         $(element).show();
139                     } else {
140                         $(element).remove();
141                     }
142                 });
143             }
144         });
145     [% END %]
146
147     [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
148
149 [% IF ( opacbookbag ) %]
150     [% IF ( virtualshelves ) %]
151     var param1 = "<label for=\"addto\">"+_("Add to: ")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
152     [% IF ( opacbookbag ) %]    param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
153     [% END %][% IF ( virtualshelves ) %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
154     param1 += "<optgroup label=\""+_("Your lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
155     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
156     param1 += "<\/optgroup>";[% END %]
157     [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %];
158     param1 += "<\/optgroup>";[% END %]
159     [% IF (( addbarshelvesloop && addbarshelvesloop.size>9) || (addpubshelvesloop && addpubshelvesloop.size>9 )) %]
160         param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
161     [% END %]
162     param1 += "<option value=\"newlist\">[ "+_("New list")+" ]<\/option>";
163     [% END %]
164     [% END %]
165     param1 += "<\/select> <input type=\"submit\" class=\"submit\" value=\""+_("Save")+"\" />";
166     [% ELSE %]
167         var param1 = "<a id=\"addto\" class=\"addtocart\" href=\"#\">" + _("Add to cart") + "<\/a>";
168     [% END %]
169 [% ELSE %]
170         var param1 = "<label for=\"addto\">"+_("Add to list: ")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
171 [% IF ( virtualshelves ) %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
172     param1 += "<optgroup label=\""+_("Your lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
173     param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
174     param1 += "<\/optgroup>";[% END %]
175     [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %][% END %]
176     param1 +="<\/optgroup><option value=\"newlist\">[ "+_("New list")+" ]<\/option>"
177     [% END %]
178     [% END %]
179     param1 += "<\/select> <input type=\"submit\" class=\"submit\" value=\""+_("Save")+"\" />";
180 [% END %]
181
182     $('#sortsubmit').hide();
183     $('#sort_by').change(function() {
184         $('#bookbag_form').submit();
185     });
186     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
187     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
188 [% IF ( opacbookbag ) %]$("span.addto").html(param1);[% ELSE %][% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]$("span.addto").html(param1);[% END %][% END %][% END %]
189 [% IF ( opacbookbag ) %]
190     [% IF ( virtualshelves ) %]
191     $("#addto").change(function(){
192         cartList();
193     });
194     $(".addto").find("input:submit").click(function(){
195         cartList();
196         return false;
197     });
198     [% ELSE %]
199     $("#addto").click(function(){
200         cartList();
201         return false;
202     });
203     [% END %]
204 [% END %]
205
206     function cartList(){
207         if($("#addto").find("option:selected").attr("value") == "addtolist"){
208             var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
209             if (vShelfAdd()) {
210             Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
211             }
212             return false;
213         } else if($("#addto").find("option:selected").attr("value") == "newlist"){
214             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
215             Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
216             }[% ELSE %] alert(_("You must be logged in to create or add to lists")); [% END %]
217             return false;
218         } else if($("#addto").find("option:selected").attr("value") == "morelists"){
219             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
220             Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
221             }[% ELSE %] alert(_("You must be logged in to create or add to lists")); [% END %]
222             return false;
223         }
224         if($("#addto").find("option:selected").attr("value") == "addtocart" || $("#addto").attr("class") == "addtocart"){
225             addMultiple();
226             return false;
227          }
228     }
229     $("#CheckAll").click(function(){
230         $("#bookbag_form").checkCheckboxes();
231         return false;
232     });
233     $("#CheckNone").click(function(){
234         $("#bookbag_form").unCheckCheckboxes();
235         return false;
236     });
237 [% IF ( RequestOnOpac ) %]
238   [% IF ( opacuserlogin ) %]
239   [% IF ( DisplayMultiPlaceHold ) %]
240     $("#placehold").html("<input class=\"submit\" type=\"submit\" value=\""+_("Place hold")+"\"/>");
241     $("#placehold").find("input:submit").click(function(){
242         holdMultiple();
243         return false;
244     });
245   [% END %]
246   [% END %]
247 [% END %]
248     $("#holdDetails").hide();
249
250 [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
251         q_array = query_desc.split(" ");
252         // ensure that we don't have "" at the end of the array, which can
253         // break the highlighter
254         while (q_array.length > 0 && q_array[q_array.length-1] == "") {
255             q_array = q_array.splice(0,-1);
256         }
257         highlightOn();
258         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
259         $("#highlight_toggle_off").show().click(function() {highlightOff();});[% END %][% END %]
260
261 [% IF ( TagsInputEnabled && loggedinusername ) %]
262             $("#tagsel_tag").click(function(){
263                 tagSelected();
264                 return false;
265             });
266             $("#tagsel_cancel").click(function(){
267                 tagCanceled();
268                 return false;
269             });
270             $("#tagsel_button").click(function(){
271                 tagAdded();
272                 return false;
273             });
274
275             $(".tag_add").click(function(){
276                 var thisid = $(this).attr("id");
277                 thisid = thisid.replace("tag_add","");
278                 $(this).hide();
279                 $("#tagform"+thisid).show();
280                 $("#newtag"+thisid).focus();
281                 $("#newtag"+thisid+"_status").empty().hide();
282                 return false;
283             });
284             $(".cancel_tag_add").click(function(){
285                 var thisid = $(this).attr("id");
286                 thisid = thisid.replace("cancel","");
287                 $("#tagform"+thisid).hide();
288                 $("#tag_add"+thisid).show();
289                 $("#newtag"+thisid).val("");
290                 $("#newtag"+thisid+"_status").empty().hide();
291                 return false;
292             });
293             $(".tagbutton").click(function(){
294                 var thisid = $(this).attr("title");
295                 var tag = $("#newtag"+thisid).val();
296                 if (!tag || (tag == "")) {
297                     alert(MSG_NO_TAG_SPECIFIED);
298                     return false;
299                 }
300                 KOHA.Tags.add_tag_button(thisid, tag);
301                 return false;
302             });
303 [% END %]
304     [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
305     [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
306     [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
307
308 [% IF ( DidYouMean ) %]
309     $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
310         function() {
311             $(".searchsuggestion").parent().parent().css({
312                 "border-color": "#F4ECBE",
313                 "background-color": "#FFFBEA"
314             });
315         });
316 [% END %]
317
318 });
319
320 //]]>
321 </script>
322 </head>
323 <body id="results">
324     [% IF ( opacfacets ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
325    <div id="bd">
326
327 [% INCLUDE 'masthead.inc' %]
328
329
330     <div id="yui-main">
331     <div class="yui-b">
332     <div id="userresults" class="container">
333     [% IF ( DidYouMean ) %]
334         <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>
335     [% END %]
336     <div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div>
337   [% IF ( koha_spsuggest ) %]
338     Did you mean:
339     <ul style="list-style: none;">
340         [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
341         <li>
342             <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion %]">[% SPELL_SUGGES.spsuggestion %]</a>
343         </li>
344         [% END %]
345     </ul>
346 [% END %]
347
348 [% IF ( query_error ) %]
349 <div class="dialog alert">
350     <h4>Error:</h4>
351     [% query_error %]
352 </div>
353 [% END %]
354
355 <!-- Search Results Table -->
356 [% IF ( total ) %]
357 [% IF ( scan ) %]
358     <h1>Scan index:</h1>
359     <form action="/cgi-bin/koha/opac-search.pl" method="get">
360         <table>
361             <tr>
362                 <td>
363                     Scan index for: <input type="text" name="q" id="scan-index" size="35" value="" />
364                 </td>
365             </tr>
366             <tr>
367                 <td>
368                     <label for="scan-index">Indexed in:</label>
369                     <select name="idx" id="scan-index">
370                         <option value="">Any word</option>
371                         <option value="kw,phr:">Any phrase</option>
372                         <option value="ti:">Title</option>
373                         <option value="ti,phr:">Title phrase</option>
374                         <option value="au,phr:">Author</option>
375                         <option value="su:">Subject</option>
376                         <option value="su,phr:">Subject phrase</option>
377                         <option value="se:">Series</option>
378                         <option value="pb:">Publisher</option>
379                         <option value="nt:">Notes</option>
380                         <option value="se:">Series Title</option>
381                         <option value="sn:">ISBN</option>
382                         <option value="ss:">ISSN</option>
383                     </select>
384                     <input type="hidden" name="scan" value="1" />
385                 </td>
386             </tr>
387         </table>
388     </form>
389
390     <form action="/cgi-bin/koha/opac-search.pl" method="get">
391         <table>
392             <tr>
393                 <th>Term/Phrase</th>
394                 <th>Count</th>
395             </tr>
396             [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
397             [% IF ( SEARCH_RESULT.even ) %]
398             <tr class="highlight">
399             [% ELSE %]
400             <tr>
401             [% END %]
402                 <td>
403                     <a href="/cgi-bin/koha/opac-search.pl?q=[% SEARCH_RESULT.scan_use |url %]&quot;[% SEARCH_RESULT.title |url %]&quot;">[% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %]</a>
404                 </td>
405                 <td>
406                     [% SEARCH_RESULT.author %]
407                 </td>
408             </tr>
409             [% END %]
410         </table>
411     </form>
412 [% ELSE %]
413
414     <div class="searchresults">
415     <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
416         [% IF ( searchdesc ) %]
417         [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
418         <input type="hidden" name="[% QUERY_INPUT.input_name |html %]" value="[% QUERY_INPUT.input_value |html %]"/>
419         [% END %]
420         [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
421         <input type="hidden" name="[% LIMIT_INPUT.input_name |html %]" value="[% LIMIT_INPUT.input_value |html %]"/>
422         [% END %]
423         [% END %]
424
425         <!-- TABLE RESULTS START -->
426         <table>
427         <tr><td colspan="5" class="resultscontrol">
428         <div class="resort"> <select id="sort_by" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select> <input type="submit" class="submit clearfix" id="sortsubmit" value="Go" /></div>
429         <div class="cartlist">
430             <!-- checkall, clearall are now needed for placehold -->
431             <span class="checkall"></span>
432             <span class="clearall"></span>
433             [% IF ( OpacHighlightedWords ) %]
434                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
435                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
436             [% END %]
437             [% IF ( opacbookbag || virtualshelves ) %]
438                 <span class="addto"></span>
439             [% END %]
440             <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
441             <div id="holdDetails"></div>
442
443             [% IF ( TagsInputEnabled && loggedinusername ) %]
444                             <span id="tagsel_span">
445                               <input id="tagsel_tag" class="submit" type="submit" value="Tag"/>
446                             </span>
447                             <span id="tagsel_form" style="display:none">
448                               <label for="tagsel_new">New tag:</label>
449                               <input name="tagsel_new" id="tagsel_new" maxlength="100" />
450                               <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" />
451                               <a href="#" id="tagsel_cancel">(done)</a>
452                             </span>
453                             <span id="tagsel_status" class="tagsel_tatus" style="display:none;">
454                               Tag status here.
455                             </span>
456             [% END %]
457         </div>
458
459         </td></tr>
460             <!-- Actual Search Results -->
461             [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
462             [% UNLESS ( loop.odd ) %]
463                 <tr class="highlight">
464             [% ELSE %]
465                 <tr>
466             [% END %]
467
468                 <td class="select selectcol">[% IF ( opacbookbag ) %]<input type="checkbox" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>[% ELSE %]
469 [% IF ( virtualshelves ) %]<input type="checkbox" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>[% ELSE %]
470 [% IF ( RequestOnOpac ) %][% UNLESS ( SEARCH_RESULT.norequests ) %][% IF ( opacuserlogin ) %]<input type="checkbox" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>[% END %][% END %][% END %][% END %][% END %]</td>
471                 <td class="select selectcol">[% UNLESS suppress_result_number %][% SEARCH_RESULT.result_number %].[% END %]</td>
472
473                 [% UNLESS ( item_level_itypes ) %]
474                 [% UNLESS ( noItemTypeImages ) %]
475
476                 <td class="itypecol">
477                 [% IF ( SEARCH_RESULT.imageurl ) %]
478                 <img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" alt="[% SEARCH_RESULT.description %]" />
479                 [% END %]
480                 [% IF ( SEARCH_RESULT.score_avg ) %]
481                     <img src="[% themelang %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/>
482                 [% END %]
483                 </td>
484                 [% END %]
485                 [% END %]
486
487                 [% IF ( AuthorisedValueImages ) %]
488                 <td class="itypecol">
489                 [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
490                     [% IF ( authorised_value_image.imageurl ) %]
491                         <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]">
492                     [% END %]
493                 [% END %]
494                 </td>
495                 [% END %]
496
497                 <td>
498                 [% IF ( COinSinOPACResults ) %]
499                     [% IF ( SEARCH_RESULT.coins ) %]
500                         <!-- COinS / Openurl --><span class="Z3988" title="[% SEARCH_RESULT.coins %]"></span>
501                     [% END %]
502                 [% END %]
503
504                 [% IF ( OPACXSLTResultsDisplay ) %]
505                 [% SEARCH_RESULT.XSLTResultsRecord %]
506                 [% ELSE %]
507                 [% IF ( BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
508                                 [% ELSE %]
509                                 [% IF ( BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
510                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
511                                 [% END %]
512                                 [% END %]
513                                 [% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield|html %][% END %]</a>
514                                 [% IF ( SEARCH_RESULT.author ) %]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>
515                                 [% ELSE %]&nbsp;
516                                 [% END %]
517                 <span class="results_summary"><span class="label">Publication:</span>
518                         [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode|html %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear %]
519                     [% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate %][% END %][% END %]
520                         [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages %][% END %]
521                         [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes|html %][% END %]
522                         [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size %][% END %]
523                         [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp %])</i>[% END %]
524                 </span>
525                 [% IF ( SEARCH_RESULT.summary ) %]
526                 <span class="result_summary">
527                     [% SEARCH_RESULT.summary %]
528                 </span>
529                 [% END %]
530                 [% IF ( SEARCH_RESULT.copyrightdate ) %]<span class="results_summary"><span class="label">Date:</span>[% SEARCH_RESULT.copyrightdate %]</span>[% END %]
531
532                 <span class="results_summary">
533                 <span class="label">Availability:</span>
534                     [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
535                     <span class="available"><strong>Copies available:</strong>
536                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
537                     [% IF available_items_loo.this_branch %]<span class="highlight-row-results">[% ELSE %]<span>[% END %]
538                     [% IF ( singleBranchMode ) %]
539                         [% available_items_loo.location %]
540                     [% ELSE %]
541                         [% available_items_loo.branchname %]
542                     [% END %]
543
544                     [% IF ( OPACItemsResultsDisplay ) %]
545                         [% UNLESS ( singleBranchMode ) %][% available_items_loo.location %][% END %]
546                         [% 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 %]
547                     [% END %]
548                     ([% available_items_loo.count %]),
549                     </span>
550                     [% END %]
551                     </span>
552                     [% ELSE %]
553                     [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
554                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
555                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding %]</span>,
556                     [% END %]
557                     [% ELSE %]
558                         <span class="unavailable">No items available:</span>
559                     [% END %]
560                     [% END %]
561                     <span class="unavailable">
562                     [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount %]), [% END %]
563                     [% IF ( SEARCH_RESULT.wthdrawncount ) %] Withdrawn ([% SEARCH_RESULT.wthdrawncount %]), [% END %]
564                     [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount %]),[% END %][% END %]
565                     [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount %]),[% END %]
566                     [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount %]),[% END %]
567                     [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount %]),[% END %]
568                     [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount %]),[% END %]
569                     </span>
570                 </span>
571                 [% END %]
572
573                 [% IF ( SEARCH_RESULT.score_avg ) %]
574                     <span class="result_summary">
575                         <img src="[% themelang %]/../images/Star[% SEARCH_RESULT.score_int %].gif" title="" style="max-height: 15px;"/> <span style="font-size: 85%;">[% SEARCH_RESULT.score_avg %] / 5 (on [% SEARCH_RESULT.num_scores %] rates)</span>
576                         [% IF ( SEARCH_RESULT.num_critics ) %]
577                             <span class="social_data">[% SEARCH_RESULT.num_critics %] Internet user critics</span>
578                         [% END %]
579                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
580                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro %] Professional critics</span>
581                         [% END %]
582                         [% IF ( SEARCH_RESULT.num_videos ) %]
583                             <span class="social_data">[% SEARCH_RESULT.num_videos %] Video extracts</span>
584                         [% END %]
585                         [% IF ( SEARCH_RESULT.num_quotations ) %]
586                             <span class="social_data">[% SEARCH_RESULT.num_quotations %] Quotations</span>
587                         [% END %]
588                     </span>
589                 [% END %]
590
591                 [% IF ( LibraryThingForLibrariesID ) %]<div class="ltfl_reviews"></div>[% END %]
592                 [% IF ( TagsShowEnabled ) %]
593                                 [% IF ( SEARCH_RESULT.TagLoop.size ) %]
594                                         <div class="results_summary"><span class="label">Tags:</span>
595                                         <ul style="display: inline; list-style: none;">[% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]<li style="display: inline; list-style: none;"><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a> <span class="weight">([% TagLoo.weight_total %])</span></li>
596                                             [% END %]
597                                         </ul>
598                                         </div>
599                                 [% END %]
600                 [% END %]
601                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<span class="results_summary"><span class="label">Match:</span> [% SEARCH_RESULT.searchhighlightblob %]</span>[% END %]
602
603
604
605
606                 [% IF ( OpacStarRatings == 'all' ) %]
607                 <div class="results_summary">
608
609 [% FOREACH i  IN [ 1 2 3 4 5  ] %]
610
611 [% IF ( SEARCH_RESULT.rating_avg == i ) %]
612     <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" checked="checked" disabled="disabled"   />
613 [% ELSE   %]
614     <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" disabled="disabled"   />
615 [% END %]
616
617 [% END %]
618                 <input type="hidden" name="biblionumber"  value="[% SEARCH_RESULT.biblionumber %]" />
619                 <input type="hidden" name="loggedinuser"  value="[% loggedinuser %]" />
620
621                 [% IF (  SEARCH_RESULT.rating_total ) > 0  %]
622                     <span id="rating_total_[% SEARCH_RESULT.biblionumber %]">&nbsp;&nbsp;([% SEARCH_RESULT.rating_total %] votes)</span>
623                 [% ELSE %]
624                     <br />
625                 [% END %]
626
627                 </div>
628                 [% END %]
629
630 <span class="results_summary actions"><span class="label">Actions:</span>
631                 [% IF ( RequestOnOpac ) %]
632                     [% UNLESS ( SEARCH_RESULT.norequests ) %]
633                         [% IF ( opacuserlogin ) %]
634                             [% IF ( AllowOnShelfHolds ) %]
635                                 <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
636                             [% ELSE %]
637                                 [% IF ( SEARCH_RESULT.itemsissued ) %]
638                                     <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
639                                 [% END %]
640                             [% END %]
641                         [% END %]
642                     [% END %]
643                 [% END %]
644
645                 [% IF ( TagsInputEnabled ) %]
646                     [% IF ( loggedinusername ) %]
647                         <a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
648                         <span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
649                           <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label>
650                           <input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
651                           <input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
652                           <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
653                         </span>
654                         <span id="newtag[% SEARCH_RESULT.biblionumber %]_status" class="tagstatus" style="display:none;">
655                           Tag status here.
656                         </span>
657                     [% ELSIF ( loop.first ) %]<span id="login4tags">Log in to add tags.</span>
658                     [% END %]
659                 [% END %]
660
661                 [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<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>
662                 [% END %][% END %][% END %]
663                 [% IF ( opacbookbag ) %]
664                     [% IF ( SEARCH_RESULT.incart ) %]
665                         <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>
666                     [% ELSE %]
667                         <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>
668                     [% END %]
669                 [% END %]
670                 </span>
671                 </td><td>
672                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
673             [% IF ( OPACLocalCoverImages ) %]<span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
674                     [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<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="thumbnail" /></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
675
676                 [% IF ( SyndeticsEnabled ) %]
677                     [% IF ( SyndeticsCoverImages ) %]
678                         [% IF SEARCH_RESULT.normalized_isbn %]
679                                 [% IF ( using_https ) %]
680                             <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="thumbnail" /></span>
681                         [% ELSE %]
682                             <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="thumbnail" /></span>
683                     [% END %]
684                     [% ELSE %]
685                         <span class="no-image">No cover image available</span>
686                     [% END %]
687             [% END %]
688                 [% END %]
689
690                 [% IF ( GoogleJackets ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
691         [% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
692                 </a>
693                 [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
694                 [% IF ( IDreamBooksResults ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div class="idbresult" style="display: none;">
695                     [% IF ( IDreamBooksReviews ) %]
696                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]#idb_critic_reviews">
697                     [% ELSE %]
698                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
699                     [% END %]
700                     [% SEARCH_RESULT.normalized_isbn %]</a></div>
701                 [% END %][% END %]
702                 </td>
703                 </tr>
704                 [% END %]
705             </table>
706     </form>
707     <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
708         <!-- The value will be set by holdBiblioNums() in basket.js -->
709         <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
710     </form>
711         </div>
712     [% END %]
713     <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
714
715     [% ELSE %]
716     [% END %]
717
718     [% IF ( suggestion ) %]
719 [% IF ( AnonSuggestions ) %]<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>[% ELSE %][% IF ( loggedinusername ) %]<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>[% END %][% END %]
720 [% END %]
721 </div>
722 </div>
723 </div>
724         [% IF ( opacfacets ) %]
725 <div class="yui-b"><div id="facetcontainer" class="container">
726         <!-- FACETS START -->
727         [% INCLUDE 'opac-facets.inc' %]
728         <!-- FACETS END -->
729 </div></div>
730         [% END %]
731 </div>
732
733 [% IF ( LibraryThingForLibrariesID ) %]
734 [% IF ( using_https ) %]
735 <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
736 [% ELSE %]
737 <script src="http://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
738 [% END %]
739 [% END %]
740
741 [% INCLUDE 'opac-bottom.inc' %]