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