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