]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
Bug 13618: Add html filters to all the variables
[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 | html %]
329 [% BLOCK items_table %]
330     [% items_table_block_iter = items_table_block_iter + 1 | html %]
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         </tr>
714       </thead>
715       <tbody>
716       [% FOR order IN orders %]
717           <tr>
718             <td>
719             [% IF (order.id) %]
720                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | html %]" title="Vendor detail page">[% order.name | html %]</a>
721             [% END %]
722             </td>
723             <td>
724             [% IF (order.invoiceid) %]
725                 [% IF CAN_user_acquisition %]
726                     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | html %]"
727                        title="Invoice detail page">
728                        [% order.invoicenumber | html %]</a>
729                 [% ELSE %]
730                     [% order.invoicenumber | html %]
731                 [% END %]
732             [% END %]
733             </td>
734             <td>
735             [% IF (order.basketgroupid) %]
736                 [% IF CAN_user_acquisition_group_manage %]
737                     <a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% order.id | html %]&basketgroupid=[% order.basketgroupid | html %]">[% order.groupname | html %] ([% order.basketgroupid | html %])</a>
738                 [% ELSE %]
739                     [% order.groupname | html %] ([% order.basketgroupid | html %])
740                 [% END %]
741             [% END %]
742             </td>
743             <td>[% IF CAN_user_acquisition_order_manage %]
744                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | html %]">[% order.basketname | html %] ([% order.basketno | html %])</a>
745             [% ELSE %]
746                 [% order.basketname | html %] ([% order.basketno | html %])
747             [% END %]</td>
748             <td>[% order.ordernumber | html %]</td>
749             <td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates%]</span></td>
750             <td><span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates%]</span></td>
751             <td>
752               [% SWITCH order.orderstatus %]
753                 [% CASE 'new' %]New
754                 [% CASE 'ordered' %]Ordered
755                 [% CASE 'partial' %]Partial
756                 [% CASE 'complete' %]Complete
757                 [% CASE 'cancelled' %]Cancelled
758               [% END %]
759             </td>
760             <td>[% order.quantity | html %]</td>
761           </tr>
762       [% END %]
763       </tbody>
764     </table>
765   [% ELSE %]
766     There is no order for this biblio.
767   [% END %]
768 </div>
769 [% END %]
770
771 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
772 <div id="editions"><h4>Editions</h4>
773 <table>
774 [% 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 %]
775 [% 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 %]
776 <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 %]
777   [% IF ( XISBN.publishercode ) %]
778 [% 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 %]
779     [% END %]
780                 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
781                 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
782 </td>
783
784 [% END %]
785 </table></div>[% END %]
786 [% END %]
787
788 [% IF ( LocalCoverImages ) %]
789 <div id="images">
790 [% IF ( localimages.0 ) %]
791     <p>Click on an image to view it in the image viewer</p>
792     <ul class="thumbnails">
793 [% FOREACH image IN localimages %]
794     [% IF image %]
795         <li id="imagenumber-[% image | html %]">
796             <a class="thumbnail" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | html %]&amp;imagenumber=[% image | html %]">
797                 <img alt="remove this image" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image | html %]" />
798                 [% IF CAN_user_tools_upload_local_cover_images %]
799                   <span class="remove" title="remove this image">Delete image</span>
800                 [% END %]
801             </a>
802         </li>
803     [% END %]
804 [% END %]
805     </ul>
806 [%# ELSE - No image passed JavaScript takes care %]
807 [% END %]
808 </div>
809 [% END %]
810
811 [% IF ( HTML5MediaEnabled ) %]
812 <div id="html5media">
813           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
814             <p>
815               <[% HTML5MediaParent | html %] controls preload=none>
816                 <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | html %]"[% HTML5MediaSet.typeblock | html %] />
817                 [[% HTML5MediaParent | html %] tag not supported by your browser.]
818               </[% HTML5MediaParent | html %]>
819             </p>
820           [% END %]
821 </div>
822 [% END %]
823
824
825 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
826     <div id="NovelistSelect" class="novelistSelect">
827         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
828     </div>
829 [% END %]
830
831 </div><!-- /bibliodetails -->
832
833 <div class="yui-g" id="export" style="margin-top: 1em;">
834 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
835 <table>  <tr>
836       <th>Save Record</th>   </tr>
837     <tr><td> Select download format:    <select name="format">
838         <option value="mods">MODS (XML)</option>
839         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
840         <option value="marcxml">MARCXML</option>
841         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
842         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
843         <input type="submit" name="save" value="Download Record" /></td>
844   </tr>
845   <tr><td>
846     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
847   </td></tr>
848 </table>
849 </form>
850 </div>
851
852 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
853     <div class="modal-dialog modal-lg">
854     <div class="modal-content">
855     <div class="modal-header">
856         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
857         <h3 id="marcPreviewLabel">MARC preview</h3>
858     </div>
859     <div class="modal-body">
860         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
861     </div>
862     <div class="modal-footer">
863         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
864     </div>
865     </div>
866     </div>
867 </div>
868
869 </div>
870 </div>
871 <div class="yui-b">
872 [% INCLUDE 'biblio-view-menu.inc' %]
873 </div>
874 [% END %]
875 </div>
876
877 [% MACRO jsinclude BLOCK %]
878     [% INCLUDE 'catalog-strings.inc' %]
879     [% Asset.js("js/catalog.js") | $raw %]
880     [% INCLUDE 'greybox.inc' %]
881     <script type="text/javascript">
882         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
883         function verify_images() {
884             $("#bookcoverimg").each(function(i){
885                 $(this).find('img').each(function(i){
886                    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'))) {
887                         w = this.width;
888                         h = this.height;
889                         if ((w == 1) || (h == 1)) {
890                             $("#amazon-bookcoverimg").remove();
891                             $(".yui-gb").attr("class","yui-g");
892                         } else if ((this.complete != null) && (!this.complete)) {
893                             $("#amazon-bookcoverimg").remove();
894                             $(".yui-gb").attr("class","yui-g");
895                         }
896                     }
897                 });
898                 if( $(this).find('img').length < 1 ) $(this).remove();
899             });
900             $("#editions img").each(function(i){
901                 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'))) {
902                     w = this.width;
903                     h = this.height;
904                     if ((w == 1) || (h == 1)) {
905                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
906                     } else if ((this.complete != null) && (!this.complete)) {
907                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
908                     }
909                 }
910             });
911         }
912
913         function removeLocalImage(imagenumber) {
914             $.ajax({
915                 url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + biblionumber + "&imagenumber=" + imagenumber,
916                 success: function(data) {
917                     $(data).each( function(i) {
918                         if ( this.deleted == 1 ) {
919                             $('#imagenumber-' + this.imagenumber).remove();
920                         }
921                         if ( $('ul.thumbnails > li').length == 0 ) {
922                             showNoImageMessage();
923                         }
924                     });
925                 },
926                 error: function(data) {
927                     alert(_("An error occurred on deleting this image"));
928                 }
929             });
930         }
931
932         function showNoImageMessage() {
933             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
934             no_images_msg = '<p>' + no_images_msg + '</p>';
935             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
936                 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>");
937                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
938             [% END %]
939             $('#images').html(no_images_msg);
940         }
941
942         [% IF StaffDetailItemSelection %]
943             function itemSelectionBuildDeleteLink(div) {
944                 var itemnumbers = new Array();
945                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
946                     itemnumbers.push($(this).val());
947                 });
948                 if (itemnumbers.length > 0) {
949                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
950                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
951                     url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
952                     $('a.itemselection_action_delete').attr('href', url);
953                 } else {
954                     return false;
955                 }
956                 return true
957             }
958
959             function itemSelectionBuildModifyLink(div) {
960                 var itemnumbers = new Array();
961                 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
962                     itemnumbers.push($(this).val());
963                 });
964                 if (itemnumbers.length > 0) {
965                     var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
966                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
967                     url += '&src=' + '[% "/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber" |uri %]';
968                     $('a.itemselection_action_modify').attr('href', url);
969                 } else {
970                     return false;
971                 }
972                 return true;
973             }
974
975             function itemSelectionBuildActionLinks(tab) {
976                 var div = $("#" + tab);
977                 var delete_link_ok = itemSelectionBuildDeleteLink(div);
978                 var modify_link_ok = itemSelectionBuildModifyLink(div);
979                 if (modify_link_ok || delete_link_ok) {
980                     $('.itemselection_actions', div).show();
981                 } else {
982                     $('.itemselection_actions', div).hide();
983                 }
984             }
985
986             $(document).ready(function() {
987                 $('table.items_table').each(function() {
988                     var div = $(this).parent().attr("id");
989                     itemSelectionBuildActionLinks(div);
990                 });
991
992                 $("input[name='itemnumber'][type='checkbox']").change(function() {
993                     var div = $(this).parents('table').parent().parent().attr("id");
994                     itemSelectionBuildActionLinks(div);
995                 });
996
997                 $(".SelectAll").on("click",function(e){
998                     e.preventDefault();
999                     var tab = $(this).data("tab");
1000                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1001                     itemSelectionBuildActionLinks(tab);
1002                 });
1003
1004                 $(".ClearAll").on("click",function(e){
1005                     e.preventDefault();
1006                     var tab = $(this).data("tab");
1007                     $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1008                     itemSelectionBuildActionLinks(tab);
1009                 });
1010             });
1011         [% END %]
1012
1013         $(document).ready(function() {
1014             $('#bibliodetails').tabs();
1015             [% IF count == 0 %]
1016                 $('#bibliodetails').tabs("option", "active", 3);
1017             [% END %]
1018             $('#search-form').focus();
1019             $('.thumbnails > li > a > span.remove').click(function() {
1020                 var result = confirm(_("Are you sure you want to delete this cover image?"));
1021
1022                 if ( result == true ) {
1023                     var imagenumber = $(this).parent().parent().attr('id').split('-')[1];
1024                     removeLocalImage(imagenumber);
1025                 }
1026
1027                 return false;
1028             });
1029             [%# inject no images message %]
1030             [% IF ( LocalCoverImages && ! localimages.0 ) %]
1031                 showNoImageMessage();
1032             [% END %]
1033             [% IF LocalCoverImages %]
1034                 KOHA.LocalCover.GetCoverFromBibnumber(true);
1035             [% END %]
1036             $("body").on("click",".previewMARC", function(e){
1037                 e.preventDefault();
1038                 var page = $(this).attr("href");
1039                 $("#marcPreview .modal-body").load(page + " table");
1040                 $('#marcPreview').modal({show:true});
1041             });
1042             $("#marcPreview").on("hidden", function(){
1043                 $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
1044             });
1045             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1046                 novSelect.loadContentForQuery({
1047                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1048                     ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1049                     version : '2.1'
1050                 },
1051                 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1052                 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1053                 function(d){
1054                     if ( d.length > 0 ){ //If no content
1055                         $(".NovelistSelect").show();
1056                     }
1057                  });
1058              [% END %]
1059
1060         });
1061
1062         [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
1063             verify_images();
1064         });[% END %]
1065     </script>
1066     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1067         [% Asset.js("https://imageserver.ebscohost.com/novelistselect/ns2init.js") | $raw %]
1068     [% END %]
1069     [% INCLUDE 'datatables.inc' %]
1070     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1071     [% INCLUDE 'browser-strings.inc' %]
1072     [% INCLUDE 'columns_settings.inc' %]
1073     [% Asset.js("js/browser.js") | $raw %]
1074     [% Asset.js("js/table_filters.js") | $raw %]
1075     <script type="text/javascript">
1076         var browser;
1077         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1078         browser.show();
1079
1080         $(document).ready(function() {
1081             var ids = ['holdings_table', 'otherholdings_table'];
1082
1083             for (var i in ids) {
1084                 var id = ids[i];
1085                 var dt_parameters = {
1086                     'sDom': 't',
1087                     'bPaginate': false,
1088                     'bAutoWidth': false,
1089                     "aoColumnDefs": [
1090                         { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }
1091                     ]
1092                 };
1093                 var table = KohaTable(id, dt_parameters, null, 'with_filters');
1094             }
1095
1096             [% IF Koha.Preference('AcquisitionDetails') %]
1097                 $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
1098                     'sDom': 't',
1099                     'bPaginate': false,
1100                     'bAutoWidth': false,
1101                     "aaSorting": [[ 4, "desc" ]],
1102                     "aoColumnDefs": [
1103                         { "aTargets": "title-string", "sType": "title-string" }
1104                     ]
1105                 }));
1106             [% END %]
1107         });
1108     </script>
1109 [% END %]
1110 [% INCLUDE 'intranet-bottom.inc' %]