Bug 20366: Add subscription info to the acq tab on the biblio detail page
[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 AuthorisedValues %]
6 [% USE Branches %]
7 [% USE Biblio %]
8
9 [% IF Koha.Preference('AmazonAssocTag') %]
10     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') | html %]
11 [% ELSE %]
12     [% AmazonAssocTag = '' | html %]
13 [% END %]
14
15 [% ShowCourseReserves = 0 | html %]
16 [% IF UseCourseReserves %]
17     [% FOREACH item IN itemloop %]
18        [% IF item.course_reserves %]
19            [% FOREACH r IN item.course_reserves %]
20                [% IF r.course.enabled == 'yes' %]
21                    [% ShowCourseReserves = 1 | html %]
22                [% END %]
23            [% END %]
24         [% END %]
25     [% END %]
26 [% END %]
27
28 [% SET footerjs = 1 %]
29 [% INCLUDE 'doc-head-open.inc' %]
30 <title>Koha &rsaquo; Catalog &rsaquo;
31   [% IF ( unknownbiblionumber ) %]
32     Unknown record
33   [% ELSE %]
34     Details for [% title | html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]
35   [% END %]
36 </title>
37 [% INCLUDE 'doc-head-close.inc' %]
38 [% Asset.css("css/datatables.css") | $raw %]
39 </head>
40
41 <body id="catalog_detail" class="catalog">
42
43 [% INCLUDE 'header.inc' %]
44 [% INCLUDE 'cat-search.inc' %]
45
46 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo;
47   [% IF ( unknownbiblionumber ) %]
48     Unknown record
49   [% ELSE %]
50     Details for <i>[% title | html %]  [% FOREACH subtitl IN subtitle %] [% subtitl.subfield | html %][% END %]</i>
51   [% END %]
52 </div>
53
54 <div id="doc3" class="yui-t2">
55
56 [% IF ( unknownbiblionumber ) %]
57   <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
58 [% ELSE %]
59    <div id="bd">
60     <div id="yui-main">
61     <div class="yui-b">
62
63 [% INCLUDE 'cat-toolbar.inc' %]
64     [% IF ( ocoins ) %]
65         <!-- COinS / OpenURL -->
66         <span class="Z3988" title="[% ocoins | html %]"></span>
67     [% END %]
68
69     [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
70         [% IF ( XSLTDetailsDisplay ) %]
71             <div class="yui-gc">
72             <div id="catalogue_detail_biblio" class="yui-u first">
73         [% ELSE %]
74             <div class="yui-gb">
75             <div id="catalogue_detail_biblio" class="yui-u first">
76         [% END %]
77     [% ELSE %]
78         [% IF ( XSLTDetailsDisplay ) %]
79             <div class="yui-g">
80             <div id="catalogue_detail_biblio">
81         [% ELSE %]
82             <div class="yui-g">
83             <div id="catalogue_detail_biblio" class="yui-u first">
84         [% END %]
85     [% END %]
86
87     [% IF ( XSLTDetailsDisplay ) %]
88         [% XSLTBloc | $raw %]
89
90         [% IF shelves.count %]
91             <span class="results_summary"><span class="label">Lists that include this title: </span>
92             [% FOREACH s IN shelves %]
93                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | html %]">[% s.shelfname | html %]</a>
94                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
95             [% END %]
96             </span>
97         [% END %]
98         [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
99                 <span class="results_summary"><span class="label">Tags:</span>
100                     [% FOREACH TagLoo IN TagLoop %]
101                         [% IF ( CAN_user_tools_moderate_tags ) %]
102                         <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
103                         [% ELSE %]
104                         [% TagLoo.term | html %]
105                         [% END %]
106                         <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
107                     [% END %]
108                     </span>
109         [% END %]
110         <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 | html %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
111
112         [% IF ( holdcount ) %]
113             <span class="results_summary">
114                 <span class="label">Holds:</span>
115                 <span class="number_box">
116                     [% IF CAN_user_reserveforothers_place_holds %]
117                         <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | html %]">[% holdcount | html %]</a>
118                     [% ELSE %]
119                         <span>[% holdcount | html %]</span>
120                     [% END %]
121                 </span>
122             </span>
123         [% END %]
124
125         [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
126             <span class="results_summary">
127                 <span class="label">Article requests:</span>
128                 <span class="number_box">
129                     <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | html %]">[% article_requests_count | html %]</a>
130                 </span>
131             </span>
132         [% END %]
133
134         [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
135         </div><div class="yui-u" id="bookcoverimg">
136         [% IF ( LocalCoverImages ) %]
137             <div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div>
138         [% END %]
139         [% IF ( AmazonCoverImages ) %]
140             <div id="amazon-bookcoverimg">
141             <a href="http://www.amazon[% AmazonTld | html %]/gp/reader/[% normalized_isbn | html %][% AmazonAssocTag | html %]#reader-link">
142                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" />
143         </a></div>
144         [% END %]
145         [% END %]
146     [% ELSE %]
147
148     <h3>[% title | html %]</h3>
149     [% FOREACH subtitl IN subtitle %]
150         <h4>[% subtitl.subfield | html %]</h4>
151     [% END %]
152             [% UNLESS ( item_level_itypes ) %]<img src="[% imageurl | html %]" alt="[% translated_description | html %]" title="[% translated_description | html %]">[% END %]
153             [% IF ( unititle ) %]<p>[% unititle | html %]</p>[% END %]
154             [% IF ( author ) %]<p>By <a href="/cgi-bin/koha/catalogue/search.pl?q=au:[% author |url %]">[% author | html %]</a></p>[% END %]
155         <ul>
156         [% IF ( MARCAUTHORS ) %]
157             <li><strong>Additional authors:</strong><ul>
158             [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
159                 <li>[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator | html %]<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code | html %] [% MARCAUTHOR_SUBFIELDS_LOO.value |url %]" href="/cgi-bin/koha/catalogue/search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit | html %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value | html %]</a>[% END %]</li>
160                 [% END %]
161
162         </ul>
163             </li>
164         [% END %]
165 [% IF ( MARCSERIES ) %]
166                 <li><strong>Series: </strong><ul>[% FOREACH MARCSERIE IN MARCSERIES %]
167                 <li>[% FOREACH MARCSERIES_SUBFIELDS_LOO IN MARCSERIE.MARCSERIES_SUBFIELDS_LOOP %] [% IF ( MARCSERIES_SUBFIELDS_LOO.value ) %]<a href="/cgi-bin/koha/catalogue/search.pl?q=se:[% MARCSERIES_SUBFIELDS_LOO.value |url %]">[% MARCSERIES_SUBFIELDS_LOO.value | html %]</a>[% END %][% IF ( MARCSERIES_SUBFIELDS_LOO.volumenum ) %]. [% MARCSERIES_SUBFIELDS_LOO.volumenum | html %][% END %][% END %]</li> 
168                 [% END %]
169                 </ul>
170                 </li>
171 [% END %]
172         [% IF ( publishercode ) %]
173     <li><strong>Published by:</strong>
174         <a href="/cgi-bin/koha/catalogue/search.pl?q=pb:[% publishercode |url %]">
175             [% publishercode | html %]
176         </a> [% IF ( place ) %]([% place | html %])[% END %] [% IF ( publicationyear ) %], [% publicationyear | html %][% END %] [% IF ( editionstatement ) %][% editionstatement | html %][% END %] [% IF ( editionresponsibility ) %][% editionresponsibility | html %][% END %]
177     </li>
178     [% END %]
179         <li><strong>Description:</strong>
180                 [% IF ( pages ) %] [% END %][% pages | html %] [% IF ( illus ) %][% illus | html %][% END %]
181                 [% IF ( size ) %][% size | html %][% END %]
182         </li>
183 [% IF ( MARCURLS ) %]<li>
184     
185     <strong>Online resources:</strong>
186     <ul>    [% FOREACH MARCurl IN MARCURLS %]
187                 <li>[% IF ( MARCurl.part ) %][% MARCurl.part | html %]
188                         <br />[% END %] 
189                 <!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
190                 <a href="[% MARCurl.MARCURL | html %]" title="[% MARCurl.MARCURL | html %]">[% MARCurl.linktext | html %]</a>
191                         [% IF ( MARCurl.notes ) %]<ul>[% FOREACH note IN MARCurl.notes %]<li>[% note.note | html %]</li>[% END %]</ul>[% END %]</li>
192             [% END %]</ul>
193 </li>
194     [% END %]
195
196     [% IF ( OPACBaseURL ) %]
197         <li><strong>OPAC view:</strong>
198         <a href="[% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]" target="_blank">Open in new window</a>
199         </li>
200     [% END %]
201         <li id="catalogue_detail_marc_preview">
202             <strong>MARC Preview:</strong>
203             <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber | html %]" title="MARC" rel="gb_page_center[600,500]">Show</a>
204         </li>
205         </ul>
206         </div>
207        
208     [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
209         <div class="yui-u" id="bookcoverimg">
210         [% IF ( LocalCoverImages ) %]
211             <div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div>
212         [% END %]
213         [% IF ( AmazonCoverImages ) %]
214             <div id="amazon-bookcoverimg">
215             <a href="http://www.amazon[% AmazonTld | html %]/gp/reader/[% normalized_isbn | html %][% AmazonAssocTag | html %]#reader-link">
216             <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" />
217             </a>
218         </div>
219         [% END %]
220         </div>
221     [% END %]
222         
223         <div class="yui-u" style="margin-top: 1em;">
224         <ul>
225         [% IF ( MARCISBNS ) %]
226             <li><strong>ISBN:</strong><ul>[% FOREACH MARCISBN IN MARCISBNS %]<li>[% MARCISBN | html %]</li>[% END %]</ul></li>
227         [% ELSE %]
228             [% IF ( normalized_isbn ) %]
229                 <li><strong>ISBN:</strong> [% normalized_isbn | html %]</li>
230             [% END %]
231         [% END %]
232         [% IF ( issn ) %]
233             <li><strong>ISSN:</strong>[% issn | html %]</li>
234         [% END %]
235         [% IF ( collectiontitle ) %]
236             <li><strong>Collection: </strong>
237                 [% collectiontitle | html %] [% IF ( collectionvolume ) %], [% collectionvolume | html %][% END %][% IF ( collectionissn ) %] (<strong>ISSN:</strong> [% collectionissn | html %])[% END %]
238             </li>
239         [% END %]
240         [% IF ( MARCSUBJCTS ) %]
241             <li><strong>Subjects:</strong> 
242             <ul>
243                 [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
244                 <li>[% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] [% MARCSUBJECT_SUBFIELDS_LOO.separator | html %] <a title="‡[% MARCSUBJECT_SUBFIELDS_LOO.code | html %] [% MARCSUBJECT_SUBFIELDS_LOO.value | html %]" href="/cgi-bin/koha/catalogue/search.pl?q=[% FOREACH link_loo IN MARCSUBJECT_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit | html %]:[% link_loo.link |url %][% END %]">[% MARCSUBJECT_SUBFIELDS_LOO.value | html %]</a>[% END %]</li>
245                 [% END %]
246                 </ul>
247             </li>
248         [% END %]
249         [% IF ( copyrightdate ) %]
250             <li><strong>Copyright:</strong> [% copyrightdate | html %]</li>
251         [% END %]
252      
253         [% IF ( classification ) %]
254             <li><strong>Classification:</strong> [% subclass | html %][% classification | html %]</li>
255         [% END %]
256         [% IF ( dewey ) %]
257             <li><strong>Dewey:</strong> [% dewey | html %]</li>
258         [% END %]
259         [% IF ( urlS ) %]
260             <li><strong>URL:</strong>
261                 [% FOREACH url IN urlS %]
262                     <a href="[% url.url | html %]">[% url.url | html %]</a>
263                 [% END %]
264             </li>
265         [% END %]
266         <!--This grabs all of the lists a bib record appears in -->
267         [% IF shelves.count %]
268             <li><strong>Lists that include this title: </strong>
269             <ul>
270             [% FOREACH s IN shelves %]
271                 <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | html %]">[% s.shelfname | html %]</a></li>
272             [% END %]
273             </ul>
274             </li>
275         [% END %]
276         [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
277                 <li><strong>Tags:</strong>
278                     <ul id="tagslist">
279                     [% FOREACH TagLoo IN TagLoop %]
280                         <li>
281                         [% IF ( CAN_user_tools_moderate_tags ) %]
282                         <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term | html %]</a>
283                         [% ELSE %]
284                         [% TagLoo.term | html %]
285                         [% END %]
286                         <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]</li>
287                     [% END %]
288                     </ul></li>
289         [% END %]
290             [% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="number_box"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | html %]">[% holdcount | html %]</a></span></li>[% ELSE %][% END %]
291         </ul>
292                 [% END %]
293
294 </div>
295 </div>
296 <div id="bibliodetails" class="toptabs">
297
298 <ul>
299     [% IF (SeparateHoldings) %]
300         <li>
301             <a href="#holdings">[% LoginBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
302         </li>
303         <li>
304             <a href="#otherholdings">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
305         </li>
306     [% ELSE %]
307         <li>
308             <a href="#holdings">Holdings ([% itemloop.size() || 0 | html %])</a>
309         </li>
310     [% END %]
311 [% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
312 [% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
313 [% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
314 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
315 [% IF ( LocalCoverImages ) %]
316     [% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]
317         <li>
318             <a href="#images">Images ([% localimages.size() || 0 | html %])</a>
319         </li>
320     [% END %]
321 [% END %]
322 [% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
323 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
324     <li class="NovelistSelect" style="display:none;"><a href="#NovelistSelect">NoveList Select</a></li>
325 [% END %]
326 </ul>
327
328 [% items_table_block_iter = 0 %]
329 [% BLOCK items_table %]
330     [% items_table_block_iter = items_table_block_iter + 1 %]
331     <div class="[% tab | html %]_table_table_controls">
332         [% IF (StaffDetailItemSelection) %]
333             | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> |
334             <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-remove"></i> Clear all</a>
335             <span class="itemselection_actions">
336               | Actions:
337               [% IF CAN_user_tools_items_batchdel %]
338                 <a class="itemselection_action_delete"><i class="fa fa-trash"></i> Delete selected items</a>
339               [% END %]
340               [% IF CAN_user_tools_items_batchmod %]
341                 <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
342               [% END %]
343             </span>
344         [% END %]
345     </div>
346     <table class="items_table" id="[% tab | html %]_table">
347         <thead>
348             <tr>
349                 [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
350                 [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
351                 <th>Current location</th>
352                 <th>Home library</th>
353                 [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
354                 <th>Call number</th>
355                 <th>Status</th>
356                 <th>Last seen</th>
357                 <th>Barcode</th>
358                 [% IF ( volinfo ) %]<th>Serial enumeration / chronology</th>[% END %]
359                 [% IF ( itemdata_uri ) %]<th>URL</th>[% END %]
360                 [% IF ( itemdata_copynumber ) %]<th>Copy number</th>[% END %]
361                 [% IF ( itemdata_stocknumber ) %]<th>Inventory number</th>[% END %]
362                 [% IF materials %]<th>Materials specified</th>[% END %]
363                 [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
364                 [% IF ( itemdata_nonpublicnotes ) %]<th>Non-public notes</th>[% END %]
365                 [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
366                 [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
367                 [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
368                 [% IF ( ShowCourseReserves ) %]<th>Course Reserves</th>[% END %]
369                 [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">&nbsp;</th>[% END %]
370             </tr>
371         </thead>
372         <tbody>
373             [% FOREACH item IN items %]
374                 <tr>
375                 [% IF (StaffDetailItemSelection) %]
376                     <td style="text-align:center;vertical-align:middle">
377                         <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
378                     </td>
379                 [% END %]
380                     [% IF ( item_level_itypes ) %]
381                         <td class="itype">
382                             [% IF !noItemTypeImages && item.imageurl %]
383                                 <img src="[% item.imageurl | html %]" alt="[% item.translated_description | html %]" title="[% item.translated_description | html %]" />
384                             [% END %]
385                             [% item.translated_description | html %]
386                         </td>
387                     [% END %]
388                     <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.branchcode ) | html %] [% END %]</td>
389                     <td class="homebranch">[% Branches.GetName(item.homebranch) | html %]<span class="shelvingloc">[% item.location | html %]</span> </td>
390                     [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
391                     <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
392                     <td class="status">
393
394                         [% IF item.CheckedOutFor %]
395                           [% IF item.onsite_checkout %]
396                             <span>Currently in local use
397                           [% ELSE %]
398                             <span class="datedue">Checked out
399                           [% END %]
400                                 [% UNLESS ( item.NOTSAMEBRANCH ) %]
401                                   [% IF item.onsite_checkout %]
402                                     by
403                                   [% ELSE %]
404                                     to
405                                   [% END %]
406                                   [% INCLUDE 'patron-title.inc' patron=item.CheckedOutFor hide_patron_infos_if_needed=1 %]
407                                 [% END %]
408                                 : due [% item.datedue | html %]
409                             </span>
410                         [% ELSIF ( item.transfertwhen ) %]
411                             <span class="intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %] to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>
412                         [% END %]
413
414                         [% IF ( item.itemlost ) %]
415                             [% IF itemlostloop %]
416                                 [% FOREACH itemlostloo IN itemlostloop %]
417                                     [% IF itemlostloo.authorised_value == item.itemlost %]
418                                         <span class="lost">[% itemlostloo.lib | html %]</span>
419                                     [% END %]
420                                 [% END %]
421                             [% ELSE %]
422                                 <span class="lost">Unavailable (lost or missing)</span>
423                             [% END %]
424                         [% END %]
425
426                         [% IF ( item.withdrawn ) %]
427                             [% IF itemwithdrawnloop %]
428                                 [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %]
429                                     [% IF itemwithdrawnloo.authorised_value == item.withdrawn %]
430                                         <span class="wdn">[% itemwithdrawnloo.lib | html %]</span>
431                                     [% END %]
432                                 [% END %]
433                             [% ELSE %]
434                                 <span class="wdn">Withdrawn</span>
435                             [% END %]
436                         [% END %]
437
438                         [% IF ( item.damaged ) %]
439                             [% IF itemdamagedloop %]
440                                 [% FOREACH itemdamagedloo IN itemdamagedloop %]
441                                     [% IF itemdamagedloo.authorised_value == item.damaged %]
442                                         <span class="dmg">[% itemdamagedloo.lib | html %]</span>
443                                     [% END %]
444                                 [% END %]
445                             [% ELSE %]
446                                 <span class="dmg">Damaged</span>
447                             [% END %]
448                         [% END %]
449
450                         [% IF ( item.itemnotforloan || item.notforloan_per_itemtype ) %]
451                             Not for loan
452                             [% IF ( item.notforloanvalue ) %]
453                                 ([% item.notforloanvalue | html %])
454                             [% END %]
455                         [% END %]
456
457                         [% IF ( item.reservedate ) %]
458                             [% IF ( item.waitingdate ) %]
459                                 Waiting at [% Branches.GetName( item.ExpectedAtLibrary ) | html %] since [% item.waitingdate | $KohaDates %].
460                             [% ELSE %]
461                                 Item-level hold (placed [% item.reservedate | $KohaDates %]) for delivery at [% Branches.GetName( item.ExpectedAtLibrary ) | html %].
462                             [% END %]
463                             [% IF ( canreservefromotherbranches ) %]
464                                 Hold for:
465                                 [% INCLUDE 'patron-title.inc' patron=item.ReservedFor hide_patron_infos_if_needed=1 %]
466                             [% END %]
467                         [% END %]
468                         [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate ) %]
469                             Available
470                         [% END %]
471
472                         [% IF ( item.restricted ) %]
473                             <span class="restricted">([% item.restricted | html %])</span>
474                         [% END %]
475
476                     </td>
477                     <td class="datelastseen">[% item.datelastseen | $KohaDates %]</td>
478                     <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type | html %]&amp;itemnumber=[% item.itemnumber | html %]&amp;biblionumber=[% item.biblionumber | html %]&amp;bi=[% item.biblioitemnumber | html %]#item[% item.itemnumber | html %]">[% item.barcode | html %]</a></td>
479                     [% IF ( volinfo ) %]
480                         <td class="enumchron">
481                             [% IF ( itemdata_enumchron ) %]
482                                 [% IF item.enumchron && item.serialseq %]
483                                     <span class="enum">[% item.enumchron | html %]</span>
484                                     [% IF ( item.serialseq && item.enumchron!=item.serialseq ) %]
485                                         <span class="sep"> -- </span>
486                                         <span class="serialseq">[% item.serialseq | html %]</span>
487                                     [% END %]
488                                 [% ELSIF item.enumchron %]
489                                     <span class="enum">[% item.enumchron | html %]</span>
490                                 [% ELSIF item.serialseq %]
491                                     <span class="serialseq">[% item.serialseq | html %]</span>
492                                 [% END %]
493                                 [% IF ( item.publisheddate ) %]
494                                     <span class="pubdate">([% item.publisheddate | $KohaDates %])</span>
495                                 [% END %]
496                             [% END %]
497                         </td>
498                     [% END %]
499                     [% IF ( itemdata_uri ) %]
500                         <td class="uri"><a href="[% item.uri | html %]">[% item.uri | html %]</a></td>
501                     [% END %]
502                     [% IF ( itemdata_copynumber ) %]
503                         <td class="copynumber">[% item.copynumber | html %]</td>
504                     [% END %]
505                     [% IF ( itemdata_stocknumber ) %]
506                         <td class="stocknumber">[% item.stocknumber | html %]</td>
507                     [% END %]
508                     [% IF materials %]
509                         <td class="materials"> [% item.materials | html %] </td>
510                     [% END %]
511                     [% IF ( itemdata_itemnotes ) %]
512                         <td><div class="itemnotes">[% item.itemnotes | html %]</div></td>
513                     [% END %]
514                     [% IF itemdata_nonpublicnotes %]
515                         <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
516                     [% END %]
517                     [% IF ( SpineLabelShowPrintOnBibDetails ) %]
518                         <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | html %]" >Print label</a></td>
519                     [% END %]
520                     [% IF ( hostrecords ) %]
521                         <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | html %]" >[% item.hosttitle | html %]</a>[% END %]</td>
522                     [% END %]
523                     [% IF ( analyze ) %]
524                         <td>
525                             [% IF ( item.countanalytics ) %]
526                                 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | html %]">[% item.countanalytics | html %] analytics</a>
527                             [% END %]
528                         </td>
529                     [% END %]
530                     [% IF ( analyze ) %]
531                         <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | html %]&amp;hostitemnumber=[% item.itemnumber | html %]">Create analytics</a></td>
532                     [% END %]
533
534                 [% IF ShowCourseReserves %]
535                     <td>
536                         [% IF item.course_reserves %]
537                             [% FOREACH r IN item.course_reserves %]
538                                 [% IF r.course.enabled == 'yes' %]
539                                     <p>
540                                       <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | html %]">
541                                          [% r.course.course_name | html %]
542                                          <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
543                                          [% IF r.course.section %] [% r.course.section | html %] [% END %]
544                                          [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
545                                       </a>
546                                    </p>
547                                [% END %]
548                            [% END %]
549                        [% END %]
550                     </td>
551                 [% END %]
552                 [% IF CAN_user_editcatalogue_edit_items %]
553                     <td class="actions">
554                         [% UNLESS item.cannot_be_edited %]
555                             <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>
556                         [% END %]
557                     </td>
558                 [% END %]
559                 </tr>
560             [% END %]
561         </tbody>
562     </table>
563 [% END %][%# end of block items_table %]
564
565 <div id="holdings">
566
567 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
568     <span class="results_summary NovelistSelect" style="display:none;">
569         <span class="label">Novelist Select: </span>
570         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
571     </span>
572 [% END %]
573
574 [% IF ( count ) %]
575     [% IF ( showncount ) %]
576         [% PROCESS items_table tab="holdings" items=itemloop %]
577         [% END %]
578                 [% IF ( hiddencount ) %]
579                    <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | html %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
580                 [% END %]               
581                 [% IF ( debug_display ) %]
582                 <br /><br />
583                 <table>
584                         <tr><td>itemdata_enumchron</td><td>[% itemdata_enumchron | html %]</td></tr>
585                         <tr><td>itemdata_copynumber</td><td>[% itemdata_copynumber | html %]</td></tr>
586                         <tr><td>serial</td><td>[% serial | html %]</td></tr>
587                 </table>
588                 [% END %]
589 [% ELSE %]
590     [% IF ( ALTERNATEHOLDINGS ) %]
591     [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
592         <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
593     [% END %]
594     [% ELSE %]
595     <div id="noitems">No physical items for this record</div>
596     [% END %]
597 [% END %]
598
599 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
600     <span class="results_summary NovelistSelect" style="display:none;">
601         <span class="label">Novelist Select: </span>
602         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
603     </span>
604 [% END %]
605     </div>
606
607 [% IF (SeparateHoldings) %]
608     <div id="otherholdings">
609         [% IF (otheritemloop.size) %]
610             [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
611         [% ELSE %]
612             No other items.
613         [% END %]
614     </div>
615 [% END %]
616
617 [% IF ( MARCNOTES || notes ) %]
618
619 <div id="description">
620 <div class="content_set">
621
622 [% IF ( MARCNOTES ) %]
623     [% FOREACH MARCNOTE IN MARCNOTES %]
624         <p>
625         [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
626             <a href="[% MARCNOTE.marcnote | html %]">[% MARCNOTE.marcnote | html %]</a>
627         [% ELSE %]
628             [% MARCNOTE.marcnote FILTER html_line_break | html %]
629         [% END %]
630         </p>
631     [% END %]
632 [% ELSE %]
633     [% IF ( notes ) %]
634         <p>[% notes | html %]</p>
635     [% END %]
636 [% END %]
637 </div>
638 </div>
639
640 [% END %]
641
642 [% IF ( subscriptionsnumber ) %]
643 <div id="subscriptions">
644 <div class="yui-g">
645 <div id="catalogue_detail_subscriptions">
646     <h2>This is a serial subscription</h2>
647     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
648     [% FOREACH subscription IN subscriptions %]
649             [% IF subscription.branchcode %]
650                 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
651             [% END %]
652             [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
653             [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
654             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break | html %] </p>[% END %]
655             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
656             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
657             [% IF ( subscription.latestserials ) %]
658             <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
659             <table>
660                 <tr>
661                     <th>Issue #</th>
662                     <th>Date arrived</th>
663                     <th>Date published</th>
664                     <th>Status</th>
665                     <th>Note</th>
666                 </tr>
667             [% FOREACH latestserial IN subscription.latestserials %]
668                 <tr>
669                     <td>[% latestserial.serialseq | html %]</td>
670                     <td>[% latestserial.planneddate | html %]</td>
671                     <td>[% latestserial.publisheddate | html %]</td>
672                     <td>
673                       [% IF ( latestserial.status1 ) %]Expected[% END %]
674                       [% IF ( latestserial.status2 ) %]Arrived[% END %]
675                       [% IF ( latestserial.status3 ) %]Late[% END %]
676                       [% IF ( latestserial.status4 ) %]Missing[% END %]
677                       [% IF ( latestserial.status41 ) %]Missing (never received)[% END %]
678                       [% IF ( latestserial.status42 ) %]Missing (sold out)[% END %]
679                       [% IF ( latestserial.status43 ) %]Missing (damaged)[% END %]
680                       [% IF ( latestserial.status44 ) %]Missing (lost)[% END %]
681                       [% IF ( latestserial.status5 ) %]Not issued[% END %]
682                       [% IF ( latestserial.status6 ) %]Delete[% END %]
683                       [% IF ( latestserial.status7 ) %]Claimed[% END %]
684                       [% IF ( latestserial.status8 ) %]Stopped[% END %]
685                     </td>
686                     <td>[% latestserial.notes | html %]</td>
687                 </tr>
688             [% END %]
689             </table>
690             [% END %]
691             <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | html %]">Subscription details</a>
692     [% END %]
693 </div>
694 </div>
695 </div>
696 [% END %]
697
698 [% IF Koha.Preference('AcquisitionDetails') %]
699 <div id="acq_details">
700   [% IF orders %]
701     <table id="orders">
702       <thead>
703         <tr>
704           <th>Vendor</th>
705           <th>Invoice</th>
706           <th>Basket group</th>
707           <th>Basket</th>
708           <th>Order number</th>
709           <th class="title-string">Creation date</th>
710           <th class="title-string">Receive date</th>
711           <th>Status</th>
712           <th>Quantity</th>
713           <th>Subscription</th>
714           <th>Subscription callnumber</th>
715         </tr>
716       </thead>
717       <tbody>
718       [% FOR order IN orders %]
719         [% SET basket = order.basket %]
720         [% SET vendor = basket.bookseller %]
721           <tr>
722             <td>
723                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
724             </td>
725             <td>
726             [% IF order.invoiceid %]
727                 [% IF CAN_user_acquisition %]
728                     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
729                        title="Invoice detail page">
730                        [% order.invoice.invoicenumber | hrml %]</a>
731                 [% ELSE %]
732                     [% order.invoice.invoicenumber | html %]
733                 [% END %]
734             [% END %]
735             </td>
736             <td>
737             [% IF basket.basketgroupid %]
738                 [% SET basket_group = basket.basket_group %]
739                 [% IF CAN_user_acquisition_group_manage %]
740                     <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>
741                 [% ELSE %]
742                     [% basket_group.name | html %] ([% basket_group.id | html %])
743                 [% END %]
744             [% END %]
745             </td>
746             <td>[% IF CAN_user_acquisition_order_manage %]
747                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
748             [% ELSE %]
749                 [% basket.basketname | html %] ([% basket.basketno | html %])
750             [% END %]</td>
751             <td>[% order.ordernumber | html %]</td>
752             <td><span title="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</span></td>
753             <td><span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</span></td>
754             <td>
755               [% SWITCH order.orderstatus %]
756                 [% CASE 'new' %]New
757                 [% CASE 'ordered' %]Ordered
758                 [% CASE 'partial' %]Partial
759                 [% CASE 'complete' %]Complete
760                 [% CASE 'cancelled' %]Cancelled
761               [% END %]
762             </td>
763             <td>[% order.quantity | html %]</td>
764             <td>
765                 [% IF order.subscriptionid %]
766                     <a href="g/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
767                 [% END %]
768             </td>
769             <td>
770                 [% IF order.subscriptionid %]
771                     [% order.subscription.callnumber | html %]
772                 [% END %]
773             </td>
774           </tr>
775       [% END %]
776       </tbody>
777     </table>
778   [% ELSE %]
779     There is no order for this biblio.
780   [% END %]
781 </div>
782 [% END %]
783
784 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
785 <div id="editions"><h4>Editions</h4>
786 <table>
787 [% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn | html %][% AmazonAssocTag | html %]#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 %]
788 [% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description | html %][% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
789 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber | html %]">[% XISBN.title | html %]</a> by [% XISBN.author | html %] &copy;[% XISBN.copyrightdate | html %]
790   [% IF ( XISBN.publishercode ) %]
791 [% 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 %]
792     [% END %]
793                 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
794                 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
795 </td>
796
797 [% END %]
798 </table></div>[% END %]
799 [% END %]
800
801 [% IF ( LocalCoverImages ) %]
802 <div id="images">
803 [% IF ( localimages.0 ) %]
804     <p>Click on an image to view it in the image viewer</p>
805     <ul class="thumbnails">
806 [% FOREACH image IN localimages %]
807     [% IF image %]
808         <li id="imagenumber-[% image | html %]">
809             <a class="thumbnail" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | html %]&amp;imagenumber=[% image | html %]">
810                 <img alt="remove this image" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image | html %]" />
811                 [% IF CAN_user_tools_upload_local_cover_images %]
812                   <span class="remove" title="remove this image">Delete image</span>
813                 [% END %]
814             </a>
815         </li>
816     [% END %]
817 [% END %]
818     </ul>
819 [%# ELSE - No image passed JavaScript takes care %]
820 [% END %]
821 </div>
822 [% END %]
823
824 [% IF ( HTML5MediaEnabled ) %]
825 <div id="html5media">
826           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
827             <p>
828               <[% HTML5MediaParent | html %] controls preload=none>
829                 <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | html %]"[% HTML5MediaSet.typeblock | html %] />
830                 [[% HTML5MediaParent | html %] tag not supported by your browser.]
831               </[% HTML5MediaParent | html %]>
832             </p>
833           [% END %]
834 </div>
835 [% END %]
836
837
838 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
839     <div id="NovelistSelect" class="novelistSelect">
840         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
841     </div>
842 [% END %]
843
844 </div><!-- /bibliodetails -->
845
846 <div class="yui-g" id="export" style="margin-top: 1em;">
847 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
848 <table>  <tr>
849       <th>Save Record</th>   </tr>
850     <tr><td> Select download format:    <select name="format">
851         <option value="mods">MODS (XML)</option>
852         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
853         <option value="marcxml">MARCXML</option>
854         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
855         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
856         <input type="submit" name="save" value="Download Record" /></td>
857   </tr>
858   <tr><td>
859     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
860   </td></tr>
861 </table>
862 </form>
863 </div>
864
865 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
866     <div class="modal-dialog modal-lg">
867     <div class="modal-content">
868     <div class="modal-header">
869         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
870         <h3 id="marcPreviewLabel">MARC preview</h3>
871     </div>
872     <div class="modal-body">
873         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
874     </div>
875     <div class="modal-footer">
876         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
877     </div>
878     </div>
879     </div>
880 </div>
881
882 </div>
883 </div>
884 <div class="yui-b">
885 [% INCLUDE 'biblio-view-menu.inc' %]
886 </div>
887 [% END %]
888 </div>
889
890 [% MACRO jsinclude BLOCK %]
891     [% INCLUDE 'catalog-strings.inc' %]
892     [% Asset.js("js/catalog.js") | $raw %]
893     [% INCLUDE 'greybox.inc' %]
894     <script type="text/javascript">
895         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
896         function verify_images() {
897             $("#bookcoverimg").each(function(i){
898                 $(this).find('img').each(function(i){
899                    if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
900                         w = this.width;
901                         h = this.height;
902                         if ((w == 1) || (h == 1)) {
903                             $("#amazon-bookcoverimg").remove();
904                             $(".yui-gb").attr("class","yui-g");
905                         } else if ((this.complete != null) && (!this.complete)) {
906                             $("#amazon-bookcoverimg").remove();
907                             $(".yui-gb").attr("class","yui-g");
908                         }
909                     }
910                 });
911                 if( $(this).find('img').length < 1 ) $(this).remove();
912             });
913             $("#editions img").each(function(i){
914                 if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) {
915                     w = this.width;
916                     h = this.height;
917                     if ((w == 1) || (h == 1)) {
918                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
919                     } else if ((this.complete != null) && (!this.complete)) {
920                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
921                     }
922                 }
923             });
924         }
925
926         function removeLocalImage(imagenumber) {
927             $.ajax({
928                 url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + biblionumber + "&imagenumber=" + imagenumber,
929                 success: function(data) {
930                     $(data).each( function(i) {
931                         if ( this.deleted == 1 ) {
932                             $('#imagenumber-' + this.imagenumber).remove();
933                         }
934                         if ( $('ul.thumbnails > li').length == 0 ) {
935                             showNoImageMessage();
936                         }
937                     });
938                 },
939                 error: function(data) {
940                     alert(_("An error occurred on deleting this image"));
941                 }
942             });
943         }
944
945         function showNoImageMessage() {
946             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
947             no_images_msg = '<p>' + no_images_msg + '</p>';
948             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
949                 var please_upload = _("Please select the image file to upload. %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>");
950                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
951             [% END %]
952             $('#images').html(no_images_msg);
953         }
954
955         [% IF StaffDetailItemSelection %]
956             function itemSelectionBuildDeleteLink(div) {
957                 var itemnumbers = new Array();
958                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
959                     itemnumbers.push($(this).val());
960                 });
961                 if (itemnumbers.length > 0) {
962                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
963                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
964                     url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
965                     $('a.itemselection_action_delete').attr('href', url);
966                 } else {
967                     return false;
968                 }
969                 return true
970             }
971
972             function itemSelectionBuildModifyLink(div) {
973                 var itemnumbers = new Array();
974                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
975                     itemnumbers.push($(this).val());
976                 });
977                 if (itemnumbers.length > 0) {
978                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
979                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
980                     url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
981                     $('a.itemselection_action_modify').attr('href', url);
982                 } else {
983                     return false;
984                 }
985                 return true;
986             }
987
988             function itemSelectionBuildActionLinks(tab) {
989                 var div = $("#" + tab);
990                 var delete_link_ok = itemSelectionBuildDeleteLink(div);
991                 var modify_link_ok = itemSelectionBuildModifyLink(div);
992                 if (modify_link_ok || delete_link_ok) {
993                     $('.itemselection_actions', div).show();
994                 } else {
995                     $('.itemselection_actions', div).hide();
996                 }
997             }
998
999             $(document).ready(function() {
1000                 $('table.items_table').each(function() {
1001                     var div = $(this).parent().attr("id");
1002                     itemSelectionBuildActionLinks(div);
1003                 });
1004
1005                 $("input[name='itemnumber'][type='checkbox']").change(function() {
1006                     var div = $(this).parents('table').parent().parent().attr("id");
1007                     itemSelectionBuildActionLinks(div);
1008                 });
1009
1010                 $(".SelectAll").on("click",function(e){
1011                     e.preventDefault();
1012                     var tab = $(this).data("tab");
1013                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1014                     itemSelectionBuildActionLinks(tab);
1015                 });
1016
1017                 $(".ClearAll").on("click",function(e){
1018                     e.preventDefault();
1019                     var tab = $(this).data("tab");
1020                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1021                     itemSelectionBuildActionLinks(tab);
1022                 });
1023             });
1024         [% END %]
1025
1026         $(document).ready(function() {
1027             $('#bibliodetails').tabs();
1028             [% IF count == 0 %]
1029                 $('#bibliodetails').tabs("option", "active", 3);
1030             [% END %]
1031             $('#search-form').focus();
1032             $('.thumbnails > li > a > span.remove').click(function() {
1033                 var result = confirm(_("Are you sure you want to delete this cover image?"));
1034
1035                 if ( result == true ) {
1036                     var imagenumber = $(this).parent().parent().attr('id').split('-')[1];
1037                     removeLocalImage(imagenumber);
1038                 }
1039
1040                 return false;
1041             });
1042             [%# inject no images message %]
1043             [% IF ( LocalCoverImages && ! localimages.0 ) %]
1044                 showNoImageMessage();
1045             [% END %]
1046             [% IF LocalCoverImages %]
1047                 KOHA.LocalCover.GetCoverFromBibnumber(true);
1048             [% END %]
1049             $("body").on("click",".previewMARC", function(e){
1050                 e.preventDefault();
1051                 var page = $(this).attr("href");
1052                 $("#marcPreview .modal-body").load(page + " table");
1053                 $('#marcPreview').modal({show:true});
1054             });
1055             $("#marcPreview").on("hidden", function(){
1056                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
1057             });
1058             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1059                 novSelect.loadContentForQuery({
1060                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1061                     ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1062                     version : '2.1'
1063                 },
1064                 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1065                 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1066                 function(d){
1067                     if ( d.length > 0 ){ //If no content
1068                         $(".NovelistSelect").show();
1069                     }
1070                  });
1071              [% END %]
1072
1073         });
1074
1075         [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1076             verify_images();
1077         });[% END %]
1078     </script>
1079     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1080         [% Asset.js("https://imageserver.ebscohost.com/novelistselect/ns2init.js") | $raw %]
1081     [% END %]
1082     [% INCLUDE 'datatables.inc' %]
1083     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1084     [% INCLUDE 'browser-strings.inc' %]
1085     [% INCLUDE 'columns_settings.inc' %]
1086     [% Asset.js("js/browser.js") | $raw %]
1087     [% Asset.js("js/table_filters.js") | $raw %]
1088     <script type="text/javascript">
1089         var browser;
1090         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1091         browser.show();
1092
1093         $(document).ready(function() {
1094             var ids = ['holdings_table', 'otherholdings_table'];
1095
1096             for (var i in ids) {
1097                 var id = ids[i];
1098                 var dt_parameters = {
1099                     'sDom': 't',
1100                     'bPaginate': false,
1101                     'bAutoWidth': false,
1102                     "aoColumnDefs": [
1103                         { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
1104                     ]
1105                 };
1106                 var table = KohaTable(id, dt_parameters, null, 'with_filters');
1107             }
1108
1109             [% IF Koha.Preference('AcquisitionDetails') %]
1110                 $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
1111                     'sDom': 't',
1112                     'bPaginate': false,
1113                     'bAutoWidth': false,
1114                     "aaSorting": [[ 4, "desc" ]],
1115                     "aoColumnDefs": [
1116                         { "aTargets": "title-string", "sType": "title-string" }
1117                     ]
1118                 }));
1119             [% END %]
1120         });
1121     </script>
1122 [% END %]
1123 [% INCLUDE 'intranet-bottom.inc' %]