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