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