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