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