Bug 26145: Allow multi covers per item
[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 bookcoverimg">
170                 <div id="biblio-cover-slider" class="cover-slider">
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-slider -->
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                             <div class="bookcoverimg">
330                                 <div class="cover-slider">
331                                     [% FOREACH image IN item.cover_images %]
332                                         <div class="cover-image local-coverimg">
333                                             <a href="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% image.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
334                                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" />
335                                             </a>
336                                         </div>
337                                     [% END %]
338                                 </div>
339                             </div>
340                         </td>
341                     [% END %]
342
343                     [% IF ( item_level_itypes ) %]
344                         <td class="itype">
345                             [% IF !noItemTypeImages && item.imageurl %]
346                                 <img src="[% item.imageurl | html %]" alt="[% item.translated_description | html %]" title="[% item.translated_description | html %]" />
347                             [% END %]
348                             <span class="itypedesc">[% item.translated_description | html %]</span>
349                         </td>
350                     [% END %]
351                     <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
352                     <td class="homebranch">
353                         <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
354                         <span class="shelvingloc">
355 <!--
356 If permanent location is defined, show description or code and display current location in parentheses. If not, display current location.
357 Note that permanent location is a code, and location may be an authval.
358 -->
359                             [% IF item.permanent_location %]
360                                 [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
361                                 [% permloc_authval | html %]
362                                 [% IF item.location AND item.location != permloc_authval AND item.location != item.permanent_location %]
363                                     ([% item.location | html %])
364                                 [% END %]
365                             [% ELSE %]
366                                 [% item.location | html %]
367                             [% END %]
368                         </span>
369                     </td>
370                     [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
371                     <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
372                     [% IF ( volinfo ) %]
373                         <td class="enumchron">
374                             [% IF itemdata_publisheddate %]<span title="[% item.publisheddate | html %]">[% END %]
375                             [% IF ( itemdata_enumchron ) %]
376                                 [% IF item.enumchron && item.serialseq %]
377                                     <span class="enum">[% item.enumchron | html %]</span>
378                                     [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %]
379                                         <span class="sep"> -- </span>
380                                         <span class="serialseq">[% item.serialseq | html %]</span>
381                                     [% END %]
382                                 [% ELSIF item.enumchron %]
383                                     <span class="enum">[% item.enumchron | html %]</span>
384                                 [% ELSIF item.serialseq %]
385                                     <span class="serialseq">[% item.serialseq | html %]</span>
386                                 [% END %]
387                                 [% IF ( item.publisheddate ) %]
388                                     <span class="pubdate">([% item.publisheddate | $KohaDates %])</span>
389                                 [% END %]
390                             [% END %]
391                             </span>
392                         </td>
393                     [% END %]
394                     <td class="status">
395
396                         [% IF item.CheckedOutFor %]
397                           [% IF item.onsite_checkout %]
398                             <span>Currently in local use
399                           [% ELSE %]
400                             <span class="datedue">Checked out
401                           [% END %]
402                                 [% UNLESS ( item.NOTSAMEBRANCH ) %]
403                                   [% IF item.onsite_checkout %]
404                                     by
405                                   [% ELSE %]
406                                     to
407                                   [% END %]
408                                   [% INCLUDE 'patron-title.inc' patron=item.CheckedOutFor hide_patron_infos_if_needed=1 %]
409                                 [% END %]
410                                 : due [% item.datedue | html %]
411                             </span>
412                         [% ELSIF ( item.transfertwhen ) %]
413                             <span class="intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %] to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>
414                         [% END %]
415
416                         [% IF ( item.itemlost ) %]
417                             [% IF itemlostloop %]
418                                 [% FOREACH itemlostloo IN itemlostloop %]
419                                     [% IF itemlostloo.authorised_value == item.itemlost %]
420                                         <span class="lost">[% itemlostloo.lib | html %]</span>
421                                     [% END %]
422                                 [% END %]
423                             [% ELSE %]
424                                 <span class="lost">Unavailable (lost or missing)</span>
425                             [% END %]
426                         [% END %]
427
428                         [% IF ( item.withdrawn ) %]
429                             [% IF itemwithdrawnloop %]
430                                 [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %]
431                                     [% IF itemwithdrawnloo.authorised_value == item.withdrawn %]
432                                         <span class="wdn">[% itemwithdrawnloo.lib | html %]</span>
433                                     [% END %]
434                                 [% END %]
435                             [% ELSE %]
436                                 <span class="wdn">Withdrawn</span>
437                             [% END %]
438                         [% END %]
439
440                         [% IF ( item.damaged ) %]
441                             [% IF itemdamagedloop %]
442                                 [% FOREACH itemdamagedloo IN itemdamagedloop %]
443                                     [% IF itemdamagedloo.authorised_value == item.damaged %]
444                                         <span class="dmg">[% itemdamagedloo.lib | html %]</span>
445                                     [% END %]
446                                 [% END %]
447                             [% ELSE %]
448                                 <span class="dmg">Damaged</span>
449                             [% END %]
450                         [% END %]
451
452                         [% IF ( item.itemnotforloan || item.notforloan_per_itemtype ) %]
453                             <span class="notforloan">Not for loan
454                             [% IF ( item.notforloanvalue ) %]
455                                 <span class="reason">([% item.notforloanvalue | html %])</span>
456                             [% END %]
457                             </span>
458                         [% END %]
459
460                         [% SET hold = item.first_hold %]
461                         [% IF hold %]
462                             [% IF hold.waitingdate %]
463                                 <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %] since [% hold.waitingdate | $KohaDates %].</span>
464                                 [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
465                                     <span class="heldfor">Hold for:</span>
466                                     [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
467                                 [% END %]
468                             [% ELSE %]
469                                 <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
470                             [% END %]
471                         [% END %]
472                         [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || hold ) %]
473                             <span class="available">Available</span>
474                         [% END %]
475
476                         [% IF ( item.restricted ) %]
477                             <span class="restricted">([% item.restrictedvalue | html %])</span>
478                         [% END %]
479
480                     </td>
481                     <td class="datelastseen"><span title="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</span></td>
482                     <td class="dateaccessioned"><span title="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</span></td>
483                     <td class="datelastborrowed"><span title="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</span></td>
484                     <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>
485                     [% IF ( itemdata_uri ) %]
486                         [% IF item.uri.split(' \| ').size > 1 %]
487                             <td class="uri">
488                                 [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
489                             </td>
490                         [% ELSE %]
491                             <td class="uri">
492                                 [% IF item.uri %]
493                                     <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
494                                 [% END %]
495                             </td>
496                         [% END %]
497                     [% END %]
498                     [% IF ( itemdata_copynumber ) %]
499                         <td class="copynumber">[% item.copynumber | html %]</td>
500                     [% END %]
501                     [% IF ( itemdata_stocknumber ) %]
502                         <td class="stocknumber">[% item.stocknumber | html %]</td>
503                     [% END %]
504                     [% IF materials %]
505                         <td class="materials"> [% item.materials | html %] </td>
506                     [% END %]
507                     [% IF ( itemdata_itemnotes ) %]
508                         <td><div class="itemnotes">[% item.itemnotes | $raw %]</div></td>
509                     [% END %]
510                     [% IF itemdata_nonpublicnotes %]
511                         <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
512                     [% END %]
513                     [% IF ( hostrecords ) %]
514                         <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
515                     [% END %]
516                     [% IF ( analyze ) %]
517                         <td>
518                             [% IF ( item.countanalytics ) %]
519                                 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
520                             [% END %]
521                         </td>
522                     [% END %]
523                     [% IF ( analyze ) %]
524                         <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&amp;hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
525                     [% END %]
526
527                 [% IF ShowCourseReserves %]
528                     <td>
529                         [% IF item.course_reserves %]
530                             [% FOREACH r IN item.course_reserves %]
531                                 [% IF r.course.enabled == 'yes' %]
532                                     <p>
533                                       <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
534                                          [% r.course.course_name | html %]
535                                          <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
536                                          [% IF r.course.section %] [% r.course.section | html %] [% END %]
537                                          [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
538                                       </a>
539                                    </p>
540                                [% END %]
541                            [% END %]
542                        [% END %]
543                     </td>
544                 [% END %]
545
546                 [% IF ( SpineLabelShowPrintOnBibDetails ) %]
547                     <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>
548                 [% END %]
549
550                 [% IF CAN_user_editcatalogue_edit_items %]
551                     <td class="actions">
552                         [% UNLESS item.cannot_be_edited %]
553                             <div class="btn-group">
554                                 <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>
555                                 <ul class="dropdown-menu pull-right">
556                                     <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>
557                                 </ul>
558                             </div>
559                         [% END %]
560                     </td>
561                 [% END %]
562                 </tr>
563             [% END %]
564         </tbody>
565     </table>
566
567 [% END %][%# end of block items_table %]
568
569 <div id="holdings">
570
571 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
572     <span class="results_summary NovelistSelect" style="display:none;">
573         <span class="label">Novelist Select: </span>
574         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
575     </span>
576 [% END %]
577
578 [% IF ( count ) %]
579     [% IF ( showncount ) %]
580         [% PROCESS items_table tab="holdings" items=itemloop %]
581         [% END %]
582                 [% IF ( hiddencount ) %]
583                    <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
584                 [% END %]               
585                 [% IF ( debug_display ) %]
586                 <br /><br />
587                 <table>
588                         <tr><td>itemdata_enumchron</td><td>[% itemdata_enumchron | html %]</td></tr>
589                         <tr><td>itemdata_copynumber</td><td>[% itemdata_copynumber | html %]</td></tr>
590                         <tr><td>serial</td><td>[% serial | html %]</td></tr>
591                 </table>
592                 [% END %]
593 [% ELSE %]
594     [% IF ( ALTERNATEHOLDINGS ) %]
595     [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
596         <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
597     [% END %]
598     [% ELSE %]
599     <div id="noitems">No physical items for this record</div>
600     [% END %]
601 [% END %]
602
603 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
604     <span class="results_summary NovelistSelect" style="display:none;">
605         <span class="label">Novelist Select: </span>
606         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
607     </span>
608 [% END %]
609     </div>
610
611 [% IF (SeparateHoldings) %]
612     <div id="otherholdings">
613         [% IF (otheritemloop.size) %]
614             [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
615         [% ELSE %]
616             <span class="nootheritems">No other items.</span>
617         [% END %]
618     </div>
619 [% END %]
620
621 [% IF ( MARCNOTES || notes ) %]
622
623 <div id="description">
624 <div class="content_set">
625
626 [% IF ( MARCNOTES ) %]
627     [% FOREACH MARCNOTE IN MARCNOTES %]
628         <p>
629         [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
630             <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
631         [% ELSE %]
632             [% MARCNOTE.marcnote | html | html_line_break %]
633         [% END %]
634         </p>
635     [% END %]
636 [% ELSE %]
637     [% IF ( notes ) %]
638         <p>[% notes | html %]</p>
639     [% END %]
640 [% END %]
641 </div>
642 </div>
643
644 [% END %]
645
646 [% IF ( subscriptionsnumber ) %]
647 <div id="subscriptions">
648 <div id="catalogue_detail_subscriptions">
649     <h2>This is a serial subscription</h2>
650     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
651     [% FOREACH subscription IN subscriptions %]
652             [% IF subscription.branchcode %]
653                 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
654             [% END %]
655             [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
656             [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
657             [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
658             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
659             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
660             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
661             [% IF ( subscription.latestserials ) %]
662             <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
663             <table>
664                 <tr>
665                     <th>Issue #</th>
666                     <th>Date arrived</th>
667                     <th>Date published</th>
668                     <th>Status</th>
669                     <th>Note</th>
670                 </tr>
671             [% FOREACH latestserial IN subscription.latestserials %]
672                 <tr>
673                     <td>[% latestserial.serialseq | html %]</td>
674                     <td><span title="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</span></td>
675                     <td><span title="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</span></td>
676                     <td>
677                       [% IF ( latestserial.status1 ) %]Expected[% END %]
678                       [% IF ( latestserial.status2 ) %]Arrived[% END %]
679                       [% IF ( latestserial.status3 ) %]Late[% END %]
680                       [% IF ( latestserial.status4 ) %]Missing[% END %]
681                       [% IF ( latestserial.status41 ) %]Missing (never received)[% END %]
682                       [% IF ( latestserial.status42 ) %]Missing (sold out)[% END %]
683                       [% IF ( latestserial.status43 ) %]Missing (damaged)[% END %]
684                       [% IF ( latestserial.status44 ) %]Missing (lost)[% END %]
685                       [% IF ( latestserial.status5 ) %]Not issued[% END %]
686                       [% IF ( latestserial.status6 ) %]Delete[% END %]
687                       [% IF ( latestserial.status7 ) %]Claimed[% END %]
688                       [% IF ( latestserial.status8 ) %]Stopped[% END %]
689                     </td>
690                     <td>[% latestserial.notes | html %]</td>
691                 </tr>
692             [% END %]
693             </table>
694             [% END %]
695             <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]">Subscription details</a>
696     [% END %]
697 </div>
698 </div>
699 [% END %]
700
701 [% IF Koha.Preference('AcquisitionDetails') %]
702 <div id="acq_details">
703   [% IF orders.count %]
704     <table id="orders">
705       <thead>
706         <tr>
707           <th>Vendor</th>
708           <th>Invoice</th>
709           <th>Basket group</th>
710           <th>Basket</th>
711           <th>Order number</th>
712           <th class="title-string">Creation date</th>
713           <th class="title-string">Receive date</th>
714           <th>Status</th>
715           <th>Quantity</th>
716           <th>Internal note</th>
717           <th>Subscription</th>
718           <th>Subscription callnumber</th>
719         </tr>
720       </thead>
721       <tbody>
722       [% FOR order IN orders %]
723         [% SET basket = order.basket %]
724         [% SET vendor = basket.bookseller %]
725           <tr>
726             <td>
727                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
728             </td>
729             <td>
730             [% IF order.invoiceid %]
731                 [% IF CAN_user_acquisition %]
732                     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
733                        title="Invoice detail page">
734                        [% order.invoice.invoicenumber | html %]</a>
735                 [% ELSE %]
736                     [% order.invoice.invoicenumber | html %]
737                 [% END %]
738             [% END %]
739             </td>
740             <td>
741             [% IF basket.basketgroupid %]
742                 [% SET basket_group = basket.basket_group %]
743                 [% IF CAN_user_acquisition_group_manage %]
744                     <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>
745                 [% ELSE %]
746                     [% basket_group.name | html %] ([% basket_group.id | html %])
747                 [% END %]
748             [% END %]
749             </td>
750             <td>[% IF CAN_user_acquisition_order_manage %]
751                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
752             [% ELSE %]
753                 [% basket.basketname | html %] ([% basket.basketno | html %])
754             [% END %]</td>
755             <td>[% order.ordernumber | html %]</td>
756             <td><span title="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</span></td>
757             <td><span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</span></td>
758             <td>
759               [% SWITCH order.orderstatus %]
760                 [% CASE 'new' %]New
761                 [% CASE 'ordered' %]Ordered
762                 [% CASE 'partial' %]Partial
763                 [% CASE 'complete' %]Complete
764                 [% CASE 'cancelled' %]Cancelled
765               [% END %]
766             </td>
767             <td>[% order.quantity | html %]</td>
768             <td>[% order.order_internalnote | html %]</td>
769             <td>
770                 [% IF order.subscriptionid %]
771                     <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
772                 [% END %]
773             </td>
774             <td>
775                 [% IF order.subscriptionid %]
776                     [% order.subscription.callnumber | html %]
777                 [% END %]
778             </td>
779           </tr>
780       [% END %]
781       </tbody>
782     </table>
783   [% ELSE %]
784     <span class="noorder">There is no order for this bibliographic record.</span>
785   [% END %]
786 </div>
787 [% END %]
788
789 [% IF suggestions.count %]
790     <div id="suggestion_details">
791         [% IF nb_archived_suggestions > 0 %]
792             <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw  %]
793         [% END %]
794         <table id="suggestions" class="sorted">
795             <thead>
796                 <tr>
797                     <th class="NoSort">&nbsp;</th>
798                     <th class="anti-the">Suggestion</th>
799                     <th>Suggested by - on</th>
800                     <th>Managed by - on</th>
801                     <th>Last modification by - on</th>
802                     <th>Library</th>
803                     <th>Fund</th>
804                     <th>Status</th>
805                 </tr>
806             </thead>
807             <tbody>
808             [% FOREACH suggestion IN suggestions %]
809                 <tr>
810                     <td>[% suggestion.suggestionid | html %]</td>
811                     <td>
812                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show" title="suggestion" >
813                             [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
814                         <br />
815                         [% IF ( suggestion.copyrightdate ) %]&copy; [% suggestion.copyrightdate | html %] [% END %]
816                         [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
817                         [% 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 %]
818                     </td>
819                     <td>
820                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
821                         [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
822                     </td>
823                     <td>
824                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
825                         [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
826                     </td>
827                     <td>
828                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
829                         [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
830                     </td>
831                     <td>
832                         [% Branches.GetName( suggestion.branchcode ) | html %]
833                     </td>
834                     <td>
835                         [% suggestion.fund.budget_name | html %]
836                     </td>
837                     <td>
838                         [% IF    suggestion.STATUS == 'ASKED'     %]Pending
839                         [% ELSIF suggestion.STATUS == 'ACCEPTED'  %]Accepted
840                         [% ELSIF suggestion.STATUS == 'ORDERED'   %]Ordered
841                         [% ELSIF suggestion.STATUS == 'REJECTED'  %]Rejected
842                         [% ELSIF suggestion.STATUS == 'CHECKED'   %]Checked
843                         [% ELSIF suggestion.STATUS == 'AVAILABLE' %]Available
844                         [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
845                             [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
846                         [% ELSE %]Status unknown
847                         [% END %]
848                         [% IF suggestion.reason %]
849                             <br />([% suggestion.reason | html %])
850                         [% END %]
851                     </td>
852                 </tr>
853                 [% END %]
854             </tbody>
855         </table>
856     </div>
857 [% END %]
858
859 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
860 <div id="editions"><h4>Editions</h4>
861 <table>
862 [% 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 %]
863 [% 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 %]
864 <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 %]
865   [% IF ( XISBN.publishercode ) %]
866 [% 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 %]
867     [% END %]
868                 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
869                 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
870 </td>
871
872 [% END %]
873 </table></div>[% END %]
874 [% END %]
875
876 [% IF ( LocalCoverImages ) %]
877     <div id="images">
878         [% IF localimages.count %]
879             <p>Click on an image to view it in the image viewer</p>
880             <ul class="thumbnails">
881                 [% FOREACH image IN localimages %]
882                     [% IF image %]
883                         <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
884                             <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
885                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" />
886                             </a>
887                             [% IF CAN_user_tools_upload_local_cover_images %]
888                                 <a href="#" class="remove"><i class="fa fa-trash"></i> Delete image</a>
889                             [% END %]
890                         </li>
891                     [% END %]
892                 [% END %]
893             </ul>
894         [% ELSE # - No image passed JavaScript takes care %]
895             <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
896         [% END %]
897         [% IF ( CAN_user_tools_upload_local_cover_images ) %]
898             <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>
899             </p>
900         [% END %]
901     </div>
902 [% END %]
903
904 [% IF ( HTML5MediaEnabled ) %]
905 <div id="html5media">
906           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
907             <p>
908                 [% IF HTML5MediaSet.is_youtube %]
909                     <iframe id="player" type="text/html" width="640" height="360"
910                         src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
911                 [% ELSE %]
912                   <[% HTML5MediaParent | html %] controls preload=none>
913                     <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
914                     [[% HTML5MediaParent | html %] tag not supported by your browser.]
915                   </[% HTML5MediaParent | html %]>
916                 [% END %]
917             </p>
918           [% END %]
919 </div>
920 [% END %]
921
922
923 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
924     <div id="NovelistSelect" class="novelistSelect">
925         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
926     </div>
927 [% END %]
928
929 [% FOREACH tab IN tabs %]
930     <div id="[% tab.id | html %]">
931         [% tab.content | $raw %]
932     </div>
933 [% END %]
934
935 </div><!-- /bibliodetails -->
936
937 <div id="export" style="margin-top: 1em;">
938 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
939 <table>  <tr>
940       <th>Save record</th>   </tr>
941     <tr><td> Select download format:    <select name="format">
942         <option value="mods">MODS (XML)</option>
943         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
944         <option value="marcxml">MARCXML</option>
945         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
946         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
947         <input type="submit" name="save" value="Download record" /></td>
948   </tr>
949   <tr><td>
950     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
951   </td></tr>
952 </table>
953 </form>
954 </div>
955
956 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
957     <div class="modal-dialog modal-lg">
958     <div class="modal-content">
959     <div class="modal-header">
960         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
961         <h3 id="marcPreviewLabel">MARC preview</h3>
962     </div>
963     <div class="modal-body">
964         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
965     </div>
966     <div class="modal-footer">
967         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
968     </div>
969     </div>
970     </div>
971 </div>
972
973             </main>
974         </div> <!-- /.col-sm-10.col-sm-push-2 -->
975
976         <div class="col-sm-2 col-sm-pull-10">
977             <aside>
978                 [% INCLUDE 'biblio-view-menu.inc' %]
979             </aside>
980         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
981      </div> <!-- /.row -->
982
983 [% END %]
984
985 [% MACRO jsinclude BLOCK %]
986     [% INCLUDE 'catalog-strings.inc' %]
987     [% Asset.js("js/catalog.js") | $raw %]
988     [% Asset.js("js/coce.js") | $raw %]
989     <script>
990         var interface = "[% interface | html %]";
991         var theme = "[% theme | html %]";
992         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
993         function verify_images() {
994             // Loop over each container in the template which contains covers
995             $(".cover-slider").each(function(){
996                 $(this).find(".cover-image").each( function( index ){
997                     var div = $(this);
998                     // Find the image in the container
999                     var img = div.find("img")[0];
1000                     if( $(img).length > 0 ){
1001                         if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1002                             // No image loaded in the container. Remove the slide
1003                             div.remove();
1004                         } else {
1005                             // All slides start hidden. If this is the first one, show it.
1006                             if( index == 0 ){
1007                                 div.show();
1008                             }
1009                             // Check if Amazon image is present
1010                             if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1011                                 w = img.width;
1012                                 h = img.height;
1013                                 if ((w == 1) || (h == 1)) {
1014                                     // Amazon returned single-pixel placeholder
1015                                     // Remove the container
1016                                     div.remove();
1017                                 }
1018                             }
1019                             if( div.attr("id") == "custom-img" ){
1020                                 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1021                                     // No image was loaded via the CustomCoverImages system preference
1022                                     // Remove the container
1023                                     div.remove();
1024                                 }
1025                             }
1026                             if( div.attr("id") == "coce-coverimg" ){
1027                                 // Identify which service's image is being loaded by Coce
1028                                 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1029                                     div.find(".hint").html(_("Coce image from Amazon.com"));
1030                                 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1031                                     div.find(".hint").html(_("Coce image from Google Books"));
1032                                 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1033                                     div.find(".hint").html(_("Coce image from Open Library"));
1034                                 }
1035                             }
1036                         }
1037                     }
1038                 });
1039             });
1040
1041             $(".cover-slider").each(function(){
1042                 var coverSlide = this;
1043                 var coverImages = $(this).find(".cover-image");
1044                 if( coverImages.length > 1 ){
1045                     coverImages.each(function( index ){
1046                         // If more that one image is present, add a navigation link
1047                         // for activating the slide
1048                         var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1049                         if( index == 0 ){
1050                             // Set the first navigation link as active
1051                             $(covernav).addClass("nav-active");
1052                         }
1053                         $(covernav).html("<i class=\"fa fa-circle\"></i>");
1054                         $(coverSlide).append( covernav );
1055                     });
1056                 }
1057
1058                 if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1059                     $(coverSlide).remove();
1060                 } else {
1061                     $(coverSlide).addClass("cover-slides");
1062                 }
1063             });
1064
1065             $("#editions img").each(function(i){
1066                 if ( this.src.indexOf('amazon.com') >= 0 ) {
1067                     w = this.width;
1068                     h = this.height;
1069                     if ((w == 1) || (h == 1)) {
1070                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1071                     } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1072                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1073                     }
1074                 }
1075             });
1076         }
1077
1078         function removeLocalImage(imagenumber) {
1079             var thumbnail = $("#imagenumber-" + imagenumber );
1080             var copy = thumbnail.html();
1081             thumbnail.find("img").css("opacity", ".2");
1082             thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1083             $.ajax({
1084                 url: "/cgi-bin/koha/svc/cover_images?action=delete&imagenumber=" + imagenumber,
1085                 success: function(data) {
1086                     $(data).each( function(i) {
1087                         if ( this.deleted == 1 ) {
1088                             thumbnail.remove();
1089                         } else {
1090                             thumbnail.html( copy );
1091                             alert(_("An error occurred on deleting this image"));
1092                         }
1093                         if ( $('ul.thumbnails > li').length == 0 ) {
1094                             showNoImageMessage();
1095                         }
1096                     });
1097                 },
1098                 error: function(data) {
1099                     thumbnail.html( copy );
1100                     alert(_("An error occurred on deleting this image"));
1101                 }
1102             });
1103         }
1104
1105         function showNoImageMessage() {
1106             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1107             no_images_msg = '<p>' + no_images_msg + '</p>';
1108             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1109                 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>");
1110                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1111             [% END %]
1112             $('#images').html(no_images_msg);
1113         }
1114
1115         [% IF StaffDetailItemSelection %]
1116             function itemSelectionBuildDeleteLink(div) {
1117                 var itemnumbers = new Array();
1118                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1119                     itemnumbers.push($(this).val());
1120                 });
1121                 if (itemnumbers.length > 0) {
1122                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
1123                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1124                     url += '&biblionumber=[% biblionumber | uri %]';
1125                     url += '&src=CATALOGUING';
1126                     $('a.itemselection_action_delete').attr('href', url);
1127                 } else {
1128                     return false;
1129                 }
1130                 return true
1131             }
1132
1133             function itemSelectionBuildModifyLink(div) {
1134                 var itemnumbers = new Array();
1135                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1136                     itemnumbers.push($(this).val());
1137                 });
1138                 if (itemnumbers.length > 0) {
1139                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
1140                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1141                     url += '&biblionumber=[% biblionumber | uri %]';
1142                     url += '&src=CATALOGUING';
1143                     $('a.itemselection_action_modify').attr('href', url);
1144                 } else {
1145                     return false;
1146                 }
1147                 return true;
1148             }
1149
1150             function itemSelectionBuildActionLinks(tab) {
1151                 var div = $("#" + tab);
1152                 var delete_link_ok = itemSelectionBuildDeleteLink(div);
1153                 var modify_link_ok = itemSelectionBuildModifyLink(div);
1154                 if (modify_link_ok || delete_link_ok) {
1155                     $('.itemselection_actions', div).show();
1156                 } else {
1157                     $('.itemselection_actions', div).hide();
1158                 }
1159             }
1160
1161             $(document).ready(function() {
1162                 $('table.items_table').each(function() {
1163                     var div = $(this).parent().attr("id");
1164                     itemSelectionBuildActionLinks(div);
1165                 });
1166
1167                 $("input[name='itemnumber'][type='checkbox']").change(function() {
1168                     var div = $(this).parents('table').parent().parent().attr("id");
1169                     itemSelectionBuildActionLinks(div);
1170                 });
1171
1172                 $(".SelectAll").on("click",function(e){
1173                     e.preventDefault();
1174                     var tab = $(this).data("tab");
1175                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1176                     itemSelectionBuildActionLinks(tab);
1177                 });
1178
1179                 $(".ClearAll").on("click",function(e){
1180                     e.preventDefault();
1181                     var tab = $(this).data("tab");
1182                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1183                     itemSelectionBuildActionLinks(tab);
1184                 });
1185             });
1186         [% END %]
1187
1188         $(document).ready(function() {
1189             $('#bibliodetails').tabs();
1190         [% IF count == 0 and ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) %]
1191             $('#bibliodetails').tabs("option", "active", $('#media_tab').index() );
1192         [% END %]
1193             $('#search-form').focus();
1194             $('.thumbnails > li > .remove').click(function() {
1195                 var result = confirm(_("Are you sure you want to delete this cover image?"));
1196
1197                 if ( result == true ) {
1198                     var imagenumber = $(this).parent().attr('id').split('-')[1];
1199                     removeLocalImage(imagenumber);
1200                 }
1201
1202                 return false;
1203             });
1204             [% IF ( IntranetCoce && CoceProviders ) %]
1205                 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1206             [% END %]
1207
1208             $("body").on("click",".previewMARC", function(e){
1209                 e.preventDefault();
1210                 var page = $(this).attr("href");
1211                 $("#marcPreview .modal-body").load(page + " table");
1212                 $('#marcPreview').modal({show:true});
1213             });
1214             $("#marcPreview").on("hidden.bs.modal", function(){
1215                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
1216             });
1217             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1218                 novSelect.loadContentForQuery({
1219                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1220                     ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1221                     version : '2.1'
1222                 },
1223                 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1224                 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1225                 function(d){
1226                     if ( d.length > 0 ){ //If no content
1227                         $(".NovelistSelect").show();
1228                     }
1229                  });
1230              [% END %]
1231              $(".print-label").on("click", function(e){
1232                 e.preventDefault();
1233                 link = $(this).attr("href");
1234                 openWindow(link,"Print spine label",400,400);
1235              });
1236              $(".cover-slider").on("click",".cover-nav", function(e){
1237                  e.preventDefault();
1238                 var cover_slider = $(this).parent();
1239                 // Adding click handler for cover image navigation links
1240                 var num = $(this).data("num");
1241                 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1242                 $(this).addClass("nav-active");
1243                 $(cover_slider).find(".cover-image").hide();
1244                 $(cover_slider).find(".cover-image").eq( num ).show();
1245              });
1246         });
1247
1248         $(window).load(function() {
1249             verify_images();
1250         });
1251     </script>
1252     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1253         <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1254     [% END %]
1255     [% INCLUDE 'datatables.inc' %]
1256     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1257     [% INCLUDE 'columns_settings.inc' %]
1258     [% Asset.js("js/browser.js") | $raw %]
1259     [% Asset.js("js/table_filters.js") | $raw %]
1260     <script>
1261         var browser;
1262         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1263         browser.show();
1264
1265         $(document).ready(function() {
1266             var ids = ['holdings_table', 'otherholdings_table'];
1267             var columns_settings = [ [% TablesSettings.GetColumns('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetColumns('catalogue', 'detail','otherholdings_table','json')  | $raw %] ];
1268             for (var i in ids) {
1269                 var id = ids[i];
1270                 var dt_parameters = {
1271                     'sDom': 't',
1272                     'bPaginate': false,
1273                     'bAutoWidth': false,
1274                     "bKohaColumnsUseNames": true,
1275                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1276                 };
1277                 var table = KohaTable(id, dt_parameters, columns_settings[i], 'with_filters');
1278             }
1279
1280             [% IF Koha.Preference('AcquisitionDetails') %]
1281                 var columns_settings = [% TablesSettings.GetColumns('catalogue', 'detail', 'acquisitiondetails-table', 'json') %];
1282                 var acquisitiondetails_table = KohaTable("orders", {
1283                     "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1284                     'bPaginate': false,
1285                     'bAutoWidth': false,
1286                     "aaSorting": [[ 4, "desc" ]],
1287                 }, columns_settings);
1288             [% END %]
1289
1290             [% IF suggestions.count %]
1291                 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
1292                     "aoColumnDefs": [
1293                         { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
1294                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
1295                     ],
1296                     "sPaginationType": "full"
1297                 }));
1298             [% END %]
1299         });
1300     </script>
1301 [% END %]
1302 [% INCLUDE 'intranet-bottom.inc' %]