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