Bug 5025: discrepancy between opac doc-head-open.inc and staff doc-head-open.inc
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-results-grouped.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;
4 [% IF ( searchdesc ) %]
5     Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
6 [% ELSE %]
7     You did not specify any search criteria.
8 [% END %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %][% END %]
11 <link rel="alternate" type="application/rss+xml" title="Koha - RSS"
12 href="/cgi-bin/koha/opac-rss.pl?[% query_cgi %][% limit_cgi |html %]" />
13
14 </head>
15 [% INCLUDE 'bodytag.inc' bodyid='results-grouped' %]
16 [% INCLUDE 'masthead.inc' %]
17
18     <div class="main">
19         <ul class="breadcrumb">
20             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
21             <li>
22                 [% IF ( searchdesc ) %]
23                     <a href="#">Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]</a>
24                 [% ELSE %]
25                     <a href="#">You did not specify any search criteria.</a>
26                 [% END %]
27             </li>
28         </ul>
29
30         [% IF ( query_error ) %]
31             <div class="container-fluid">
32                 <div class="row-fluid">
33                     <div class="span12">
34                         <div class="alert">
35                             <h4>Error:</h4>
36                             <p>[% query_error %]</p>
37                         </div>
38                     </div> <!-- / .span12 -->
39                 </div> <!-- / .row-fluid -->
40             </div> <!-- / .container-fluid -->
41         [% END %]
42
43         <div class="container-fluid">
44             <div class="row-fluid">
45                 [% IF ( opacfacets && total ) %]
46                     <div class="span2">
47                         <div id="facetcontainer">
48                             <!-- FACETS START -->
49                             [% INCLUDE 'opac-facets.inc' %]
50                             <!-- FACETS END -->
51                         </div>
52                     </div>
53                     <div class="span10">
54                 [% ELSE %]
55                     <div class="span12">
56                 [% END %]
57                     <div id="grouped-results">
58                         <!-- Search Results Table -->
59                         [% IF ( total ) %]
60                             [% IF ( scan ) %]
61                                 <h1>Scan index:</h1>
62                                     <form action="/cgi-bin/koha/opac-search.pl" method="get">
63                                         <table>
64                                             <tbody>
65                                                 <tr>
66                                                     <td>
67                                                         Scan index for: <input type="text" name="q" id="scan-index" size="35" value="" />
68                                                     </td>
69                                                 </tr>
70                                                 <tr>
71                                                     <td>
72                                                         <label for="scan-index">Indexed in:</label>
73                                                         <select name="idx" id="scan-index">
74                                                             <option value="">Any word</option>
75                                                             <option value="kw,phr:">Any phrase</option>
76                                                             <option value="ti:">Title</option>
77                                                             <option value="ti,phr:">Title phrase</option>
78                                                             <option value="au,phr:">Author</option>
79                                                             <option value="su:">Subject</option>
80                                                             <option value="su,phr:">Subject phrase</option>
81                                                             <option value="se:">Series</option>
82                                                             <option value="pb:">Publisher</option>
83                                                             <option value="nt:">Notes</option>
84                                                             <option value="se:">Series Title</option>
85                                                             <option value="sn:">ISBN</option>
86                                                             <option value="ss:">ISSN</option>
87                                                         </select>
88                                                         <input type="hidden" name="scan" value="1" />
89                                                     </td>
90                                                 </tr>
91                                             </tbody>
92                                         </table>
93                                     </form>
94
95                                     <form action="/cgi-bin/koha/opac-search.pl" method="get">
96                                         <table>
97                                             <thead>
98                                                 <tr>
99                                                     <th>Term/Phrase</th>
100                                                     <th>Count</th>
101                                                 </tr>
102                                             </thead>
103                                             <tbody>
104                                                 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
105                                                 <tr>
106                                                     <td>
107                                                         <a href="/cgi-bin/koha/opac-search.pl?q=[% SEARCH_RESULT.scan_use |url %]&quot;[% SEARCH_RESULT.title |url %]&quot;">[% SEARCH_RESULT.title |html %]</a>
108                                                     </td>
109                                                     <td>
110                                                         [% FOREACH subtitl IN SEARCH_RESULT.subtitle %]
111                                                             [% subtitl.subfield %]
112                                                         [% END %]
113                                                     </td>
114                                                 </tr>
115                                                 [% END %]
116                                             </thead>
117                                         </table>
118                                     </form>
119                             [% ELSE %]
120
121                                 <div class="searchresults">
122                                     <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
123                                         [% IF ( searchdesc ) %]
124                                             [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
125                                                 <input type="hidden" name="[% QUERY_INPUT.input_name |html %]" value="[% QUERY_INPUT.input_value |html %]"/>
126                                             [% END %]
127                                             [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
128                                                 <input type="hidden" name="[% LIMIT_INPUT.input_name |html %]" value="[% LIMIT_INPUT.input_value |html %]"/>
129                                             [% END %]
130                                         [% END %]
131
132                                         <!-- TABLE RESULTS START -->
133                                         <table class="table table-striped">
134                                             <tr>
135                                                 <td colspan="3" class="resultscontrol">
136                                                     <div class="resort">
137                                                         <select id="sort_by" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
138                                                         <input type="submit" class="submit clearfix" id="sortsubmit" value="Go" />
139                                                     </div>
140                                                     [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
141                                                         <div class="cartlist"><span class="checkall"></span>
142                                                         <span class="clearall"></span>
143                                                         <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
144                                                         <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
145                                                         <span class="addto"></span></div>
146                                                     [% END %]
147                                                 </td>
148                                             </tr>
149                                             <!-- Actual Search Results -->
150                                             [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
151                                                 <tr class="grouplabel"><td colspan="3">[% SEARCH_RESULT.group_label %]</td></tr>
152                                                 [% FOREACH GROUP_RESULT IN SEARCH_RESULT.GROUP_RESULTS %]
153                                                     [% IF ( GROUP_RESULT.even ) %]
154                                                         <tr class="highlight">
155                                                     [% ELSE %]
156                                                         <tr>
157                                                     [% END %]
158                                                         <td>
159                                                             [% IF ( OPACAmazonCoverImages ) %]
160                                                                 <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]">[% IF ( GROUP_RESULT.isbn ) %]<img src="http://images.amazon.com/images/P/[% GROUP_RESULT.isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />[% END %]
161                                                             </a>
162                                                         [% ELSE %]
163                                                             [% UNLESS ( noItemTypeImages ) %]
164                                                                 [% IF ( GROUP_RESULT.imageurl ) %]
165                                                                     <img src="[% GROUP_RESULT.imageurl %]" title="[% GROUP_RESULT.description %]" />
166                                                                 [% END %]
167                                                             [% END %]
168                                                             [% GROUP_RESULT.description %]
169                                                         [% END %]
170                                                         </td>
171                                                         <td>
172                                                             [% GROUP_RESULT.result_number %].
173                                                             [% IF ( GROUP_RESULT.BiblioDefaultViewmarc ) %]
174                                                                 <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title %]
175                                                             [% ELSE %]
176                                                                 [% IF ( GROUP_RESULT.BiblioDefaultViewisbd ) %]
177                                                                     <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title %]
178                                                                 [% ELSE %]
179                                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]" title="View details for this title">[% GROUP_RESULT.title %]
180                                                                 [% END %]
181                                                                 [% FOREACH subtitl IN GROUP_RESULT.subtitle %]
182                                                                     [% subtitl.subfield %]
183                                                                 [% END %]
184                                                                 </a>
185                                                             [% END # / IF GROUP_RESULT.BiblioDefaultViewmarc %]
186                                                             [% IF ( GROUP_RESULT.author ) %]
187                                                                 by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% GROUP_RESULT.author |url %]" title="Search for works by this author">[% GROUP_RESULT.author %]</a>
188                                                             [% ELSE %]
189                                                                 &nbsp;
190                                                             [% END %]
191                                                             <p>
192                                                                 [% IF ( GROUP_RESULT.publicationyear ) %] - [% GROUP_RESULT.publicationyear %][% END %]
193                                                                 [% IF ( GROUP_RESULT.publishercode ) %]- [% GROUP_RESULT.publishercode %][% END %]
194                                                                 [% IF ( GROUP_RESULT.place ) %] ; [% GROUP_RESULT.place %][% END %]
195                                                                 [% IF ( GROUP_RESULT.pages ) %] - [% GROUP_RESULT.pages %][% END %]
196                                                                 [% IF ( GROUP_RESULT.notes ) %] : [% GROUP_RESULT.notes %][% END %]
197                                                                 [% IF ( GROUP_RESULT.size ) %] ; [% GROUP_RESULT.size %][% END %]
198                                                                 [% IF ( GROUP_RESULT.timestamp ) %] <i>(modified on [% GROUP_RESULT.timestamp %])</i>[% END %]
199                                                             </p>
200                                                             [% IF ( GROUP_RESULT.searchhighlightblob ) %]
201                                                                 <p class="searchhighlightblob">[% GROUP_RESULT.searchhighlightblob %]</p>
202                                                             [% END %]
203                                                             <p class="availability">
204                                                                 [% IF ( GROUP_RESULT.available_items_loop ) %]
205                                                                     <span class="available"><strong>Items available at:</strong>
206                                                                         [% FOREACH available_items_loo IN GROUP_RESULT.available_items_loop %]
207                                                                             [% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname %][% END %]
208                                                                             [% IF ( OPACItemsResultsDisplay ) %]
209                                                                                 [% IF ( available_items_loo.location ) %][% available_items_loo.location %][% END %]
210                                                                                 [% 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 %]
211                                                                             [% END %]
212                                                                             ([% available_items_loo.count %]),
213                                                                         [% END # / FOREACH available_items_loo %]
214                                                                     </span>
215                                                                 [% ELSE %]
216                                                                     <span class="unavailable">No items available:</span>
217                                                                 [% END # / IF GROUP_RESULT.available_items_loop %]
218                                                                 <span class="unavailable">
219                                                                     [% IF ( GROUP_RESULT.onloancount ) %] Checked out ([% GROUP_RESULT.onloancount %]), [% END %]
220                                                                     [% IF ( GROUP_RESULT.withdrawncount ) %] Withdrawn ([% GROUP_RESULT.withdrawncount %]), [% END %]
221                                                                     [% IF ( GROUP_RESULT.itemlostcount ) %] Lost ([% GROUP_RESULT.itemlostcount %]),[% END %]
222                                                                     [% IF ( GROUP_RESULT.damagedcount ) %] Damaged ([% GROUP_RESULT.damagedcount %]),[% END %]
223                                                                     [% IF ( GROUP_RESULT.orderedcount ) %] On order ([% GROUP_RESULT.orderedcount %]),[% END %]
224                                                                     [% IF ( GROUP_RESULT.intransitcount ) %] In transit ([% GROUP_RESULT.intransitcount %]),[% END %]
225                                                                 </span>
226                                                             </p>
227                                                             <p>
228                                                                 [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
229                                                                     [% UNLESS ( GROUP_RESULT.norequests ) %]
230                                                                         [% IF Koha.Preference( 'opacuserlogin' ) == 1 && GROUP_RESULT.holdable %]
231                                                                             <a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% GROUP_RESULT.biblionumber %]">Place hold</a><!-- add back when available 0 holds in queue-->
232                                                                         [% END %]
233                                                                     [% END %]
234                                                                 [% END %]
235
236                                                                 [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
237                                                                     <input type="checkbox" name="biblionumber" value="[% GROUP_RESULT.biblionumber %]" title="Click to add to cart" /> <label for="bib[% GROUP_RESULT.biblionumber %]">
238                                                                 [% END %]
239                                                                 <img src="[% themelang %]/images/[% GROUP_RESULT.itemtype %].gif" alt="[% GROUP_RESULT.ccode %]" title="[% GROUP_RESULT.ccode %]" />
240                                                                 [% IF ( ( Koha.Preference( 'opacbookbag' ) = 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]</label>[% END %]
241                                                                 [% IF ( GROUP_RESULT.classification ) %]
242                                                                     <a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% GROUP_RESULT.classification |url %]"> [% GROUP_RESULT.classification %] </a>
243                                                                 [% END %]
244                                                             </p>
245                                                         </td>
246                                                     </tr>
247                                                 [% END # / FOREACH GROUP_RESULT %]
248                                             [% END # / FOREACH SEARCH_RESULTS %]
249                                         </table>
250                                     </form>
251                                 </div> <!-- / .searchresults -->
252                             [% END # /  IF scan %]
253                             [% INCLUDE 'page-numbers.inc' %]
254                         [% END # / IF total %]
255
256                         [% IF Koha.Preference( 'suggestion' ) == 1 %]
257                             [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
258                                 <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>
259                             [% ELSE %]
260                                 [% 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 %]
261                             [% END %]
262                         [% END %]
263
264                     </div> <!-- / #grouped-results -->
265                 </div> <!-- /.span10/12 -->
266             </div> <!-- / .row-fluid -->
267         </div> <!-- / .container-fluid -->
268     </div><!-- / .main -->
269
270 [% INCLUDE 'opac-bottom.inc' %]
271 [% BLOCK jsinclude %]
272 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
273 <script type="text/javascript">
274 //<![CDATA[
275
276 var q_array = new Array();  // will hold the search terms, if possible
277
278 $(document).ready(function(){
279     [% IF ( OpacHighlightedWords ) %]
280         $('a.title').each(function() {
281             $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
282         });
283     [% END %]
284
285     $('#sortsubmit').hide();
286     $('#sort_by').change(function() {
287         $('#bookbag_form').submit();
288     });
289     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">Clear all</a>");
290     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">Select all</a>");
291     $("span.addto").html("<label for=\"addto\">Add to: </label><select name=\"addto\" id=\"addto\"><option value=\"\"></option>[% IF Koha.Preference( 'opacbookbag' ) == 1 %]<option value=\"addtocart\">Cart</option>[% END %][% IF Koha.Preference( 'virtualshelves' ) == 1 %][% IF ( loggedinusername ) %]<optgroup label=\"Lists:\">[% IF ( barshelves ) %][% FOREACH barshelvesloo IN barshelvesloop %][% IF ( category == 1 ) %]<option id=\"s[% barshelvesloo.shelfnumber %]\" value=\"addtolist\">[% barshelvesloo.shelfname %]</option>[% END %][% END %][% END %]<option value=\"newlist\">[ New list ]</option></optgroup>[% ELSE %]<option value=\"newlist\">List</option>[% END %][% END %]</select> <input type=\"submit\" class=\"submit\" value=\"Save\" />");
292     $("#addto").change(function(){
293         cartList();
294     });
295     $(".addto").find("input:submit").click(function(){
296         cartList();
297         return false;
298     });
299     function cartList(){
300             if($("#addto").find("option:selected").attr("value") == "addtolist"){
301             var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
302             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
303             Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
304             }[% ELSE %] alert(_("You must be logged in to create or add to Lists")); [% END %]
305             return false;
306         } else if($("#addto").find("option:selected").attr("value") == "newlist"){
307             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
308             Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
309             }[% ELSE %] alert(_("You must be logged in to create or add to Lists")); [% END %]
310             return false;
311         }
312         if($("#addto").find("option:selected").attr("value") == "addtocart"){
313             addMultiple();
314             return false;
315          }
316     }
317     $("#CheckAll").click(function(){
318         $("#bookbag_form").checkCheckboxes();
319         return false;
320     });
321     $("#CheckNone").click(function(){
322         $("#bookbag_form").unCheckCheckboxes();
323         return false;
324     });
325     [% IF ( query_desc ) %]
326     var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
327     q_array = query_desc.split(" ");
328     // ensure that we don't have "" at the end of the array, which can
329     // break the highlighter
330     while (q_array.length > 0 && q_array[q_array.length-1] == "") {
331         q_array = q_array.splice(0,-1);
332     }
333     highlightOn();
334     $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
335     $("#highlight_toggle_off").show().click(function() {highlightOff();});
336     [% END %]
337 });
338
339 function highlightOff() {
340     $("td").removeHighlight();
341     $(".highlight_toggle").toggle();
342 }
343 function highlightOn() {
344     var x;
345     for (x in q_array) {
346         q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
347         q_array[x] = q_array[x].toLowerCase();
348         var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
349         if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
350             $("td").highlight(q_array[x]);
351         }
352     }
353     $(".highlight_toggle").toggle();
354 }
355 //]]>
356 </script>
357 [% END %]