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