Bug 13618: Add html filters to all the variables
[koha-equinox.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Math %]
4 [% USE Koha %]
5 [% USE KohaDates %]
6 [% USE Branches %]
7 [% USE ColumnsSettings %]
8 [% USE AuthorisedValues %]
9 [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10 [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11 [% IF Koha.Preference('AmazonAssocTag') %]
12     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') | html %]
13 [% ELSE %]
14     [% AmazonAssocTag = '' | html %]
15 [% END %]
16
17 [% ShowCourseReservesHeader = 0 | html %]
18 [% IF Koha.Preference( 'UseCourseReserves' ) == 1 %]
19     [% FOREACH ITEM_RESULT IN itemloop %]
20        [% IF ITEM_RESULT.course_reserves %]
21            [% FOREACH r IN ITEM_RESULT.course_reserves %]
22                [% IF r.course.enabled == 'yes' %]
23                    [% ShowCourseReservesHeader = 1 | html %]
24                [% END %]
25            [% END %]
26         [% END %]
27     [% END %]
28 [% END %]
29
30 [% INCLUDE 'doc-head-open.inc' %]
31 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title | html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl.subfield | html %][% END %]</title>
32 [% INCLUDE 'doc-head-close.inc' %]
33 [% IF ( bidi ) %]
34   [% BLOCK cssinclude %][% Asset.css("css/right-to-left.css").raw %][% END %]
35 [% END %]
36 [% IF ( OpacStarRatings != 'disable' ) %]
37     [% BLOCK cssinclude %][% Asset.css("css/jquery.rating.css") | $raw %][% END %]
38 [% END %]
39 [% INCLUDE greybox.inc %]
40     [% Asset.css("lib/emoji-picker/css/emoji.css") | $raw %]
41 </head>
42 [% INCLUDE 'bodytag.inc' bodyid='opac-detail' bodyclass='scrollto' %]
43 [% INCLUDE 'masthead.inc' %]
44
45 <div class="main">
46     <ul class="breadcrumb">
47         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
48         <li><a href="#"><span>Details for: </span>[% title | html %][% FOREACH subtitl IN subtitle %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] [% subtitl.subfield | html %][% END %]</a></li>
49     </ul>
50
51     <div class="container-fluid">
52         <div class="row-fluid">
53             <div class="span9">
54                 <div id="catalogue_detail_biblio" class="maincontent">
55
56                     <div id="bookcover">
57                     [% IF ( OPACLocalCoverImages ) %]
58                         <div title="[% biblio.biblionumber | html %]" class="[% biblio.biblionumber | html %]" id="local-thumbnail-preview"></div>
59                     [% END %]
60                     [% IF ( OPACAmazonCoverImages ) %]
61                         [% IF ( OPACURLOpenInNewWindow ) %]
62                             <a href="http://www.amazon[% AmazonTld | html %]/gp/reader/[% normalized_isbn | html %][% AmazonAssocTag | html %]#reader-link" target="_blank" rel="noreferrer">
63                         [% ELSE %]
64                             <a href="http://www.amazon[% AmazonTld | html %]/dp/[% normalized_isbn | html %][% AmazonAssocTag | html %]">
65                         [% END %]
66                             <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>
67                     [% END %]
68
69                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
70                         [% IF ( content_identifier_exists ) %]
71                             <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | html %]/[% SyndeticsCoverImageSize | html %].GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% normalized_upc | html %]&amp;oclc=[% normalized_oclc | html %]" alt="" class="thumbnail" />
72                         [% ELSE %]
73                             <span class="no-image">No cover image available</span>
74                         [% END %]
75                     [% END %]
76
77                     [% IF ( GoogleJackets ) %]
78                         <div title="[% biblio.biblionumber | html %]" class="[% normalized_isbn | html %]" id="gbs-thumbnail-preview"></div>
79                     [% END %]
80                     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
81                       [% coce_id = normalized_ean || normalized_isbn | html %]
82                       <div title="[% biblio.biblionumber | html %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></div>
83                     [% END %]
84                     [% IF OpenLibraryCovers %]
85                         <div title="[% biblio.biblionumber | html %]" class="[% normalized_isbn | html %]" id="openlibrary-thumbnail-preview"></div>
86                     [% END %]
87                     [% bt_id = ( normalized_upc || normalized_isbn ) | html %]
88                     [% IF ( BakerTaylorEnabled && bt_id ) %]
89                         [% IF BakerTaylorBookstoreURL %]
90                             [% IF ( OPACURLOpenInNewWindow ) %]
91                                 <a href="https://[% BakerTaylorBookstoreURL | html %][% bt_id | html %]" target="_blank" rel="noreferrer"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
92                             [% ELSE %]
93                                 <a href="https://[% BakerTaylorBookstoreURL | html %][% bt_id | html %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
94                             [% END %]
95                         [% ELSE %]
96                             <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
97                         [% END %]
98                     [% END %]
99                     </div><!-- / #bookcover -->
100
101                     <abbr class="unapi-id" title="koha:biblionumber:[% biblio.biblionumber | html %]"><!-- unAPI --></abbr>
102                     [% IF ( ocoins ) # COinS / Openurl %]
103                         <span class="Z3988" title="[% ocoins | html %]"></span>
104                     [% END %]
105
106                     <div id="views">
107                         <span class="view current-view"><span id="Normalview">Normal view</span></span>
108                         <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% biblio.biblionumber | html %]">MARC view</a></span>
109                         [% IF ( ISBD ) %]<span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% biblio.biblionumber | html %]">ISBD view</a></span>[% END %]
110                     </div>
111                     [% IF ( OPACXSLTDetailsDisplay ) %]
112                         [% XSLTBloc | $raw %]
113                     [% ELSE %]
114                         <h1 class="title">[% title | html %][% IF ( subtitle ) %] <span class="subtitle">[% FOREACH subtitl IN subtitle %][% subtitl.subfield | html %] [% END %]</span>[% END %]</h1>
115                         [% IF ( author ) %]<h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:[% author |url %]">[% author | html %]</a></h5>[% END %]
116
117                         <span class="results_summary">[% UNLESS ( item_level_itypes ) %]
118                             [
119                             [% IF ( description ) %]
120                                 [% description | html %]
121                             [% ELSE %]
122                                 [% itemtype | html %]
123                             [% END %]
124                             ] [% END %]
125                             [% IF ( unititle ) %], [% unititle | html %][% END %]
126                         </span>
127
128                         [% IF ( MARCAUTHORS ) %]
129                             <div class="results_summary">
130                                 <span class="label">Additional authors:</span>
131                                 [% IF OPACPopupAuthorsSearch %]
132                                     <!-- Author search term selection modal -->
133                                     <div id="authorSearch" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="authorSearchLabel" aria-hidden="true">
134                                         <div class="modal-header">
135                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
136                                             <h3 id="authorSearchLabel">Select the item(s) to search</h3>
137                                         </div>
138                                         <div class="modal-body">
139                                             <input type="checkbox" onchange="checkAll(this, '#authorsList')" /> <b>All</b>
140                                             <ul id="authorsList">
141                                                 [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
142                                                     <li>
143                                                         [% IF (MARCAUTHOR.authoritylink) %]
144                                                             <input type="checkbox" name="checkbox"
145                                                                 id="author_[% loop.count | html %]"
146                                                                 onclick="makeAuthorRequest()"
147                                                                 value="an:[% MARCAUTHOR.authoritylink | html %]" />
148                                                         [% ELSE %]
149                                                             <input type="checkbox" name="checkbox"
150                                                                 id="author_[% loop.count | html %]"
151                                                                 onclick="makeAuthorRequest()"
152                                                                 value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" />
153                                                         [% END %]
154                                                         <label for="author_[% loop.count | html %]">
155                                                             [% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
156                                                                 [% SUBFIELD.value | html %]
157                                                             [% END %]
158                                                         </label>
159                                                     </li>
160                                                 [% END # /FOREACH MARCAUTHORS %]
161                                             </ul>
162                                         </div>
163                                         <div class="modal-footer">
164                                             <a id="validAuthorSearch" href="#" class="btn btn-primary">Search</a>
165                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
166                                         </div>
167                                     </div>
168                                 [% END # /OPACPopupAuthorsSearch %]
169
170                                 [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
171                                     [% authorsloop = loop | html %]
172                                     [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
173                                         [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]
174                                         [% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %]
175                                             <a role="button" data-toggle="modal" title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]"
176                                             class="showauthors" data-count="[% authorsloop.count | html %]"
177                                             href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]#authorSearch">[% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a>
178                                         [% ELSE %]
179                                             <a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value | html %]"
180                                             class="showauthors" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a>
181                                         [% END %]
182                                     [% END %]
183                                     [% IF (MARCAUTHOR.authoritylink) %]
184                                         <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink | html %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface | html %]/[% theme | html %]/images/filefind.png"></a>
185                                     [% END %]
186                                     [% IF IDREF and MARCAUTHOR.unimarc3 %]
187                                         <a href="/cgi-bin/koha/opac-idref.pl?unimarc3=[% MARCAUTHOR.unimarc3 | html %]" title="IdRef" rel="gb_page_center[600,500]">IdRef</a>
188                                     [% END %]
189                                     [% UNLESS ( loop.last ) %]|[% END %]
190                                 [% END # /FOREACH MARCAUTHORS %]
191                             </div>
192                         [% END # IF MARCAUTHORS %]
193
194                         [% IF ( MARCSERIES ) %]
195                             <span class="results_summary series"><span class="label">Series:</span>
196                                 [% FOREACH MARCSERIE IN MARCSERIES %]
197                                     [% FOREACH MARCSERIES_SUBFIELDS_LOO IN MARCSERIE.MARCSERIES_SUBFIELDS_LOOP %]
198                                         [% IF ( MARCSERIES_SUBFIELDS_LOO.value ) %]
199                                             <a href="/cgi-bin/koha/opac-search.pl?q=se:[% MARCSERIES_SUBFIELDS_LOO.value |url %]">[% MARCSERIES_SUBFIELDS_LOO.value | html %]</a>
200                                         [% END %]
201                                         [% IF ( MARCSERIES_SUBFIELDS_LOO.volumenum ) %]
202                                             . [% MARCSERIES_SUBFIELDS_LOO.volumenum | html %]
203                                         [% END %]
204                                     [% END %]
205                                     [% UNLESS ( loop.last ) %]|[% END %]
206                                 [% END # / FOREACH MARCSERIES %]
207                             </span>
208                         [% END # /MARCSERIES %]
209
210                         [% IF ( editionstatement ) %]
211                             <span class="results_summary edition"><span class="label">Edition statement:</span>[% editionstatement | html %][% IF ( editionresponsibility ) %]/[% editionresponsibility | html %][% END %]</span>
212                         [% END %]
213                         [% IF ( publishercode ) %]
214                             <span class="results_summary publisher"><span class="label">Published by :</span>
215                                 <a href="/cgi-bin/koha/opac-search.pl?q=pb:[% publishercode |url %] ">
216                                     [% publishercode | html %]
217                                 </a> [% IF ( place ) %]([% place | html %])[% END %] [% IF ( publicationyear ) %], [% publicationyear | html %][% END %]
218                             </span>
219                         [% END %]
220
221                         [% IF ( pages ) %]
222                             <span class="results_summary physical"><span class="label">Physical details:</span> [% pages | html %] [% illus | html %] [% size | html %]</span>
223                         [% END %]
224
225                         [% IF ( MARCISBNS ) %]
226                             <span class="results_summary isbn"><span class="label">ISBN:</span>[% FOREACH MARCISBN IN MARCISBNS %][% MARCISBN | html %][% IF ( loop.last ) %].[% ELSE %]; [% END %][% END %]</span>
227                         [% ELSE %]
228                             [% IF ( normalized_isbn ) %]
229                                 <span class="results_summary isbn"><span class="label">ISBN: </span>[% normalized_isbn | html %]</span>
230                             [% END %]
231                         [% END %]
232
233                         [% IF ( issn ) %]
234                             <span class="results_summary issn"><span class="label">ISSN:</span>[% issn | html %]</span>
235                         [% END %]
236
237                         [% IF ( collectiontitle ) %]
238                             <span class="results_summary collection"><span class="label">Collection: </span>
239                                 [% collectiontitle | html %]
240                                 [% IF ( collectionissn ) %] [% ', ISSN ' _  collectionissn | html %][% END %]
241                                 [% IF ( collectionvolume ) %] [% ' ; ' _ collectionvolume | html %] [% END %]
242
243                             </span>
244                         [% END %]
245
246                         [% IF ( unititles ) %]
247                             <span class="results_summary unititle"><span class="label">Uniform titles:</span>
248                                 [% FOREACH unititle IN unititles %]
249                                     [% unititle.unititle | html %] ;
250                                 [% END %]
251                             </span>
252                         [% END %]
253
254                         [% IF ( MARCSUBJCTS ) %]
255                             <div class="results_summary subject">
256                                 <span class="label">Subject(s):</span>
257
258                                 [% IF OPACPopupAuthorsSearch %]
259                                     <!-- Search term selection modal -->
260                                     <div id="subjectSearch" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="subjectSearchLabel" aria-hidden="true">
261                                         <div class="modal-header">
262                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
263                                             <h3 id="subjectSearchLabel">Select the term(s) to search</h3>
264                                         </div>
265                                         <div id="subjectsList" class="modal-body">
266                                             <input type="checkbox" id="all_subjects" onchange="checkAll(this, '#subjectsList')" />
267                                             <label for="all_subjects">
268                                                 <b>All</b>
269                                             </label>
270                                             [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
271                                                 [% subjectsloop = loop | html %]
272                                                 [% IF MARCSUBJCT.authoritylink %]
273                                                     <ul id="subjectsList[% loop.count | html %]" data-authid="[% MARCSUBJCT.authoritylink | html %]">
274                                                 [% ELSE %]
275                                                     <ul id="subjectsList[% loop.count | html %]">
276                                                 [% END %]
277                                                 [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
278                                                     <li>
279                                                         <input type="checkbox" onclick="makeSubjectRequest()" name="checkbox" id="subject_[% subjectsloop.count | html %]_[% loop.count | html %]" value="su,wrdl:[% SUBFIELD.value |url %]" />
280                                                         <label for="subject_[% subjectsloop.count | html %]_[% loop.count | html %]">
281                                                             [% SUBFIELD.value | html %]
282                                                         </label>
283                                                     </li>
284                                                 [% END %]
285                                                 </ul>
286                                             [% END %]
287                                         </div>
288                                         <div class="modal-footer">
289                                             <a href="#" id="validSubjectSearch" class="btn btn-primary">Search</a>
290                                             <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
291                                         </div>
292                                     </div>
293                                 [% END # /OPACPopupAuthorsSearch%]
294
295                                 [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
296                                     [% subjectsloop = loop | html %]
297                                     [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
298                                         [% SUBFIELD.separator | html %]
299                                         [% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %]
300                                             <a role="button" data-toggle="modal" title="[% '$' _ SUBFIELD.code _ ' ' _ SUBFIELD.value | html %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]#subjectSearch" onclick="showSubjects(this, [% subjectsloop.count | html %], [% loop.count | html %]); return false;">[% SUBFIELD.value | html %]</a>
301                                         [% ELSE %]
302                                             <a title="[% '$' _ SUBFIELD.code _ ' ' _ SUBFIELD.value | html %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% SUBFIELD.value | html %]</a>
303                                         [% END %]
304                                     [% END %]
305                                     [% IF (MARCSUBJCT.authoritylink) %]
306                                         <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink | html %]"><img style="vertical-align:middle" height="15" width="15" src="[% interface | html %]/[% theme | html %]/images/filefind.png" /></a>
307                                     [% END %]
308                                     [% UNLESS ( loop.last ) %] | [% END %]
309                                 [% END # / FOREACH MARCSUBJCTS %]
310                             </div>
311                         [% ELSE # /IF MARCSUBJCTS %]
312                             [% IF ( subjects ) %]<span class="results_summary"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject | html %]</a> | [% END %]</span>[% END %]
313                         [% END %]
314
315                         [% IF ( copyrightdate ) %]
316                             <span class="results_summary year"><span class="label">Year: </span>[% copyrightdate | html %]</span>
317                         [% END %]
318
319                         [% UNLESS ( item_level_itypes ) %]
320                             [% IF ( imgeurl ) %]
321                                 <img src="[% imageurl | html %]" alt="" />
322                             [% END %]
323                             <span class="results_summary itemtype"><span class="label">Item type: </span>
324                                 [% IF ( description ) %]
325                                     [% description | html %]
326                                 [% ELSE %]
327                                     [% itemtype | html %]
328                                 [% END %]
329                             </span>
330                         [% END %]
331
332                         [% IF ( MARCURLS ) %]
333                             <div class="results_summary online_resources"><span class="label">Online resources:</span>
334                                 <ul>
335                                     [% FOREACH MARCurl IN MARCURLS %]
336                                         <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]<br />[% END %]
337
338                                         [% IF ( OPACURLOpenInNewWindow ) %]
339                                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
340                                                 <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblio.biblionumber | html %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
341                                             [% ELSE %]
342                                                 <a href="[% MARCurl.MARCURL | html %]" title="[% MARCurl.MARCURL | html %]" target="_blank" rel="noreferrer">
343                                             [% END %]
344                                         [% ELSE %]
345                                             [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
346                                                 <a href="/cgi-bin/koha/tracklinks.pl?uri=[% MARCurl.MARCURL |url%]&amp;biblionumber=[% biblio.biblionumber | html %]" title="[% MARCurl.MARCURL | html %]">
347                                             [% ELSE %]
348                                                 <a href="[% MARCurl.MARCURL | html %]" title="[% MARCurl.MARCURL | html %]">
349                                             [% END %]
350                                         [% END %]
351                                         [% MARCurl.linktext | html %]</a>
352                                             [% IF ( MARCurl.notes ) %]
353                                                 <ul>
354                                                     [% FOREACH note IN MARCurl.notes %]
355                                                         <li>[% note.note | html %]</li>
356                                                     [% END %]
357                                                 </ul>
358                                             [% END %]
359                                         </li>
360                                     [% END # /FOREACH MARCURLS %]
361                                 </ul>
362                             </div>
363                         [% END # / IF MARCURLS %]
364                     [% END # / IF OPACXSLTDetailsDisplay %]
365
366                     <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
367                     [% IF ( LibraryThingForLibrariesID ) %]
368                         [% UNLESS ( LibraryThingForLibrariesTabbedView ) %]
369                             <div class="results_summary"><div id="ltfl_related" class="ltfl"></div></div>
370                             <div class="results_summary"><div id="ltfl_similars" class="ltfl"></div></div>
371                             <div class="results_summary"><div id="ltfl_tagbrowse" class="ltfl"></div></div>
372                         [% END %]
373                         <span class="results_summary">
374                             <span class="label">Reviews from LibraryThing.com:</span>
375                             <span style="display: block;" class="ltfl_reviews"></span>
376                         </span>
377                     [% END # / LibraryThingForLibrariesID %]
378
379                     <!--This grabs all of the lists a bib record appears in -->
380                     [% IF shelves.count %]
381                         <span class="results_summary lists"><span class="label">List(s) this item appears in: </span>
382                         [% FOREACH s IN shelves %]
383                             <a href="/cgi-bin/koha/opac-shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
384                             [% IF ( loop.last ) %][% ELSE %]|[% END %]
385                         [% END %]
386                         </span>
387                     [% END %]
388
389                     [% IF ( TagsShowEnabled ) %]
390                         <div class="results_summary tags">
391                             [% IF ( TagLoop ) %]
392                                 <span class="label">Tags from this library:</span>
393                                 <ul id="tagslist">
394                                     [% FOREACH TagLoo IN TagLoop %]
395                                         <li><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a> <span class="weight">([% TagLoo.weight_total | html %])</span>
396                                         [% IF ( loop.last ) %][% ELSE %], [% END %]
397                                         </li>
398                                     [% END %]
399                                 </ul>
400                             [% ELSE %]
401                                 <span class="label">Tags from this library:</span> <span class="notags">No tags from this library for this title.</span>
402                             [% END %]
403                             [% IF ( TagsInputEnabled ) %]
404                                 [% IF ( loggedinusername ) %]
405                                     <form id="tagform[% biblio.biblionumber | html %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
406                                         <label for="newtag[% biblio.biblionumber | html %]">New tag(s), separated by a comma:</label>
407                                         <p class="emoji-picker-container">
408                                           <input
409                                             name="newtag[% biblio.biblionumber | html %]"
410                                             id="newtag[% biblio.biblionumber | html %]"
411                                             type="text"
412                                             maxlength="100"
413                                             data-emojiable="true"
414                                             data-emoji-input="unicode">
415                                         </p>
416                                         <input name="tagbutton" class="btn btn-small tagbutton" title="[% biblio.biblionumber | html %]" type="submit" value="Add" />
417                                         <a class="cancel_tag_add" id="cancel[% biblio.biblionumber | html %]" href="#">(done)</a>
418                                     </form>
419
420                                     <span id="newtag[% biblio.biblionumber | html %]_status" class="tagstatus" style="display:none;">
421                                         Tag status here.
422                                     </span>
423                                     <a class="tag_add" id="tag_add[% biblio.biblionumber | html %]" href="#">Add tag(s)</a>
424                                 [% ELSE %]
425                                     <span id="login4tags">
426                                         [% IF Koha.Preference('casAuthentication') %]
427                                             [%# CAS authentication is too complicated for modal window %]
428                                             <a href="/cgi-bin/koha/opac-user.pl">Log in to add tags.</a>
429                                         [% ELSE %]
430                                             <a class="loginModal-trigger" data-toggle="modal" role="button" href="/cgi-bin/koha/opac-user.pl">Log in to add tags.</a>
431                                         [% END %]
432                                     </span>
433                                 [% END %]
434                             [% END # / IF TagsInputEnabled %]
435                         </div>
436                     [% END # /IF TagsShowEnabled %]
437
438                     [% IF ( SyndeticsEnabled ) %]
439                         [% IF ( SyndeticsSeries && SyndeticsSERIES1Exists ) %]
440                             <span class="results_summary">
441                                 <span class="label">Series information:</span>
442                                 <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/ffseries.aspx?isbn=[% normalized_isbn | html %]&amp;type=series&amp;num=1&amp;client=[% SyndeticsClientCode | html %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc | html %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc | html %][% END %]">Click to open in new window</a>
443                             </span>
444                         [% END # / IF SyndeticsSeries && SyndeticsSERIES1Exists%]
445                         [% IF ( SyndeticsAVPROFILEExists ) %]
446                             <span class="results_summary">
447                                 <span class="label">Audiovisual profile:</span>
448                                 <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | html %]/avprofile.html&amp;client=[% SyndeticsClientCode | html %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc | html %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc | html %][% END %]&amp;type=xw10">Click to open in new window</a>
449                             </span>
450                         [% END # / IF SyndeticsAVPROFILEExists %]
451
452                         [% IF ( SyndeticsFICTIONExists ) %]
453                             <span class="results_summary">
454                                 <span class="label">Fiction notes:</span>
455                                 <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | html %]/fiction.html&amp;client=[% SyndeticsClientCode | html %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc | html %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc | html %][% END %]&amp;type=xw10">Click to open in new window</a>
456                             </span>
457                         [% END # / IF SyndeticsFICTIONExists %]
458
459                         [% IF ( SyndeticsAwards && SyndeticsAWARDS1Exists ) %]
460                             <span class="results_summary">
461                                 <span class="label">Awards:</span>
462                                 <a target="_blank" rel="noreferrer" href="https://secure.syndetics.com/ffawards.aspx?isbn=[% normalized_isbn | html %]&amp;type=awards&amp;client=[% SyndeticsClientCode | html %][% IF ( normalized_upc ) %]&amp;upc=[% normalized_upc | html %][% END %][% IF ( normalized_oclc ) %]&amp;oclc=[% normalized_oclc | html %][% END %]">Click to open in new window</a>
463                             </span>
464                         [% END # / IF SyndeticsAwards && SyndeticsAWARDS1Exists %]
465                     [% END # / IF SyndeticsEnabled%]
466
467                     [% IF ( OpacStarRatings != 'disable' ) %]
468                         <form method="post" action="/cgi-bin/koha/opac-ratings.pl">
469                             <div class="results_summary ratings">
470
471                                 [% SET rating_avg = ratings.get_avg_rating() %]
472                                 [% rating_avg_int = BLOCK | html %][% rating_avg | format("%.0f") %][% END %]
473                                 [% FOREACH i  IN [ 1 2 3 4 5  ] %]
474                                     [% IF rating_avg_int == i && borrowernumber %]
475                                         <input class="auto-submit-star" type="radio" name="rating"  value="[% i | html %]"  checked="checked" />
476                                     [% ELSIF rating_avg_int == i %]
477                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i | html %]" checked="checked" disabled="disabled" />
478                                     [% ELSIF borrowernumber  %]
479                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i | html %]" />
480                                     [% ELSE   %]
481                                         <input class="auto-submit-star" type="radio" name="rating" value="[% i | html %]" disabled="disabled" />
482                                     [% END %]
483                                 [% END %]
484
485                                 <!-- define some hidden vars for ratings -->
486
487                                 <input  type="hidden" name='biblionumber'  value="[% biblio.biblionumber | html %]" />
488                                 <input  type="hidden" name='rating_value' id='rating_value' value="[% my_rating.rating_value | html %]" />
489
490                                 [% UNLESS ( rating_readonly ) %]&nbsp;  <input name="rate_button" type="submit" value="Rate me" />[% END %]&nbsp;
491
492                                 [% IF my_rating %]
493                                     <span id="rating_value_text">your rating: [% my_rating.rating_value | html %], </span>
494                                 [% ELSE %]
495                                     <span id="rating_value_text"></span>
496                                 [% END %]
497
498                                 <span id="rating_text">average rating: [% rating_avg | html %] ([% ratings.count | html %] votes)</span>
499                             </div>
500                         </form>
501                     [% END # / IF OpacStarRatings != 'disable' %]
502
503                     [% IF ( BakerTaylorContentURL ) %]
504                         <span class="results_summary">
505                         <span class="label">Enhanced content: </span>
506                               [% IF ( OPACURLOpenInNewWindow ) %]<a href="[% BakerTaylorContentURL | html %]" target="_blank" rel="noreferrer">Content Cafe</a>[% ELSE %]<a href="[% BakerTaylorContentURL | html %]">Content Cafe</a>[% END %]
507                         </span>
508                     [% END # / IF BakerTaylorContentURL %]
509
510                     [% IF ( NovelistSelectProfile && (normalized_isbn || normalized_upc) ) %]
511                         [% IF ( NovelistSelectView == 'above') %]
512                             <span class="results_summary NovelistSelect" style="display:none;">
513                             <span class="label">Novelist Select: </span>
514                             <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]></div>
515
516                             </span>
517                         [% END %]
518                     [% END # / IF NovelistSelectProfile %]
519
520                     [% IF ( Babeltheque ) %]
521                         <input type="hidden" name="BW_id_isbn" id="BW_id_isbn" value="[% normalized_isbn | html %]"/>
522                         <div id="BW_notes"></div>
523                         <div id="BW_critiques"></div>
524                         <div id="BW_critiques_pro"></div>
525                         <div id="BW_citations"></div>
526                     [% END # / IF Babeltheque%]
527
528                 </div> <!-- / #catalogue_detail_biblio -->
529
530                 <div id="bibliodescriptions" class="toptabs">
531                     <ul>
532                         [% IF ( defaulttab == 'holdings' ) %]
533                             <li id="tab_holdings" class="ui-tabs-active">
534                         [% ELSE %]
535                             <li id="tab_holdings">
536                         [% END %]
537                         [% BLOCK holding_tab_title %][% IF SeparateHoldings %]<span>[% LoginBranchname | html %] holdings</span>[% ELSE %]<span>Holdings</span>[% END %][% END %]
538                             <a href="#holdings">[% PROCESS holding_tab_title %] [% UNLESS too_many_items %][% ' ( ' _ (itemloop.size || 0) _ ' )' | html %][% END %]</a>
539                         </li>
540                         [% IF (SeparateHoldings) %]
541                             <li><a href="#otherholdings">Other holdings [% ' ( ' _ (otheritemloop.size || 0) _ ' )' | html %]</a></li>
542                         [% END %]
543                         [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
544                             <li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
545                         [% END %]
546                         [% IF ( SYNDETICS_TOC ) %]
547                             <li id="tab_toc"> <a href="#toc">TOC</a></li>
548                         [% END %]
549                         [% IF ( SyndeticsEnabled ) %]
550                             [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %]
551                                 <li id="tab_excerpt"> <a href="#excerpt">Excerpt</a></li>
552                             [% END %]
553                             [% IF ( ( SyndeticsReviews && SYNDETICS_REVIEWS ) || ( LibraryThingForLibrariesTabbedView && LibraryThingForLibrariesID) ) %]
554                                 <li id="tab_reviews"> <a href="#reviews">Reviews</a></li>
555                                 [% IF ( LibraryThingForLibrariesID ) %]
556                                     <li id="tab_LTFLreviews">
557                                         <script src="https://www.librarything.com/forlibraries/widget.js?id=[% LibraryThingForLibrariesID | html %]"></script>
558                                         <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking <a href="https://www.librarything.com/forlibraries/noscript.php?id=[% LibraryThingForLibrariesID | html %]&amp;accessibility=1">here</a>.</noscript>
559                                     </li>
560                                 [% END %]
561                             [% END %]
562                             [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
563                                 <li id="tab_anotes"> <a href="#anotes">About the author</a></li>
564                             [% END %]
565                         [% END # / IF SyndeticsEnabled %]
566
567                         [% IF ( LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView ) %]
568                             <li id="tab_LFTLSimilarItems"> <a href="#LFTLSimilarItems">Similar items</a></li>
569                             <li id="tab_LTFLTagBrowse"> <a href="#LTFLTagBrowse">Tag browser</a></li>
570                         [% END %]
571
572                         [% IF ( subscriptionsnumber ) %]
573                             [% IF ( defaulttab == 'subscriptions' ) %]<li id="tab_subscriptions" class="ui-tabs-active">[% ELSE %]<li id="tab_subscriptions">[% END %]
574                                 <a href="#subscriptions">Subscriptions ( [% subscriptionsnumber | html %] )</a>
575                             </li>
576                         [% END %]
577
578                         [% IF Koha.Preference( 'reviewson' ) == 1 %]
579                             <li id="tab_comments"><a href="#comments">Comments[% ' ( ' _ (reviews.size || 0) _ ' )' | html %]</a></li>
580                         [% END %]
581
582                         [% IF ( NovelistSelectProfile && (normalized_isbn || normalized_upc) ) %]
583                             [% IF ( NovelistSelectView == 'tab') %]
584                                 <li id="tab_NovelistSelect" class="NovelistSelect" style="display:none;"> <a href="#NovelistSelect">Novelist Select</a></li>
585                             [% END %]
586                         [% END %]
587
588                         [% IF ( OPACFRBRizeEditions && XISBNS ) %]
589                             <li id="tab_editions"><a href="#editions">Editions</a></li>
590                         [% END %]
591
592                         [% IF ( serialcollection ) %]
593                             [% IF ( defaulttab == 'serialcollection' ) %]<li id="tab_serialcollection" class="ui-tabs-active">[% ELSE %]<li id="tab_serialcollection">[% END %]
594                                 <a href="#serialcollection">Serial collection</a>
595                             </li>
596                         [% END %]
597
598                         [% IF ( OPACLocalCoverImages && localimages.size ) %]
599                             <li id="tab_images"><a href="#images">Images</a></li>
600                         [% END %]
601
602                         [% IF ( HTML5MediaEnabled && HTML5MediaSets ) %]
603                             [% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li>
604                         [% END %]
605
606                         [% IF ( IDreamBooksReviews ) %]
607                             <li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li>
608                         [% END %]
609                     </ul>
610
611                     [% IF ( serialcollection ) %]
612                         <div id="serialcollection">
613                             <table id="serialcollectiont" class="table table-bordered table-striped">
614                             <thead>
615                                 <tr>
616                                     <th id="serial_library">Library</th>
617                                     <th id="serial_collection">Serial collection</th>
618                                     <th id="serial_itemcallnumber">Item call number</th>
619                                 </tr>
620                             </thead>
621                             <tbody>
622                             [% FOREACH serialcollection IN serialcollections %]
623                                 <tr>
624                                 <td>[% serialcollection.branch | html %]</td>
625                                 <td>[% serialcollection.text | html %]</td>
626                                 <td>[% serialcollection.itemcallnumber | html %]</td>
627                                 </tr>
628                             [% END %]
629                             </tbody>
630                             </table>
631                         </div>
632                     [% END # / IF serialcollection %]
633
634
635                     <div id="holdings">
636                         [% IF too_many_items %]
637                             <p>This record has many physical items ([% items_count | html %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]&amp;viewallitems=1">Click here to view them all.</a></p>
638                         [% ELSIF ( itemloop.size ) %]
639                             [% INCLUDE items_table items=itemloop tab="holdings" table_id="holdingst" %]
640                             [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
641                               [% IF acquisition_details.total_quantity == 1 %]
642                                 <span>1 item is on order.</span>
643                               [% ELSE %]
644                                 <span>[% acquisition_details.total_quantity | html %] items are on order.</span>
645                               [% END %]
646                             [% END %]
647                             [% IF holds_count.defined || priority %]
648                                 <div id="bib_holds">
649                                     [% IF holds_count.defined %]
650                                         <span>Total holds: [% holds_count | html %]</span>
651                                     [% END %]
652                                     [% IF priority %]
653                                         [% IF holds_count.defined %]
654                                             <span>(priority [% priority | html %])</span>
655                                         [% ELSE %]
656                                             <span>Overall queue priority: [% priority | html %]</span>
657                                         [% END %]
658                                     [% END %]
659                                 </div>
660                             [% END %]
661                         [% ELSE %]
662                             [% IF ( ALTERNATEHOLDINGS ) %]
663                                 [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
664                                     <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
665                                 [% END %]
666                             [% ELSE %]
667                                 [% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.total_quantity > 0 %]
668                                   [% IF acquisition_details.total_quantity == 1 %]
669                                     <span>1 item is on order.</span>
670                                   [% ELSE %]
671                                     <span>[% acquisition_details.total_quantity | html %] items are on order.</span>
672                                   [% END %]
673                                 [% ELSE %]
674                                     <div id="noitems">No physical items for this record</div>
675                                 [% END %]
676                             [% END %]
677                         [% END # IF itemloop.size %]
678                         [% PROCESS 'shelfbrowser.inc' %]
679                         [% INCLUDE shelfbrowser tab='holdings' %]
680                         <br style="clear:both;" />
681                     </div> <!-- / #holdings -->
682
683                     [% IF (SeparateHoldings) %]
684                         <div id="otherholdings">
685                             [% IF (otheritemloop.size) %]
686                                 [% INCLUDE items_table items=otheritemloop tab="otherholdings" table_id="otherholdingst" %]
687                             [% ELSE %]
688                                 <span>No other items.</span>
689                             [% END %]
690                             [% INCLUDE shelfbrowser tab='otherholdings' %]
691                         </div>
692                     [% END # / SeparateHoldings %]
693
694                     [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
695                         <div id="descriptions">
696                             <div class="content_set">
697
698                             [% IF ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY ) %]
699                                 <h4>Enhanced descriptions from Syndetics:</h4>
700                                 <p>[% SYNDETICS_SUMMARY | html %]</p>
701                             [% END %]
702
703                             [% IF ( MARCNOTES ) %]
704                                 <div id="marcnotes">
705                                 [% FOREACH MARCNOTE IN MARCNOTES %]
706                                     <p>
707                                     [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
708                                         <a href="[% MARCNOTE.marcnote | html %]">[% MARCNOTE.marcnote | html %]</a>
709                                     [% ELSE %]
710                                         [% MARCNOTE.marcnote FILTER html_line_break | html %]
711                                     [% END %]
712                                     </p>
713                                 [% END %]
714                                 </div>
715                             [% ELSE %]
716                                 [% IF ( notes ) %]
717                                     <p>[% notes | html %]</p>
718                                 [% END %]
719                             [% END %]
720
721                             </div>
722                         </div> <!-- / #descriptions -->
723                     [% END # / IF MARCNOTES || notes %]
724
725                     [% IF ( SyndeticsEnabled ) %]
726                         [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %]
727                             <div id="toc">
728                                 <div class="content_set">
729                                     <h3>Table of contents provided by Syndetics</h3>
730                                         <ul>
731                                             [% FOREACH SYNDETICS_TO IN SYNDETICS_TOC %]
732                                                 <li><b>[% SYNDETICS_TO.l | html %] [% SYNDETICS_TO.t | html %]</b>[% IF ( SYNDETICS_TO.p ) %] ([% SYNDETICS_TO.p | html %])[% END %]</li>
733                                             [% END %]
734                                         </ul>
735                                 </div>
736                             </div>
737                         [% END # / IF SyndeticsTOC && SYNDETICS_TOC %]
738
739                         [% IF ( SyndeticsExcerpt && SYNDETICS_EXCERPT ) %]
740                             <div id="excerpt">
741                                 <div class="content_set">
742                                     <h3>Excerpt provided by Syndetics</h3>
743                                     [% SYNDETICS_EXCERPT | html %]
744                                 </div>
745                             </div>
746                         [% END # / IF SyndeticsExcerpt && SYNDETICS_EXCERPT %]
747
748                         [% IF ( SyndeticsReviews && SYNDETICS_REVIEWS ) %]
749                             <div id="reviews">
750                                 <div class="content_set">
751                                     <h3>Reviews provided by Syndetics</h3>
752                                     [% FOREACH SYNDETICS_REVIEW IN SYNDETICS_REVIEWS %]
753                                         [% IF ( SYNDETICS_REVIEW.title ) %]
754                                             <h4>[% SYNDETICS_REVIEW.title | html %]</h4>
755                                                 [% FOREACH review IN SYNDETICS_REVIEW.reviews %]
756
757                                                     [% IF ( review.content ) %]
758                                                         [% review.content | html %]
759                                                     [% END %]
760
761                                                 [% END %]
762                                         [% END %]
763                                     [% END %]
764                                 </div>
765                             </div>
766                         [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
767
768                         [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %]
769                             <div id="anotes">
770                                 <div class="content_set">
771                                     <h3>Author notes provided by Syndetics</h3>
772                                     [% FOREACH SYNDETICS_ANOTE IN SYNDETICS_ANOTES %]
773                                         [% IF ( SYNDETICS_ANOTE.content ) %]
774                                             [% SYNDETICS_ANOTE.content | html %]
775                                         [% END %]
776                                     [% END %]
777                                 </div>
778                             </div>
779                         [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %]
780                     [% END # / IF SyndeticsEnabled %]
781
782                     [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && (normalized_isbn || normalized_upc) ) %]
783                        <div id="NovelistSelect" >
784                             <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]></div>
785                        </div>
786                     [% END # / IF NovelistSelectProfile && NovelistSelectView == 'tab' %]
787
788                     [% IF ( subscriptionsnumber ) %]
789                         <div id="subscriptions">
790                             <h2>This is a serial</h2>
791                             <p class="subscription_count">There are [% subscriptionsnumber | html %] subscription(s) associated with this title.</p>
792                             [% FOREACH subscription IN subscriptions %]
793                                 [% IF ( subscription.branchcode ) %]
794                                     <h3>At library: [% Branches.GetName( subscription.branchcode ) | html %]</h3>
795                                 [% ELSE %]
796                                     [% IF ( subscription.branchcode ) %]
797                                         <h3>At library: [% subscription.branchcode | html %]</h3>
798                                     [% END %]
799                                 [% END %]
800                                 [% IF ( subscription.closed ) %]
801                                     <p class="subscription_closed">This subscription is closed.</p>
802                                 [% END %]
803                                 [% IF ( subscription.callnumber ) %]
804                                   <p class="subscription_callnumber">Call number: [% subscription.callnumber | html %]</p>
805                                 [% END %]
806                                 [% IF ( subscription.subscriptionnotes ) %]
807                                     <p class="subscription_notes">[% subscription.subscriptionnotes FILTER html_line_break | html %] </p>
808                                 [% END %]
809                                 <p class="subscription_dates">Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
810                                 [% IF ( subscription.letter ) %]<span class="email_notifications">
811                                     [% IF ( loggedinusername ) %]
812                                         [% IF ( subscription.hasalert ) %]
813                                             <span>You have subscribed to email notification on new issues. </span><a style="color:#000;" class="btn" title="Cancel email notification" href="/cgi-bin/koha/opac-alert-subscribe.pl?op=cancel&amp;subscriptionid=[% subscription.subscriptionid | html %]&amp;biblionumber=[% subscription.biblionumber | html %]">Cancel email notification</a>
814                                         [% ELSE %]
815                                             <a style="color:#000;" class="btn" title="Subscribe to email notification on new issues" href="/cgi-bin/koha/opac-alert-subscribe.pl?subscriptionid=[% subscription.subscriptionid | html %]&amp;biblionumber=[% subscription.biblionumber | html %]">Subscribe to email notification on new issues</a>
816                                         [% END %]
817                                     [% ELSE %]
818                                         <span>You must log in if you want to subscribe to email notification on new issues</span>
819                                     [% END %]
820                                 </span>[% END %]
821                                 [% IF ( subscription.missinglist ) %]
822                                     <p class="subscription_missing">Missing issues: [% subscription.missinglist | html %] </p>
823                                 [% END %]
824                                 [% IF ( subscription.opacnote ) %]
825                                     <p class="subscription_opacnote">[% subscription.opacnote FILTER html_line_break | html %]</p>
826                                 [% END %]
827                                 [% IF ( subscription.latestserials ) %]
828                                     <p class="subscription_latestissues"> The [% subscription.opacdisplaycount | html %] latest issues for this subscription:</p>
829                                     <table class="table table-bordered table-striped" id="subscriptionst">
830                                         <thead>
831                                         <tr>
832                                             <th id="serial_serialseq" data-colname="serial_serialseq">Issue #</th>
833                                             <th id="serial_publisheddate" data-colname="serial_publisheddate" class="title-string">Publication date</th>
834                                             <th id="serial_planneddate" data-colname="serial_planneddate" class="title-string">Received date</th>
835                                             <th id="serial_status" data-colname="serial_status">Status</th>
836                                             <th id="serial_notes" data-colname="serial_notes">Note</th>
837                                         </tr>
838                                         </thead>
839                                         <tbody>
840                                         [% FOREACH latestserial IN subscription.latestserials %]
841                                             <tr>
842                                                 <td class="serialseq">[% latestserial.serialseq | html %]</td>
843                                                 <td class="publisheddate">[% latestserial.publisheddate | html %]</td>
844                                                 <td class="planneddate">[% latestserial.planneddate | html %]</td>
845                                                 <td class="serial_status">
846                                                     [% IF (latestserial.status1 ) %]<span>Expected</span>[% END %]
847                                                     [% IF (latestserial.status2 ) %]<span>Arrived</span>[% END %]
848                                                     [% IF (latestserial.status3 ) %]<span>Late</span>[% END %]
849                                                     [% IF (latestserial.status4 ) %]<span>Missing</span>[% END %]
850                                                         [% IF (latestserial.status41 ) %]<span>Missing (never received)</span>[% END %]
851                                                         [% IF (latestserial.status42 ) %]<span>Missing (sold out)</span>[% END %]
852                                                         [% IF (latestserial.status43 ) %]<span>Missing (damaged)</span>[% END %]
853                                                         [% IF (latestserial.status44 ) %]<span>Missing (lost)</span>[% END %]
854                                                     [% IF (latestserial.status5 ) %]<span>Not issued</span>[% END %]
855                                                     [% IF (latestserial.status6 ) %]<span>Delete</span>[% END %]
856                                                     [% IF (latestserial.status7 ) %]<span>Claimed</span>[% END %]
857                                                     [% IF (latestserial.status8 ) %]<span>Stopped</span>[% END %]
858                                                 </td>
859                                                 <td class="serial_notes">[% latestserial.notes | html %]</td>
860                                             </tr>
861                                         [% END # / FOREACH latestserials %]
862                                         </tbody>
863                                     </table>
864                                 [% END # / IF subscription.latestserials %]
865                             [% END # / FOREACH subscriptions %]
866                             <p class="subscription_moredetails"><a href="opac-serial-issues.pl?biblionumber=[% biblio.biblionumber | html %]">More details</a></p>
867                         </div> <!-- / #subscriptions -->
868                     [% END # IF subscriptionsnumber %]
869
870                     [% IF ( LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView ) %]
871                         <!-- Library Thing for Libraries Content -->
872                         <div id="LFTLSimilarItems">
873                             <div class="content_set">
874                                 <!-- Uncommenting this span makes the font smaller in the tab for LTFL -->
875                                 <!-- but breaks Xhtml validation -->
876                                 <!--    <span class="results_summary">-->
877                                 <div id="ltfl_related"></div>
878                                 <div id="ltfl_similars"></div>
879                                 <!--            </span>-->
880                                 </div>
881                                 </div>
882                                 <div id="LTFLTagBrowse">
883                                     <div class="content_set">
884                                         <!-- <span class="results_summary"> -->
885                                         <div id="ltfl_tagbrowse" class="ltfl"></div>
886                                         <!-- </span> -->
887                                     </div>
888                                 </div>
889                     [% END # / IF LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView %]
890
891                     [% IF Koha.Preference( 'reviewson' ) == 1 %]
892                         <div id="comments">
893                             <div id="newcomment"></div>
894                                 [% IF ( reviews ) %]
895                                     [% FOREACH review IN reviews %]
896                                         [% IF borrowernumber && review.borrowernumber == borrowernumber %]
897                                             <div class="commentline yours" id="c[% review.reviewid | html %]">
898                                                 [% IF ( review.avatarurl ) %]
899                                                     <img class="avatar" src="[% review.avatarurl | html %]" height="80" width="80" alt="" />
900                                                 [% END %]
901                                                 [% IF review.approved %]
902                                                     <h5>Your comment</h5>
903                                                 [% ELSE %]
904                                                     <h5>Your comment (preview, pending approval)</h5>
905                                                 [% END %]
906                                                 <small>[% review.datereviewed | $KohaDates %]</small>
907                                                 <p>
908                                                     [% FILTER html_break %]
909                                                         [% review.review | html %]
910                                                     [% END %]
911                                                     <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% review.biblionumber | html %]&amp;reviewid=[% review.reviewid | html %]');">Edit</a>
912                                                 </p>
913                                             </div>
914                                         [% ELSE %]
915                                             <div class="commentline">
916                                                 [% IF ( ShowReviewer != "none" && review.patron) %]
917
918                                                     [% IF ( review.avatarurl ) %]
919                                                         <img class="avatar" src="[% review.avatarurl | html %]" height="80" width="80" alt="" />
920                                                     [% END %]
921                                                     [% SWITCH ShowReviewer %]
922                                                     [% CASE 'full' %]
923                                                         <h5>Comment by [% review.patron.title | html %] [% review.patron.firstname | html %] [% review.patron.surname | html %]</h5>
924                                                     [% CASE 'first' %]
925                                                         <h5>Comment by [% review.patron.firstname | html %]</h5>
926                                                     [% CASE 'surname' %]
927                                                         <h5>Comment by [% review.patron.surname | html %]</h5>
928                                                     [% CASE 'firstandinitial' %]
929                                                         <h5>Comment by [% review.patron.firstname | html %] [% review.patron.surname|truncate(2,'.') | html %]</h5>
930                                                     [% CASE 'username' %]
931                                                         <h5>Comment by [% review.patron.userid | html %]</h5>
932                                                     [% END %]
933
934                                                     <small>[% review.datereviewed | $KohaDates %]</small>
935                                                 [% ELSE %]
936                                                     <h5>Patron comment on [% review.datereviewed | $KohaDates %]</h5>
937                                                 [% END # / IF ShowReviewer != "none" && review.patron %]
938                                                 <p>
939                                                   [% FILTER html_break %]
940                                                   [% review.review | html %]
941                                                   [% END %]
942                                                 </p>
943                                             </div> <!-- / .commentline -->
944                                         [% END %]
945                                     [% END # / FOREACH reviews %]
946                                 [% ELSE %]
947                                     <p>There are no comments for this item.</p>
948                                 [% END # / IF reviews %]
949
950                                 [% IF ( loggedinusername ) %]
951                                     [% UNLESS ( loggedincommenter ) %]
952                                        <div id="addcomment"> <a href="#" onclick="Dopop('/cgi-bin/koha/opac-review.pl?biblionumber=[% biblio.biblionumber | html %]'); return false;">
953                                             Post your comments on this item.
954                                         </a></div>
955                                     [% END %]
956                                 [% ELSE %]
957                                     <div id="addcomment"><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a> to post a comment.</div>
958                                 [% END # / IF loggedinusername %]
959                             </div> <!-- / #comments -->
960                         [% END # / IF reviewson %]
961
962                         [% IF ( OPACFRBRizeEditions && XISBNS ) %]
963                             <div id="editions">
964                                 <h4>Other editions of this work</h4>
965                                 <table class="table table-bordered table-striped">
966                                     [% FOREACH XISBN IN XISBNS %]
967                                         <tr>
968                                             <td>
969                                             [% IF ( OPACAmazonCoverImages ) %]
970                                                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" alt="" />
971                                             [% END %]
972
973                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
974                                                 [% IF ( XISBN.content_identifier_exists ) %]
975                                                     <img src="https://secure.syndetics.com/index.aspx?isbn=[% XISBN.browser_normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %][% IF ( XISBN.browser_normalized_upc ) %]&amp;upc=[% XISBN.browser_normalized_upc | html %][% END %][% IF ( XISBN.browser_normalized_oclc ) %]&amp;oclc=[% XISBN.browser_normalized_oclc | html %][% END %]&amp;type=xw10" alt="" />
976                                                 [% ELSE %]
977                                                     <span class="no-image">No cover image available</span>
978                                                 [% END # / IF  XISBN.content_identifier_exists %]
979                                             [% END # / IF SyndeticsEnabled && SyndeticsCoverImages %]
980                                             </td>
981
982                                             [% UNLESS ( item_level_itypes ) %]
983                                                 <td>[% XISBN.description | html %]</td>
984                                             [% END %]
985                                             <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% XISBN.biblionumber | html %]">[% XISBN.title | html %]</a>
986                                                 [% IF ( XISBN.author ) %]<span> by </span>[% XISBN.author | html %][% END %]
987                                                 [% IF ( XISBN.copyrightdate ) %]<span> &copy;</span>[% XISBN.copyrightdate | html %][% END %]
988                                                 [% IF ( XISBN.publishercode ) %]
989                                                     <p>[% XISBN.publishercode | html %]
990                                                         [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %]
991                                                         [% IF ( XISBN.publicationyear ) %][% ', ' _ XISBN.publicationyear | html %][% END %]
992                                                         [% IF ( XISBN.pages ) %][% XISBN.pages | html %] [% XISBN.illus | html %] [% XISBN.size | html %][% END %]
993                                                     </p>
994                                                 [% END %]
995                                             </td>
996                                         </tr>
997                                     [% END # / FOREACH XISBNS %]
998                                 </table>
999                             </div> <!-- / #editions -->
1000                         [% END # / IF OPACFRBRizeEditions && XISBNS %]
1001
1002                         [% IF ( HTML5MediaEnabled ) %]
1003                             <div id="html5media">
1004                               [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1005                                 <p>
1006                                   [% SET ctrl_preload = ' controls preload=none' #translatability %]
1007                                   <[% HTML5MediaParent _ ctrl_preload | html %] >
1008                                     <[% HTML5MediaSet.child _ ' src="' _  HTML5MediaSet.srcblock _'"' _ HTML5MediaSet.typeblock | html %] />
1009                                     <span>[[% HTML5MediaParent | html %] tag not supported by your browser.]</span>
1010                                   </[% HTML5MediaParent | html %]>
1011                                 </p>
1012                               [% END %]
1013                             </div>
1014                         [% END # / IF HTML5MediaEnabled %]
1015
1016                         [% IF ( OPACLocalCoverImages && localimages.size ) %]
1017                             <div id="images">
1018                                 <p>Click on an image to view it in the image viewer</p>
1019                                 [% FOREACH image IN localimages %]
1020                                     [% IF image %]
1021                                         <a class="localimage" href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblio.biblionumber | html %]&amp;imagenumber=[% image | html %]"><img alt="" src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image | html %]" /></a>
1022                                     [% END %]
1023                                 [% END %]
1024                             </div><!-- / #images -->
1025                         [% END # / IF OPACLocalCoverImages && localimages.size %]
1026
1027                         [% IF ( IDreamBooksReviews ) %]
1028                             <div id="idb_critic_reviews">
1029                                 <div id="idb_review_snippets"></div>
1030                                 <span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span>
1031                             </div>
1032                         [% END %]
1033                 </div> <!-- / #bibliodescriptions -->
1034
1035                 [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]
1036                     <div id="NovelistSelect">
1037                         <h3>Novelist Select</h3>
1038                         <div data-novelist-novelistselect="[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]"></div>
1039                     </div>
1040                 [% END %]
1041
1042                 [% IF ( Babeltheque ) %]
1043                     <div>
1044                         <div id="BW_etiquettes"></div>
1045                         <div id="BW_suggestions"></div>
1046                     </div>
1047                     <div class="clearfix"></div>
1048                     <div>
1049                         <div id="BW_podcasts"></div>
1050                     </div>
1051                     <div class="clearfix"></div>
1052                     <div>
1053                         <div id="BW_videos"></div>
1054                     </div>
1055                 [% END # / IF Babeltheque %]
1056
1057             [%# Following on one line due to translation issues %]
1058             [% INCLUDE "openlibrary-readapi.inc" bib = { normalized_isbn => normalized_isbn,lccn => lccn, normalized_oclc => normalized_oclc } %]
1059
1060         </div> <!-- /.span9 -->
1061
1062         <div class="span3">
1063             <div id="ulactioncontainer">
1064
1065                 [% IF ( OpacBrowseResults && busc ) %]
1066                     <div class="nav_results">
1067                         <div class="l_Results">
1068                             [% IF ( listResults ) %]
1069                                 <a href="#" id="a_listResults">Browse results</a>
1070                             [% ELSE %]
1071                                 <span>Browse results</span>
1072                             [% END %]
1073                         </div>
1074                         <ul class="pg_menu clearfix">
1075                             <li class="left_results">
1076                                 [% IF ( previousBiblionumber ) %]
1077                                     <a href="opac-detail.pl?biblionumber=[% previousBiblionumber | html %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( previousTitle ) %][% previousTitle | html %][% ELSE %]previous biblio[% END %]">&laquo; Previous</a>
1078                                 [% ELSE %]
1079                                     <span>Previous</span>
1080                                 [% END %]
1081                             </li>
1082                             [%# busc is already URI encoded %]
1083                             <li class="back_results"><a href="opac-search.pl?[% busc | html %]" title="Back to the results search list">Back to results</a></li>
1084                             <li class="right_results">
1085                                 [% IF ( nextBiblionumber ) %]
1086                                     <a href="opac-detail.pl?biblionumber=[% nextBiblionumber | html %][% IF ( query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]" title="See: [% IF ( nextTitle ) %][% nextTitle | html %][% ELSE %]next biblio[% END %]">Next &raquo;</a>
1087                                 [% ELSE %]
1088                                     <span>Next</span>
1089                                 [% END %]
1090                             </li>
1091                         </ul>
1092                         [% IF ( listResults ) %]
1093                         <div class="results-pagination">
1094                             <div class="nav_pages">
1095                                 <span class="close_pagination"><a href="#" id="close_pagination">Close</a></span>
1096                                 <ul id="listResults"></ul>
1097                             </div>
1098                             <div class="pagination_list">
1099                                 <ul id="ul_pagination_list"></ul>
1100                             </div>
1101                         </div>
1102                         [% END %]
1103                     </div>
1104                 [% END # / IF OpacBrowseResults && busc %]
1105
1106                 [% INCLUDE 'opac-detail-sidebar.inc' %]
1107
1108                 [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && ( normalized_isbn || normalized_upc ) ) %]
1109                     <div id="NovelistSelect">
1110                         <h4>Novelist Select</h4>
1111                         <div data-novelist-novelistselect=[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]></div>
1112                     </div>
1113                 [% END %]
1114
1115                 [% IF ( Babeltheque ) %]
1116                     <div class="babeltheque_adds">
1117                         <div id="BW_critiques_aj"></div>
1118                         <div id="BW_citations_aj"></div>
1119                     </div>
1120                 [% END %]
1121
1122                 [% IF ( SocialNetworks ) %]
1123                     <div id="social_networks" class="clearfix">
1124                         <span>Share</span>
1125                         <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1126                         <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1127                         <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div>
1128                         <div><div class="g-plusone" data-size="small" data-count="false"></div></div>
1129                         <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title |url %]" data-lang="[% lang | html %]">Tweet</a></div>
1130                     </div>
1131                 [% END %]
1132             </div> <!-- / .ulactioncontainer -->
1133         </div> <!-- / .span4 -->
1134     </div> <!-- / .row-fluid -->
1135     <div class="row-fluid">
1136         [% IF ( LibraryThingForLibrariesID ) %]
1137             <script src="https://ltfl.librarything.com/forlibraries/widget.js?systype=koha&amp;id=[% LibraryThingForLibrariesID | html %]"></script>
1138             <noscript>This page contains enriched content visible when JavaScript is enabled or by clicking
1139             <a href="https://www.librarything.com/forlibraries/noscript.php?id=[% LibraryThingForLibrariesID | html %]&amp;accessibility=1">here</a>.</noscript>
1140         [% END %]
1141
1142         [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1143             <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1144         [% END %]
1145
1146         [% IF ( Babeltheque ) %]
1147             <script src="[% Babeltheque_url_js | html %]"></script>
1148         [% END %]
1149     </div> <!-- / .row-fluid -->
1150 </div> <!-- / .container-fluid -->
1151 </div> <!-- / .main -->
1152
1153 [% INCLUDE 'opac-bottom.inc' %]
1154
1155 [%# End of template %]
1156
1157 [% BLOCK items_table %]
1158     <table class="table table-bordered table-striped" id="[% table_id | html %]">
1159         <thead>
1160             <tr>
1161         [% IF ( item_level_itypes ) %]
1162                 <th id="item_itemtype" data-colname="item_itemtype" class="itype">Item type</th>[% END %]
1163         [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1164                 <th id="item_current_location" data-colname="item_current_location" class="item_location">Current location</th>[% END %]
1165         [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1166                 <th id="item_home_location" data-colname="item_home_location" class="item_location">Home library</th>[% END %]
1167         [% IF ( itemdata_ccode ) %]
1168                 <th id="item_ccode" data-colname="item_ccode" class="collection">Collection</th>[% END %]
1169         [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
1170                 <th id="item_shelving_location" data-colname="item_shelving_location" class="shelving_location">Shelving location</th>[% END %]
1171                 <th id="item_callnumber" data-colname="item_callnumber" class="call_no">Call number</th>
1172         [% IF ( itemdata_enumchron ) %]
1173                 <th id="item_enumchron" data-colname="item_enumchron" class="vol_info">Vol info</th>[% END %]
1174         [% IF ( itemdata_uri ) %]
1175                 <th id="item_url" data-colname="item_url" class="url">URL</th>[% END %]
1176         [% IF ( itemdata_copynumber ) %]
1177                 <th id="item_copy" data-colname="item_copy" class="copynumber">Copy number</th>[% END %]
1178                 <th id="item_status" data-colname="item_status" class="status">Status</th>
1179         [% IF ( itemdata_itemnotes ) %]
1180                 <th id="item_notes" data-colname="item_notes" class="notes">Notes</th>[% END %]
1181                 <th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
1182                 <th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>
1183         [% IF holds_count.defined %]
1184                 <th id="item_holds" data-colname="item_holds">Item holds</th>
1185         [% ELSIF show_priority %]
1186                 <th id="item_priority" data-colname="item_priority">Item hold queue priority</th>
1187         [% END %]
1188         [% IF ( ShowCourseReservesHeader ) %]
1189                 <th id="item_coursereserves" data-colname="item_coursereserves">Course reserves</th>[% END %]
1190             </tr>
1191         </thead>
1192         <tbody>
1193             [% FOREACH ITEM_RESULT IN items %]
1194                 [% IF ITEM_RESULT.this_branch %]
1195                   <tr class="highlight-row-detail" vocab="http://schema.org/" typeof="Offer">
1196                 [% ELSE %]
1197                   <tr vocab="http://schema.org/" typeof="Offer">
1198                 [% END %]
1199                     [% IF ( item_level_itypes ) %]
1200                         <td class="itype">
1201                             [% UNLESS ( noItemTypeImages ) %]
1202                                 [% IF ( ITEM_RESULT.imageurl ) %]
1203                                     <img src="[% ITEM_RESULT.imageurl | html %]" title="[% ITEM_RESULT.description | html %]" alt="[% ITEM_RESULT.description | html %]" />
1204                                 [% END %]
1205                             [% END %]
1206                             [% ITEM_RESULT.description | html %]
1207                         </td>
1208                     [% END %]
1209                     [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1210                         <td class="location" property="seller">
1211                             <link property="itemOffered" href="#record" />
1212                             <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
1213                             <span class="[% ITEM_RESULT.holding_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title="">
1214                                 [% IF ( ITEM_RESULT.branchurl ) %]
1215                                     <a href="[% ITEM_RESULT.branchurl | html %]">[% ITEM_RESULT.branchname | html %]</a>
1216                                 [% ELSE %]
1217                                     <span>[% ITEM_RESULT.branchname | html %]</span>
1218                                 [% END %]
1219                             </span>
1220                             <div class="branch-info-tooltip">[% ITEM_RESULT.holding_branch_opac_info | $raw %]</div>
1221
1222                             [% IF ( Koha.Preference('OpacLocationOnDetail') == 'holding' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
1223                                 <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span>
1224                             [% END %]
1225
1226                         </td>
1227                     [% END %]
1228
1229                     [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %]
1230                         <td class="location" property="seller">
1231                             <link property="itemOffered" href="#record" />
1232                             <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
1233                             <span class="[% ITEM_RESULT.home_branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]" title="">
1234                                 [% IF Branches.GetURL( ITEM_RESULT.homebranch ) %]
1235                                     [% home_branch_url = Branches.GetURL( ITEM_RESULT.homebranch ) | html %]
1236                                     [% IF ( home_branch_url ) %]
1237                                          <a href="[% home_branch_url | html %]">[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</a>
1238                                     [% ELSE %]
1239                                         <span>[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</span>
1240                                     [% END %]
1241                                 [% ELSE %]
1242                                     <span>[% Branches.GetName( ITEM_RESULT.homebranch ) | html %]</span>
1243                                 [% END %]
1244                             </span>
1245                             <div class="branch-info-tooltip">[% ITEM_RESULT.home_branch_opac_info | $raw %]</div>
1246
1247                             [% IF ( Koha.Preference('OpacLocationOnDetail') == 'home' || Koha.Preference('OpacLocationOnDetail') == 'both' ) %]
1248                                 <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span>
1249                             [% END %]
1250
1251                         </td>
1252                     [% END %]
1253
1254                     [% IF ( itemdata_ccode ) %]
1255                         <td class="collection">[% ITEM_RESULT.ccode | html %]</td>
1256                     [% END %]
1257
1258                     [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %]
1259                         <td class="shelving_location">[% ITEM_RESULT.location_description | html %]</td>
1260                     [% END %]
1261
1262                     <td class="call_no" property="sku">
1263                         [% IF ( ITEM_RESULT.itemcallnumber ) %]
1264                             [% ITEM_RESULT.itemcallnumber | html %]
1265                             [% IF ( OPACShelfBrowser ) %]
1266                                 [% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
1267                                     (<a class="close_shelf" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber | html %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber | html %]#[% tab | html %]">Browse shelf</a>)
1268                                 [% ELSE %]
1269                                     (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber | html %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber | html %]#[% tab | html %]">Browse shelf</a>)
1270                                 [% END %]
1271                             [% END %]
1272                         [% END %]
1273                     </td>
1274                     [% IF ( itemdata_enumchron ) %]
1275                         <td class="vol_info">
1276                             [% IF ITEM_RESULT.enumchron && ITEM_RESULT.serialseq %]
1277                                 <span class="enum">[% ITEM_RESULT.enumchron | html %]</span>
1278                                 [% IF ( ITEM_RESULT.serialseq && ITEM_RESULT.enumchron!=ITEM_RESULT.serialseq ) %]
1279                                     <span class="sep"> -- </span>
1280                                     <span class="serialseq">[% ITEM_RESULT.serialseq | html %]</span>
1281                                 [% END %]
1282                             [% ELSIF ITEM_RESULT.enumchron %]
1283                                 <span class="enum">[% ITEM_RESULT.enumchron | html %]</span>
1284                             [% ELSIF ITEM_RESULT.serialseq %]
1285                                     <span class="serialseq">[% ITEM_RESULT.serialseq | html %]</span>
1286                             [% END %]
1287                             [% IF ( ITEM_RESULT.publisheddate ) %]
1288                                 <span class="pubdate">([% ITEM_RESULT.publisheddate | $KohaDates %])</span>
1289                             [% END %]
1290                         </td>
1291                     [% END %]
1292                     [% IF ( itemdata_uri ) %]
1293                         <td class="url">
1294                             [% IF ITEM_RESULT.uri %]
1295                                 [% IF trackclicks == 'track' || trackclicks == 'anonymous' %]
1296                                     [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1297                                     <a target="_blank" rel="noreferrer" href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
1298                                     [% ELSE %]
1299                                     <a href="/cgi-bin/koha/tracklinks.pl?uri=[% ITEM_RESULT.uri | uri %]&amp;biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% ITEM_RESULT.itemnumber | url %]" property="url"> Link to resource </a>
1300                                     [% END %]
1301
1302                                 [% ELSE %]
1303                                     [% IF Koha.Preference("OPACURLOpenInNewWindow") %]
1304                                     <a target="_blank" rel="noreferrer" href="[% ITEM_RESULT.uri | html %]" property="url">[% ITEM_RESULT.uri | html %]</a>
1305                                     [% ELSE %]
1306                                     <a href="[% ITEM_RESULT.uri | html %]" property="url">[% ITEM_RESULT.uri | html %]</a>
1307                                     [% END %]
1308                                 [% END %]
1309                             [% END %]
1310                         </td>
1311                     [% END %]
1312                     [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td>[% END %]
1313                     <td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
1314                     [% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes | html %]</td>[% END %]
1315                     <td class="date_due"><span title="[% ITEM_RESULT.datedue | html %]">[% ITEM_RESULT.datedue | $KohaDates as_due_date => 1 | html %]</span></td>
1316                         <td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode | html %]</td>
1317                     [% IF holds_count.defined || show_priority %]
1318                         <td class="holds_count">
1319                             [% IF holds_count.defined %] [% ITEM_RESULT.holds_count | html %] [% END %]
1320                             [% IF ITEM_RESULT.priority %]
1321                                 [% IF holds_count.defined %]
1322                                     <span>(priority [% ITEM_RESULT.priority | html %])</span>
1323                                 [% ELSE %]
1324                                     <span>[% ITEM_RESULT.priority | html %]</span>
1325                                 [% END %]
1326                             [% END %]
1327                         </td>
1328                     [% END %]
1329                     [% IF ShowCourseReservesHeader %]
1330                         <td>
1331                             [% IF ITEM_RESULT.course_reserves %]
1332                                 [% FOREACH r IN ITEM_RESULT.course_reserves %]
1333                                     [% IF r.course.enabled == 'yes' %]
1334                                         <p>
1335                                             <a href="opac-course-details.pl?course_id=[% r.course.course_id | html %]">
1336                                             [% r.course.course_name | html %]
1337                                             <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
1338                                             [% IF r.course.section %] [% r.course.section | html %] [% END %]
1339                                             [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
1340                                             </a>
1341                                         </p>
1342                                     [% END %]
1343                                 [% END %]
1344                             [% END %]
1345                         </td>
1346                     [% END  # /IF ShowCourseReservesHeader %]
1347                 </tr>
1348             [% END %]
1349         </tbody>
1350     </table>
1351 [% END %][%# end of items_table block %]
1352
1353 [% BLOCK jsinclude %]
1354 [% INCLUDE 'datatables.inc' %]
1355 [% INCLUDE 'columns_settings.inc' %]
1356 [% IF ( SocialNetworks ) %]
1357     <script src="https://apis.google.com/js/plusone.js"></script>
1358     //<![CDATA[
1359       {lang: '[% lang | html %]'}
1360     //]]>
1361     </script>
1362     <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
1363 [% END %]
1364 [% IF ( OpacStarRatings != 'disable' ) %][% Asset.js("lib/jquery/plugins/jquery.rating.js") | $raw %][% END %]
1365
1366 [% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js").raw %][% END %]
1367
1368 <script>
1369 //<![CDATA[
1370
1371     [% IF ( OpacBrowseResults && busc ) %]
1372         var arrPagination = new Array();
1373         var pag_index_ini = [% indexPag | html %];
1374         [% IF ( listResults ) %]
1375             [% FOREACH listResult IN listResults %]
1376                 arrPagination[[% listResult.index | html %]] = {
1377                     url:"[% listResult.url | html %][% IF ( listResult.url && query_desc && OpacHighlightedWords ) %]&query_desc=[% query_desc |uri %][% END %]",
1378                     title:"[% listResult.title|remove('\n') | html %]",
1379                     author:"[% listResult.author | html %]",
1380                     biblionumber:[% listResult.biblionumber | html %]
1381                 };
1382            [% END %]
1383         [% END %]
1384     [% END %]
1385
1386     [% IF ( OpacHighlightedWords ) %]
1387         var q_array = new Array();  // holds search terms if available
1388
1389         function highlightOff() {
1390             $("#catalogue_detail_biblio").removeHighlight();
1391             $(".highlight_toggle").toggle();
1392         }
1393         function highlightOn() {
1394             var x;
1395             for (x in q_array) {
1396                 if ( q_array[x].length > 0 ) {
1397                     q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1398                     q_array[x] = q_array[x].toLowerCase();
1399                     var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|');
1400                     if( $.inArray(q_array[x], myStopwords) == -1 ) {
1401                         $(".title").highlight(q_array[x]);
1402                         $(".author").highlight(q_array[x]);
1403                         $(".results_summary").highlight(q_array[x]);
1404                     }
1405                 }
1406             }
1407             $(".highlight_toggle").toggle();
1408         }
1409     [% END %]
1410
1411      $(document).ready(function() {
1412         $('#bibliodescriptions').tabs();
1413         $(".branch-info-tooltip-trigger").uitooltip({
1414             position: { my: "left+15 center", at: "right center" },
1415             show: 50,
1416             hide: 50,
1417             content: function(){
1418                 var element = $(this).next("div");
1419                 return element.html();
1420             }
1421         });
1422
1423         var columns_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'holdingst', 'json' ).raw %];
1424
1425         KohaTable("#holdingst", {
1426             dom: '<"clearfix">t',
1427             "columnDefs": [
1428                 { "targets": [ -1 ], "sortable": false, "searchable": false },
1429                 { "type": "title-string", "targets" : [ "title-string" ] }
1430                 ],
1431             "bKohaColumnsUseNames": true
1432         }, columns_settings);
1433
1434         KohaTable("#otherholdingst", {
1435             dom: '<"clearfix">t',
1436             "columnDefs": [
1437                 { "targets": [ -1 ], "sortable": false, "searchable": false },
1438                 { "type": "title-string", "targets" : [ "title-string" ] }
1439                 ],
1440             "bKohaColumnsUseNames": true
1441         }, columns_settings);
1442
1443         var serial_column_settings = [% ColumnsSettings.GetColumns( 'opac', 'biblio-detail', 'subscriptionst', 'json' ).raw %];
1444
1445         KohaTable("#subscriptionst", {
1446             dom: '<"clearfix">t',
1447             "columnDefs": [
1448                 { "type": "title-string", "targets" : [ "title-string" ] }
1449                 ],
1450             "bKohaColumnsUseNames": true
1451         }, serial_column_settings);
1452
1453 [% IF ( TagsInputEnabled && loggedinusername ) %]
1454         $(".tag_add").click(function(){
1455             var thisid = $(this).attr("id");
1456             thisid = thisid.replace("tag_add","");
1457             $(this).hide();
1458             $("#tagform"+thisid).show();
1459             $("#newtag"+thisid).focus();
1460             $("#newtag"+thisid+"_status").empty().hide();
1461             return false;
1462         });
1463         $(".cancel_tag_add").click(function(){
1464             var thisid = $(this).attr("id");
1465             thisid = thisid.replace("cancel","");
1466             $("#tagform"+thisid).hide();
1467             $("#tag_add"+thisid).show();
1468             $("#newtag"+thisid).val("");
1469             $("#newtag"+thisid+"_status").empty().hide();
1470             return false;
1471         });
1472         $(".tagbutton").click(function(){
1473             var thisid = $(this).attr("title");
1474             var tag = $("#newtag"+thisid).val();
1475             if (!tag || (tag == "")) {
1476                 alert(MSG_NO_TAG_SPECIFIED);
1477                 return false;
1478             }
1479             KOHA.Tags.add_tag_button(thisid, tag);
1480             return false;
1481         });
1482 [% END %]
1483
1484         [%# Note that there is no way atm to target a column with its class name to set it as the default sort order %]
1485         [% IF Koha.Preference('OpacLocationBranchToDisplay') == 'home' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes
1486         OR Koha.Preference('OpacLocationBranchToDisplay') == 'holding' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'holdingbranch' AND item_level_itypes
1487         OR Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND NOT item_level_itypes
1488         OR Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'holdingbranch' AND item_level_itypes %]
1489             var default_order_index = 1;
1490         [% ELSIF Koha.Preference('OpacLocationBranchToDisplay') == 'both' AND Koha.Preference('OPACHoldingsDefaultSortField') == 'homebranch' AND item_level_itypes %]
1491             var default_order_index = 2;
1492         [% ELSE %]
1493             var default_order_index = 0;
1494         [% END %]
1495
1496         [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
1497             q_array = query_desc.split(" ");
1498             q_array = q_array.filter(function(n){ return n }); // Remove empty strings
1499             highlightOn();
1500             $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});
1501             $("#highlight_toggle_off").show().click(function() {highlightOff(); return false;});[% END %][% END %]
1502     [% IF ( GoogleJackets ) %]
1503         KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
1504     [% END %]
1505     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
1506         KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
1507     [% END %]
1508
1509     [% IF OpenLibraryCovers %]
1510         KOHA.OpenLibrary.GetCoverFromIsbn();
1511     [% END %]
1512     [% IF OPACLocalCoverImages %]
1513         KOHA.LocalCover.GetCoverFromBibnumber(true);
1514     [% END %]
1515     [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1516         novSelect.loadContentForQuery(
1517             {
1518                 ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1519                 ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1520                 version : '2.1'
1521             },
1522             '[% NovelistSelectProfile | html %]',
1523             '[% NovelistSelectPassword | html %]',
1524             function(d){
1525                 if ( d.length > 0 ){ //If no content
1526                     $(".NovelistSelect").show();
1527                 }
1528             });
1529     [% END %]
1530
1531     [% IF ( OpacBrowseResults && busc ) %]
1532         var list_title_showmsg = _("Show pagination list (%s-%s / %s)").format([% indexPag | html %], [% indexPagEnd | html %], [% totalPag | html %]);
1533         var list_title_hidemsg = _("Hide pagination list (%s-%s / %s)").format([% indexPag | html %], [% indexPagEnd | html %], [% totalPag | html %]);
1534         if (arrPagination.length > 0) {
1535             renderPagIndexList(pag_index_ini, $("#listResults"));
1536             var reslist = $("#a_listResults");
1537             reslist.attr('title', list_title_showmsg);
1538         }
1539         $("#a_listResults").click(function(e) {
1540             if (arrPagination.length > 0) {
1541                 e.preventDefault();
1542                 var navigation = $(".results-pagination");
1543                 if (navigation.css("display") == 'none') {
1544                     navigation.show();
1545                     $(this).attr('title',list_title_hidemsg);
1546                     renderPagination(pag_index_ini, arrPagination.length - 1, $("#ul_pagination_list"), false);
1547                 } else {
1548                     navigation.hide();
1549                     $(this).attr('title',list_title_showmsg);
1550                 }
1551             }
1552         });
1553         $("#close_pagination").click(function(e) {
1554             e.preventDefault();
1555             var navigation = $(".results-pagination");
1556             navigation.hide();
1557         });
1558     [% END %]
1559 [% IF ( OPACShelfBrowser ) %]
1560
1561     (function prepareShelfBrowser(){
1562
1563         $(".main").on("click",".close_shelf",function(e){
1564             e.preventDefault();
1565             $("#shelfbrowser").toggle();
1566         });
1567         $(".main").on("click", "#browser_previous a", function(e){
1568             e.preventDefault();
1569             $.ajax({
1570                 url: "/cgi-bin/koha/svc/shelfbrowser.pl",
1571                 type: "POST",
1572                 data: {
1573                     "shelfbrowse_itemnumber": $("#browser_previous a").data( "prev-itemnumber" )
1574                 },
1575                 success: function(data){
1576                     $("#shelfbrowser").replaceWith(data);
1577                     [% IF ( GoogleJackets ) %]
1578                       KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
1579                     [% END %]
1580                     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
1581                       KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
1582                     [% END %]
1583                     [% IF OpenLibraryCovers %]
1584                       KOHA.OpenLibrary.GetCoverFromIsbn();
1585                     [% END %]
1586                     [% IF OPACLocalCoverImages %]
1587                       KOHA.LocalCover.GetCoverFromBibnumber(true);
1588                     [% END %]
1589                 }
1590             });
1591         });
1592
1593         $(".main").on("click", "#browser_next a", function(e){
1594             e.preventDefault();
1595             $.ajax({
1596                   url: "/cgi-bin/koha/svc/shelfbrowser.pl",
1597                   type: "POST",
1598                   data: {
1599                     "shelfbrowse_itemnumber": $("#browser_next a").data( "next-itemnumber" )
1600                 },
1601                 success: function(data){
1602                     $("#shelfbrowser").replaceWith(data);
1603                     [% IF ( GoogleJackets ) %]
1604                       KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
1605                     [% END %]
1606                     [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]
1607                       KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
1608                     [% END %]
1609                     [% IF OpenLibraryCovers %]
1610                       KOHA.OpenLibrary.GetCoverFromIsbn();
1611                     [% END %]
1612                     [% IF OPACLocalCoverImages %]
1613                       KOHA.LocalCover.GetCoverFromBibnumber(true);
1614                     [% END %]
1615                 }
1616             });
1617         });
1618     }());
1619 [% END %]
1620 [% IF ( OpacStarRatings != 'disable' ) %]
1621     // -----------------------------------------------------
1622     // star-ratings code
1623     // -----------------------------------------------------
1624     // hide 'rate' button if javascript enabled
1625
1626     $('input[name="rate_button"]').remove();
1627
1628     $(function () {
1629       $(".auto-submit-star").rating({
1630         cancel: _("Cancel rating"),
1631         callback: function (value, link) {
1632
1633           // if the new value equals the old value, dont execute callback...
1634           // just do nothing!
1635           if ($("#rating_value").attr("value") != value) {
1636
1637             $(function () {
1638
1639               $.post("/cgi-bin/koha/opac-ratings-ajax.pl", {
1640                 rating_old_value: $("#rating_value").attr("value"),
1641                 borrowernumber: "[% borrowernumber | html %]",
1642                 biblionumber: "[% biblio.biblionumber | html %]",
1643                 rating_value: value,
1644                 auth_error: value
1645               }, function (data) {
1646
1647                 if (data.auth_status != 'ok') {
1648                   window.alert(_("Your CGI session cookie is not current. Please refresh the page and try again."));
1649                 } else {
1650                   $("#rating_value").val(data.rating_value);
1651
1652                   if (data.rating_value) {
1653                     $("#rating_value_text").text(_("your rating: %s, ").format(data.rating_value));
1654                   } else {
1655                     $("#rating_value_text").text('');
1656                   }
1657
1658                   $("#rating_text").text(_("average rating: %s (%s votes)").format(data.rating_avg, data.rating_total));
1659
1660                 }
1661               }, "json");
1662             });
1663           };
1664         }
1665       });
1666     });
1667     // -----------------------------------------------------
1668 [% END # / IF ( OpacStarRatings != 'disable' )%]
1669
1670 [% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
1671     var isbn = $(".isbn:last").text().split(" ")[1];
1672     if (isbn) {
1673         isbn = isbn.replace(/\W*$/, '');
1674         isbn = isbn.replace(/-/, '');
1675
1676         if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
1677         // Use Microsoft XDR for IE version 8 or above
1678             var xdr = new XDomainRequest();
1679             xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
1680             xdr.onload = function() {
1681                 json = 'json = '+xdr.responseText; // the string now looks like..  json = { ... };
1682                 eval(json); // json is now a regular JSON object
1683                 parseIDBJSON(json); // parse using same function as for jQuery's success event
1684             }
1685             xdr.send();
1686         } else {
1687             $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
1688                 parseIDBJSON(json);
1689             });
1690         }
1691     }
1692 [% END # / IDreamBooksReviews || IDreamBooksReadometer%]
1693
1694 });
1695     [% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %]
1696         function parseIDBJSON( json ) {
1697             if(json.total_results > 0 && json.book.rating > 0){
1698                 var isbn = $(".isbn:last").text().split(" ")[1];
1699                 isbn = isbn.replace(/\W+/g, '');
1700
1701                 [% IF ( IDreamBooksReadometer ) %]
1702                     $(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="https://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+_(" by ")+json.book.author+'" title="'+_("Rating based on reviews of ")+json.book.title+'"></a>');
1703                 [% END %]
1704
1705                 [% IF ( IDreamBooksReviews ) %]
1706                     //build new tab for critic reviews
1707                     $("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count));
1708
1709                     //append happy-sad cloud review
1710
1711                     $("#catalogue_detail_biblio").append("<span class='idreambookssummary results_summary'><a href='"+json.book.detail_link+"'><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+"%</a> <a href='http://www.idreambooks.com/'>"+_("rating based on reviews at iDreamBooks.com")+"</a></span>");
1712
1713                     //insert data into Book reviews tab
1714                     $.each(json.book.critic_reviews, function(){
1715                             $("#idb_review_snippets").append("<div class='review'><div><a href='"+this.review_link+"'>"+this.source+"</a></div><div>\"..."+this.snippet+"...\"</div><div>"+_("Review date: ")+this.review_date+"</div><div><a class='reviewlink' href='"+json.book.detail_link+"'>"+_("Review result: ")+this.pos_or_neg+" <img src='"+this.smiley_or_sad_small+"' alt='"+_("iDreamBooks.com rating")+"' title='"+this.pos_or_neg+"' /></a></div></div>");
1716                             });
1717                     $("#seemoreidb").attr('href', json.book.detail_link);
1718                     $("#tab_idb_critic_reviews").show();
1719                 [% END %]
1720             }
1721         }
1722     [% END # / IF IDreamBooksReviews || IDreamBooksReadometer %]
1723
1724     [% IF ( OpacBrowseResults && busc ) %]
1725         var timeoutRFW;
1726         var totalPagItemList = 10;
1727
1728         function rewindList()
1729         {
1730             var ul = $("#listResults");
1731             var li_ini = ul.children(':first').next();
1732             var index_ini = pag_index_ini;
1733             if (li_ini) {
1734                 index_ini = parseInt(li_ini.attr("class").substring(7), 10);
1735             }
1736             var li_end = ul.children(':last').prev();
1737             var index_end = arrPagination.length - 1;
1738             if (li_end) {
1739                 index_end = parseInt(li_end.attr("class").substring(7), 10);
1740             }
1741             if (index_ini > pag_index_ini) {
1742                 renderPagIndexList(index_ini - 1, ul, false);
1743                 renderPagination(index_ini - 1, arrPagination.length - 1, $("#ul_pagination_list"), true);
1744             }
1745         }//rewindList
1746
1747         function forwardList()
1748         {
1749             var ul = $("#listResults");
1750             var li_ini = ul.children(':first').next();
1751             var index_ini = pag_index_ini;
1752             if (li_ini) {
1753                 index_ini = parseInt(li_ini.attr("class").substring(7), 10);
1754             }
1755             var li_end = ul.children(':last').prev();
1756             var index_end = arrPagination.length - 1;
1757             if (li_end) {
1758                 index_end = parseInt(li_end.attr("class").substring(7), 10);
1759             }
1760             if (index_end < arrPagination.length - 1) {
1761                 renderPagIndexList(index_ini + 1, ul, false);
1762                 renderPagination(index_ini + 1, arrPagination.length - 1, $("#ul_pagination_list"), true);
1763             }
1764         }//forwardList
1765
1766         function renderPagIndexList(index, ul)
1767         {
1768             var $kids = ul.children("li");
1769             if ($kids.length > 0) {
1770                 $kids.each(function() {
1771                     $(this).remove();
1772                 });
1773             }
1774             var li;
1775             var html = "";
1776             var ini = index - 1;
1777             var end = ini + totalPagItemList - 1;
1778             li = $("<li />");
1779             html = (index > pag_index_ini)?"<a href='#' id='rew_list_index' onclick='rewindList()' title='" + _("Click to rewind the list to") + " " + ini + " - " + end + "'>&laquo;</a>":"&laquo;";
1780             li.html(html);
1781             ul.append(li);
1782             var title = "";
1783             for (var i=index; i < arrPagination.length && i < index + totalPagItemList; i++) {
1784                 if (arrPagination[i] == undefined) continue;
1785                 var li = $("<li />");
1786                 if (arrPagination[i].url != "") {
1787                     title = _("See biblio") + " &quot;" + arrPagination[i].title + "&quot; ";
1788                     if (arrPagination[i].author != "") title += " " + _("by") + "&quot;" + arrPagination[i].author + "&quot;";
1789                     title += " " + _("with biblionumber") + " " + arrPagination[i].biblionumber;
1790                     html = "<a href='" + arrPagination[i].url + "' title='" + title + "' class='a_pag' id='a_pag_" + i + "'";
1791                     html += " onmouseover='renderPagination(" + i + ", " + (arrPagination.length - 1) + ", $(\"#ul_pagination_list\"), true)'";
1792                     html += ">" + i + "</a>";
1793                 } else html = i;
1794                 li.html(html);
1795                 li.attr("class", "li_pag_" + i);
1796                 ul.append(li);
1797             }
1798             li = $("<li />");
1799             ini = index + 1;
1800             end = (arrPagination.length > index + totalPagItemList)?index + totalPagItemList:arrPagination.length - 1;
1801             html = (end <= arrPagination.length - 1 && (end - index) >= totalPagItemList)?"<a href='#' id='fw_list_index' onclick='forwardList()' title='" + _("Click to forward the list to") + " " + ini + " - " + end + "'>&raquo;</a>":"&raquo;";
1802             li.html(html);
1803             ul.append(li);
1804         }//renderPagIndexList
1805
1806
1807         function renderPagination(index, total, ul, highlIndex)
1808         {
1809             for (var i = pag_index_ini; i <= total; i++) {
1810                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
1811                 $("#li_pag_" + i).remove();
1812             }
1813             var j = 0;
1814             for (var i = index; i <= total && j < totalPagItemList; i++) {
1815                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
1816                 var li = $("<li id='li_pag_" + i + "' " + ((j % 2 == 0)?"class='highlight'":"")  + " title='" + _("Go to detail") + "' />");
1817                 var html = "<span class='li_pag_index'>" + i + "</span><a href='" + arrPagination[i].url + "'>" + arrPagination[i].title + "</a>";
1818                 if (arrPagination[i].author) html += "<br /> " + _("by") + " " + arrPagination[i].author;
1819                 li.html(html);
1820                 if (highlIndex && i == index) li.css("backgroundColor", "#DDDDDD");
1821                 ul.append(li);
1822                 j++;
1823             }
1824             for (i = pag_index_ini; i < index && j < totalPagItemList; i++) {
1825                 if (arrPagination[i] == undefined || arrPagination[i].url == "") continue;
1826                 $("#li_pag_" + i).remove();
1827                 var li = $("<li id='li_pag_" + i + "' " + ((j % 2 == 0)?"class='highlight'":"")  + " title='" + _("Go to detail") + "' />");
1828                 var html = "<span class='li_pag_index'>" + i + "</span><a href='" + arrPagination[i].url + "'>" + arrPagination[i].title + "</a>";
1829                 if (arrPagination[i].author) html += "<br /> " + _("by") + " " + arrPagination[i].author;
1830                 li.html(html);
1831                 ul.append(li);
1832                 j++;
1833             }
1834         }//renderPagination
1835     [% END # / IF ( OpacBrowseResults && busc ) %]
1836 //]]>
1837 </script>
1838
1839 [% IF OPACPopupAuthorsSearch %]
1840     <script>
1841     //<![CDATA[
1842         function showAuthors(element){
1843             var authornumber = $(element).attr("data-count");
1844
1845             // Check checkbox related to the clicked link
1846             $("#authorsList input[type='checkbox']").attr('checked', false);
1847             $("#author_"+authornumber).attr('checked', true);
1848
1849             makeAuthorRequest();
1850         }
1851
1852         function checkAll(checkbox, elem) {
1853             var check = $(checkbox).attr('checked') ? true : false;
1854             $(elem).find("input[type='checkbox']").attr('checked', check);
1855             elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest();
1856         }
1857
1858         function makeAuthorRequest(){
1859             var values = [];
1860
1861             $("#authorsList").find("input[type='checkbox']:checked").each(function () {
1862                 values.push($(this).val());
1863             });
1864
1865             if (values.length > 0) {
1866                 var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
1867                 $("#validAuthorSearch").attr("href", request);
1868             } else {
1869                 $("#validAuthorSearch").removeAttr("href");
1870             }
1871
1872         }
1873
1874         //Subjects
1875         function showSubjects(element, subjectnumber, subfieldnumber){
1876
1877             // Check checkbox related to the clicked link
1878             $("#subjectsList input[type='checkbox']").attr('checked', false);
1879             $("#subject_"+subjectnumber+"_"+subfieldnumber).attr('checked', true);
1880
1881             makeSubjectRequest();
1882
1883         }
1884
1885         function makeSubjectRequest() {
1886             var values = [];
1887             $("#subjectsList > ul").each(function() {
1888                 var all_checked = true;
1889                 var local_values = [];
1890                 $(this).find('input[type="checkbox"]').each(function() {
1891                     if($(this).attr('checked')) {
1892                         local_values.push($(this).val());
1893                     } else {
1894                         all_checked = false;
1895                     }
1896                 });
1897                 var authid = $(this).attr('data-authid');
1898                 if(all_checked && authid) {
1899                     values.push('an:' + authid);
1900                 } else {
1901                     values = values.concat(local_values);
1902                 }
1903             });
1904             if(values.length > 0) {
1905                 var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and ');
1906                 $("#validSubjectSearch").attr('href', request);
1907             } else {
1908                 $("#validSubjectSearch").removeAttr("href");
1909             }
1910         }
1911         $(document).ready(function() {
1912             $("a.showauthors").click(function(e){
1913                 e.preventDefault();
1914                 showAuthors(this);
1915             });
1916         });
1917
1918     //]]>
1919     </script>
1920 [% END # / IF OPACPopupAuthorsSearch  %]
1921 [% END %]