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