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