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