Bug 30327: Add options for sorting components
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE KohaPlugins %]
6 [% USE AuthorisedValues %]
7 [% USE Branches %]
8 [% USE Biblio %]
9 [% USE Price %]
10 [% USE TablesSettings %]
11 [% PROCESS 'i18n.inc' %]
12
13 [% IF Koha.Preference('AmazonAssocTag') %]
14     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
15 [% ELSE %]
16     [% AmazonAssocTag = '' %]
17 [% END %]
18
19 [% ShowCourseReserves = 0 | html %]
20 [% IF UseCourseReserves %]
21     [% FOREACH item IN itemloop %]
22        [% IF item.course_reserves %]
23            [% FOREACH r IN item.course_reserves %]
24                [% IF r.course.enabled == 'yes' %]
25                    [% ShowCourseReserves = 1 | html %]
26                [% END %]
27            [% END %]
28         [% END %]
29     [% END %]
30 [% END %]
31
32 [% SET plugins_intranet_catalog_biblio_tabs = KohaPlugins.get_plugins_intranet_catalog_biblio_tab({ biblio => biblio, biblio_id => biblionumber }) %]
33
34 [% SET footerjs = 1 %]
35 [% INCLUDE 'doc-head-open.inc' %]
36 <title>
37   [% IF ( unknownbiblionumber ) %]
38     Unknown record
39   [% ELSE %]
40     Details for [% INCLUDE 'biblio-title-head.inc' %]
41   [% END %] &rsaquo; Catalog &rsaquo; Koha
42 </title>
43 [% INCLUDE 'doc-head-close.inc' %]
44 [% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %]
45 </head>
46
47 <body id="catalog_detail" class="catalog">
48
49 [% INCLUDE 'header.inc' %]
50 [% INCLUDE 'cat-search.inc' %]
51
52 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
53     <ol>
54         <li>
55             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
56         </li>
57         <li>
58             <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
59         </li>
60
61         [% IF ( unknownbiblionumber ) %]
62             <li>
63                 <a href="#" aria-current="page">
64                     Unknown record
65                 </a>
66             </li>
67         [% ELSE %]
68             <li>
69                 [% INCLUDE 'biblio-title.inc' link = 1 %]
70             </li>
71             <li>
72                 <a href="#" aria-current="page">
73                     Details
74                 </a>
75             </li>
76         [% END %]
77     </ol>
78 </nav>
79
80 <div class="main container-fluid">
81     <div class="row">
82         <div class="col-sm-10 col-sm-push-2">
83             <main>
84                 <div class="row">
85
86 [% IF ( unknownbiblionumber ) %]
87   <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
88 [% ELSE %]
89
90 [% IntranetCoce    = Koha.Preference('IntranetCoce') %]
91 [% CoceProviders   = Koha.Preference('CoceProviders') %]
92 [% CoceHost        = Koha.Preference('CoceHost') %]
93 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
94
95 [% INCLUDE 'cat-toolbar.inc' %]
96     [% IF decoding_error %]
97         <div>
98            <span class="biberror">
99             There is an error with this bibliographic record, the view may be degraded.</span>
100             <span class="error"><br/> Error: [% decoding_error | html %]</span>
101         </div>
102     [% END %]
103     [% IF analytics_error %]
104         <div>
105            <span class="analytics_error">
106             There was an error searching for analytic records, please see the logs for details.</span>
107         </div>
108     [% END %]
109     [% IF ( ocoins ) %]
110         <!-- COinS / OpenURL -->
111         <span class="Z3988" title="[% ocoins | html %]"></span>
112     [% END %]
113
114     [% IF ( AmazonCoverImages  || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
115         <div id="catalogue_detail_biblio" class="col-xs-9">
116     [% ELSE %]
117         <div id="catalogue_detail_biblio" class="col-xs-12">
118     [% END %]
119
120         [% XSLTBloc | $raw %]
121
122         [% IF shelves.count %]
123             <span class="results_summary"><span class="label">Lists that include this title: </span>
124             [% FOREACH s IN shelves %]
125                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
126                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
127             [% END %]
128             </span>
129         [% END %]
130         [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
131                 <span class="results_summary"><span class="label">Tags:</span>
132                     [% FOREACH TagLoo IN TagLoop %]
133                         [% IF ( CAN_user_tools_moderate_tags ) %]
134                         <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |uri %]">[% TagLoo.term | html %]</a>
135                         [% ELSE %]
136                         [% TagLoo.term | html %]
137                         [% END %]
138                         <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
139                     [% END %]
140                     </span>
141         [% END %]
142         <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber | uri %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
143         [% IF !item_level_itypes ||  Koha.Preference("BiblioItemtypeInfo") %]
144            <span class="results_summary itemtype"><span class="label">Itemtype:</span>
145           [% IF ( !noItemTypeImages && imageurl ) %]
146               <img src="[% imageurl | html %]" alt="" />
147           [% END %]
148           [% IF ( description ) %]
149             [% description | html %]
150           [% ELSE %]
151             [% itemtype | html %]
152           [% END %]
153           </span>
154         [% END %]
155
156         [% IF ( holdcount ) %]
157             <span class="results_summary">
158                 <span class="label">Holds:</span>
159                 <span class="number_box">
160                     [% IF CAN_user_reserveforothers_place_holds %]
161                         <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
162                     [% ELSE %]
163                         <span>[% holdcount | html %]</span>
164                     [% END %]
165                 </span>
166             </span>
167         [% END %]
168
169         [% IF illrequests.count %]
170             <span class="results_summary">
171                 <span class="label">ILL requests:</span>
172                 [% IF CAN_user_ill %]
173                     [% FOREACH ill IN illrequests %]
174                         <a href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=[% ill.illrequest_id | uri %]">Request [% ill.illrequest_id | html %]</a>[% IF ! loop.last %], [% END %]
175                     [% END %]
176                 [% ELSE %]
177                     [% FOREACH ill IN illrequests %]
178                         <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
179                     [% END %]
180                 [% END %]
181             </span>
182         [% END %]
183
184         [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
185             <span class="results_summary">
186                 <span class="label">Article requests:</span>
187                 <span class="number_box">
188                     <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
189                 </span>
190             </span>
191         [% END %]
192
193         [% IF course_reserves %]
194             <span class="results_summary"><span class="label">Courses that have reserved this title: </span>
195             [% FOREACH c IN course_reserves %]
196                 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% c.course_id | uri %]">[% c.course.course_name | html %]</a>
197                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
198             [% END %]
199             </span>
200         [% END %]
201
202         [% IF ( AmazonCoverImages  || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
203             </div>
204             <div class="col-xs-3 bookcoverimg">
205                 <div id="biblio-cover-slider" class="cover-slider">
206                     [% IF ( LocalCoverImages ) %]
207                         [% IF localimages.count %]
208                             [% FOREACH image IN localimages %]
209                                 <div class="cover-image local-coverimg">
210                                     <a href="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
211                                         <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" />
212                                     </a>
213                                     <div class="hint">Local cover image</div>
214                                 </div>
215                             [% END %]
216                         [% END %]
217                     [% END %]
218
219                     [% IF ( AmazonCoverImages && normalized_isbn) %]
220                         <div class="cover-image" id="amazon-bookcoverimg">
221                             <a href="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.LZZZZZZZ.jpg" title="Amazon cover image">
222                                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.MZZZZZZZ.jpg" alt="Amazon cover image" data-link="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"/>
223                             </a>
224                             <div class="hint">Image from Amazon.com</div>
225                         </div>
226                     [% END %]
227
228                     [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
229                         [% coce_id = normalized_ean || normalized_isbn %]
230                         <div class="cover-image" id="coce-coverimg">
231                             [% IF ( coce_id ) %]
232                                 <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
233                             [% ELSE %]
234                                 <span class="no-image">No cover image available</span>
235                             [% END %]
236                             <div class="hint">Image from Coce</div>
237                         </div>
238                     [% END %]
239
240                     [% IF ( SyndeticsCovers ) %]
241                         [% IF ( content_identifier_exists ) %]
242                         <div class="cover-image" id="syndetics-bookcoverimg">
243                             <a href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | url %]/LC.GIF&amp;client=[% Koha.Preference('SyndeticsClientCode') | url %]&amp;type=xw10&amp;upc=[% normalized_upc | url %]&amp;oclc=[% normalized_oclc | url %]" title="Syndetics cover image">
244                                 <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | url %]/[% Koha.Preference('SyndeticsCoverImageSize') | url %].GIF&amp;client=[% Koha.Preference('SyndeticsClientCode') | url %]&amp;type=xw10&amp;upc=[% normalized_upc | url %]&amp;oclc=[% normalized_oclc | url %]" alt="" class="thumbnail" />
245                             </a>
246                             <div class="hint">Image from Syndetics</div>
247                         </div>
248                             [% ELSE %]
249                                 <span class="no-image">No cover image available</span>
250                             [% END %]
251                     [% END %]
252
253                     [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
254                         [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
255                         [% IF custom_cover_image_url %]
256                             <div class="cover-image" id="custom-coverimg">
257                                 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" title="Custom cover image">
258                                     <img id="custom-img" alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
259                                 </a>
260                                 <div class="hint">Custom cover image</div>
261                             </div>
262                         [% END %]
263                     [% END %]
264                 </div> <!-- /.cover-slider -->
265             </div> <!-- /.bookcoverimg.col-xs-3 -->
266         [% ELSE %]
267         </div> <!-- /.col-xs-* -->
268         [% END # /IF ( AmazonCoverImages, etc ) %]
269 </div>
270
271 <div id="bibliodetails" class="toptabs">
272
273 <ul class="nav nav-tabs" role="tablist">
274     [% IF (SeparateHoldings) %]
275         <li role="presentation">
276             <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">[% Branches.GetLoggedInBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
277         </li>
278         <li role="presentation">
279             <a href="#otherholdings"  aria-controls="otherholdings" role="tab" data-toggle="tab">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
280         </li>
281     [% ELSE %]
282         <li role="presentation">
283             <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% itemloop.size() || 0 | html %])</a>
284         </li>
285     [% END %]
286 [% IF ( MARCNOTES ) %]<li role="presentation"><a href="#description"  aria-controls="description" role="tab" data-toggle="tab">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
287 [% IF ComponentParts && ComponentParts.size %]<li id="components_tab" role="presentation"><a href="#components"  aria-controls="components" role="tab" data-toggle="tab">Components ([% ComponentParts.size | html %])</a></li>[% END %]
288 [% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions"  aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %]
289 [% IF Koha.Preference('AcquisitionDetails') %]<li role="presentation"><a href="#acq_details"  aria-controls="acq_details" role="tab" data-toggle="tab">Acquisition details</a></li>[% END %]
290 [% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details"  aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %]
291 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions"  aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %]
292 [% IF ( LocalCoverImages ) %]
293     <li role="presentation">
294         <a href="#images"  aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a>
295     </li>
296 [% END %]
297 [% IF HTML5MediaEnabled && HTML5MediaSets.size %]
298     <li id="media_tab" role="presentation"><a href="#html5media"  aria-controls="html5media" role="tab" data-toggle="tab">Play media</a></li>
299 [% END %]
300 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
301     <li class="NovelistSelect" style="display:none;" role="presentation"><a href="#NovelistSelect"  aria-controls="NovelistSelect" role="tab" data-toggle="tab">NoveList Select</a></li>
302 [% END %]
303 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
304     <li role="presentation"><a href="#[% plugins_intranet_catalog_biblio_tab.id | uri %]"  aria-controls="[% plugins_intranet_catalog_biblio_tab.id | uri %]" role="tab" data-toggle="tab">[% plugins_intranet_catalog_biblio_tab.title | html %]</a></li>
305 [% END %]
306 </ul>
307
308 <div class="tab-content">
309 [% items_table_block_iter = 0 %]
310 [% BLOCK items_table %]
311     [% items_table_block_iter = items_table_block_iter + 1 %]
312     <div class="[% tab | html %]_table_table_controls">
313         [% IF (StaffDetailItemSelection) %]
314             | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> |
315             <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-remove"></i> Clear all</a>
316             <span class="itemselection_actions">
317               | Actions:
318               [% IF CAN_user_tools_items_batchdel %]
319                 <a class="itemselection_action_delete"><i class="fa fa-trash"></i> Delete selected items</a>
320               [% END %]
321               [% IF CAN_user_tools_items_batchmod %]
322                 <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
323               [% END %]
324             </span>
325         [% END %]
326     </div>
327     <table class="items_table" id="[% tab | html %]_table">
328         <thead>
329             <tr>
330                 [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %]
331                 [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
332                     <th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th>
333                 [% END %]
334                 [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
335                 <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th>
336                 <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
337                 [% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %]
338                 <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
339                 [% IF volinfo %]
340                     <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
341                 [% END %]
342                 <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
343                 <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
344                 <th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
345                 <th id="[% tab | html %]_renewals" data-colname="[% tab | html %]_renewals">Renewals</th>
346                 <th id="[% tab | html %]_dateaccessioned" data-colname="[% tab | html %]_dateaccessioned">Date accessioned</th>
347                 <th id="[% tab | html %]_datelastborrowed" data-colname="[% tab | html %]_datelastborrowed">Date last borrowed</th>
348                 <th id="[% tab | html %]_barcode" data-colname="[% tab | html %]_barcode">Barcode</th>
349                 [% IF ( itemdata_uri ) %]<th id="[% tab | html %]_uri" data-colname="[% tab | html %]_uri">URL</th>[% END %]
350                 [% IF ( itemdata_copynumber ) %]<th id="[% tab | html %]_copynumber" data-colname="[% tab | html %]_copynumber">Copy number</th>[% END %]
351                 [% IF ( itemdata_stocknumber ) %]<th id="[% tab | html %]_stocknumber" data-colname="[% tab | html %]_stocknumber">Inventory number</th>[% END %]
352                 [% IF materials %]<th id="[% tab | html %]_materials" data-colname="[% tab | html %]_materials">Materials specified</th>[% END %]
353                 [% IF ( itemdata_itemnotes ) %]<th id="[% tab | html %]_itemnotes" data-colname="[% tab | html %]_itemnotes">Public notes</th>[% END %]
354                 [% IF ( itemdata_nonpublicnotes ) %]<th id="[% tab | html %]_itemnotes_nonpublic" data-colname="[% tab | html %]_itemnotes_nonpublic">Non-public notes</th>[% END %]
355                 [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
356                 [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
357                 [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
358                 [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
359                 [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort">&nbsp;</th>[% END %]
360             </tr>
361         </thead>
362         <tbody>
363             [% FOREACH item IN items %]
364                 <tr>
365                 [% IF (StaffDetailItemSelection) %]
366                     <td style="text-align:center;vertical-align:middle">
367                         <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
368                     </td>
369                 [% END %]
370                     [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
371                         <td class="cover">
372                             <div class="bookcoverimg">
373                                 <div class="cover-slider">
374                                     [% FOREACH image IN item.cover_images %]
375                                         <div class="cover-image local-coverimg">
376                                             <a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=[% image.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
377                                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% item.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" />
378                                             </a>
379                                         </div>
380                                     [% END %]
381                                 </div>
382                             </div>
383                         </td>
384                     [% END %]
385
386                     [% IF ( item_level_itypes ) %]
387                         <td class="itype">
388                             [% IF !noItemTypeImages && item.imageurl %]
389                                 <img src="[% item.imageurl | html %]" alt="[% item.translated_description | html %]" title="[% item.translated_description | html %]" />
390                             [% END %]
391                             <span class="itypedesc">[% item.translated_description | html %]</span>
392                         </td>
393                     [% END %]
394                     <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
395                     <td class="homebranch">
396                         <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
397                         <span class="shelvingloc">
398 <!--
399 If permanent location is defined, show description or code and display current location in parentheses. If not, display current location.
400 Note that permanent location is a code, and location may be an authval.
401 -->
402                             [% IF item.permanent_location %]
403                                 [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
404                                 [% permloc_authval | html %]
405                                 [% IF item.location AND item.location != permloc_authval AND item.location != item.permanent_location %]
406                                     ([% item.location | html %])
407                                 [% END %]
408                             [% ELSE %]
409                                 [% item.location | html %]
410                             [% END %]
411                         </span>
412                     </td>
413                     [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
414                     <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
415                     [% IF ( volinfo ) %]
416                         [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %]
417                             <td class="enumchron" data-order="[% item.publisheddate | html %]">
418                         [% ELSE %]
419                             <td class="enumchron">
420                         [% END %]
421                             [% IF ( itemdata_enumchron ) %]
422                                 [% IF item.enumchron && item.serialseq %]
423                                     <span class="enum">[% item.enumchron | html %]</span>
424                                     [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %]
425                                         <span class="sep"> -- </span>
426                                         <span class="serialseq">[% item.serialseq | html %]</span>
427                                     [% END %]
428                                 [% ELSIF item.enumchron %]
429                                     <span class="enum">[% item.enumchron | html %]</span>
430                                 [% ELSIF item.serialseq %]
431                                     <span class="serialseq">[% item.serialseq | html %]</span>
432                                 [% END %]
433                                 [% IF ( item.publisheddate ) %]
434                                     <span class="pubdate">([% item.publisheddate | $KohaDates %])</span>
435                                 [% END %]
436                             [% END %]
437                             </span>
438                         </td>
439                     [% END %]
440                     <td class="status">
441
442                         [% IF item.CheckedOutFor %]
443                           [% IF item.onsite_checkout %]
444                             <span>Currently in local use
445                           [% ELSE %]
446                             <span class="datedue">Checked out
447                           [% END %]
448                                 [% UNLESS ( item.NOTSAMEBRANCH ) %]
449                                   [% IF item.onsite_checkout %]
450                                     by
451                                   [% ELSE %]
452                                     to
453                                   [% END %]
454                                   [% INCLUDE 'patron-title.inc' patron=item.CheckedOutFor hide_patron_infos_if_needed=1 %]
455                                 [% END %]
456                                 : due [% item.datedue | html %]
457                             </span>
458                         [% ELSIF ( item.transfertwhen ) %]
459                             <span class="intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %] to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>
460                         [% END %]
461
462                         [% IF ( item.itemlost ) %]
463                             [% IF itemlostloop %]
464                                 [% FOREACH itemlostloo IN itemlostloop %]
465                                     [% IF itemlostloo.authorised_value == item.itemlost %]
466                                         <span class="lost">[% itemlostloo.lib | html %]</span>
467                                     [% END %]
468                                 [% END %]
469                             [% ELSE %]
470                                 <span class="lost">Unavailable (lost or missing)</span>
471                             [% END %]
472                         [% END %]
473
474                         [% IF ( item.withdrawn ) %]
475                             [% IF itemwithdrawnloop %]
476                                 [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %]
477                                     [% IF itemwithdrawnloo.authorised_value == item.withdrawn %]
478                                         <span class="wdn">[% itemwithdrawnloo.lib | html %]</span>
479                                     [% END %]
480                                 [% END %]
481                             [% ELSE %]
482                                 <span class="wdn">Withdrawn</span>
483                             [% END %]
484                         [% END %]
485
486                         [% IF ( item.damaged ) %]
487                             [% IF itemdamagedloop %]
488                                 [% FOREACH itemdamagedloo IN itemdamagedloop %]
489                                     [% IF itemdamagedloo.authorised_value == item.damaged %]
490                                         <span class="dmg">[% itemdamagedloo.lib | html %]</span>
491                                     [% END %]
492                                 [% END %]
493                             [% ELSE %]
494                                 <span class="dmg">Damaged</span>
495                             [% END %]
496                         [% END %]
497
498                         [% IF ( item.itemnotforloan || item.notforloan_per_itemtype ) %]
499                             <span class="notforloan">Not for loan
500                             [% IF ( item.notforloanvalue ) %]
501                                 <span class="reason">([% item.notforloanvalue | html %])</span>
502                             [% END %]
503                             </span>
504                         [% END %]
505
506                         [% SET hold = item.first_hold %]
507                         [% IF hold %]
508                             [% IF hold.waitingdate %]
509                                 <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
510                                 [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
511                                     <span class="heldfor">Hold for:</span>
512                                     [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
513                                 [% END %]
514                             [% ELSE %]
515                                 <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
516                             [% END %]
517                         [% END %]
518
519                         [% IF item.recalled %]
520                             [% IF item.recall.waiting_date %]
521                                 <span>Waiting at [% Branches.GetName( item.recall.pickup_library_id ) | html %] since [% item.recall.waiting_date | $KohaDates %]</span>
522                             [% ELSE %]
523                                 [% patron_link = BLOCK %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.recall.patron_id | uri %]">[% item.recall.patron.firstname | html %] [% item.recall.patron.surname | html %] ([% item.recall.patron.cardnumber | html %])</a>[% END %]
524                                 <span>Item recalled by [% patron_link| $raw %] on [% item.recall.created_date | $KohaDates %]</span>
525                             [% END %]
526                         [% END %]
527
528                         [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || hold || item.recalled ) %]
529                             <span>Available</span>
530                         [% END %]
531
532                         [% IF ( item.restricted ) %]
533                             <span class="restricted">([% item.restrictedvalue | html %])</span>
534                         [% END %]
535                     </td>
536                     <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
537                     <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
538                     <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
539                     <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
540                     <td class="datelastborrowed" data-order="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</td>
541                     <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type | uri %]&amp;itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% item.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
542                     [% IF ( itemdata_uri ) %]
543                         [% IF item.uri.split(' \| ').size > 1 %]
544                             <td class="uri">
545                                 [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
546                             </td>
547                         [% ELSE %]
548                             <td class="uri">
549                                 [% IF item.uri %]
550                                     <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
551                                 [% END %]
552                             </td>
553                         [% END %]
554                     [% END %]
555                     [% IF ( itemdata_copynumber ) %]
556                         <td class="copynumber">[% item.copynumber | html %]</td>
557                     [% END %]
558                     [% IF ( itemdata_stocknumber ) %]
559                         <td class="stocknumber">[% item.stocknumber | html %]</td>
560                     [% END %]
561                     [% IF materials %]
562                         <td class="materials"> [% item.materials | html %] </td>
563                     [% END %]
564                     [% IF ( itemdata_itemnotes ) %]
565                         <td><div class="itemnotes">[% item.itemnotes | $raw %]</div></td>
566                     [% END %]
567                     [% IF itemdata_nonpublicnotes %]
568                         <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
569                     [% END %]
570                     [% IF ( hostrecords ) %]
571                         <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
572                     [% END %]
573                     [% IF ( analyze ) %]
574                         <td>
575                             [% IF ( item.countanalytics ) %]
576                                 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
577                             [% END %]
578                         </td>
579                     [% END %]
580                     [% IF ( analyze ) %]
581                         <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&amp;hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
582                     [% END %]
583
584                 [% IF ShowCourseReserves %]
585                     <td>
586                         [% IF item.course_reserves %]
587                             [% FOREACH r IN item.course_reserves %]
588                                 [% IF r.course.enabled == 'yes' %]
589                                     <p>
590                                       <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
591                                          [% r.course.course_name | html %]
592                                          <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
593                                          [% IF r.course.section %] [% r.course.section | html %] [% END %]
594                                          [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
595                                       </a>
596                                    </p>
597                                [% END %]
598                            [% END %]
599                        [% END %]
600                     </td>
601                 [% END %]
602
603                 [% IF ( SpineLabelShowPrintOnBibDetails ) %]
604                     <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
605                 [% END %]
606
607                 [% IF CAN_user_editcatalogue_edit_items %]
608                     <td class="actions">
609                         [% UNLESS item.cannot_be_edited %]
610                             [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
611                                 <div class="btn-group">
612                                     <a  class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
613                                     <ul class="dropdown-menu pull-right">
614                                         <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&amp;filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
615                                     </ul>
616                                 </div>
617                             [% ELSE %]
618                                 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a>
619                             [% END %]
620                         [% END %]
621                     </td>
622                 [% END %]
623                 </tr>
624             [% END %]
625         </tbody>
626     </table>
627
628 [% END %][%# end of block items_table %]
629
630 <div role="tabpanel" class="tab-pane" id="holdings">
631
632 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
633     <span class="results_summary NovelistSelect" style="display:none;">
634         <span class="label">Novelist Select: </span>
635         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
636     </span>
637 [% END %]
638
639 [% IF ( count ) %]
640     [% IF ( showncount ) %]
641         [% PROCESS items_table tab="holdings" items=itemloop %]
642         [% END %]
643                 [% IF ( hiddencount ) %]
644                    <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
645                 [% END %]               
646                 [% IF ( debug_display ) %]
647                 <br /><br />
648                 <table>
649                         <tr><td>itemdata_enumchron</td><td>[% itemdata_enumchron | html %]</td></tr>
650                         <tr><td>itemdata_copynumber</td><td>[% itemdata_copynumber | html %]</td></tr>
651                         <tr><td>serial</td><td>[% serial | html %]</td></tr>
652                 </table>
653                 [% END %]
654 [% ELSE %]
655     [% IF ( ALTERNATEHOLDINGS ) %]
656     [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
657         <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
658     [% END %]
659     [% ELSE %]
660     <div id="noitems">No physical items for this record</div>
661     [% END %]
662 [% END %]
663
664 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
665     <span class="results_summary NovelistSelect" style="display:none;">
666         <span class="label">Novelist Select: </span>
667         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
668     </span>
669 [% END %]
670     </div>
671
672 [% IF (SeparateHoldings) %]
673     <div role="tabpanel" class="tab-pane" id="otherholdings">
674         [% IF (otheritemloop.size) %]
675             [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
676         [% ELSE %]
677             <span class="nootheritems">No other items.</span>
678         [% END %]
679     </div>
680 [% END %]
681
682 [% IF ( MARCNOTES ) %]
683
684 <div role="tabpanel" class="tab-pane" id="description">
685 <div class="content_set">
686
687     [% FOREACH MARCNOTE IN MARCNOTES %]
688         <p>
689         [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
690             <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
691         [% ELSE %]
692             [% MARCNOTE.marcnote | html | html_line_break %]
693         [% END %]
694         </p>
695 [% END %]
696 </div>
697 </div>
698
699 [% END %]
700
701 [% IF ComponentParts && ComponentParts.size %]
702 <div role="tabpanel" class="tab-pane" id="components">
703     <div class="content_set">
704         <table>
705             [% FOR PART IN ComponentParts %]
706             <tr>
707                 <td>
708                     [% PART | $raw %]
709                 </td>
710             </tr>
711             [% END %]
712         </table>
713         [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%]
714         <p>Only [% ComponentParts.size | html %] results are shown: <a href="/cgi-bin/koha/catalogue/search.pl?q=[% ComponentPartsQuery | url %]"/>show all component parts</a></p>
715         [% END %]
716     </div> <!-- /.content_set -->
717 </div> <!-- /#components -->
718
719 [% END %]
720
721 [% IF ( subscriptionsnumber ) %]
722 <div role="tabpanel" class="tab-pane" id="subscriptions">
723 <div id="catalogue_detail_subscriptions">
724     <h2>This is a serial subscription</h2>
725     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
726     [% FOREACH subscription IN subscriptions %]
727             [% IF subscription.branchcode %]
728                 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
729             [% END %]
730             [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
731             [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
732             [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
733             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
734             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
735             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
736             [% IF ( subscription.latestserials ) %]
737             <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
738             <table>
739                 <tr>
740                     <th>Issue #</th>
741                     <th>Date arrived</th>
742                     <th>Date published</th>
743                     <th>Status</th>
744                     <th>Note</th>
745                 </tr>
746             [% FOREACH latestserial IN subscription.latestserials %]
747                 <tr>
748                     <td>[% latestserial.serialseq | html %]</td>
749                     <td data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td>
750                     <td data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td>
751                     <td>
752                       [% IF ( latestserial.status1 ) %]<span>Expected</span>[% END %]
753                       [% IF ( latestserial.status2 ) %]<span>Arrived</span>[% END %]
754                       [% IF ( latestserial.status3 ) %]<span>Late</span>[% END %]
755                       [% IF ( latestserial.status4 ) %]<span>Missing</span>[% END %]
756                       [% IF ( latestserial.status41 ) %]<span>Missing (never received)</span>[% END %]
757                       [% IF ( latestserial.status42 ) %]<span>Missing (sold out)</span>[% END %]
758                       [% IF ( latestserial.status43 ) %]<span>Missing (damaged)</span>[% END %]
759                       [% IF ( latestserial.status44 ) %]<span>Missing (lost)</span>[% END %]
760                       [% IF ( latestserial.status5 ) %]<span>Not issued</span>[% END %]
761                       [% IF ( latestserial.status6 ) %]<span>Delete</span>[% END %]
762                       [% IF ( latestserial.status7 ) %]<span>Claimed</span>[% END %]
763                       [% IF ( latestserial.status8 ) %]<span>Stopped</span>[% END %]
764                     </td>
765                     <td>[% latestserial.notes | html %]</td>
766                 </tr>
767             [% END %]
768             </table>
769             [% END %]
770             <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]">Subscription details</a>
771     [% END %]
772 </div>
773 </div>
774 [% END %]
775
776 [% IF Koha.Preference('AcquisitionDetails') %]
777 <div role="tabpanel" class="tab-pane" id="acq_details">
778   [% IF orders.count %]
779     <table id="orders">
780       <thead>
781         <tr>
782           <th>Vendor</th>
783           <th>Invoice</th>
784           <th>Basket group</th>
785           <th>Basket</th>
786           <th>Order number</th>
787           <th>Creation date</th>
788           <th>Receive date</th>
789           <th>Status</th>
790           <th>Quantity</th>
791           <th title="Estimated cost tax incl. while pending, actual cost tax incl. once received">Price</th>
792           <th>Internal note</th>
793           <th>Subscription</th>
794           <th>Subscription call number</th>
795         </tr>
796       </thead>
797       <tbody>
798       [% FOR order IN orders %]
799         [% SET basket = order.basket %]
800         [% SET vendor = basket.bookseller %]
801           <tr>
802             <td>
803                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
804             </td>
805             <td>
806             [% IF order.invoiceid %]
807                 [% IF CAN_user_acquisition %]
808                     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
809                        title="Invoice detail page">
810                        [% order.invoice.invoicenumber | html %]</a>
811                 [% ELSE %]
812                     [% order.invoice.invoicenumber | html %]
813                 [% END %]
814             [% END %]
815             </td>
816             <td>
817             [% IF basket.basketgroupid %]
818                 [% SET basket_group = basket.basket_group %]
819                 [% IF CAN_user_acquisition_group_manage %]
820                     <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% vendor.id | uri %]&basketgroupid=[% basket_group.id | uri %]">[% basket_group.name | html%] ([% basket_group.id | html %])</a>
821                 [% ELSE %]
822                     [% basket_group.name | html %] ([% basket_group.id | html %])
823                 [% END %]
824             [% END %]
825             </td>
826             <td>[% IF CAN_user_acquisition_order_manage %]
827                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
828             [% ELSE %]
829                 [% basket.basketname | html %] ([% basket.basketno | html %])
830             [% END %]</td>
831             <td>[% order.ordernumber | html %]</td>
832             <td data-order="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</td>
833             <td data-order="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</td>
834             <td>
835               [% SWITCH order.orderstatus %]
836                 [% CASE 'new' %]<span>New</span>
837                 [% CASE 'ordered' %]<span>Ordered</span>
838                 [% CASE 'partial' %]<span>Partial</span>
839                 [% CASE 'complete' %]<span>Complete</span>
840                 [% CASE 'cancelled' %]<span>Cancelled</span>
841               [% END %]
842             </td>
843             <td>[% order.quantity | html %]</td>
844             <td>[% IF ( order.unitprice_tax_included > 0 ) %][% order.unitprice_tax_included | $Price %][% ELSE %][% order.ecost_tax_included | $Price %][% END %]
845             <td>[% order.order_internalnote | html %]</td>
846             <td>
847                 [% IF order.subscriptionid %]
848                     <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
849                 [% END %]
850             </td>
851             <td>
852                 [% IF order.subscriptionid %]
853                     [% order.subscription.callnumber | html %]
854                 [% END %]
855             </td>
856           </tr>
857       [% END %]
858       </tbody>
859     </table>
860   [% ELSE %]
861     <span class="noorder">There is no order for this bibliographic record.</span>
862   [% END %]
863 </div>
864 [% END %]
865
866 [% IF suggestions.count %]
867     <div role="tabpanel" class="tab-pane" id="suggestion_details">
868         [% IF nb_archived_suggestions > 0 %]
869             <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw  %]
870         [% END %]
871         <table id="suggestions" class="sorted">
872             <thead>
873                 <tr>
874                     <th class="NoSort">&nbsp;</th>
875                     <th class="anti-the">Suggestion</th>
876                     <th>Suggested by - on</th>
877                     <th>Managed by - on</th>
878                     <th>Last modification by - on</th>
879                     <th>Library</th>
880                     <th>Fund</th>
881                     <th>Status</th>
882                 </tr>
883             </thead>
884             <tbody>
885             [% FOREACH suggestion IN suggestions %]
886                 <tr>
887                     <td>[% suggestion.suggestionid | html %]</td>
888                     <td>
889                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show" title="suggestion" >
890                             [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
891                         <br />
892                         [% IF ( suggestion.copyrightdate ) %]&copy; [% suggestion.copyrightdate | html %] [% END %]
893                         [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
894                         [% IF ( suggestion.isbn ) %]; ISBN:<em>[% suggestion.isbn | html %]</em> [% END %][% IF ( suggestion.publishercode ) %]; Published by [% suggestion.publishercode | html %] [% END %][% IF ( suggestion.publicationyear ) %] in <em>[% suggestion.publicationyear | html %]</em> [% END %][% IF ( suggestion.place ) %] in <em>[% suggestion.place | html %]</em> [% END %][% IF ( suggestion.collectiontitle ) %]; [% suggestion.collectiontitle | html %] [% END %][% IF ( suggestion.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestion.itemtype, 0 ) | html %] [% END %]<br />[% IF ( suggestion.note ) %]<div class="suggestion_note"><i class="fa fa-comment"></i> [% suggestion.note | html %]</div>[% END %]
895                     </td>
896                     <td>
897                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
898                         [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
899                     </td>
900                     <td>
901                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
902                         [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
903                     </td>
904                     <td>
905                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
906                         [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
907                     </td>
908                     <td>
909                         [% Branches.GetName( suggestion.branchcode ) | html %]
910                     </td>
911                     <td>
912                         [% suggestion.fund.budget_name | html %]
913                     </td>
914                     <td>
915                         [% IF    suggestion.STATUS == 'ASKED'     %]<span>Pending</span>
916                         [% ELSIF suggestion.STATUS == 'ACCEPTED'  %]<span>Accepted</span>
917                         [% ELSIF suggestion.STATUS == 'ORDERED'   %]<span>Ordered</span>
918                         [% ELSIF suggestion.STATUS == 'REJECTED'  %]<span>Rejected</span>
919                         [% ELSIF suggestion.STATUS == 'CHECKED'   %]<span>Checked</span>
920                         [% ELSIF suggestion.STATUS == 'AVAILABLE' %]<span>Available</span>
921                         [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
922                             [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
923                         [% ELSE %]<span>Status unknown</span>
924                         [% END %]
925                         [% IF suggestion.reason %]
926                             <br />([% suggestion.reason | html %])
927                         [% END %]
928                     </td>
929                 </tr>
930                 [% END %]
931             </tbody>
932         </table>
933     </div>
934 [% END %]
935
936 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
937 <div role="tabpanel" class="tab-pane" id="editions"><h4>Editions</h4>
938 <table>
939 [% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
940 [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
941 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber | uri %]">[% XISBN.title | html %]</a> <span>by</span> [% XISBN.author | html %] &copy;[% XISBN.copyrightdate | html %]
942   [% IF ( XISBN.publishercode ) %]
943 [% XISBN.publishercode | html %] [% IF ( XISBN.place ) %]([% XISBN.place | html %])[% END %] [% IF ( XISBN.publicationyear ) %], [% XISBN.publicationyear | html %][% END %] [% IF ( XISBN.editionstatement ) %][% XISBN.editionstatement | html %][% END %] [% IF ( XISBN.editionresponsibility ) %][% XISBN.editionresponsibility | html %][% END %]
944     [% END %]
945                 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
946                 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
947 </td>
948
949 [% END %]
950 </table></div>[% END %]
951 [% END %]
952
953 [% IF ( LocalCoverImages ) %]
954     <div role="tabpanel" class="tab-pane" id="images">
955         [% IF localimages.count %]
956             <p>Click on an image to view it in the image viewer</p>
957             <ul class="thumbnails">
958                 [% FOREACH image IN localimages %]
959                     [% IF image %]
960                         <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
961                             <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
962                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" />
963                             </a>
964                             [% IF CAN_user_tools_upload_local_cover_images %]
965                                 <a href="#" class="remove"><i class="fa fa-trash"></i> Delete image</a>
966                             [% END %]
967                         </li>
968                     [% END %]
969                 [% END %]
970             </ul>
971         [% ELSE # - No image passed JavaScript takes care %]
972             <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
973         [% END %]
974         [% IF ( CAN_user_tools_upload_local_cover_images ) %]
975             <p>Upload an image file: <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&amp;filetype=image"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
976             </p>
977         [% END %]
978     </div>
979 [% END %]
980
981 [% IF ( HTML5MediaEnabled ) %]
982 <div role="tabpanel" class="tab-pane" id="html5media">
983           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
984             <p>
985                 [% IF HTML5MediaSet.is_youtube %]
986                     <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
987                 [% ELSE %]
988                   <[% HTML5MediaParent | html %] controls preload=none>
989                     <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
990                     [[% HTML5MediaParent | html %] tag not supported by your browser.]
991                   </[% HTML5MediaParent | html %]>
992                 [% END %]
993             </p>
994           [% END %]
995 </div>
996 [% END %]
997
998
999 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
1000     <div role="tabpanel" class="tab-pane" id="NovelistSelect" class="novelistSelect">
1001         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
1002     </div>
1003 [% END %]
1004
1005 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
1006     <div role="tabpanel" class="tab-pane" id="[% plugins_intranet_catalog_biblio_tab.id | html %]">
1007         [% plugins_intranet_catalog_biblio_tab.content | $raw %]
1008     </div>
1009 [% END %]
1010
1011 </div><!-- /tab-content -->
1012 </div><!-- /bibliodetails -->
1013
1014 <div id="export" style="margin-top: 1em;">
1015 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
1016 <table>  <tr>
1017       <th>Save record</th>   </tr>
1018     <tr><td> Select download format:    <select name="format">
1019         <option value="mods">MODS (XML)</option>
1020         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
1021         <option value="marcxml">MARCXML</option>
1022         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
1023         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
1024         <input type="submit" name="save" value="Download record" /></td>
1025   </tr>
1026   <tr><td>
1027     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
1028   </td></tr>
1029 </table>
1030 </form>
1031 </div>
1032
1033 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
1034     <div class="modal-dialog modal-lg">
1035     <div class="modal-content">
1036     <div class="modal-header">
1037         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1038         <h3 id="marcPreviewLabel">MARC preview</h3>
1039     </div>
1040     <div class="modal-body">
1041         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
1042     </div>
1043     <div class="modal-footer">
1044         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1045     </div>
1046     </div>
1047     </div>
1048 </div>
1049
1050             </main>
1051         </div> <!-- /.col-sm-10.col-sm-push-2 -->
1052
1053         <div class="col-sm-2 col-sm-pull-10">
1054             <aside>
1055                 [% INCLUDE 'biblio-view-menu.inc' %]
1056             </aside>
1057         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1058      </div> <!-- /.row -->
1059
1060 [% END %]
1061
1062 [% MACRO jsinclude BLOCK %]
1063     [% INCLUDE 'catalog-strings.inc' %]
1064     [% Asset.js("js/catalog.js") | $raw %]
1065     [% Asset.js("js/recalls.js") | $raw %]
1066     [% Asset.js("js/coce.js") | $raw %]
1067     [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1068     <script>
1069         var interface = "[% interface | html %]";
1070         var theme = "[% theme | html %]";
1071         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1072         function verify_cover_images() {
1073             // Loop over each container in the template which contains covers
1074             $(".cover-slider").each(function(){
1075                 var lightbox_descriptions = [];
1076                 $(this).find(".cover-image").each( function( index ){
1077                     var div = $(this);
1078                     // Find the image in the container
1079                     var img = div.find("img")[0];
1080                     if( $(img).length > 0 ){
1081                         var description = "";
1082                         if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1083                             // No image loaded in the container. Remove the slide
1084                             div.remove();
1085                         } else {
1086                             // All slides start hidden. If this is the first one, show it.
1087                             if( index == 0 ){
1088                                 div.show();
1089                             }
1090                             // Check if Amazon image is present
1091                             if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1092                                 w = img.width;
1093                                 h = img.height;
1094                                 if ((w == 1) || (h == 1)) {
1095                                     // Amazon returned single-pixel placeholder
1096                                     // Remove the container
1097                                     div.remove();
1098                                 } else {
1099                                     lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1100                                 }
1101                             } else if( div.attr("id") == "custom-coverimg" ){
1102                                 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1103                                     // No image was loaded via the CustomCoverImages system preference
1104                                     // Remove the container
1105                                     div.remove();
1106                                 } else {
1107                                     lightbox_descriptions.push("Custom cover image");
1108                                 }
1109                             } else if ( div.attr("id") == "syndetics-bookcoverimg" ){
1110                                     lightbox_descriptions.push(_("Syndetics cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1111                             }
1112                             else if( div.attr("id") == "coce-coverimg" ){
1113                                 // Identify which service's image is being loaded by Coce
1114                                 var coce_description;
1115                                 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1116                                     coce_description = ("Coce image from Amazon.com");
1117                                 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1118                                     coce_description = _("Coce image from Google Books");
1119                                 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1120                                     coce_description = _("Coce image from Open Library");
1121                                 }
1122                                 div.find(".hint").html(coce_description);
1123                                 lightbox_descriptions.push(coce_description);
1124                             } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1125                                 lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1126                             } else {
1127                                 lightbox_descriptions.push(_("Cover image source unknown"));
1128                             }
1129                         }
1130                     }
1131                 });
1132
1133                 // Lightbox for cover images
1134                 Chocolat(this.querySelectorAll('.cover-image a'), {
1135                     description: function(){
1136                         return lightbox_descriptions[this.settings.currentImageIndex];
1137                     }
1138                 });
1139
1140             });
1141
1142             $(".cover-slider").each(function(){
1143                 var coverSlide = this;
1144                 var coverImages = $(this).find(".cover-image");
1145                 if( coverImages.length > 1 ){
1146                     coverImages.each(function( index ){
1147                         // If more that one image is present, add a navigation link
1148                         // for activating the slide
1149                         var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1150                         if( index == 0 ){
1151                             // Set the first navigation link as active
1152                             $(covernav).addClass("nav-active");
1153                         }
1154                         $(covernav).html("<i class=\"fa fa-circle\"></i>");
1155                         $(coverSlide).append( covernav );
1156                     });
1157                 }
1158
1159                 if( $(coverSlide).attr('id') == 'biblio-cover-slider' // Hide if not visible, but only for the biblio images. Images for items are only local cover images
1160                     && $(coverSlide).find(".cover-image:visible").length < 1 ){
1161                     $(coverSlide).remove();
1162                 } else {
1163                     $(coverSlide).addClass("cover-slides");
1164                 }
1165             });
1166
1167             $("#editions img").each(function(i){
1168                 if ( this.src.indexOf('amazon.com') >= 0 ) {
1169                     w = this.width;
1170                     h = this.height;
1171                     if ((w == 1) || (h == 1)) {
1172                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1173                     } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1174                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1175                     }
1176                 }
1177             });
1178         }
1179
1180         function removeLocalImage(imagenumber) {
1181             var thumbnail = $("#imagenumber-" + imagenumber );
1182             var copy = thumbnail.html();
1183             thumbnail.find("img").css("opacity", ".2");
1184             thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1185             $.ajax({
1186                 url: "/cgi-bin/koha/svc/cover_images?action=delete&imagenumber=" + imagenumber,
1187                 success: function(data) {
1188                     $(data).each( function(i) {
1189                         if ( this.deleted == 1 ) {
1190                             thumbnail.remove();
1191                         } else {
1192                             thumbnail.html( copy );
1193                             alert(_("An error occurred on deleting this image"));
1194                         }
1195                         if ( $('ul.thumbnails > li').length == 0 ) {
1196                             showNoImageMessage();
1197                         }
1198                     });
1199                 },
1200                 error: function(data) {
1201                     thumbnail.html( copy );
1202                     alert(_("An error occurred on deleting this image"));
1203                 }
1204             });
1205         }
1206
1207         function showNoImageMessage() {
1208             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1209             no_images_msg = '<p>' + no_images_msg + '</p>';
1210             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1211                 var please_upload = _("Upload an image file: %sUpload%s").format("<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber + "&amp;filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>");
1212                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1213             [% END %]
1214             $('#images').html(no_images_msg);
1215         }
1216
1217         [% IF StaffDetailItemSelection %]
1218             function itemSelectionBuildDeleteLink(div) {
1219                 var itemnumbers = new Array();
1220                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1221                     itemnumbers.push($(this).val());
1222                 });
1223                 if (itemnumbers.length > 0) {
1224                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
1225                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1226                     url += '&biblionumber=[% biblionumber | uri %]';
1227                     url += '&src=CATALOGUING';
1228                     $('a.itemselection_action_delete').attr('href', url);
1229                 } else {
1230                     return false;
1231                 }
1232                 return true
1233             }
1234
1235             function itemSelectionBuildModifyLink(div) {
1236                 var itemnumbers = new Array();
1237                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1238                     itemnumbers.push($(this).val());
1239                 });
1240                 if (itemnumbers.length > 0) {
1241                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
1242                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1243                     url += '&biblionumber=[% biblionumber | uri %]';
1244                     url += '&src=CATALOGUING';
1245                     $('a.itemselection_action_modify').attr('href', url);
1246                 } else {
1247                     return false;
1248                 }
1249                 return true;
1250             }
1251
1252             function itemSelectionBuildActionLinks(tab) {
1253                 var div = $("#" + tab);
1254                 var delete_link_ok = itemSelectionBuildDeleteLink(div);
1255                 var modify_link_ok = itemSelectionBuildModifyLink(div);
1256                 if (modify_link_ok || delete_link_ok) {
1257                     $('.itemselection_actions', div).show();
1258                 } else {
1259                     $('.itemselection_actions', div).hide();
1260                 }
1261             }
1262
1263             $(document).ready(function() {
1264                 $('table.items_table').each(function() {
1265                     var div = $(this).parent().attr("id");
1266                     itemSelectionBuildActionLinks(div);
1267                 });
1268
1269                 $("input[name='itemnumber'][type='checkbox']").change(function() {
1270                     var div = $(this).parents('table').parent().parent().attr("id");
1271                     itemSelectionBuildActionLinks(div);
1272                 });
1273
1274                 $(".SelectAll").on("click",function(e){
1275                     e.preventDefault();
1276                     var tab = $(this).data("tab");
1277                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1278                     itemSelectionBuildActionLinks(tab);
1279                 });
1280
1281                 $(".ClearAll").on("click",function(e){
1282                     e.preventDefault();
1283                     var tab = $(this).data("tab");
1284                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1285                     itemSelectionBuildActionLinks(tab);
1286                 });
1287             });
1288         [% END %]
1289
1290         $(document).ready(function() {
1291             // Pick details tab to display by default
1292             [% IF count == 0 %]
1293                 [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %]
1294                     $(".nav-tabs a[href='#html5media']").tab("show");
1295                 [% ELSIF ComponentParts && ComponentParts.size %]
1296                     $(".nav-tabs a[href='#components']").tab("show");
1297                 [% ELSE %]
1298                     $(".nav-tabs a[href='#holdings']").tab("show");
1299                 [% END %]
1300             [% ELSE %]
1301                 $(".nav-tabs a[href='#holdings']").tab("show");
1302             [% END %]
1303             $('#search-form').focus();
1304             $('.thumbnails > li > .remove').click(function() {
1305                 var result = confirm(_("Are you sure you want to delete this cover image?"));
1306
1307                 if ( result == true ) {
1308                     var imagenumber = $(this).parent().attr('id').split('-')[1];
1309                     removeLocalImage(imagenumber);
1310                 }
1311
1312                 return false;
1313             });
1314             [% IF ( IntranetCoce && CoceProviders ) %]
1315                 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1316             [% END %]
1317
1318             $("body").on("click",".previewMARC", function(e){
1319                 e.preventDefault();
1320                 var page = $(this).attr("href");
1321                 $("#marcPreview .modal-body").load(page + " table");
1322                 $('#marcPreview').modal({show:true});
1323             });
1324             $("#marcPreview").on("hidden.bs.modal", function(){
1325                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
1326             });
1327             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1328                 novSelect.loadContentForQuery({
1329                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1330                     ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1331                     version : '2.1'
1332                 },
1333                 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1334                 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1335                 function(d){
1336                     if ( d.length > 0 ){ //If no content
1337                         $(".NovelistSelect").show();
1338                     }
1339                  });
1340              [% END %]
1341              $(".print-label").on("click", function(e){
1342                 e.preventDefault();
1343                 link = $(this).attr("href");
1344                 openWindow(link,"Print spine label",400,400);
1345              });
1346              $(".cover-slider").on("click",".cover-nav", function(e){
1347                  e.preventDefault();
1348                 var cover_slider = $(this).parent();
1349                 // Adding click handler for cover image navigation links
1350                 var num = $(this).data("num");
1351                 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1352                 $(this).addClass("nav-active");
1353                 $(cover_slider).find(".cover-image").hide();
1354                 $(cover_slider).find(".cover-image").eq( num ).show();
1355              });
1356         });
1357
1358         $(window).load(function() {
1359             verify_cover_images();
1360         });
1361     </script>
1362     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1363         <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1364     [% END %]
1365     [% INCLUDE 'datatables.inc' %]
1366     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1367     [% INCLUDE 'columns_settings.inc' %]
1368     [% Asset.js("js/browser.js") | $raw %]
1369     [% Asset.js("js/table_filters.js") | $raw %]
1370     <script>
1371         var browser;
1372         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1373         browser.show();
1374
1375         $(document).ready(function() {
1376             var table_names = [ 'holdings_table', 'otherholdings_table' ];
1377             var table_settings = [ [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json')  | $raw %] ];
1378             var has_images = [ "[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]" ];
1379             table_names.forEach( function( table_name, index ) {
1380                 if ( !has_images[index] ) {
1381                     table_settings[index].columns.splice(1,1);
1382                 }
1383                 var dt_parameters = {
1384                     'sDom': 't',
1385                     'bPaginate': false,
1386                     'bAutoWidth': false,
1387                     "bKohaColumnsUseNames": true,
1388                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1389                 };
1390                 var table = KohaTable( table_name, dt_parameters, table_settings[index], 'with_filters' );
1391             });
1392
1393             [% IF Koha.Preference('AcquisitionDetails') %]
1394                 var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') | $raw %];
1395                 var acquisitiondetails_table = KohaTable("orders", {
1396                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1397                     'bPaginate': false,
1398                     'bAutoWidth': false,
1399                     "aaSorting": [[ 4, "desc" ]],
1400                 }, table_settings);
1401             [% END %]
1402
1403             [% IF suggestions.count %]
1404                 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
1405                     "aoColumnDefs": [
1406                         { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
1407                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
1408                     ],
1409                     "sPaginationType": "full"
1410                 }));
1411             [% END %]
1412         });
1413
1414         [% IF (found1) %]
1415             $(document).ready(function() {
1416                 var search_index = localStorage.getItem("cat_search_pulldown_selection");
1417                 var search_value = localStorage.getItem("searchbox_value");
1418                 if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)};
1419                 if ( search_value ){ $('#cat-search-block #search-form').val(search_value)};
1420             });
1421         [% END %]
1422     </script>
1423 [% END %]
1424 [% INCLUDE 'intranet-bottom.inc' %]