Bug 9554: single quote in didyoumean
[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 | uri %]");
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 [% IF ( DidYouMean ) %]
307     $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
308         function() {
309             $(".searchsuggestion").parent().parent().css({
310                 "border-color": "#F4ECBE",
311                 "background-color": "#FFFBEA"
312             });
313         });
314 [% END %]
315
316 });
317
318 //]]>
319 </script>
320 </head>
321 <body id="results">
322     [% IF ( opacfacets ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
323    <div id="bd">
324
325 [% INCLUDE 'masthead.inc' %]
326
327
328     <div id="yui-main">
329     <div class="yui-b">
330     <div id="userresults" class="container">
331     [% IF ( DidYouMean ) %]
332         <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>
333     [% END %]
334     <div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div>
335   [% IF ( koha_spsuggest ) %]
336     Did you mean:
337     <ul style="list-style: none;">
338         [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
339         <li>
340             <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion %]">[% SPELL_SUGGES.spsuggestion %]</a>
341         </li>
342         [% END %]
343     </ul>
344 [% END %]
345
346 [% IF ( query_error ) %]
347 <div class="dialog alert">
348     <h4>Error:</h4>
349     [% query_error %]
350 </div>
351 [% END %]
352
353 <!-- Search Results Table -->
354 [% IF ( total ) %]
355 [% IF ( scan ) %]
356     <h1>Scan index:</h1>
357     <form action="/cgi-bin/koha/opac-search.pl" method="get">
358         <table>
359             <tr>
360                 <td>
361                     Scan index for: <input type="text" name="q" id="scan-index" size="35" value="" />
362                 </td>
363             </tr>
364             <tr>
365                 <td>
366                     <label for="scan-index">Indexed in:</label>
367                     <select name="idx" id="scan-index">
368                         <option value="">Any word</option>
369                         <option value="kw,phr:">Any phrase</option>
370                         <option value="ti:">Title</option>
371                         <option value="ti,phr:">Title phrase</option>
372                         <option value="au,phr:">Author</option>
373                         <option value="su:">Subject</option>
374                         <option value="su,phr:">Subject phrase</option>
375                         <option value="se:">Series</option>
376                         <option value="pb:">Publisher</option>
377                         <option value="nt:">Notes</option>
378                         <option value="se:">Series Title</option>
379                         <option value="sn:">ISBN</option>
380                         <option value="ss:">ISSN</option>
381                     </select>
382                     <input type="hidden" name="scan" value="1" />
383                 </td>
384             </tr>
385         </table>
386     </form>
387
388     <form action="/cgi-bin/koha/opac-search.pl" method="get">
389         <table>
390             <tr>
391                 <th>Term/Phrase</th>
392                 <th>Count</th>
393             </tr>
394             [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
395             [% IF ( SEARCH_RESULT.even ) %]
396             <tr class="highlight">
397             [% ELSE %]
398             <tr>
399             [% END %]
400                 <td>
401                     <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>
402                 </td>
403                 <td>
404                     [% SEARCH_RESULT.author %]
405                 </td>
406             </tr>
407             [% END %]
408         </table>
409     </form>
410 [% ELSE %]
411
412     <div class="searchresults">
413     <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
414         [% IF ( searchdesc ) %]
415         [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
416         <input type="hidden" name="[% QUERY_INPUT.input_name |html %]" value="[% QUERY_INPUT.input_value |html %]"/>
417         [% END %]
418         [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
419         <input type="hidden" name="[% LIMIT_INPUT.input_name |html %]" value="[% LIMIT_INPUT.input_value |html %]"/>
420         [% END %]
421         [% END %]
422
423         <!-- TABLE RESULTS START -->
424         <table>
425         <tr><td colspan="5" class="resultscontrol">
426         <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>
427         <div class="cartlist">
428             <!-- checkall, clearall are now needed for placehold -->
429             <span class="checkall"></span>
430             <span class="clearall"></span>
431             [% IF ( OpacHighlightedWords ) %]
432                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
433                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
434             [% END %]
435             [% IF ( opacbookbag || virtualshelves ) %]
436                 <span class="addto"></span>
437             [% END %]
438             <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
439             <div id="holdDetails"></div>
440
441             [% IF ( TagsInputEnabled && loggedinusername ) %]
442                             <span id="tagsel_span">
443                               <input id="tagsel_tag" class="submit" type="submit" value="Tag"/>
444                             </span>
445                             <span id="tagsel_form" style="display:none">
446                               <label for="tagsel_new">New tag:</label>
447                               <input name="tagsel_new" id="tagsel_new" maxlength="100" />
448                               <input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" />
449                               <a href="#" id="tagsel_cancel">(done)</a>
450                             </span>
451                             <span id="tagsel_status" class="tagsel_tatus" style="display:none;">
452                               Tag status here.
453                             </span>
454             [% END %]
455         </div>
456
457         </td></tr>
458             <!-- Actual Search Results -->
459             [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
460             [% UNLESS ( loop.odd ) %]
461                 <tr class="highlight">
462             [% ELSE %]
463                 <tr>
464             [% END %]
465
466                 <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 %]
467 [% IF ( virtualshelves ) %]<input type="checkbox" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" /> <label for="bib[% SEARCH_RESULT.biblionumber %]"></label>[% ELSE %]
468 [% 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>
469                 <td class="select selectcol">[% UNLESS suppress_result_number %][% SEARCH_RESULT.result_number %].[% END %]</td>
470
471                 [% UNLESS ( item_level_itypes ) %]
472                 [% UNLESS ( noItemTypeImages ) %]
473
474                 <td class="itypecol">
475                 [% IF ( SEARCH_RESULT.imageurl ) %]
476                 <img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" alt="[% SEARCH_RESULT.description %]" />
477                 [% END %]
478                 [% IF ( SEARCH_RESULT.score_avg ) %]
479                     <img src="[% themelang %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/>
480                 [% END %]
481                 </td>
482                 [% END %]
483                 [% END %]
484
485                 [% IF ( AuthorisedValueImages ) %]
486                 <td class="itypecol">
487                 [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
488                     [% IF ( authorised_value_image.imageurl ) %]
489                         <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]">
490                     [% END %]
491                 [% END %]
492                 </td>
493                 [% END %]
494
495                 <td>
496                 [% IF ( COinSinOPACResults ) %]
497                     [% IF ( SEARCH_RESULT.coins ) %]
498                         <!-- COinS / Openurl --><span class="Z3988" title="[% SEARCH_RESULT.coins %]"></span>
499                     [% END %]
500                 [% END %]
501
502                 [% IF ( OPACXSLTResultsDisplay ) %]
503                 [% SEARCH_RESULT.XSLTResultsRecord %]
504                 [% ELSE %]
505                 [% IF ( BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
506                                 [% ELSE %]
507                                 [% IF ( BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
508                                 [% ELSE %]<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
509                                 [% END %]
510                                 [% END %]
511                                 [% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield|html %][% END %]</a>
512                                 [% 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>
513                                 [% ELSE %]&nbsp;
514                                 [% END %]
515                 <span class="results_summary"><span class="label">Publication:</span>
516                         [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode|html %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear %]
517                     [% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate %][% END %][% END %]
518                         [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages %][% END %]
519                         [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes|html %][% END %]
520                         [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size %][% END %]
521                         [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp %])</i>[% END %]
522                 </span>
523                 [% IF ( SEARCH_RESULT.summary ) %]
524                 <span class="result_summary">
525                     [% SEARCH_RESULT.summary %]
526                 </span>
527                 [% END %]
528                 [% IF ( SEARCH_RESULT.copyrightdate ) %]<span class="results_summary"><span class="label">Date:</span>[% SEARCH_RESULT.copyrightdate %]</span>[% END %]
529
530                 <span class="results_summary">
531                 <span class="label">Availability:</span>
532                     [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
533                     <span class="available"><strong>Copies available:</strong>
534                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
535                     [% IF ( singleBranchMode ) %]
536                         [% available_items_loo.location %]
537                     [% ELSE %]
538                         [% available_items_loo.branchname %]
539                     [% END %]
540
541                     [% IF ( OPACItemsResultsDisplay ) %]
542                         [% UNLESS ( singleBranchMode ) %][% available_items_loo.location %][% END %]
543                         [% 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 %]
544                     [% END %]
545                     ([% available_items_loo.count %]),
546                     [% END %]
547                     </span>
548                     [% ELSE %]
549                     [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
550                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
551                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding %]</span>,
552                     [% END %]
553                     [% ELSE %]
554                         <span class="unavailable">No items available:</span>
555                     [% END %]
556                     [% END %]
557                     <span class="unavailable">
558                     [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount %]), [% END %]
559                     [% IF ( SEARCH_RESULT.wthdrawncount ) %] Withdrawn ([% SEARCH_RESULT.wthdrawncount %]), [% END %]
560                     [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount %]),[% END %][% END %]
561                     [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount %]),[% END %]
562                     [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount %]),[% END %]
563                     [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount %]),[% END %]
564                     [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount %]),[% END %]
565                     </span>
566                 </span>
567                 [% END %]
568
569                 [% IF ( SEARCH_RESULT.score_avg ) %]
570                     <span class="result_summary">
571                         <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>
572                         [% IF ( SEARCH_RESULT.num_critics ) %]
573                             <span class="social_data">[% SEARCH_RESULT.num_critics %] Internet user critics</span>
574                         [% END %]
575                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
576                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro %] Professional critics</span>
577                         [% END %]
578                         [% IF ( SEARCH_RESULT.num_videos ) %]
579                             <span class="social_data">[% SEARCH_RESULT.num_videos %] Video extracts</span>
580                         [% END %]
581                         [% IF ( SEARCH_RESULT.num_quotations ) %]
582                             <span class="social_data">[% SEARCH_RESULT.num_quotations %] Quotations</span>
583                         [% END %]
584                     </span>
585                 [% END %]
586
587                 [% IF ( LibraryThingForLibrariesID ) %]<div class="ltfl_reviews"></div>[% END %]
588                 [% IF ( TagsShowEnabled ) %]
589                                 [% IF ( SEARCH_RESULT.TagLoop.size ) %]
590                                         <div class="results_summary"><span class="label">Tags:</span>
591                                         <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>
592                                             [% END %]
593                                         </ul>
594                                         </div>
595                                 [% END %]
596                 [% END %]
597                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<span class="results_summary"><span class="label">Match:</span> [% SEARCH_RESULT.searchhighlightblob %]</span>[% END %]
598
599
600
601
602                 [% IF ( OpacStarRatings == 'all' ) %]
603                 <div class="results_summary">
604
605 [% FOREACH i  IN [ 1 2 3 4 5  ] %]
606
607 [% IF ( SEARCH_RESULT.rating_avg == i ) %]
608     <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" checked="checked" disabled="disabled"   />
609 [% ELSE   %]
610     <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber %]" value="[% i %]" disabled="disabled"   />
611 [% END %]
612
613 [% END %]
614                 <input type="hidden" name="biblionumber"  value="[% SEARCH_RESULT.biblionumber %]" />
615                 <input type="hidden" name="loggedinuser"  value="[% loggedinuser %]" />
616
617                 [% IF (  SEARCH_RESULT.rating_total ) > 0  %]
618                     <span id="rating_total_[% SEARCH_RESULT.biblionumber %]">&nbsp;&nbsp;([% SEARCH_RESULT.rating_total %] votes)</span>
619                 [% ELSE %]
620                     <br />
621                 [% END %]
622
623                 </div>
624                 [% END %]
625
626 <span class="results_summary actions"><span class="label">Actions:</span>
627                 [% IF ( RequestOnOpac ) %]
628                     [% UNLESS ( SEARCH_RESULT.norequests ) %]
629                         [% IF ( opacuserlogin ) %]
630                             [% IF ( AllowOnShelfHolds ) %]
631                                 <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-->
632                             [% ELSE %]
633                                 [% IF ( SEARCH_RESULT.itemsissued ) %]
634                                     <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-->
635                                 [% END %]
636                             [% END %]
637                         [% END %]
638                     [% END %]
639                 [% END %]
640
641                 [% IF ( TagsInputEnabled ) %]
642                     [% IF ( loggedinusername ) %]
643                         <a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
644                         <span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
645                           <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label>
646                           <input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
647                           <input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
648                           <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
649                         </span>
650                         <span id="newtag[% SEARCH_RESULT.biblionumber %]_status" class="tagstatus" style="display:none;">
651                           Tag status here.
652                         </span>
653                     [% ELSIF ( loop.first ) %]<span id="login4tags">Log in to add tags.</span>
654                     [% END %]
655                 [% END %]
656
657                 [% 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>
658                 [% END %][% END %][% END %]
659                 [% IF ( opacbookbag ) %]
660                     [% IF ( SEARCH_RESULT.incart ) %]
661                         <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>
662                     [% ELSE %]
663                         <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>
664                     [% END %]
665                 [% END %]
666                 </span>
667                 </td><td>
668                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
669             [% IF ( OPACLocalCoverImages ) %]<span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
670                     [% 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 %]
671
672                 [% IF ( SyndeticsEnabled ) %]
673                     [% IF ( SyndeticsCoverImages ) %]
674                         [% IF SEARCH_RESULT.normalized_isbn %]
675                                 [% IF ( using_https ) %]
676                             <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" />
677                         [% ELSE %]
678                             <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" />
679                     [% END %]
680                     [% ELSE %]
681                         <span class="no-image">No cover image available</span>
682                     [% END %]
683             [% END %]
684                 [% END %]
685
686                 [% 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 %]
687         [% 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 %]
688                 </a>
689                 [% 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 %]
690                 [% IF ( IDreamBooksResults ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div class="idbresult" style="display: none;">
691                     [% IF ( IDreamBooksReviews ) %]
692                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]#idb_critic_reviews">
693                     [% ELSE %]
694                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
695                     [% END %]
696                     [% SEARCH_RESULT.normalized_isbn %]</a></div>
697                 [% END %][% END %]
698                 </td>
699                 </tr>
700                 [% END %]
701             </table>
702     </form>
703     <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
704         <!-- The value will be set by holdBiblioNums() in basket.js -->
705         <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
706     </form>
707         </div>
708     [% END %]
709     <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
710
711     [% ELSE %]
712     [% END %]
713
714     [% IF ( suggestion ) %]
715 [% 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 %]
716 [% END %]
717 </div>
718 </div>
719 </div>
720         [% IF ( opacfacets ) %]
721 <div class="yui-b"><div id="facetcontainer" class="container">
722         <!-- FACETS START -->
723         [% INCLUDE 'opac-facets.inc' %]
724         <!-- FACETS END -->
725 </div></div>
726         [% END %]
727 </div>
728
729 [% IF ( LibraryThingForLibrariesID ) %]
730 [% IF ( using_https ) %]
731 <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
732 [% ELSE %]
733 <script src="http://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID %]&amp;systype=koha" type="text/javascript"></script>
734 [% END %]
735 [% END %]
736
737 [% INCLUDE 'opac-bottom.inc' %]