Bug 22710: [18.11.x] Return to the last advanced search link not filtering correctly...
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-results.tt
blob6115cecd9a70d4d2f2d68787b95246783108599e
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %]
5 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %]
6 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
7 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
9 [% IF firstPage %]
10      [% SET OverDriveEnabled = Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %]
11      [% SET RecordedBooksEnabled = Koha.Preference('RecordedBooksLibraryID') && Koha.Preference('RecordedBooksClientSecret') %]
12 [% END %]
14 [% INCLUDE 'doc-head-open.inc' %]
15 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;
16 [% IF ( searchdesc ) %]
17     Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]
18 [% ELSE %]
19     You did not specify any search criteria.
20 [% END %]</title>
21 [% INCLUDE 'doc-head-close.inc' %]
22 [% IF ( OpacStarRatings == 'all' || Koha.Preference('Babeltheque') ) %]
23     [% BLOCK cssinclude %]
24         [% Asset.css("css/jquery.rating.css") | $raw %]
25     [% END %]
26 [% END %]
28 <link rel="alternate" type="application/rss+xml" title="[% LibraryName | html %] Search RSS feed" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss2" />
29 </head>
31 [% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
32 [% INCLUDE 'masthead.inc' %]
34     <div class="main">
35         <ul class="breadcrumb">
36             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
37             <li>
38                 [% IF ( searchdesc ) %]
39                     <a href="#">Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %]</a>
40                 [% ELSE %]
41                     <a href="#">You did not specify any search criteria</a>
42                 [% END %]
43             </li>
44         </ul>
46         [% UNLESS ( total ) %]
47             <div class="container-fluid maincontent">
48                 <div class="row-fluid">
49                     <div class="span12">
50                         <strong>No results found!</strong>
51                         <p>
52                             [% IF ( searchdesc ) %]
53                                 No results found for that in [% LibraryName | html %] catalog. <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;format=rss2" class="rsssearchlink noprint"><img src="[% interface | html %]/[% theme | html %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
54                             [% ELSE %]
55                                 You did not specify any search criteria.
56                             [% END %]
57                         </p>
58                         [% IF ( ReturnPath ) %]
59                            <div class="returntosearch">
60                                 <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
61                             </div>
62                         [% END %]
63                         [% IF ( OPACNoResultsFound ) %]
64                             <div id="noresultsfound">
65                                 [% OPACNoResultsFound | $raw %]
66                             </div>
67                         [% END %]
68                     </div> <!-- / .span12 -->
69                 </div> <!-- / .row-fluid -->
70             </div> <!-- / .container-fluid -->
71         [% END # / UNLESS searchdesc %]
73         <div id="maincontent" class="container-fluid">
74             <div class="row-fluid">
75                 [% IF ( opacfacets && total ) %]
76                     <div class="span2">
77                         <div id="facetcontainer">
78                             <!-- FACETS START -->
79                             [% INCLUDE 'opac-facets.inc' %]
80                             <!-- FACETS END -->
81                         </div>
82                     </div>
83                 [% END %]
85                 [% IF ( opacfacets && total ) %]<div class="span10 maincontent">[% ELSE %]<div class="span12 maincontent">[% END %]
87                 [% IF ( searchdesc ) %]
88                     <p id="numresults">
89                     [% IF ( total ) %]<strong>Your search returned [% total | html %] results.</strong>
90                         [% IF ( related ) %]
91                             (related searches:
92                                 [% FOREACH relate IN related %]
93                                     [% relate.related_search | html %]
94                                 [% END %]
95                             ).
96                         [% END %]
97                         <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;count=[% countrss | uri %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink noprint"><img src="[% interface | html %]/[% theme | html %]/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" class="rsssearchicon"/></a>
98                     [% END # / IF total %]
99                     </p>
100                 [% END # / IF searchdesc %]
102                 <div id="userresults">
103                     [% IF ( DidYouMean ) %]
104                         <div id="didyoumean">Not what you expected? Check for <a href="/cgi-bin/koha/svc/suggestion?render=standalone&amp;q=[% querystring |uri %]">suggestions</a></div>
105                     [% END %]
107                     <div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div>
109                     [% IF ( koha_spsuggest ) %]
110                         Did you mean:
111                         <ul style="list-style: none;">
112                             [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
113                             <li>
114                                 <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion | uri %]">[% SPELL_SUGGES.spsuggestion | html %]</a>
115                             </li>
116                             [% END %]
117                         </ul>
118                     [% END # / IF koha_spsuggest%]
119                     [% IF ( total ) %]
120                         [% IF ( ReturnPath ) %]
121                             <div class="returntosearch">
122                                 <p><a href="[% ReturnPath | url %]">Return to the last advanced search</a></p>
123                             </div>
124                         [% END %]
125                     [% END %]
126                     [% IF ( query_error ) %]
127                         <div class="dialog alert">
128                             <h4>Error:</h4>
129                             [% query_error | html %]
130                         </div>
131                     [% END %]
133                     <!-- Search Results Table -->
134                     [% IF ( total ) %]
136                         <div class="searchresults">
137                             <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
138                                 [% IF ( searchdesc ) %]
139                                     [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
140                                         <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
141                                     [% END %]
142                                     [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %]
143                                         <input type="hidden" name="[% LIMIT_INPUT.input_name | html %]" value="[% LIMIT_INPUT.input_value | html %]"/>
144                                     [% END %]
145                                 [% END # IF /searchdesc %]
147                                 <div id="toolbar" class="toolbar clearfix">
148                                     [% IF ( OpacHighlightedWords ) %]
149                                         <div class="highlight_controls noprint">
150                                             <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
151                                             <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
152                                         </div>
153                                     [% END %]
154                                     [% UNLESS tag %]
155                                         <div class="sort_by pull-right">
156                                             <select id="sort_by" class="resort" name="sort_by"> [% INCLUDE 'resort_form.inc' %] </select>
157                                             <input type="submit" class="btn btn-small clearfix" id="sortsubmit" value="Go" />
158                                         </div>
159                                     [% END %]
160                                 </div> <!-- / #toolbar -->
162                                 <div id="selections-toolbar" class="toolbar noprint">
163                                     <!-- checkall, clearall are now needed for placehold -->
164                                     <span class="checkall"></span>
165                                     <span class="clearall"></span> <span class="sep">|</span>
167                                         <span class="links">
168                                             [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
169                                                 <span class="addto"></span>
170                                             [% END %]
171                                             <span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
173                                             [% IF ( TagsInputEnabled && loggedinusername ) %]
174                                                 <span id="tagsel_span">
175                                                     <input id="tagsel_tag" class="disabled" type="submit" value="Tag"/>
176                                                 </span>
177                                                 <span id="tagsel_form" style="display:none">
178                                                     <label for="tagsel_new">New tag:</label>
179                                                     <input type="text" name="tagsel_new" id="tagsel_new" maxlength="100" />
180                                                     <input id="tagsel_button" name="tagsel_button" class="tagsel_button btn btn-small" title="Add" type="submit" value="Add" />
181                                                     <a href="#" id="tagsel_cancel">(done)</a>
182                                                 </span>
183                                                 <span id="tagsel_status" class="tagsel_tatus" style="display:none;">
184                                                     Tag status here.
185                                                 </span>
186                                             [% END %]
187                                         </span> <!-- / .links -->
188                                 </div> <!-- / #selections-toolbar -->
190                                 <!-- TABLE RESULTS START -->
191                                 <table class="table table-striped">
193                                     <!-- Actual Search Results -->
194                                     [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
195                                         <tr>
196                                             [% # Cell 1: Checkbox %]
197                                             <td class="select selectcol">
198                                                 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
199                                                     <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
200                                                 [% ELSE %]
201                                                     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
202                                                         <input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
203                                                     [% ELSE %]
204                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
205                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
206                                                                 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]<input type="checkbox" class="cb" id="bib[% SEARCH_RESULT.biblionumber | html %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber | html %]" /> <label for="bib[% SEARCH_RESULT.biblionumber | html %]"></label>
207                                                                 [% END %]
208                                                             [% END %]
209                                                         [% END # IF RequestOnOpac %]
210                                                     [% END # IF virtualshelves %]
211                                                 [% END # IF opacbookbag%]
212                                             </td>
213                                             [% # Cell 2: Show result number if OpacHiddenItems is empty %]
214                                             <td class="select selectcol">
215                                                 [% UNLESS suppress_result_number %]
216                                                     [% SEARCH_RESULT.result_number | html %].
217                                                 [% END %]
218                                             </td>
220                                             [% IF ( !item_level_itypes && !noItemTypeImages ) %]
221                                                 [% # Cell 3: Show item type image %]
222                                                 <td class="itypecol">
223                                                     [% IF ( SEARCH_RESULT.imageurl ) %]
224                                                         <img src="[% SEARCH_RESULT.imageurl | html %]" title="[% SEARCH_RESULT.description | html %]" alt="[% SEARCH_RESULT.description | html %]" />
225                                                     [% END %]
226                                                     [% IF ( SEARCH_RESULT.score_avg ) %]
227                                                         <img src="[% themelang | html %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/>
228                                                     [% END %]
229                                                 </td>
230                                             [% END %]
232                                             [% # Cell 4: Search result details and controls %]
233                                             <td class="bibliocol">
234                                                 <div class="coverimages itemtype_[% SEARCH_RESULT.itemtype | html %]">
235                                                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">
236                                                         [% IF ( OPACLocalCoverImages ) %]
237                                                             <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
238                                                         [% END %]
240                                                         [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]
241                                                             <span title="[% SEARCH_RESULT.biblionumber | html %]" id="adlibris-thumbnail[% loop.count | html %]">
242                                                                 <img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]"
243                                                                      alt="Adlibris thumbnail for ISBN: [% SEARCH_RESULT.normalized_isbn | html %]" class="adlibris-cover" />
244                                                             </span>
245                                                         [% END %]
246                                                         [% IF ( OPACAmazonCoverImages ) %]
247                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
248                                                                     <span title="[% SEARCH_RESULT.biblionumber | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span>
249                                                             [% ELSE %]
250                                                                 <span class="no-image">No cover image available</span>
251                                                             [% END %]
252                                                         [% END %]
254                                                         [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
255                                                             [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %]
256                                                                     <span title="[% SEARCH_RESULT.biblionumber | html %]" id="syndetics-thumbnail[% loop.count | html %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc | html %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %]" alt="" class="item-thumbnail" /></span>
257                                                             [% ELSE %]
258                                                                 <span class="no-image">No cover image available</span>
259                                                             [% END %]
260                                                         [% END %]
262                                                         [% IF ( GoogleJackets ) %]
263                                                             [% IF ( SEARCH_RESULT.normalized_isbn ) %]
264                                                                 <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></span>
265                                                             [% ELSE %]
266                                                                 <span class="no-image">No cover image available</span>
267                                                             [% END %]
268                                                         [% END %]
270                                                         [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
271                                                           [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %]
272                                                           [% IF ( coce_id ) %]
273                                                             <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
274                                                           [% ELSE %]
275                                                             <span class="no-image">No cover image available</span>
276                                                           [% END %]
277                                                         [% END %]
279                                                         [% IF OpenLibraryCovers %]
280                                                             [% IF SEARCH_RESULT.normalized_isbn %]
281                                                                 <span title="[% SEARCH_RESULT.biblionumber | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="openlibrary-thumbnail[% loop.count | html %]"></span>
282                                                             [% ELSE %]
283                                                                 <span class="no-image">No cover image available</span>
284                                                             [% END %]
285                                                         [% END %]
287                                                         [% IF ( BakerTaylorEnabled && !BakerTaylorBookstoreURL ) %]
288                                                             [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
289                                                             [% IF ( bt_id ) %]
290                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
291                                                             [% ELSE %]
292                                                                 <span class="no-image">No cover image available</span>
293                                                             [% END %]
294                                                         [% END %]
295                                                     </a>
297                                                     [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %]
298                                                         [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
299                                                         [% IF ( bt_id ) %]
300                                                             <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]">
301                                                                 <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
302                                                             </a>
303                                                         [% ELSE %]
304                                                             <span class="no-image">No cover image available</span>
305                                                         [% END %]
306                                                     [% END %]
308                                                     [% IF ( IDreamBooksResults && SEARCH_RESULT.normalized_isbn ) %]
309                                                         <div class="idbresult" style="display: none;">
310                                                             [% IF ( IDreamBooksReviews ) %]
311                                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]#idb_critic_reviews">
312                                                             [% ELSE %]
313                                                                 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">
314                                                             [% END %]
315                                                             [% SEARCH_RESULT.normalized_isbn | html %]</a>
316                                                         </div>
317                                                     [% END %]
318                                                 </div>
319                                                 [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
320                                                     <!-- COinS / Openurl -->
321                                                     <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
322                                                 [% END %]
324                                                 [% IF ( OPACXSLTResultsDisplay ) %]
325                                                     [% SEARCH_RESULT.XSLTResultsRecord | $raw %]
326                                                 [% ELSE %]
327                                                     [% IF ( BiblioDefaultViewmarc ) %]
328                                                         <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
329                                                     [% ELSE %]
330                                                         [% IF ( BiblioDefaultViewisbd ) %]
331                                                             <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
332                                                         [% ELSE %]
333                                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]" title="View details for this title">
334                                                         [% END %]
335                                                     [% END %]
337                                                     [% IF ( SEARCH_RESULT.title ) %]
338                                                         [% SEARCH_RESULT.title | html %]
339                                                     [% ELSE %]
340                                                         No title
341                                                     [% END %]
343                                                     [% FOREACH subtitl IN SEARCH_RESULT.subtitle %]
344                                                         , [% subtitl.subfield | html %]
345                                                     [% END %]</a>
347                                                     [% IF ( SEARCH_RESULT.author ) %]
348                                                         by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% SEARCH_RESULT.author |url %]" title="Search for works by this author" class="author">[% SEARCH_RESULT.author | html %]</a>
349                                                     [% ELSE %]
350                                                         &nbsp;
351                                                     [% END %]
353                                                     <span class="results_summary publisher">
354                                                         <span class="label">Publication:</span>
355                                                             [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %]
356                                                             [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %]
357                                                             [% IF ( SEARCH_RESULT.publicationyear ) %]
358                                                                 [% SEARCH_RESULT.publicationyear | html %]
359                                                             [% ELSE %]
360                                                                 [% IF ( SEARCH_RESULT.copyrightdate ) %]
361                                                                     [% SEARCH_RESULT.copyrightdate | html %]
362                                                                 [% END %]
363                                                             [% END %]
364                                                             [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %]
365                                                             [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %]
366                                                             [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %][% END %]
367                                                             [% IF ( SEARCH_RESULT.timestamp ) %] <i>(modified on [% SEARCH_RESULT.timestamp | html %])</i>[% END %]
368                                                     </span>
370                                                     [% IF ( SEARCH_RESULT.summary ) %]
371                                                         <span class="result_summary">
372                                                             [% SEARCH_RESULT.summary | html %]
373                                                         </span>
374                                                     [% END %]
376                                                     [% IF ( SEARCH_RESULT.copyrightdate ) %]
377                                                         <span class="results_summary date">
378                                                             <span class="label">Date:</span>
379                                                             [% SEARCH_RESULT.copyrightdate | html %]
380                                                         </span>
381                                                     [% END %]
383                                                     <span class="results_summary">
384                                                         <span class="label">Availability:</span>
385                                                             [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
386                                                                 <span class="available"><strong>Items available:</strong>
387                                                                     [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
388                                                                         [% IF available_items_loo.this_branch %]
389                                                                             <span class="highlight-row-results">
390                                                                         [% ELSE %]
391                                                                             <span>
392                                                                         [% END %]
394                                                                         [% IF ( singleBranchMode ) %]
395                                                                             <span class="shelvingloc">[% available_items_loo.location | html %]</span>
396                                                                         [% ELSE %]
397                                                                             [% available_items_loo.branchname | html %]
398                                                                         [% END %]
400                                                                         [% IF ( OPACItemsResultsDisplay ) %]
401                                                                             [% UNLESS ( singleBranchMode ) %]<span class="shelvingloc">[% available_items_loo.location | html %]</span>[% END %]
402                                                                             [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:%22[% available_items_loo.itemcallnumber |url %]%22">[% available_items_loo.itemcallnumber | html %]</a>][% END %]
403                                                                         [% END %]
404                                                                         ([% available_items_loo.count | html %]),
405                                                                         </span>
406                                                                     [% END # / FOREACH available_items_loo %]
407                                                                 </span>
408                                                             [% ELSE %]
409                                                                 [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
410                                                                     [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %]
411                                                                         &nbsp;<span id="alternateholdings">[% ALTERNATEHOLDING.holding | html %]</span>,
412                                                                     [% END %]
413                                                                 [% ELSE %]
414                                                                     <span class="unavailable">No items available:</span>
415                                                                 [% END %]
416                                                             [% END # / IF SEARCH_RESULT.available_items_loop.size %]
418                                                             <span class="unavailable">
419                                                                 [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount | html %]), [% END %]
420                                                                 [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount | html %]), [% END %]
421                                                                 [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %]
422                                                                 [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %]
423                                                                 [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %]
424                                                                 [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %]
425                                                                 [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %]
426                                                             </span>
427                                                     </span> <!-- / .results_summary -->
428                                                 [% END # / IF OPACXSLTResultsDisplay %]
430                                                 [% IF ( SEARCH_RESULT.score_avg ) %]
431                                                     <div class="results_summary">
432                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
433                                                             [% IF ( SEARCH_RESULT.score_int >= i ) %]
434                                                                 <div class="star-rating rater-[% i | html %] star star-rating-applied star-rating-readonly star-rating-on"><a title="[% i | html %]">[% i | html %]</a></div>
435                                                             [% ELSE   %]
436                                                                 <div class="star-rating rater-[% i | html %] star star-rating-applied star-rating-readonly"><a title="[% i | html %]">[% i | html %]</a></div>
437                                                             [% END %]
438                                                         [% END %]
439                                                         <span id="babeltheque-rating_total_[% SEARCH_RESULT.biblionumber | html %]">&nbsp;&nbsp; [% SEARCH_RESULT.score_avg | html %] / 5 (on [% SEARCH_RESULT.num_scores | html %] rates)</span>
441                                                         [% IF ( SEARCH_RESULT.num_critics ) %]
442                                                             <span class="social_data">[% SEARCH_RESULT.num_critics | html %] Internet user critics</span>
443                                                         [% END %]
444                                                         [% IF ( SEARCH_RESULT.num_critics_pro ) %]
445                                                             <span class="social_data">[% SEARCH_RESULT.num_critics_pro | html %] Professional critics</span>
446                                                         [% END %]
447                                                         [% IF ( SEARCH_RESULT.num_videos ) %]
448                                                             <span class="social_data">[% SEARCH_RESULT.num_videos | html %] Video extracts</span>
449                                                         [% END %]
450                                                         [% IF ( SEARCH_RESULT.num_quotations ) %]
451                                                             <span class="social_data">[% SEARCH_RESULT.num_quotations | html %] Quotations</span>
452                                                         [% END %]
453                                                     </div> <!-- / .results_summary -->
454                                                 [% END # / IF SEARCH_RESULT.score_avg %]
456                                                 [% IF ( LibraryThingForLibrariesID ) %]
457                                                     <div class="ltfl_reviews"></div>
458                                                 [% END %]
460                                                 [% IF ( TagsShowEnabled && SEARCH_RESULT.TagLoop.size ) %]
461                                                     <div class="results_summary tags">
462                                                         <span class="label">Tags:</span>
463                                                         <ul>
464                                                             [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
465                                                                 <li>
466                                                                     <a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
467                                                                     <span class="weight">([% TagLoo.weight_total | html %])</span>
468                                                                 </li>
469                                                             [% END %]
470                                                         </ul>
471                                                     </div>
472                                                 [% END %]
474                                                 [% IF Koha.Preference('virtualshelves') AND SEARCH_RESULT.shelves.count %]
475                                                     <div class="results_summary shelves">
476                                                         <span class="label">Lists:</span>
477                                                         <ul>
478                                                             [% FOREACH shelf IN SEARCH_RESULT.shelves %]
479                                                                 <li>
480                                                                     <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% shelf.shelfnumber | uri %]">[% shelf.shelfname | html %]</a>
481                                                                     [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
482                                                                 </li>
483                                                             [% END %]
484                                                         </ul>
485                                                     </div>
486                                                 [% END %]
488                                                 [% IF ( SEARCH_RESULT.searchhighlightblob ) %]
489                                                     <span class="results_summary">
490                                                         <span class="label">Match:</span>
491                                                         [% SEARCH_RESULT.searchhighlightblob | html %]
492                                                     </span>
493                                                 [% END %]
495                                                 [% IF ( OpacStarRatings == 'all' ) %]
496                                                     <div class="results_summary ratings">
497                                                       [% SET rating_avg = SEARCH_RESULT.ratings.get_avg_rating() %]
498                                                       [% rating_avg_int = BLOCK %][% rating_avg | format("%.0f") %][% END %]
499                                                         [% FOREACH i  IN [ 1 2 3 4 5  ] %]
500                                                             [% IF rating_avg_int == i %]
501                                                                 <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber | html %]" value="[% i | html %]" checked="checked" disabled="disabled"   />
502                                                             [% ELSE %]
503                                                                 <input class="star" type="radio"  name="rating-[% SEARCH_RESULT.biblionumber | html %]" value="[% i | html %]" disabled="disabled"   />
504                                                             [% END %]
505                                                         [% END %]
507                                                         [% IF SEARCH_RESULT.ratings.count > 0  %]
508                                                             <span id="rating_total_[% SEARCH_RESULT.biblionumber | html %]">&nbsp;&nbsp;([% SEARCH_RESULT.ratings.count | html %] votes)</span>
509                                                         [% ELSE %]
510                                                             <br />
511                                                         [% END %]
512                                                     </div> <!-- / .results_summary -->
513                                                 [% END # / IF OpacStarRatings %]
515                                                 <div class="actions-menu noprint">
516                                                         [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %]
517                                                             [% UNLESS ( SEARCH_RESULT.norequests ) %]
518                                                                 [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
519                                                                     <span class="actions"><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Place hold</a></span><!-- add back when available 0 holds in queue-->
520                                                                 [% END # / IF opacuserlogin && holdable %]
521                                                             [% END # UNLESS SEARCH_RESULT.norequests %]
522                                                         [% END # IF RequestOnOpac %]
524                                                         [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
525                                                             [% IF SEARCH_RESULT.artreqpossible %]
526                                                                 <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Request article</a></span>
527                                                             [% END %]
528                                                         [% END %]
530                                                         [% IF ( TagsInputEnabled ) %]
531                                                             [% IF ( loggedinusername ) %]
532                                                                 <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber | html %]" href="#">Add tag</a></span>
533                                                                 <div id="tagform[% SEARCH_RESULT.biblionumber | html %]" class="tag_results_input" style="display:none;">
534                                                                         <label for="newtag[% SEARCH_RESULT.biblionumber | html %]">New tag(s), separated by a comma:</label>
535                                                                         <input type="text" name="newtag[% SEARCH_RESULT.biblionumber | html %]" id="newtag[% SEARCH_RESULT.biblionumber | html %]" class="newtag" maxlength="100" />
536                                                                         <input name="tagbutton" class="btn btn-small tagbutton" title="[% SEARCH_RESULT.biblionumber | html %]" type="submit" value="Add" />
537                                                                         <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber | html %]" href="#">(done)</a>
538                                                                 </div>
539                                                                 <span id="newtag[% SEARCH_RESULT.biblionumber | html %]_status" class="tagstatus" style="display:none;">
540                                                                     Tag status here.
541                                                                 </span>
542                                                             [% ELSIF ( loop.first ) %]
543                                                                 <span class="actions"><span id="login4tags">Log in to add tags.</span></span>
544                                                             [% END # IF loggedinusername %]
545                                                         [% END # if TagsInputEnabled %]
547                                                         [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername && ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
548                                                             <span class="actions"><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]'); return false;">Save to lists</a></span>
549                                                         [% END %]
551                                                         [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
552                                                             [% IF ( SEARCH_RESULT.incart ) %]
553                                                                 <span class="actions"><a data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="addtocart cart[% SEARCH_RESULT.biblionumber | html %]" href="#">In your cart</a> <a data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="cartRemove cartR[% SEARCH_RESULT.biblionumber | html %]" href="#">(remove)</a></span>
554                                                             [% ELSE %]
555                                                                 <span class="actions"><a data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="addtocart cart[% SEARCH_RESULT.biblionumber | html %]" href="#">Add to your cart</a> <a style="display:none;" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" class="cartRemove cartR[% SEARCH_RESULT.biblionumber | html %]" href="#">(remove)</a></span>
556                                                             [% END %]
557                                                         [% END # / IF opacbookbag %]
558                                                 </div>
560                                                 [% INCLUDE "openlibrary-readapi.inc" bib = SEARCH_RESULT %]
562                                             </td>
563                                         </tr>
564                                     [% END # / FOREACH SEARCH_RESULT %]
565                                 </table>
566                             </form> <!-- / #bookbag_form -->
568                             <form id="hold_form" name="hold_form" method="get" action="/cgi-bin/koha/opac-reserve.pl">
569                                 <!-- The value will be set by holdBiblioNums() in basket.js -->
570                                 <input id="hold_form_biblios" type="hidden" name="biblionumbers" value=""/>
571                             </form>
572                         </div> <!-- / .searchresults -->
574                         <div id="bottom-pages">[% INCLUDE 'page-numbers.inc' %]</div>
576                     [% END # / IF total %]
578                     [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername || Koha.Preference( 'ILLModule' ) == 1 )   %]
579                         <div class="suggestion">
580                             Not finding what you're looking for?
581                             <ul>
582                                 [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %]
583                                     <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
584                                 [% ELSE %]
585                                     [% IF ( loggedinusername ) %]
586                                         <li>Make a <a href="/cgi-bin/koha/opac-suggestions.pl?op=add">purchase suggestion</a></li>
587                                     [% END %]
588                                 [% END %]
589                                 [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
590                                     <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
591                                 [% END %]
592                             </ul>
593                         </div>
594                     [% END %]
595                     </div> <!-- / #userresults -->
596                 </div> <!-- /.span10/12 -->
597             </div> <!-- / .row-fluid -->
598         </div> <!-- / .container-fluid -->
599     </div><!-- / .main -->
601 [% INCLUDE 'opac-bottom.inc' %]
602 [% BLOCK jsinclude %]
603 [% IF ( LibraryThingForLibrariesID ) %]
604     <script src="https://ltfl.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID | html %]&amp;systype=koha"></script>
605 [% END %]
606 [% IF ( OpacStarRatings == 'all' || Koha.Preference('Babeltheque') ) %][% Asset.js("lib/jquery/plugins/jquery.rating.js") | $raw %][% END %]
607 [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
608 [% IF ( RecordedBooksEnabled ) %][% Asset.js("js/recordedbooks.js") | $raw %][% END %]
609 [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
610 [% Asset.js("js/authtoresults.js") | $raw %]
611 [% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
612 [% END %]<script>
613 //<![CDATA[
614 [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %]
615 function holdMultiple() {
616     var checkedBiblioNums = ""; // Separated by "/"
617     var checkedCount = 0;
618     if(document.bookbag_form.biblionumber.length > 0) {
619         for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
620             if (document.bookbag_form.biblionumber[i].checked) {
621                 checkedBiblioNums += (document.bookbag_form.biblionumber[i].value + "/");
622                 checkedCount++;
623             }
624         }
625     }
627     if (checkedCount > 0) {
628         holdBiblioNums(checkedBiblioNums);
629     } else {
630         alert(MSG_NO_RECORD_SELECTED);
631     }
634 function holdBiblioNums(numList) {
635     // numList: biblio numbers separated by "/"
636     $("#hold_form_biblios").attr("value", numList);
637     $("#hold_form").submit();
638 }[% END %]
640 [% IF ( TagsInputEnabled && loggedinusername ) %]
641 function tagSelected() {
642     var checkedBoxes = $(".searchresults :checkbox:checked");
643     if ($(checkedBoxes).size() == 0) {
644         alert(MSG_NO_RECORD_SELECTED);
645     } else {
646         $("#tagsel_tag").hide();
647         $(".resort").hide();
648         $("#tagsel_form").show();
649     }
652 function tagCanceled() {
653     $("#tagsel_form").hide();
654     $("#tagsel_tag").show();
655     $(".resort").show();
656     $("#tagsel_new").val("");
657     $("#tagsel_status, .tagstatus").empty().hide();
660 function tagAdded() {
661     var checkedBoxes = $(".searchresults :checkbox:checked");
662     if ($(checkedBoxes).size() == 0) {
663         alert(MSG_NO_RECORD_SELECTED);
664         return false;
665     }
667     var tag = $("#tagsel_new").val();
668     if (!tag || (tag == "")) {
669         alert(MSG_NO_TAG_SPECIFIED);
670         return false;
671     }
673     var bibs = [];
674     for (var i = 0; i < $(checkedBoxes).size(); i++) {
675         var box = $(checkedBoxes).get(i);
676         bibs[i] = $(box).val();
677     }
679     KOHA.Tags.add_multitags_button(bibs, tag);
680     return false;
681 }[% END %]
684 function enableCheckboxActions(){
685     // Enable/disable controls if checkboxes are checked
686     var checkedBoxes = $(".checkboxed input:checkbox:checked");
687     var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, , #selections-toolbar .links label")
688     if ($(checkedBoxes).size()) {
689       $("#selections").html(_("With selected titles: "));
690       $(controls).removeClass("disabled");
691     } else {
692       $("#selections").html(_("Select titles to: "));
693       $(controls).addClass("disabled");
694     }
697 [% IF ( OpacHighlightedWords ) %]
698 var q_array = new Array();  // holds search terms if available
700 function highlightOff() {
701     $("td").removeHighlight();
702     $(".highlight_toggle").toggle();
704 function highlightOn() {
705     var x;
706     for (x in q_array) {
707         q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
708         q_array[x] = q_array[x].toLowerCase();
709         var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
710         if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
711             $(".title").highlight(q_array[x]);
712             $(".author").highlight(q_array[x]);
713             $(".results_summary").highlight(q_array[x]);
714         }
715     }
716     $(".highlight_toggle").toggle();
718 [% END %]
719 $(document).ready(function(){
720     [% IF ( OpacHighlightedWords ) %]
721         $('a.title').each(function() {
722             $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
723         });
724     [% END %]
726     $(".cb").click(function(){
727       enableCheckboxActions();
728     });
729     enableCheckboxActions();
731     [% IF ( IDreamBooksResults ) %]
732         $('.idbresult').each(function() {
733             var isbn = $(this).children('a').text().replace(/\s*/,'');
734             var element = this;
736             if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
737             // Use Microsoft XDR for IE version 8 or above
738                 var xdr = new XDomainRequest();
739                 xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
740                 xdr.onload = function() {
741                     json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
742                     eval(json); // json is now a regular JSON object
743                     if(json.total_results > 0 && json.book.rating > 0){
744                         $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+_(" by ")+json.book.author+"' title='"+_("Rating based on reviews of ")+json.book.title+"'>"+json.book.rating+"%");
745                         $(element).show();
746                     } else {
747                         $(element).remove();
748                     }
749                 }
750                 xdr.send();
751             } else {
752                 $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
753                     if(json.total_results > 0 && json.book.rating > 0){
754                         $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+_(" by ")+json.book.author+"' title='"+_("Rating based on reviews of ")+json.book.title+"'>"+json.book.rating+"%");
755                         $(element).show();
756                     } else {
757                         $(element).remove();
758                     }
759                 });
760             }
761         });
762     [% END %]
764     var param1 = "";
765     [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) || loggedinusername ) %]
766     param1 += "<span id=\"selections\">"+_("Select titles to: ")+"</span>";
767     [% END %]
769 [% IF Koha.Preference( 'opacbookbag' ) == 1 OR Koha.Preference('virtualshelves') %]
770     param1 += "<select class=\"disabled\" name=\"addto\" id=\"addto\"><option>"+_("Add to...")+"</option>";
772     [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
773         param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
774     [% END %]
775     [% IF Koha.Preference('virtualshelves') %]
776         [% IF loggedinusername AND add_to_some_private_shelves.count %]
777             param1 += "<optgroup label=\""+_("Your lists:")+"\">";
778             [% SET number_of_private_shelves = 0 %]
779             [% FOREACH s IN add_to_some_private_shelves %]
780                 [% IF shelfnumber != s.shelfnumber %]
781                     param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
782                     [% SET number_of_private_shelves = number_of_private_shelves + 1 %]
783                     [% IF number_of_private_shelves == 10 %][% LAST %][% END %]
784                 [% END %]
785             [% END %]
786             param1 += "<\/optgroup>";
787         [% END %]
788         [% IF add_to_some_public_shelves.count %]
789             param1 += "<optgroup label=\""+_("Public lists:")+"\">";
790             [% SET number_of_public_shelves = 0 %]
791             [% FOREACH s IN add_to_some_public_shelves %]
792                 [% IF shelfnumber != s.shelfnumber %]
793                     param1 += "<option id=\"s[% s.shelfnumber | html %]\" value=\"addtolist\">[% s.shelfname | html %]<\/option>";
794                     [% SET number_of_public_shelves = number_of_public_shelves + 1 %]
795                     [% IF number_of_public_shelves == 10 %][% LAST %][% END %]
796                 [% END %]
797             [% END %]
798             param1 += "<\/optgroup>";
799         [% END %]
800         [% IF ( add_to_some_private_shelves and add_to_some_private_shelves.count > 10 ) or ( add_to_some_public_shelves and add_to_some_public_shelves.count > 10 ) %]
801             param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";
802         [% END %]
803         param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>"
804     [% END %]
805     param1 += "<\/select> <input type=\"submit\" class=\"btn btn-small\" value=\""+_("Save")+"\" />";
806 [% END %]
808     $('#sortsubmit').hide();
809     $('.resort').change(function() {
810         $('#bookbag_form').submit();
811     });
812     $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
813     $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
815 [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
816     $("span.addto").html(param1);
817 [% ELSE %]
818     [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %]
819         $("span.addto").html(param1);
820     [% END %]
821 [% END %]
823 [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %]
824     [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
825         $("#addto").on("change",function(){
826             cartList();
827         });
828         $(".addto").find("input:submit").click(function(){
829             cartList();
830             return false;
831         });
832     [% ELSE %]
833         $("#addto").on("click",function(){
834             cartList();
835             return false;
836         });
837     [% END %]
838 [% END %]
840     function cartList(){
841         addtoOption = $("#addto").find("option:selected");
842         addtoval = addtoOption.val();
843         if(addtoval == "addtolist"){
844             var shelfnumber = addtoOption.attr("id").replace("s","");
845             if (vShelfAdd()) {
846                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?selectedshelf='+shelfnumber+'&' + vShelfAdd());
847             }
848             return false;
849         } else if(addtoval == "newlist"){
850             [% IF ( loggedinusername ) %]if (vShelfAdd()) {
851                 Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
852             }[% ELSE %]
853                 alert(_("You must be logged in to create or add to lists"));
854             [% END %]
855             return false;
856         } else if(addtoval == "morelists"){
857             [% IF ( loggedinusername ) %]
858                 if (vShelfAdd()) {
859                     Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
860                 }
861             [% ELSE %]
862                 alert(_("You must be logged in to create or add to lists"));
863             [% END %]
864             return false;
865         }
866         if(addtoval == "addtocart" || $("#addto").attr("class") == "addtocart"){
867             addMultiple();
868             return false;
869          }
870     }
871     $("#CheckAll").click(function(){
872         $("#bookbag_form").checkCheckboxes();
873         enableCheckboxActions();
874         return false;
875     });
876     $("#CheckNone").click(function(){
877         $("#bookbag_form").unCheckCheckboxes();
878         enableCheckboxActions();
879         return false;
880     });
882 [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
883     $("#placehold").html("<input class=\"hold disabled\" type=\"submit\" value=\""+_("Place hold")+"\"/>");
884     $("#placehold").find("input:submit").click(function(){
885         holdMultiple();
886         return false;
887     });
888 [% END %]
890 [% IF ( query_desc ) %]
891     var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
892     var querystring = "[% querystring |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
893     [% IF ( OpacHighlightedWords ) %]
894         q_array = query_desc.split(" ");
895         // ensure that we don't have "" at the end of the array, which can
896         // break the highlighter
897         while (q_array.length > 0 && q_array[q_array.length-1] == "") {
898             q_array = q_array.splice(0,-1);
899         }
900         highlightOn();
901         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
902         $("#highlight_toggle_off").show().click(function() {highlightOff();});
903     [% END %]
904     [% IF ( OverDriveEnabled ) %]
905         var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
906         $( '#numresults' ) .append( ' ' )
907             .append( $overdrive_results );
908         KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", querystring, 1, 0, function( data ) {
909             if ( data.error ) {
910                 $overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') );
911                 return;
912             }
914             if ( data.totalItems ) {
915                 $overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' );
916             } else {
917                 $overdrive_results.remove();
918             }
919         } );
920     [% END %]
921     [% IF ( RecordedBooksEnabled ) %]
922         var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
923         $( '#numresults' ) .append( ' ' )
924             .append( $recordedbooks_results );
925         KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" | html %], null, function( data ) {
926             if ( data.error ) {
927                 $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks')  + ': ' + data.error);
928                 return;
929             }
931             // data.total can be either 42 or "60+"
932             if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) {
933                 $recordedbooks_results.html( '<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.total, 'RecordedBooks') + '</a>' );
934             } else {
935                 $recordedbooks_results.remove();
936             }
937         } );
938     [% END %]
939     [% IF ( OpenLibrarySearch ) %]
940         var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' );
941         $( '#numresults' ) .append( ' ' )
942             .append( $openlibrary_results );
943         KOHA.OpenLibrary.search( querystring, null, function( data ) {
944             if ( data.error ) {
945                 $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') );
946                 return;
947             }
949             if ( data.numFound > 0 ) {
950                 $openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">'  + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' );
951             } else {
952                 $openlibrary_results.remove();
953             }
954         } );
955     [% END %]
956 [% END %]
958 [% IF ( TagsInputEnabled && loggedinusername ) %]
959     $("#tagsel_tag").click(function(){
960         tagSelected();
961         return false;
962     });
963     $("#tagsel_cancel").click(function(){
964         tagCanceled();
965         return false;
966     });
967     $("#tagsel_button").click(function(){
968         tagAdded();
969         return false;
970     });
972     $(".tag_add").click(function(){
973         var thisid = $(this).attr("id");
974         thisid = thisid.replace("tag_add","");
975         $(this).addClass("hidden");
976         $("#tagform"+thisid).show();
977         $("#newtag"+thisid).focus();
978         $("#newtag"+thisid+"_status").empty().hide();
979         return false;
980     });
981     $(".cancel_tag_add").click(function(){
982         var thisid = $(this).attr("id");
983         thisid = thisid.replace("cancel","");
984         $("#tagform"+thisid).hide();
985         $("#tag_add"+thisid).removeClass("hidden");
986         $("#newtag"+thisid).val("");
987         $("#newtag"+thisid+"_status").empty().hide();
988         return false;
989     });
990     $(".tagbutton").click(function(){
991         var thisid = $(this).attr("title");
992         var tag = $("#newtag"+thisid).val();
993         if (!tag || (tag == "")) {
994             alert(MSG_NO_TAG_SPECIFIED);
995             return false;
996         }
997         KOHA.Tags.add_tag_button(thisid, tag);
998         return false;
999     });
1000 [% END %]
1002 [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
1003 [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
1004 [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
1005 [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
1006     KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]');
1007 [% END %]
1009 [% IF ( DidYouMean ) %]
1010     $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
1011         function() {
1012             $(this).addClass("dym-loaded");
1013         });
1014 [% END %]
1016 $("input.newtag").on('keydown', function(e){
1017     if (e.keyCode == 13) { e.preventDefault(); }
1021 //]]>
1022 </script>
1023 [% END %]