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