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