Bug 18884: Advanced search on staff client, Availability limit not properly limiting
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / results.tt
1 [% USE Koha %]
2 [% USE Biblio %]
3 [% USE KohaDates %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Catalog &rsaquo; [% IF ( searchdesc ) %]Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %][% ELSE %]You did not specify any search criteria[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'browser-strings.inc' %]
8 [% IF BiblioDefaultViewmarc %]
9     [% SET DetailPage="MARCdetail.pl" %]
10 [% ELSIF BiblioDefaultViewlabeled_marc %]
11     [% SET DetailPage="labeledMARCdetail.pl" %]
12 [% ELSIF BiblioDefaultViewisbd %]
13     [% SET DetailPage="ISBDdetail.pl" %]
14 [% ELSE %]
15     [% SET DetailPage="detail.pl" %]
16 [% END %]
17
18 <!--[if lt IE 9]>
19 <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
20 <![endif]-->
21 <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
22 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
23 <script type="text/javascript">
24 //<![CDATA[
25 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
26 var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be placed on hold.");
27 var q_array = new Array();  // will hold search terms, if present
28 [% IF ( AmazonCoverImages ) %]
29 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
30 function verify_images() {
31     $("img").each(function(i){
32         if ((this.src.indexOf('images-amazon.com') >= 0) || (this.src.indexOf('images.amazon.com') >=0)) {
33             w = this.width;
34             h = this.height;
35             if ((w == 1) || (h == 1)) {
36                 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
37             } else if ((this.complete != null) && (!this.complete)) {
38                 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
39             }
40         }
41     });
42 }
43
44 $(window).load(function() {
45         verify_images();
46      });
47 [% END %]
48 function Dopop(link) {
49         newin=window.open(link,'popup','width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
50 }
51
52 $(document).ready(function() {
53
54     $("#searchheader").fixFloat();
55
56     $("#cartsubmit").click(function(e){
57         e.preventDefault();
58         var checkboxes = $("#searchresults").find(":checkbox");
59         addMultiple(checkboxes);
60     });
61
62     $(".addtolist").on("click",function(e){
63         e.preventDefault();
64         var shelfnumber = $(this).data("shelfnumber");
65         var checkboxes = $("#searchresults").find(":checkbox");
66         var vshelf = vShelfAdd(checkboxes);
67         if( vshelf ){
68             if( $(this).hasClass("morelists") ){
69                 Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?' + vshelf);
70             } else if( $(this).hasClass("newlist") ){
71                 Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vshelf);
72             } else {
73                 Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vshelf);
74             }
75         }
76     });
77
78 $("#z3950submit").click(function(){
79     PopupZ3950();
80     return false;
81 });
82
83 $("#searchheader").on("click",".placehold", function(){
84     $("#holdFor").val("");
85     placeHold();
86     $(".btn-group").removeClass("open");
87     return false;
88 });
89
90 $(".placeholdfor").click(function(){
91     holdForPatron();
92     $(".btn-group").removeClass("open");
93     return false;
94 });
95
96 $("#forgetholdfor").click(function(){
97     forgetPatron();
98     $(".btn-group").removeClass("open");
99     return false;
100 });
101
102  $("#tagsel_span").html("<input id=\"tagsel_tag\" class=\"submit\" type=\"submit\" value=\"Tag\"/>");
103
104     $(".selection").show();
105     [% IF ( query_desc ) %]
106     toHighlight = $("p,span.results_summary,a.title");
107         var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
108         q_array = query_desc.split(" ");
109         // ensure that we don't have "" at the end of the array, which can
110         // break the highlighter
111         while (q_array.length > 0 && q_array[q_array.length-1] == "") {
112             q_array = q_array.splice(0,-1);
113         }
114         highlightOn();
115         $("#highlight_toggle_on" ).hide().click(function(e) {
116             e.preventDefault();
117              highlightOn();
118         });
119         $("#highlight_toggle_off").show().click(function(e) {
120             e.preventDefault();
121             highlightOff();
122         });
123     [% END %]
124
125     [% IF (SEARCH_RESULTS) %]
126         var newresults = [
127             [%- FOREACH result IN SEARCH_RESULTS -%]
128                 [%- result.biblionumber %],
129             [%- END -%]
130         ];
131         var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
132         browser.create([% SEARCH_RESULTS.first.result_number %], '[% query_cgi %]', '[% limit_cgi | uri %]','[% sort_cgi | uri %]',
133                newresults, '[% total %]');
134     [% END %]
135     [% IF (gotoPage && gotoNumber) %]
136         [% IF (gotoNumber == 'first') %]
137             window.location = '/cgi-bin/koha/catalogue/[% gotoPage %]?biblionumber=' + [% SEARCH_RESULTS.first.biblionumber %] + '&searchid=[% searchid %]';
138         [% ELSIF (gotoNumber == 'last') %]
139             window.location = '/cgi-bin/koha/catalogue/[% gotoPage %]?biblionumber=' + [% SEARCH_RESULTS.last.biblionumber %] + '&searchid=[% searchid %]';
140         [% END %]
141     [% END %]
142
143     [% IF LocalCoverImages %]
144         KOHA.LocalCover.LoadResultsCovers();
145     [% END %]
146
147     $("#select_all").on("click",function(e){
148         e.preventDefault();
149         selectAll();
150     });
151     $("#clear_all").on("click",function(e){
152         e.preventDefault();
153         clearAll();
154     });
155
156     $("#searchresults").on("click",".addtocart",function(e){
157         e.preventDefault();
158         var selection_id = this.id;
159         var biblionumber = selection_id.replace("cart","");
160         addRecord(biblionumber);
161     });
162
163     $("#searchresults").on("click",".cartRemove",function(e){
164         e.preventDefault();
165         var selection_id = this.id;
166         var biblionumber = selection_id.replace("cartR","");
167         delSingleRecord(biblionumber);
168     });
169
170 });
171
172
173 [% IF ( query_desc ) %]function highlightOff() {
174     toHighlight.removeHighlight();
175     $(".highlight_toggle").toggle();
176 }
177 function highlightOn() {
178     var x;
179     for (x in q_array) {
180         q_array[x] = q_array[x].toLowerCase();
181         var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
182         if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
183             toHighlight.highlight(q_array[x]);
184         }
185     }
186     $(".highlight_toggle").toggle();
187 }[% END %]
188
189 function selectAll () {
190     $(".selection").prop("checked", true);
191 }
192 function clearAll () {
193     $(".selection").prop("checked", false);
194 }
195 function placeHold () {
196     var checkedItems = $(".selection:checked");
197     if ($(checkedItems).size() == 0) {
198         alert(MSG_NO_ITEM_SELECTED);
199         return false;
200     }
201     var bibs = "";
202     var badBibs = false;
203     $(checkedItems).each(function() {
204         var bib = $(this).val();
205         if ($("#reserve_" + bib).size() == 0) {
206             alert(MSG_NON_RESERVES_SELECTED);
207             badBibs = true;
208             return false;
209         }
210         bibs += bib + "/";
211     });
212     if (badBibs) {
213         return false;
214     }
215     $("#hold_form_biblios").val(bibs);
216     $("#hold_form").submit();
217     return false;
218 }
219
220 function forgetPatron(){
221     $.removeCookie("holdfor", { path: '/' });
222     $(".holdforlink").remove();
223     $("#placeholdc").html("<a class=\"btn btn-default btn-xs placehold\" href=\"#\"><i class=\"fa fa-sticky-note-o\"></i> "+_("Place hold")+"</a>");
224 }
225
226 function addToList () {
227     var checkedItems = $(".selection:checked");
228     if ($(checkedItems).size() == 0) {
229         alert(MSG_NO_ITEM_SELECTED);
230         return false;
231     }
232     var bibs = "";
233     $(checkedItems).each(function() {
234         bibs += $(this).val() + "/";
235     });
236
237     var url = "/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumbers=" + bibs;
238         window.open(url, 'Add_to_virtualshelf', 'width=500, height=400, toolbar=false, scrollbars=yes');
239     return false;
240 }
241
242 /* this function open a popup to search on z3950 server.  */
243 function PopupZ3950() {
244     var strQuery = GetZ3950Terms();
245     if(strQuery){
246         window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
247     }
248 }
249 /* provide Z3950 search points */
250 function GetZ3950Terms(){
251         var strQuery="&frameworkcode=";
252         [% FOREACH z3950_search_param IN z3950_search_params %]
253         strQuery += "&" + "[% z3950_search_param.name |uri %]" + "=" + "[% z3950_search_param.value |uri %]";
254         [% END %]
255         return strQuery;
256 }
257
258 function holdfor(){
259     $("#holdFor").val("");
260     placeHold();
261 }
262
263 function holdForPatron() {
264     $("#holdFor").val("[% holdfor_cardnumber %]");
265     placeHold();
266 }
267 //]]>
268 </script>
269 </head>
270 <body id="catalog_results" class="catalog">
271 [% INCLUDE 'header.inc' %]
272 [% INCLUDE 'cat-search.inc' %]
273
274 <div id="breadcrumbs">
275          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
276 &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
277 &rsaquo; Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
278 </div>
279
280 <div id="doc3" class="yui-t1">
281    <div id="bd">
282     <div id="yui-main">
283     <div class="yui-b">
284
285     [% IF ( outer_sup_results_loop ) %]
286     <div class="yui-ge">
287     <div class="yui-u first">
288     [% END %]
289
290     [% IF ( koha_spsuggest ) %]
291         <div style="font-size: 12px;">Did you mean:
292             <ul style="list-style: none;">
293             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
294             <li>
295                 <a href="/cgi-bin/koha/catalogue/search.pl?q=[% SPELL_SUGGES.spsuggestion %]">[% SPELL_SUGGES.spsuggestion %]</a>
296             </li>
297             [% END %]
298             </ul>
299         </div>
300     [% END %]
301
302     [% IF ( total ) %]
303
304         <h3>
305             [% total %] result(s) found [% IF ( query_desc ) %]for <span class="results_query_desc">'[% query_desc |html %]'</span>[% END %][% IF limit_desc  %]&nbsp;with limit(s): <span class="results_limit_desc">'[% limit_desc | html %]'</span>[% END %][% IF ( LibraryName ) %] in [% LibraryName %] Catalog[% END %].
306         </h3>
307
308         <div id="searchheader">
309
310             <div id="selection_ops">
311                 <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a>
312                 |
313                 <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
314                 |
315                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
316                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
317                 |
318
319             [% IF ( intranetbookbag ) %]
320                 <div class="btn-group">
321                     <a id="cartsubmit" class="btn btn-default btn-xs" href="#"><i class="fa fa-shopping-cart"></i> Add to cart</a>
322                 </div>
323             [% END %]
324
325             [% IF Koha.Preference('virtualshelves') %]
326                 <div class="btn-group">
327                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
328                         <i class="fa fa-list"></i> Add to list <span class="caret"></span>
329                     </button>
330                     <ul class="dropdown-menu">
331                         [% IF add_to_some_private_shelves.count %]
332                             <li class="dropdown-header">Your lists</li>
333                             [% SET number_of_private_shelves = 0 %]
334                             [% FOREACH s IN add_to_some_private_shelves %]
335                                 [% IF shelfnumber != s.shelfnumber %]
336                                     <li>
337                                         <a href="#" class="addtolist" data-shelfnumber="[% s.shelfnumber %]">[% s.shelfname |html %]</a>
338                                     </li>
339                                     [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
340                                     [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
341                                 [% END %]
342                             [% END %]
343                         [% END %]
344                         [% IF add_to_some_public_shelves.count %]
345                             <li class="dropdown-header">Public lists</li>
346                             [% SET number_of_public_shelves = 0 %]
347                             [% FOREACH s IN add_to_some_public_shelves %]
348                                 [% IF shelfnumber != s.shelfnumber %]
349                                     <li>
350                                         <a href="#" data-shelfnumber="[% s.shelfnumber %]" class="addtolist">[% s.shelfname |html %]</a>
351                                     </li>
352                                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
353                                     [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
354                                 [% END %]
355                             [% END %]
356                         [% END %]
357                         <li role="separator" class="divider"></li>
358                         [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %]
359                             <li>
360                                 <a href="#" class="addtolist morelists">More lists</a>
361                             </li>
362                         [% END %]
363                         <li>
364                             <a href="#" class="addtolist newlist">New list</a>
365                         </li>
366                     </ul>
367                 </div>
368             [% END %]
369
370
371                 [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %]
372                 [% IF ( holdfor ) %]
373                     <div id="placeholdc" class="btn-group">
374                         <button class="btn btn-default btn-xs placehold"><i class="fa fa-sticky-note-o"></i> Place hold</button>
375                         <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
376                         <span class="caret"></span>
377                         </button>
378                         <ul class="dropdown-menu">
379                             <li><a href="#" class="placehold">Place hold</a></li>
380                             <li><a href="#" class="placeholdfor">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></li>
381                             <li class="divider"></li>
382                             <li><a href="#" id="forgetholdfor">Forget  [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></li>
383                         </ul>
384                     </div>
385                 [% ELSE %]
386                     <div id="placeholdc" class="btn-group"><a class="btn btn-default btn-xs placehold" href="#"><i class="fa fa-sticky-note-o"></i> Place hold</a></div>
387                 [% END %]
388                 [% END %]
389
390                 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] <div class="btn-group"><a class="btn btn-default btn-xs" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50/SRU search</a></div>[% END %]
391
392             [% IF ( searchdesc ) %]
393                 [% BLOCK sort_search_query ~%]
394                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS ~%]
395                         &amp;[% QUERY_INPUT.input_name |html %]=[% QUERY_INPUT.input_value |html %]
396                     [%~ END %]
397                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS ~%]
398                         &amp;[% LIMIT_INPUT.input_name |html %]=[% LIMIT_INPUT.input_value |html %]
399                     [%~ END %]
400                 [%~ END %]
401             [% END %]
402
403             <div class="btn-group">
404                 <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
405                     Sort <span class="caret"></span>
406                 </button>
407                 <ul class="dropdown-menu">
408                     [% IF ( sort_by == "relevance_dsc" ) %]
409                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=relevance[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Relevance</a></li>
410                     [% ELSE %]
411                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=relevance[% PROCESS sort_search_query %]">Relevance</a></li>
412                     [% END %]
413                     <li class="dropdown-header">Popularity</li>
414                     [% IF ( sort_by == "popularity_dsc" ) %]
415                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Popularity (most to least)</a></li>
416                     [% ELSE %]
417                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_dsc[% PROCESS sort_search_query %]">Popularity (most to least)</a></li>
418                     [% END %]
419
420                     [% IF ( sort_by == "popularity_asc" ) %]
421                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Popularity (least to most)</a></li>
422                     [% ELSE %]
423                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=popularity_asc[% PROCESS sort_search_query %]">Popularity (least to most)</a></li>
424                     [% END %]
425
426                     <li class="dropdown-header">Author</li>
427
428                     [% IF ( sort_by == "author_az" || sort_by == "author_asc" ) %]
429                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_a[% PROCESS sort_search_query %]z"><i class="fa fa-check"></i> Author (A-Z)</a></li>
430                     [% ELSE %]
431                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_az[% PROCESS sort_search_query %]">Author (A-Z)</a></li>
432                     [% END %]
433
434                     [% IF ( sort_by == "author_za" || sort_by == "author_dsc" ) %]
435                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_za[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Author (Z-A)</a></li>
436                     [% ELSE %]
437                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=author_za[% PROCESS sort_search_query %]">Author (Z-A)</a></li>
438                     [% END %]
439
440                     <li class="dropdown-header">Call number</li>
441
442                     [% IF ( sort_by == "call_number_asc" ) %]
443                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Call Number (0-9 to A-Z)</a></li>
444                     [% ELSE %]
445                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_asc[% PROCESS sort_search_query %]">Call Number (0-9 to A-Z)</a></li>
446                     [% END %]
447
448                     [% IF ( sort_by == "call_number_dsc" ) %]
449                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Call number (Z-A to 9-0)</a></li>
450                     [% ELSE %]
451                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=call_number_dsc[% PROCESS sort_search_query %]">Call number (Z-A to 9-0)</a></li>
452                     [% END %]
453
454                     <li class="dropdown-header">Dates</li>
455                     [% IF ( sort_by == "pubdate_dsc" ) %]
456                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Publication/Copyright date: newest to oldest</a></li>
457                     [% ELSE %]
458                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_dsc[% PROCESS sort_search_query %]">Publication/Copyright date: newest to oldest</a></li>
459                     [% END %]
460
461                     [% IF ( sort_by == "pubdate_asc" ) %]
462                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Publication/Copyright date: oldest to newest</a></li>
463                     [% ELSE %]
464                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=pubdate_asc[% PROCESS sort_search_query %]">Publication/Copyright date: oldest to newest</a></li>
465                     [% END %]
466
467                     [% IF ( sort_by == "acqdate_dsc" ) %]
468                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_dsc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Acquisition date: newest to oldest</a></li>
469                     [% ELSE %]
470                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_dsc[% PROCESS sort_search_query %]">Acquisition date: newest to oldest</a></li>
471                     [% END %]
472
473                     [% IF ( sort_by == "acqdate_asc" ) %]
474                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_asc[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Acquisition date: oldest to newest</a></li>
475                     [% ELSE %]
476                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=acqdate_asc[% PROCESS sort_search_query %]">Acquisition date: oldest to newest</a></li>
477                     [% END %]
478
479                     <li class="dropdown-header">Title</li>
480                     [% IF ( sort_by == "title_az" || sort_by == "title_asc" ) %]
481                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_az[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Title (A-Z)</a></li>
482                     [% ELSE %]
483                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_az[% PROCESS sort_search_query %]">Title (A-Z)</a></li>
484                     [% END %]
485
486                     [% IF ( sort_by == "title_za" || sort_by == "title_dsc" ) %]
487                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_za[% PROCESS sort_search_query %]"><i class="fa fa-check"></i> Title (Z-A)</a></li>
488                     [% ELSE %]
489                         <li><a href="/cgi-bin/koha/catalogue/search.pl?sort_by=title_za[% PROCESS sort_search_query %]">Title (Z-A)</a></li>
490                     [% END %]
491                 </ul>
492             </div>
493             </div>
494
495         </div>
496     [% ELSE %]
497         <div id="searchheader">
498                         <form method="post" name="fz3950" class="fz3950bigrpad">
499                 <button class="btn btn-default" type="button" id="z3950submit"><i class="fa fa-search"></i> Z39.50/SRU search</button>
500                         </form>
501             <h3>No results found</h3>
502         [% IF ( searchdesc ) %]
503             <p>
504                 No results match your search [% IF ( query_desc ) %]for <span style="font-weight: bold;">'[% query_desc |html %]'</span>[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s): <span style="font-weight: bold;">'[% limit_desc | html %]'</span>[% END %][% IF ( LibraryName ) %] in [% LibraryName %] Catalog[% END %].
505             </p>
506         [% ELSE %]
507             <p>You did not specify any search criteria.</p>
508         [% END %]
509                 </div>
510     [% END %]
511
512     [% IF ( query_error ) %]
513         <div class="dialog alert"><p><strong>Error:</strong> [% query_error %]</p></div>
514     [% END %]
515
516     <!-- Search Results Table -->
517     [% IF ( total ) %]
518         [% IF ( scan ) %]
519             <h1>Scan index:</h1>
520             <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
521             <table>
522                 <tr>
523                     <td>
524                         [% IF ( scan_search_term_to_use ) %]
525                             Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="[% scan_search_term_to_use | html %]" />
526                         [% ELSE %]
527                             Scan Index for: <input type="text" name="q" id="scan-index" size="35" value="" />
528                         [% END %]
529                     </td>
530                 </tr>
531                 <tr>
532                     <td>
533                         <label for="scan-index">Indexed in:</label>
534                         <select name="idx" id="scan-index">
535                             <option value="">Any word</option>
536                             [% IF ( ms_anycommaphr) %]<option selected="selected" value="any,phr">Any phrase</option>
537                             [% ELSE %]<option value="any,phr">Any phrase</option>[% END %]
538                             [% IF ( ms_ti ) %]<option selected="selected" value="ti">Title</option>
539                             [% ELSE %]<option value="ti">Title</option>[% END %]
540                             [% IF ( ms_ticommaphr ) %]<option selected="selected" value="ti,phr">Title phrase</option>
541                             [% ELSE %]<option value="ti,phr">Title phrase</option>[% END %]
542                             [% IF ( ms_aucommaphr ) %]<option selected="selected" value="au,phr">Author</option>
543                             [% ELSE %]<option value="au,phr">Author</option>[% END %]
544                             [% IF ( ms_su ) %]<option selected="selected" value="su">Subject</option>
545                             [% ELSE %]<option value="su">Subject</option>[% END %]
546                             [% IF ( ms_sucommaphr ) %]<option selected="selected" value="su,phr">Subject phrase</option>
547                             [% ELSE %]<option value="su,phr">Subject phrase</option>[% END %]
548                             [% IF ( ms_se ) %]<option selected="selected" value="se">Series</option>
549                             [% ELSE %]<option value="su">Series</option>[% END %]
550                             [% IF ( ms_pb ) %]<option selected="selected" value="pb">Publisher</option>
551                             [% ELSE %]<option value="pb">Publisher</option>[% END %]
552                             [% IF ( ms_nt ) %]<option selected="selected" value="nt">Notes</option>
553                             [% ELSE %]<option value="nt">Notes</option>[% END %]
554                             [% IF ( ms_sn ) %]<option selected="selected" value="sn">ISBN</option>
555                             [% ELSE %]<option value="sn">ISBN</option>[% END %]
556                             [% IF ( ms_ss ) %]<option selected="selected" value="ss">ISSN</option>
557                             [% ELSE %]<option value="ss">ISSN</option>[% END %]
558                         </select>
559                         <input type="hidden" name="scan" value="1" />
560                     </td>
561                 </tr>
562             </table>
563             </form>
564
565             <form action="/cgi-bin/koha/catalogue/search.pl" method="get">
566             <table>
567                 <tr>
568                     <th>Term/Phrase</th>
569                     <th>Count</th>
570                 </tr>
571                 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
572                     <tr>
573                         <td>
574                             <a href="/cgi-bin/koha/catalogue/search.pl?idx=[% scan_index_to_use %]&amp;q=[% SEARCH_RESULT.scan_use |url %]&quot;[% SEARCH_RESULT.title %]&quot;">[% SEARCH_RESULT.title |html %]</a>
575                         </td>
576                         <td>
577                             [% SEARCH_RESULT.author %]
578                         </td>
579                     </tr>
580                 [% END %]
581             </table>
582             </form>
583         [% ELSE %]
584
585             <div id="searchresults">
586
587                 [% INCLUDE 'page-numbers.inc' %]
588
589                 <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
590                 [% IF ( searchdesc ) %]
591                 [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
592                 <input type="hidden" name="[% QUERY_INPUT.input_name |html %]" value="[% QUERY_INPUT.input_value |html %]"/>
593                 [% END %]
594                 [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
595                 <input type="hidden" name="[% LIMIT_INPUT.input_name |html %]" value="[% LIMIT_INPUT.input_value |html %]"/>
596                 [% END %]
597                 [% END %]
598
599                     <!-- TABLE RESULTS START -->
600                 <table>
601                     <tr>
602                         [% IF ( AmazonCoverImages || LocalCoverImages ) %]<th>&nbsp;</th>[% END %]
603                         <th colspan="2">Results</th>
604                         <th>Location</th>
605                     </tr>
606                         <!-- Actual Search Results -->
607                         [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %]
608                         [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
609                             <tr>
610                             [% IF ( AmazonCoverImages || LocalCoverImages ) %]
611                                 <td>
612                                     [% IF ( LocalCoverImages) %]
613                                         <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
614                                         <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
615                                         </a>
616                                     [% END %]
617                                     [% IF ( AmazonCoverImages ) %]
618                                         [% IF ( SEARCH_RESULT.normalized_isbn ) %]
619                                             <a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
620                                             <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
621                                         [% ELSIF ( !LocalCoverImages ) %]
622                                             <a class="p1 no-amazon-cover" href="/cgi-bin/koha/catalogue/[% DetailPage %]?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
623                                             <img src="https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />
624                                         [% END %]
625                                         </a>
626                                     [% END %]
627                                 </td>
628                             [% END %]
629                             <td>
630                                 <input type="checkbox" class="selection" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" style="display:none" />
631                             </td>
632                             <td>
633                             [% IF ( SEARCH_RESULT.XSLTResultsRecord ) %]
634                 [% SEARCH_RESULT.result_number %].
635                                 [% SEARCH_RESULT.XSLTResultsRecord %]
636                             [% ELSE %]
637                                 <p>[% SEARCH_RESULT.result_number %].
638                                  [% biblionumber = SEARCH_RESULT.biblionumber %]
639
640                                 [% INCLUDE 'biblio-default-view.inc' %]
641                                             <b>[% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %]</b>
642                                             </a>
643                                         [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield %][% END %]
644                                         [% IF ( SEARCH_RESULT.seriestitle ) %][% SEARCH_RESULT.seriestitle %][% END %]
645                                         [% IF ( SEARCH_RESULT.volume ) %][% SEARCH_RESULT.volume %][% END %] [% IF ( SEARCH_RESULT.volumeddesc ) %], [% SEARCH_RESULT.volumeddesc %][% END %]
646                                 </p>
647                                 [% IF ( SEARCH_RESULT.summary ) %]
648                                         [% IF ( SEARCH_RESULT.author ) %]
649                                             <a href="/cgi-bin/koha/catalogue/search.pl?idx=au&amp;q=[% SEARCH_RESULT.author |url %]" title="Search for this Author">[% SEARCH_RESULT.author %]</a>
650                                         [% ELSE %]
651                                             &nbsp;
652                                         [% END %]
653                                     <p>
654                                     [% UNLESS ( item_level_itypes ) %]
655                                     [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
656                                     <img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" style="float: left; margin: .1em;" alt="[% SEARCH_RESULT.description %]" />
657                                     [% END %]
658                                     [% SEARCH_RESULT.description %]
659                                     [% END %]
660                                     [% SEARCH_RESULT.summary %]</p>
661                                 [% ELSE %]
662                                     <p>
663                                     [% UNLESS ( item_level_itypes ) %]
664                                     [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %]
665                                     <img src="[% SEARCH_RESULT.imageurl %]" title="[% SEARCH_RESULT.description %]" style="float: left; margin: .1em;" alt="" />
666                                     [% END %]
667                                     [% END %]
668
669                                         [% IF ( SEARCH_RESULT.author ) %]
670                                             <a href="/cgi-bin/koha/catalogue/search.pl?idx=au&amp;q=[% SEARCH_RESULT.author |url %]" title="Search for this Author">[% SEARCH_RESULT.author %]</a>
671                                         [% ELSE %]
672                                             &nbsp;
673                                         [% END %]
674                                         Description:
675                                         <span class="results_imprint">[% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %]
676                                         [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode %][% END %] [% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear %] [% ELSIF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate %][% END %]</span>
677                                                                                 [% IF ( SEARCH_RESULT.edition ) %]<span class="results_edition">Edition: [% SEARCH_RESULT.edition %]</span>[% END %]
678                                         <span class="results_physicaldesc">[% IF ( SEARCH_RESULT.pages ) %]: [% SEARCH_RESULT.pages %][% END %]
679                                         [% IF ( SEARCH_RESULT.size ) %] ; [% SEARCH_RESULT.size %][% END %]</span> [% IF ( SEARCH_RESULT.isbn ) %]<span class="results_isbn">ISBN: [% SEARCH_RESULT.isbn | replace('\s\|', ', ')%]</span>[% END %]
680                                         <span class="results_itemtype">[% SEARCH_RESULT.description %]</span>
681                                         [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp %])</i>[% END %]
682                                         [% IF ( SEARCH_RESULT.cn_class ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% SEARCH_RESULT.cn_class |uri %]%22">[% SEARCH_RESULT.cn_class %]</a>][% END %]
683                                     </p>
684                                     [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<p class="searchhighlightblob">[% SEARCH_RESULT.searchhighlightblob %]</p>[% END %]
685
686                                 [% END %]
687                                 [% END %]
688                                   <p class="hold">
689
690                             [% IF ( SEARCH_RESULT.norequests ) %]
691                                 <span class="noholdstext">No holds allowed</span>
692                             [% ELSE %]
693                                 <a id="reserve_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) %])</a>
694                                 [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]&amp;findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %]
695                             [% END %]
696
697                                 [% IF Koha.Preference('intranetbookbag') == 1 %]
698                                     [% IF ( SEARCH_RESULT.incart ) %]
699                                         | <a class="addtocart" id="cart[% SEARCH_RESULT.biblionumber %]" href="#">In your cart</a> <a class="cartRemove" id="cartR[% SEARCH_RESULT.biblionumber %]" href="#">(remove)</a>
700                                     [% ELSE %]
701                                         | <a class="addtocart" id="cart[% SEARCH_RESULT.biblionumber %]" href="#">Add to cart</a> <a style="display:none;" class="cartRemove" id="cartR[% SEARCH_RESULT.biblionumber %]" href="#">(remove)</a>
702                                     [% END %]
703                                 [% END # / IF intranetbookbag %]
704
705                           [% IF Koha.Preference('ArticleRequests') %]
706                               | <a id="requst_article_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a>
707                           [% END %]
708
709                           [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
710                           | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit record</a>
711                           [% END %]
712                           [% IF ( CAN_user_editcatalogue_edit_items ) %]
713                           | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit items</a>
714                           [% END %]
715
716                           [% IF ( OPACBaseURL ) %]
717                               <span class="view-in-opac">
718                                 | <a href="[% Koha.Preference('OPACBaseURL') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]" target="_blank">OPAC view</a>
719                               </span>
720                           [% END %]
721
722                                 </p>
723                                 </td>
724
725                                 <td><div class="availability">
726                                     [% IF ( SEARCH_RESULT.items_count ) %]
727                                         <strong>
728                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
729                                                 <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
730                                             [% END %]
731
732                                             [% SEARCH_RESULT.items_count %] [% IF ( SEARCH_RESULT.itemsplural ) %]items[% ELSE %]item[% END %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount %] available:[% ELSE %], None available[% END %]
733
734                                             [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
735                                                 </span>
736                                             [% END %]
737                                         </strong>
738
739                                     [% IF ( SEARCH_RESULT.availablecount ) %]
740                                     <ul>
741                                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
742
743                                         [% IF item_level_itypes && !noItemTypeImages && available_items_loo.imageurl %]
744                                         <li style="list-style: none; list-style-type: none;">
745                                           <img src="[% available_items_loo.imageurl %]" title="[% available_items_loo.description %]" alt="[% available_items_loo.description %]" />
746                                         [% ELSE %]
747                                         <li>
748                                         [% END %]
749                                         [% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname %][% END %]
750                                         [% IF ( available_items_loo.location ) %][% available_items_loo.location %][% END %]
751                                         [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% available_items_loo.itemcallnumber |uri %]%22">[% available_items_loo.itemcallnumber %]</a>][% END %]
752                                         ([% available_items_loo.count %])
753                                         [% IF item_level_itypes && available_items_loo.description %]
754                                         <br/>[% available_items_loo.description %]
755                                         [% END %]
756                                         </li>
757                                     [% END %]
758                                     </ul>
759                                     [% END %]
760
761                                    [% IF ( SEARCH_RESULT.onloancount ) %]
762                                    <span class="status">[% SEARCH_RESULT.onloancount %] on loan:</span>
763                                     <ul>
764                                     [% FOREACH onloan_items_loo IN SEARCH_RESULT.onloan_items_loop %]
765                                         [% IF item_level_itypes && !noItemTypeImages && onloan_items_loo.imageurl %]
766                                         <li style="list-style: none; list-style-type: none;">
767                                           <img src="[% onloan_items_loo.imageurl %]" title="[% onloan_items_loo.description %]" alt="[% onloan_items_loo.description %]" />
768                                         [% ELSE %]
769                                         <li>
770                                         [% END %]
771                                         [% IF ( onloan_items_loo.branchname ) %][% onloan_items_loo.branchname %][% END %]
772                                         [% IF ( onloan_items_loo.location ) %][% onloan_items_loo.location %][% END %]
773                                         [% IF ( onloan_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% onloan_items_loo.itemcallnumber |uri %]%22">[% onloan_items_loo.itemcallnumber %]</a>][% END %]
774                                         ([% onloan_items_loo.count %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %]
775                                         [% IF item_level_itypes && onloan_items_loo.description %]
776                                         <br/>[% onloan_items_loo.description %]
777                                         [% END %]
778                                         </li>
779                                     [% END %]
780                                     </ul>
781                                     [% END %]
782
783                                     [% IF ( SEARCH_RESULT.othercount ) %]
784                                     <span class="unavailable">[% SEARCH_RESULT.othercount %] unavailable:</span>
785                                     <ul>
786                                     [% FOREACH other_items_loo IN SEARCH_RESULT.other_items_loop %]
787                                         [% IF item_level_itypes && !noItemTypeImages && other_items_loo.imageurl %]
788                                         <li style="list-style: none; list-style-type: none;">
789                                           <img src="[% other_items_loo.imageurl %]" title="[% other_items_loo.description %]" alt="[% other_items_loo.description %]" />
790                                         [% ELSE %]
791                                         <li>
792                                         [% END %]
793                                         [% IF ( other_items_loo.branchname ) %][% other_items_loo.branchname %][% END %]
794                                         [% IF ( other_items_loo.location ) %][% other_items_loo.location %][% END %]
795                                         [% IF ( other_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% other_items_loo.itemcallnumber |uri %]%22">[% other_items_loo.itemcallnumber %]</a>][% END %]
796                                         [% IF ( other_items_loo.withdrawn ) %](Withdrawn)[% END %]
797                                         [% IF ( other_items_loo.itemlost ) %](Lost)[% END %]
798                                         [% IF ( other_items_loo.damaged ) %](Damaged)[% END %]
799                                         [% IF ( other_items_loo.intransit ) %](In transit)[% END %]
800                                         [% IF ( other_items_loo.onhold ) %](On hold)[% END %]
801                                         [% IF ( other_items_loo.notforloan ) %][% other_items_loo.notforloan %][% END %]
802                                         ([% other_items_loo.count %])
803                                         [% IF item_level_itypes && other_items_loo.description %]
804                                         <br/>[% other_items_loo.description %]
805                                         [% END %]
806                                         </li>
807                                     [% END %]
808                                     </ul>
809                                     [% END %]
810                                     [% ELSE %]
811                                     [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS.count ) %]
812                                     <strong id="altholdings_heading">Other holdings:</strong>
813                                     <ul>
814                                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
815                                     <li id="alternateholdings">[% ALTERNATEHOLDING.holding %]</li>
816                                     [% END %]
817                                     </ul>
818                                     [% ELSE %]
819                                     <span class="unavailable">No items</span>
820                                     [% END %]
821                                     [% END %] <!-- /items count -->
822                                     </div></td>
823
824                             </tr>
825                         [% END %]
826                 </table>
827                 </form>
828                 </div>
829         [% END %]
830         [% INCLUDE 'page-numbers.inc' %]
831     [% ELSE %]
832     <!-- No Results Found -->
833     [% END %]
834 [% IF ( outer_sup_results_loop ) %]
835 </div>
836 <div class="yui-u">
837 [% FOREACH outer_sup_results_loo IN outer_sup_results_loop %]
838 <!-- <div class="yui-b"> -->
839     [% IF ( outer_sup_results_loo.inner_sup_results_loop ) %]
840         [% outer_sup_results_loo.servername %]
841         [% FOREACH inner_sup_results_loo IN outer_sup_results_loo.inner_sup_results_loop %]
842         <div><a href="/cgi-bin/koha/catalogue/search.pl?[% inner_sup_results_loo.query_cgi %][% inner_sup_results_loo.limit_cgi |html %][% inner_sup_results_loo.sort_by %][% inner_sup_results_loo.link %]">[% inner_sup_results_loo.title |html %]</a></div>
843         [% END %]
844     [% END %]
845 <!-- </div> -->
846 [% END %]
847 </div>
848 </div>
849 [% END %]
850
851 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
852     <!-- Value will be set here by placeHold() -->
853     <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
854     <input type="hidden" name="findborrower" id="holdFor" value="" />
855     <input type="hidden" name="multi_hold" value="1"/>
856 </form>
857
858 <form id="list_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
859     <!-- Value will be set here by addToList() -->
860     <input id="list_form_biblios" type="hidden" name="biblionumbers" value="" />
861     <input type="hidden" name="multi_listadd" value="1"/>
862 </form>
863
864 </div>
865 </div>
866 <div class="yui-b">
867 [% INCLUDE 'facets.inc' %]
868 </div>
869 </div>
870 [% INCLUDE 'intranet-bottom.inc' %]