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