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