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