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