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