Bug 33568: Fix DT dom and remove DT info if not needed
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / detail.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE To %]
4 [% USE Koha %]
5 [% USE KohaDates %]
6 [% USE KohaPlugins %]
7 [% USE AuthorisedValues %]
8 [% USE Branches %]
9 [% USE Biblio %]
10 [% USE Frameworks %]
11 [% USE Price %]
12 [% USE TablesSettings %]
13 [% PROCESS 'i18n.inc' %]
14 [% PROCESS 'html_helpers/tables/items/catalogue_detail.inc' %]
15 [% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %]
16
17 [% IF Koha.Preference('AmazonAssocTag') %]
18     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
19 [% ELSE %]
20     [% AmazonAssocTag = '' %]
21 [% END %]
22
23 [% SET plugins_intranet_catalog_biblio_tabs = KohaPlugins.get_plugins_intranet_catalog_biblio_tab({ biblio => biblio, biblio_id => biblionumber }) %]
24
25 [% SET footerjs = 1 %]
26 [% INCLUDE 'doc-head-open.inc' %]
27 <title>[% FILTER collapse %]
28     [% IF ( unknownbiblionumber ) %]
29         [% t("Unknown record") | html %]
30     [% ELSE %]
31         [% title_in_title = INCLUDE 'biblio-title-head.inc' %]
32         [% tx("Details for {title}", { title = title_in_title }) | html %]
33     [% END %] &rsaquo;
34     [% t("Catalog") | html %] &rsaquo;
35     [% t("Koha") | html %]
36 [% END %]</title>
37 [% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %]
38 [% INCLUDE 'doc-head-close.inc' %]
39 </head>
40
41 <body id="catalog_detail" class="catalog">
42
43 [% WRAPPER 'header.inc' %]
44     [% INCLUDE 'cat-search.inc' %]
45 [% END %]
46
47 [% WRAPPER 'sub-header.inc' %]
48     [% WRAPPER breadcrumbs %]
49         [% WRAPPER breadcrumb_item %]
50             <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
51         [% END %]
52
53         [% IF ( unknownbiblionumber ) %]
54             [% WRAPPER breadcrumb_item bc_active= 1 %]
55                 <span>Unknown record</span>
56             [% END %]
57         [% ELSE %]
58             [% WRAPPER breadcrumb_item %]
59                 [% INCLUDE 'biblio-title.inc' link = 1 %]
60             [% END %]
61             [% WRAPPER breadcrumb_item bc_active= 1 %]
62                 <span>Details</span>
63             [% END %]
64         [% END %]
65     [% END #/ WRAPPER breadcrumbs %]
66 [% END #/ WRAPPER sub-header.inc %]
67
68 <div class="main container-fluid">
69     <div class="row">
70         <div class="col-sm-10 col-sm-push-2">
71             <main>
72                 [% INCLUDE 'messages.inc' %]
73                 <div class="row">
74
75 [% IF ( unknownbiblionumber ) %]
76   <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
77 [% ELSE %]
78
79 [% IntranetCoce    = Koha.Preference('IntranetCoce') %]
80 [% CoceProviders   = Koha.Preference('CoceProviders') %]
81 [% CoceHost        = Koha.Preference('CoceHost') %]
82 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
83
84 [% INCLUDE 'cat-toolbar.inc' %]
85     [% IF ( ocoins ) %]
86         <!-- COinS / OpenURL -->
87         <span class="Z3988" title="[% ocoins | html %]"></span>
88     [% END %]
89
90     [% IF ( CoverImagePlugins || AmazonCoverImages  || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
91         <div id="catalogue_detail_biblio" class="col-xs-9">
92     [% ELSE %]
93         <div id="catalogue_detail_biblio" class="col-xs-12">
94     [% END %]
95         [% IF decoding_error || analytics_error %]
96             <div class="page-section bg-danger">
97                <h1>Errors found</h1>
98                [% IF decoding_error %]
99                    <h2>Encoding errors</h2>
100                    <p class="biberror">There is at least one encoding error with this bibliographic record, the view may be degraded.</p>
101                    <pre class="error">[% decoding_error | html %]</pre>
102                [% END %]
103                [% IF analytics_error %]
104                    <h2>Analytics errors</h2>
105                    <p class="analytics_error">There was an error searching for analytic records, please see the logs for details.</p>
106                [% END %]
107             </div>
108         [% END %]
109
110         <div class="page-section">
111
112         [% XSLTBloc | $raw %]
113
114         [% IF shelves.count %]
115             <span class="results_summary"><span class="label">Lists that include this title: </span>
116             [% FOREACH s IN shelves %]
117                 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&amp;shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
118                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
119             [% END %]
120             </span>
121         [% END %]
122         [% IF ( TagsEnabled &&  TagsShowOnDetail &&  TagLoop ) %]
123                 <span class="results_summary"><span class="label">Tags:</span>
124                     [% FOREACH TagLoo IN TagLoop %]
125                         [% IF ( CAN_user_tools_moderate_tags ) %]
126                         <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |uri %]">[% TagLoo.term | html %]</a>
127                         [% ELSE %]
128                         [% TagLoo.term | html %]
129                         [% END %]
130                         <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
131                     [% END %]
132                     </span>
133         [% END %]
134         <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber | uri %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
135         <span id="catalogue_detail_framework" class="results_summary">
136             <span class="label">MARC framework:</span>
137             <span class="frameworkcode">[% Frameworks.GetName(biblio.frameworkcode) | html %]</span>
138         </span>
139         [% IF !item_level_itypes ||  Koha.Preference("BiblioItemtypeInfo") %]
140            <span class="results_summary itemtype"><span class="label">Itemtype:</span>
141           [% IF ( !noItemTypeImages && imageurl ) %]
142               <img src="[% imageurl | html %]" alt="" />
143           [% END %]
144           [% IF ( description ) %]
145               <span class="itypetext">[% description | html %]</span>
146           [% ELSE %]
147               <span class="itypetext">[% itemtype | html %]</span>
148           [% END %]
149           </span>
150         [% END %]
151
152         [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
153             <span id="catalogue_detail_elastic_record" class="results_summary"><span class="label">Elasticsearch record:</span> <a href="/cgi-bin/koha/catalogue/showelastic.pl?id=[% biblionumber | uri %]" title="Elasticsearch record" class="previewElastic">Show</a></span>
154         [% END %]
155
156         [% IF ( holdcount ) %]
157             <span class="results_summary">
158                 <span class="label">Holds:</span>
159                 <span class="number_box">
160                     [% IF CAN_user_reserveforothers_place_holds %]
161                         <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
162                     [% ELSE %]
163                         <span>[% holdcount | html %]</span>
164                     [% END %]
165                 </span>
166             </span>
167         [% END %]
168
169         [% IF illrequests.count %]
170             <span class="results_summary">
171                 <span class="label">ILL requests:</span>
172                 [% IF CAN_user_ill %]
173                     [% FOREACH ill IN illrequests %]
174                         <a href="/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=[% ill.illrequest_id | uri %]">Request [% ill.illrequest_id | html %]</a>[% IF ! loop.last %], [% END %]
175                     [% END %]
176                 [% ELSE %]
177                     [% FOREACH ill IN illrequests %]
178                         <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
179                     [% END %]
180                 [% END %]
181             </span>
182         [% END %]
183
184         [% IF ( article_requests_count = biblio.article_requests.filter_by_current.count ) %]
185             <span class="results_summary">
186                 <span class="label">Article requests:</span>
187                 <span class="number_box">
188                     <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
189                 </span>
190             </span>
191         [% END %]
192
193         [% IF course_reserves %]
194             <span class="results_summary"><span class="label">Courses that have reserved this title: </span>
195             [% FOREACH c IN course_reserves %]
196                 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% c.course_id | uri %]">[% c.course.course_name | html %]</a>
197                 [% IF ( loop.last ) %][% ELSE %]|[% END %]
198             [% END %]
199             </span>
200         [% END %]
201         </div> [%# .page-section %]
202
203         [% IF ( CoverImagePlugins || AmazonCoverImages  || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
204         </div>
205             <div class="col-xs-3 bookcoverimg">
206                 <div id="biblio-cover-slider" class="cover-slider" data-isbn="[% normalized_isbn | html %]">
207                     [% IF ( LocalCoverImages ) %]
208                         [% IF localimages.count %]
209                             [% FOREACH image IN localimages %]
210                                 <div class="cover-image local-coverimg">
211                                     <a href="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
212                                         <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" />
213                                     </a>
214                                     <div class="hint">Local cover image</div>
215                                 </div>
216                             [% END %]
217                         [% END %]
218                     [% END %]
219
220                     [% IF ( AmazonCoverImages && normalized_isbn) %]
221                         <div class="cover-image" id="amazon-bookcoverimg">
222                             <a href="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.LZZZZZZZ.jpg" title="Amazon cover image">
223                                 <img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.MZZZZZZZ.jpg" alt="Amazon cover image" data-link="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"/>
224                             </a>
225                             <div class="hint">Image from Amazon.com</div>
226                         </div>
227                     [% END %]
228
229                     [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
230                         [% coce_id = normalized_ean || normalized_isbn %]
231                         <div class="cover-image coce-coverimg">
232                             [% IF ( coce_id ) %]
233                                 <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
234                             [% ELSE %]
235                                 <span class="no-image">No cover image available</span>
236                             [% END %]
237                             <div class="hint">Image from Coce</div>
238                         </div>
239                     [% END %]
240
241                     [% IF ( SyndeticsCovers ) %]
242                         [% IF ( content_identifier_exists ) %]
243                         <div class="cover-image" id="syndetics-bookcoverimg">
244                             <a href="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | url %]/LC.GIF&amp;client=[% Koha.Preference('SyndeticsClientCode') | url %]&amp;type=xw10&amp;upc=[% normalized_upc | url %]&amp;oclc=[% normalized_oclc | url %]" title="Syndetics cover image">
245                                 <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn | url %]/[% Koha.Preference('SyndeticsCoverImageSize') | url %].GIF&amp;client=[% Koha.Preference('SyndeticsClientCode') | url %]&amp;type=xw10&amp;upc=[% normalized_upc | url %]&amp;oclc=[% normalized_oclc | url %]" alt="" class="thumbnail" />
246                             </a>
247                             <div class="hint">Image from Syndetics</div>
248                         </div>
249                             [% ELSE %]
250                                 <span class="no-image">No cover image available</span>
251                             [% END %]
252                     [% END %]
253
254                     [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
255                         [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
256                         [% IF custom_cover_image_url %]
257                             <div class="cover-image" id="custom-coverimg">
258                                 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" title="Custom cover image">
259                                     <img id="custom-img" alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
260                                 </a>
261                                 <div class="hint">Custom cover image</div>
262                             </div>
263                         [% END %]
264                     [% END %]
265                 </div> <!-- /.cover-slider -->
266             </div> <!-- /.bookcoverimg.col-xs-3 -->
267         [% ELSE %]
268         </div> <!-- /.col-xs-* -->
269         [% END # /IF ( AmazonCoverImages, etc ) %]
270 </div>
271
272 <div id="bibliodetails" class="toptabs">
273
274 <ul class="nav nav-tabs" role="tablist">
275     [% IF Koha.Preference('SeparateHoldings') %]
276         <li role="presentation">
277             [%# FIXME We could build the numbers from DataTable's info %]
278             <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">[% Branches.GetLoggedInBranchname | html %] holdings ([% items_to_display_count - ( other_holdings_count || 0 ) - ( hidden_count || 0 ) || 0 | html %])</a>
279         </li>
280         <li role="presentation">
281             <a href="#otherholdings"  aria-controls="otherholdings" role="tab" data-toggle="tab">Other holdings ([% other_holdings_count || 0 | html %])</a>
282         </li>
283     [% ELSE %]
284         <li role="presentation">
285             <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% items_to_display_count || 0 | html %])</a>
286         </li>
287     [% END %]
288     [% IF Koha.Preference('EnableItemGroups') %]
289         <li role="presentation">
290             <a href="#item_groups" aria-controls="item_groups" role="tab" data-toggle="tab">Item groups</a>
291         </li>
292     [% END %]
293 [% IF ( MARCNOTES || notes ) %]<li role="presentation"><a href="#description" aria-controls="description" role="tab" data-toggle="tab">Descriptions ([% ( MARCNOTES.size || 1 ) | html %])</a></li>[% END %]
294 [% IF ComponentParts && ComponentParts.size %]<li id="components_tab" role="presentation"><a href="#components"  aria-controls="components" role="tab" data-toggle="tab">Components ([% ComponentParts.size | html %])</a></li>[% END %]
295 [% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions"  aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %]
296 [% IF Koha.Preference('AcquisitionDetails') %]<li role="presentation"><a href="#acq_details"  aria-controls="acq_details" role="tab" data-toggle="tab">Acquisition details</a></li>[% END %]
297 [% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details"  aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %]
298 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions"  aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %]
299 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]<li role="presentation"><a href="#concerns" aria-controls="concerns" role="tab" data-toggle="tab">Concerns ([% biblio.tickets.count | html %])</a></li>[% END %]
300 [% IF ( LocalCoverImages ) %]
301     <li role="presentation">
302         <a href="#images"  aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a>
303     </li>
304 [% END %]
305 [% IF HTML5MediaEnabled && HTML5MediaSets.size %]
306     <li id="media_tab" role="presentation"><a href="#html5media"  aria-controls="html5media" role="tab" data-toggle="tab">Play media</a></li>
307 [% END %]
308 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
309     <li class="NovelistSelect" style="display:none;" role="presentation"><a href="#NovelistSelect"  aria-controls="NovelistSelect" role="tab" data-toggle="tab">NoveList Select</a></li>
310 [% END %]
311 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
312     <li role="presentation"><a href="#[% plugins_intranet_catalog_biblio_tab.id | uri %]"  aria-controls="[% plugins_intranet_catalog_biblio_tab.id | uri %]" role="tab" data-toggle="tab">[% plugins_intranet_catalog_biblio_tab.title | html %]</a></li>
313 [% END %]
314 </ul>
315
316 <div class="tab-content">
317 [% IF Koha.Preference('EnableItemGroups') %]
318     <div role="tabpanel" class="tab-pane" id="item_groups">
319         [% IF CAN_user_editcatalogue_manage_item_groups %]
320             <div class="item_groups_table_table_controls">
321                 <a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a>
322             </div>
323         [% END %]
324         <table class="items-group-table" id="items-group-table">
325             <thead>
326                 <tr>
327                     <th>Display order</th>
328                     <th>Description</th>
329                     <th class="NoSort">&nbsp;</th>
330                 </tr>
331             </thead>
332         </table>
333     </div>
334 [% END %]
335
336
337 <div role="tabpanel" class="tab-pane" id="holdings">
338
339 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
340     <span class="results_summary NovelistSelect" style="display:none;">
341         <span class="label">Novelist Select: </span>
342         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
343     </span>
344 [% END %]
345
346 [% SET hidden_count = all_items_count - items_to_display_count %]
347 [% IF all_items_count %]
348     [% PROCESS items_table tab="holdings" %]
349
350     [% IF hidden_count %]
351         [%# FIXME We could deal with that in JS and prevent a full refresh %]
352         <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items ([% hidden_count | html %] hidden)</a>
353     [% END %]
354 [% ELSE %]
355     [% IF ( ALTERNATEHOLDINGS ) %]
356     [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
357         <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
358     [% END %]
359     [% ELSE %]
360     <div id="noitems">No physical items for this record</div>
361     [% END %]
362 [% END %]
363
364 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
365     <span class="results_summary NovelistSelect" style="display:none;">
366         <span class="label">Novelist Select: </span>
367         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
368     </span>
369 [% END %]
370     </div>
371
372 [% IF Koha.Preference('SeparateHoldings') %]
373     <div role="tabpanel" class="tab-pane" id="otherholdings">
374         [% PROCESS items_table tab="otherholdings" %]
375     </div>
376 [% END %]
377
378 [% IF ( MARCNOTES ) %]
379
380 <div role="tabpanel" class="tab-pane" id="description">
381 <div class="content_set">
382
383     [% FOREACH MARCNOTE IN MARCNOTES %]
384         <p class="marcnote marcnote-[% MARCNOTE.tag | html %]" id="marcnote-[% MARCNOTE.tag | html %]-[% loop.count | html %]">
385             [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
386                 <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
387             [% ELSE %]
388                 [% MARCNOTE.marcnote | html | html_line_break %]
389             [% END %]
390         </p>
391 [% END %]
392 </div>
393 </div>
394
395 [% END %]
396
397 [% IF ComponentParts && ComponentParts.size %]
398 <div role="tabpanel" class="tab-pane" id="components">
399     <div class="content_set">
400         <table>
401             [% FOR PART IN ComponentParts %]
402             <tr>
403                 <td>
404                     [% PART | $raw %]
405                 </td>
406             </tr>
407             [% END %]
408         </table>
409         [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%]
410         <p>Only [% ComponentParts.size | html %] results are shown: <a href="/cgi-bin/koha/catalogue/search.pl?q=[% ComponentPartsQuery | url %]"/>show all component parts</a></p>
411         [% END %]
412     </div> <!-- /.content_set -->
413 </div> <!-- /#components -->
414
415 [% END %]
416
417 [% IF ( subscriptionsnumber ) %]
418 <div role="tabpanel" class="tab-pane" id="subscriptions">
419 <div id="catalogue_detail_subscriptions">
420     <h2>This is a serial subscription</h2>
421     <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p> 
422     [% FOREACH subscription IN subscriptions %]
423             [% IF subscription.branchcode %]
424                 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
425             [% END %]
426             [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
427             [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
428             [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
429             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
430             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
431             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
432             [% IF ( subscription.latestserials ) %]
433             <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
434             <table>
435                 <tr>
436                     <th>Issue #</th>
437                     <th>Date arrived</th>
438                     <th>Date published</th>
439                     <th>Date published (text)</th>
440                     <th>Status</th>
441                     <th>Note</th>
442                 </tr>
443             [% FOREACH latestserial IN subscription.latestserials %]
444                 <tr>
445                     <td>[% latestserial.serialseq | html %]</td>
446                     <td data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td>
447                     <td data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td>
448                     <td>[% latestserial.publisheddatetext | html %]</td>
449                     <td>
450                         [% INCLUDE 'serial-status.inc' serial = latestserial %]
451                     </td>
452                     <td>[% latestserial.notes | html %]</td>
453                 </tr>
454             [% END %]
455             </table>
456             [% END %]
457             [% IF ( CAN_user_serials ) %]
458                 <p>
459                     <a class="btn btn-link" href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]"><i class="fa fa-list" aria-hidden="true"></i> Subscription details</a>
460                 </p>
461             [% END %]
462     [% END %]
463 </div>
464 </div>
465 [% END %]
466
467 [% IF Koha.Preference('AcquisitionDetails') %]
468 <div role="tabpanel" class="tab-pane" id="acq_details">
469   [% IF orders.count %]
470     <table id="orders">
471       <thead>
472         <tr>
473           <th>Vendor</th>
474           <th>Invoice</th>
475           <th>Basket group</th>
476           <th>Basket</th>
477           <th>Order number</th>
478           <th>Creation date</th>
479           <th>Receive date</th>
480           <th>Status</th>
481           <th>Quantity</th>
482           <th title="Estimated cost tax incl. while pending, actual cost tax incl. once received">Price</th>
483           <th>Internal note</th>
484           <th>Subscription</th>
485           <th>Subscription call number</th>
486         </tr>
487       </thead>
488       <tbody>
489       [% FOR order IN orders %]
490         [% SET basket = order.basket %]
491         [% SET vendor = basket.bookseller %]
492           <tr>
493             <td>
494                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
495             </td>
496             <td>
497             [% IF order.invoiceid %]
498                 [% IF CAN_user_acquisition %]
499                     <div><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
500                        title="Invoice detail page">
501                        [% order.invoice.invoicenumber | html %]</a></div>
502                 [% ELSE %]
503                     <div>[% order.invoice.invoicenumber | html %]</div>
504                 [% END %]
505
506                 [% IF ( Koha.Preference('EDIFACT') && CAN_user_acquisition_edi_manage && order.invoice.message_id ) %]
507                     <div><a href="/cgi-bin/koha/acqui/edimsg.pl?id=[% order.invoice.message_id | uri %]" title="EDI INVOICE message">EDI message</a></div>
508                 [% END %]
509             [% END %]
510             </td>
511             <td>
512             [% IF basket.basketgroupid %]
513                 [% SET basket_group = basket.basket_group %]
514                 [% IF CAN_user_acquisition_group_manage %]
515                     <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>
516                 [% ELSE %]
517                     [% basket_group.name | html %] ([% basket_group.id | html %])
518                 [% END %]
519             [% END %]
520             </td>
521             <td>[% IF CAN_user_acquisition_order_manage %]
522                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
523             [% ELSE %]
524                 [% basket.basketname | html %] ([% basket.basketno | html %])
525             [% END %]</td>
526             <td>[% order.ordernumber | html %]</td>
527             <td data-order="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</td>
528             <td data-order="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</td>
529             <td>
530               [% SWITCH order.orderstatus %]
531                 [% CASE 'new' %]<span>New</span>
532                 [% CASE 'ordered' %]<span>Ordered</span>
533                 [% CASE 'partial' %]<span>Partial</span>
534                 [% CASE 'complete' %]<span>Complete</span>
535                 [% CASE 'cancelled' %]<span>Cancelled</span>
536               [% END %]
537             </td>
538             <td>[% order.quantity | html %]</td>
539             <td>[% IF ( order.orderstatus == "complete" ) %][% order.unitprice_tax_included | $Price %][% ELSE %][% order.ecost_tax_included | $Price %][% END %]
540             <td>[% order.order_internalnote | html %]</td>
541             <td>
542                 [% IF order.subscriptionid %]
543                     <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
544                 [% END %]
545             </td>
546             <td>
547                 [% IF order.subscriptionid %]
548                     [% order.subscription.callnumber | html %]
549                 [% END %]
550             </td>
551           </tr>
552       [% END %]
553       </tbody>
554     </table>
555   [% ELSE %]
556     <span class="noorder">There is no order for this bibliographic record.</span>
557   [% END %]
558 </div>
559 [% END %]
560
561 [% IF suggestions.count %]
562     <div role="tabpanel" class="tab-pane" id="suggestion_details">
563         [% IF nb_archived_suggestions > 0 %]
564             <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw  %]
565         [% END %]
566         <table id="suggestions" class="sorted">
567             <thead>
568                 <tr>
569                     <th class="NoSort">&nbsp;</th>
570                     <th class="anti-the">Suggestion</th>
571                     <th>Suggested by - on</th>
572                     <th>Managed by - on</th>
573                     <th>Last modification by - on</th>
574                     <th>Library</th>
575                     <th>Fund</th>
576                     <th>Status</th>
577                 </tr>
578             </thead>
579             <tbody>
580             [% FOREACH suggestion IN suggestions %]
581                 <tr>
582                     <td>[% suggestion.suggestionid | html %]</td>
583                     <td>
584                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&amp;op=show" title="suggestion" >
585                             [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
586                         <br />
587                         [% IF ( suggestion.copyrightdate ) %]&copy; [% suggestion.copyrightdate | html %] [% END %]
588                         [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
589                         [% IF ( suggestion.isbn ) %]; ISBN:<em>[% suggestion.isbn | html %]</em> [% END %][% IF ( suggestion.publishercode ) %]; Published by [% suggestion.publishercode | html %] [% END %][% IF ( suggestion.publicationyear ) %] in <em>[% suggestion.publicationyear | html %]</em> [% END %][% IF ( suggestion.place ) %] in <em>[% suggestion.place | html %]</em> [% END %][% IF ( suggestion.collectiontitle ) %]; [% suggestion.collectiontitle | html %] [% END %][% IF ( suggestion.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestion.itemtype, 0 ) | html %] [% END %]<br />[% IF ( suggestion.note ) %]<div class="suggestion_note"><i class="fa fa-comment"></i> [% suggestion.note | html %]</div>[% END %]
590                     </td>
591                     <td>
592                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
593                         [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
594                     </td>
595                     <td>
596                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
597                         [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
598                     </td>
599                     <td>
600                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
601                         [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
602                     </td>
603                     <td>
604                         [% Branches.GetName( suggestion.branchcode ) | html %]
605                     </td>
606                     <td>
607                         [% suggestion.fund.budget_name | html %]
608                     </td>
609                     <td>
610                         [% IF    suggestion.STATUS == 'ASKED'     %]<span>Pending</span>
611                         [% ELSIF suggestion.STATUS == 'ACCEPTED'  %]<span>Accepted</span>
612                         [% ELSIF suggestion.STATUS == 'ORDERED'   %]<span>Ordered</span>
613                         [% ELSIF suggestion.STATUS == 'REJECTED'  %]<span>Rejected</span>
614                         [% ELSIF suggestion.STATUS == 'CHECKED'   %]<span>Checked</span>
615                         [% ELSIF suggestion.STATUS == 'AVAILABLE' %]<span>Available</span>
616                         [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
617                             [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
618                         [% ELSE %]<span>Status unknown</span>
619                         [% END %]
620                         [% IF suggestion.reason %]
621                             <br />([% suggestion.reason | html %])
622                         [% END %]
623                     </td>
624                 </tr>
625                 [% END %]
626             </tbody>
627         </table>
628     </div>
629 [% END %]
630
631 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
632 <div role="tabpanel" class="tab-pane" id="editions"><h4>Editions</h4>
633 <table>
634 [% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img src="https://images-na.ssl-images-amazon.com/images/P/[% XISBN.normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
635 [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]<td>[% IF ( noItemTypeImages ) %]<span class="itypetext">[% XISBN.description | html %]</span>[% ELSE %]<img src="[% XISBN.imageurl | html %]" alt="[% XISBN.description | html %]" title="[% XISBN.description | html %]">[% END %]</td>[% END %]
636 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber | uri %]">[% XISBN.title | html %]</a> <span>by</span> [% XISBN.author | html %] &copy;[% XISBN.copyrightdate | html %]
637   [% IF ( XISBN.publishercode ) %]
638 [% 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 %]
639     [% END %]
640                 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
641                 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
642 </td>
643
644 [% END %]
645 </table></div>[% END %]
646 [% END %]
647
648 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
649 <div role="tabpanel" class="tab-pane" id="concerns">
650     <fieldset class="action" style="cursor:pointer;">
651         <a id="hideResolved"><i class="fa fa-minus-square"></i> Hide resolved</a>
652         | <a id="showAll"><i class="fa fa-bars"></i> Show all</a>
653     </fieldset>
654
655     <table id="table_concerns" width="100%">
656         <thead>
657             <tr>
658                 <th>Reported</th>
659                 <th>Details</th>
660                 <th>Status</th>
661                 <th data-class-name="actions noExport">Actions</th>
662             </tr>
663         </thead>
664     </table>
665 </div>
666 [% END %]
667
668 [% IF ( LocalCoverImages ) %]
669     <div role="tabpanel" class="tab-pane" id="images">
670         [% IF localimages.count %]
671             <p>Click on an image to view it in the image viewer</p>
672             <ul class="thumbnails">
673                 [% FOREACH image IN localimages %]
674                     [% IF image %]
675                         <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
676                             <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]">
677                                 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" />
678                             </a>
679                             [% IF CAN_user_tools_upload_local_cover_images %]
680                                 <a href="#" class="remove"><i class="fa fa-trash-can"></i> Delete image</a>
681                             [% END %]
682                         </li>
683                     [% END %]
684                 [% END %]
685             </ul>
686         [% ELSE # - No image passed JavaScript takes care %]
687             <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
688         [% END %]
689         [% IF ( CAN_user_tools_upload_local_cover_images ) %]
690             <p>Upload an image file: <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&amp;filetype=image"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
691             </p>
692         [% END %]
693     </div>
694 [% END %]
695
696 [% IF ( HTML5MediaEnabled ) %]
697 <div role="tabpanel" class="tab-pane" id="html5media">
698           [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
699             <p>
700                 [% IF HTML5MediaSet.is_youtube %]
701                     <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
702                 [% ELSE %]
703                   <[% HTML5MediaParent | html %] controls preload=none>
704                     <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
705                     [[% HTML5MediaParent | html %] tag not supported by your browser.]
706                   </[% HTML5MediaParent | html %]>
707                 [% END %]
708             </p>
709           [% END %]
710 </div>
711 [% END %]
712
713
714 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
715     <div role="tabpanel" class="tab-pane" id="NovelistSelect" class="novelistSelect">
716         <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
717     </div>
718 [% END %]
719
720 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
721     <div role="tabpanel" class="tab-pane" id="[% plugins_intranet_catalog_biblio_tab.id | html %]">
722         [% plugins_intranet_catalog_biblio_tab.content | $raw %]
723     </div>
724 [% END %]
725
726 </div><!-- /tab-content -->
727 </div><!-- /bibliodetails -->
728
729 <div id="export" style="margin-top: 1em;">
730 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
731 <table>  <tr>
732       <th>Save record</th>   </tr>
733     <tr><td> Select download format:    <select name="format">
734         <option value="mods">MODS (XML)</option>
735         <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
736         <option value="marcxml">MARCXML</option>
737         <option value="marc8">MARC (non-Unicode/MARC-8)</option>
738         <option value="utf8">MARC (Unicode/UTF-8)</option>    </select>
739         <input type="submit" name="save" class="btn btn-primary" value="Download record" /></td>
740   </tr>
741   <tr><td>
742     <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
743   </td></tr>
744 </table>
745 </form>
746 </div>
747
748 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
749     <div class="modal-dialog modal-lg">
750     <div class="modal-content">
751     <div class="modal-header">
752         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
753         <h3 id="marcPreviewLabel">MARC preview</h3>
754     </div>
755     <div class="modal-body">
756         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
757     </div>
758     <div class="modal-footer">
759         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
760     </div>
761     </div>
762     </div>
763 </div>
764
765 <div id="elasticPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="elasticPreviewLabel" aria-hidden="true">
766     <div class="modal-dialog modal-lg">
767     <div class="modal-content">
768     <div class="modal-header">
769         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
770         <h3 id="elasticPreviewLabel">Elasticsearch record</h3>
771     </div>
772     <div class="modal-body">
773         <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
774     </div>
775     <div class="modal-footer">
776         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
777     </div>
778     </div>
779     </div>
780 </div>
781
782             </main>
783         </div> <!-- /.col-sm-10.col-sm-push-2 -->
784
785         <div class="col-sm-2 col-sm-pull-10">
786             <aside>
787                 [% INCLUDE 'biblio-view-menu.inc' %]
788             </aside>
789         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
790      </div> <!-- /.row -->
791
792 [% END %]
793
794 <div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label">
795     <div class="modal-dialog">
796         <div class="modal-content">
797             <div class="modal-header">
798                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
799                 <h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3>
800             </div>
801             <form method="get" id="modal-item-group-create-form" class="validated">
802                 <div class="modal-body">
803                     <fieldset>
804                         <p>
805                             <label for="item_group_description" class="required">Name: </label>
806                             <input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" />
807                             <span class="required">Required</span>
808                         </p>
809                         <p>
810                             <label for="item_group_display_order" class="required">Display order: </label>
811                             <input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" />
812                             <span class="required">Required</span>
813                             <br/>
814                             <span class="hint">Numbers only, item groups will be displayed in counting order</span>
815                         </p>
816                     </fieldset>
817                 </div>
818                 <div class="modal-footer">
819                     <button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button>
820                     <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
821                 </div>
822             </form>
823         </div>
824     </div>
825 </div>
826
827 <div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label">
828     <div class="modal-dialog">
829         <div class="modal-content">
830             <div class="modal-header">
831                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
832                 <h3 id="modal-item-group-edit-label"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit item group</h3>
833             </div>
834             <form method="get" id="modal-item-group-edit-form" class="validated">
835                 <div class="modal-body">
836                     <fieldset>
837                         <p>
838                             <label for="item_group_description" class="required">Name: </label>
839                             <input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" />
840                             <span class="required">Required</span>
841                         </p>
842                         <p>
843                             <label for="item_group_display_order" class="required">Sort order: </label>
844                             <input name="display_order" id="modal-item-group-edit-form-display_order" size="5" />
845                             <span class="hint">Numbers only, item groups will be displayed in counting order</span>
846                         </p>
847                     </fieldset>
848                 </div>
849                 <div class="modal-footer">
850                     <button id="modal-item-group-edit-submit" class="btn btn-default"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Submit</button>
851                     <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
852                 </div>
853             </form>
854         </div>
855     </div>
856 </div>
857
858 <div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label">
859     <div class="modal-dialog">
860         <div class="modal-content">
861             <div class="modal-header">
862                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
863                 <h3 id="modal-item-group-delete-label"><i class='fa fa-trash-can'></i> Delete item group</h3>
864             </div>
865             <div class="modal-body">
866                 Are you sure you want to delete this item group?
867             </div>
868             <div class="modal-footer">
869                 <button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash-can'></i> Delete</button>
870                 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
871             </div>
872         </div>
873     </div>
874 </div>
875
876 <div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label">
877     <div class="modal-dialog">
878         <div class="modal-content">
879             <div class="modal-header">
880                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
881                 <h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3>
882             </div>
883             <form method="get" id="modal-item-group-set-form" class="validated">
884                 <div class="modal-body">
885                     <fieldset>
886                         <p>
887                             <label for="item_group" class="required">Item group: </label>
888                             <select name="item_group" id="item-group-add-form-select">
889                                 [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
890                                     <option value="[% ig.id | html %]">[% ig.description | html %]</option>
891                                 [% END %]
892                             </select>
893                             <span class="required">Required</span>
894                         </p>
895                     </fieldset>
896                 </div>
897                 <div class="modal-footer">
898                     <button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button>
899                     <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
900                 </div>
901             </form>
902         </div>
903     </div>
904 </div>
905
906 <div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label">
907     <div class="modal-dialog">
908         <div class="modal-content">
909             <div class="modal-header">
910                 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
911                 <h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3>
912             </div>
913             <div class="modal-body">
914                 Are you sure you want to remove these item(s) from their item group(s)?
915             </div>
916             <div class="modal-footer">
917                 <button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button>
918                 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
919             </div>
920         </div>
921     </div>
922 </div>
923
924     [% IF bundlesEnabled %]
925     <div class="modal" id="addToBundleModal" tabindex="-1" role="dialog" aria-labelledby="addToBundleLabel">
926         <form method="get" id="addToBundleForm" action="">
927             <div class="modal-dialog" role="document">
928                 <div class="modal-content">
929                     <div class="modal-header">
930                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
931                         <h3 id="addToBundleLabel">Add to bundle</h3>
932                     </div>
933                     <div class="modal-body">
934                         <div id="addResult"></div>
935                         <fieldset class="rows">
936                             <ol>
937                                 <li>
938                                     <label class="required" for="external_id">Item barcode: </label>
939                                     <input type="text" id="external_id" name="external_id" required="required">
940                                     <span class="required">Required</span>
941                                 </li>
942                             </ol>
943                         </fieldset>
944                     </div>
945                     <div class="modal-footer">
946                         <button type="submit" class="btn btn-default">Submit</button>
947                         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
948                     </div>
949                 </div>
950             </div>
951         </form>
952     </div>
953
954     <div class="modal" id="removeFromBundleModal" tabindex="-1" role="dialog" aria-labelledby="removeFromBundleLabel">
955         <form method="get" id="removeFromBundleForm" action="">
956             <div class="modal-dialog" role="document">
957                 <div class="modal-content">
958                     <div class="modal-header">
959                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
960                         <h3 id="removeFromBundleLabel">Remove from bundle</h3>
961                     </div>
962                     <div class="modal-body">
963                         <div id="removeResult"></div>
964                         <fieldset class="rows">
965                             <ol>
966                                 <li>
967                                     <label class="required" for="external_id">Item barcode: </label>
968                                     <input type="text" id="rm_external_id" name="external_id" required="required">
969                                     <span class="required">Required</span>
970                                 </li>
971                             </ol>
972                         </fieldset>
973                     </div>
974                     <div class="modal-footer">
975                         <button type="submit" class="btn btn-default">Submit</button>
976                         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
977                     </div>
978                 </div>
979             </div>
980         </form>
981     </div>
982     [% END %]
983
984     [% IF ( Koha.Preference('CatalogConcerns') ) %]
985     [% INCLUDE 'modals/add_catalog_concern.inc' %]
986     [% END %]
987
988     [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
989     [% INCLUDE 'modals/display_ticket.inc' %]
990     [% END %]
991
992 [% MACRO jsinclude BLOCK %]
993     [% INCLUDE 'catalog-strings.inc' %]
994     [% INCLUDE 'calendar.inc' %]
995     [% INCLUDE 'select2.inc' %]
996     [% INCLUDE 'js-date-format.inc' %]
997     [% Asset.js("js/catalog.js") | $raw %]
998     [% Asset.js("js/recalls.js") | $raw %]
999     [% Asset.js("js/coce.js") | $raw %]
1000     [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1001     [% IF ( Koha.Preference('CatalogConcerns') ) %]
1002         <script>
1003             /* Set a variable needed by add_catalog_concern.js */
1004             var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1005         </script>
1006         [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1007      [% END %]
1008      [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1009          <script>
1010             $(document).ready(function() {
1011                 var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %];
1012
1013                 var filtered = false;
1014                 let additional_filters = {
1015                     resolved_date: function(){
1016                         if ( filtered ) {
1017                             return { "=": null };
1018                         } else {
1019                             return;
1020                         }
1021                     },
1022                     biblio_id: [% biblionumber | uri %]
1023                 };
1024
1025                 var tickets_url = '/api/v1/tickets';
1026                 var tickets = $("#table_concerns").kohaTable({
1027                     "ajax": {
1028                         "url": tickets_url
1029                     },
1030                     "embed": [
1031                         "reporter",
1032                         "resolver",
1033                         "updates+count",
1034                     ],
1035                     'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
1036                     "columnDefs": [ {
1037                         "targets": [0,1,2],
1038                         "render": function (data, type, row, meta) {
1039                             if ( type == 'display' ) {
1040                                 if ( data != null ) {
1041                                     return data.escapeHtml();
1042                                 }
1043                                 else {
1044                                     return "";
1045                                 }
1046                             }
1047                             return data;
1048                         }
1049                     } ],
1050                     "columns": [
1051                         {
1052                             "data": "reported_date:reporter.firstname",
1053                             "render": function(data, type, row, meta) {
1054                                 let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>';
1055                                 reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, {
1056                                     display_cardnumber: false,
1057                                     url: true
1058                                 }) + '</span>';
1059                                 return reported;
1060                             },
1061                             "searchable": true,
1062                             "orderable": true
1063                         },
1064                         {
1065                             "data": "title:body",
1066                             "render": function(data, type, row, meta) {
1067                                 let resolved = ( row.resolved_date ) ? true : false;
1068                                 let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '">' + row.title + '</a>';
1069                                 if (row.updates_count) {
1070                                     result += '<span class="pull-right"><a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '"><i class="fa fa-comment" aria-hidden="true"></i> ' + row.updates_count + '</a></span>';
1071                                 }
1072                                 result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>';
1073                                 return result;
1074                             },
1075                             "searchable": true,
1076                             "orderable": true
1077                         },
1078                         {
1079                             "data": "resolved_date",
1080                             "render": function(data, type, row, meta) {
1081                                 let result = '';
1082                                 if (row.resolved_date) {
1083                                     result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, {
1084                                         display_cardnumber: false,
1085                                         url: true
1086                                     }) + '</span>';
1087                                     result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
1088                                 } else {
1089                                     result += _("Open");
1090                                 }
1091                                 return result;
1092                             },
1093                             "searchable": true,
1094                             "orderable": true
1095                         },
1096                         {
1097                             "data": function(row, type, val, meta) {
1098                                 let resolved = ( row.resolved_date ) ? true : false;
1099                                 let result = '<a class="btn btn-default btn-xs" role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '"><i class="fa-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
1100                                 return result;
1101                             },
1102                             "searchable": false,
1103                             "orderable": false
1104                         },
1105                     ]
1106                 }, table_settings, 0, additional_filters);
1107
1108                 $('#hideResolved').on("click", function() {
1109                     filtered = true;
1110                     tickets.DataTable().draw();
1111                 });
1112
1113                 $('#showAll').on("click", function() {
1114                     filtered = false;
1115                     tickets.DataTable().draw();
1116                 });
1117             });
1118         </script>
1119         [% Asset.js("js/modals/display_ticket.js") | $raw %]
1120     [% END %]
1121     <script>
1122         var interface = "[% interface | html %]";
1123         var theme = "[% theme | html %]";
1124         // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1125         function verify_cover_images() {
1126             // Loop over each container in the template which contains covers
1127             $(".cover-slider").each(function(){
1128                 var lightbox_descriptions = [];
1129                 var first_shown = 0;
1130                 $(this).find(".cover-image").each( function( index ){
1131                 var div = $(this);
1132                 // Find the image in the container
1133                 var img = div.find("img")[0];
1134                 if( $(img).length > 0 ){
1135                     var description = "";
1136                         // All slides start hidden. If this is the first one, show it.
1137                         if( first_shown == 0 ){
1138                             div.show();
1139                             first_shown = 1;
1140                         }
1141                         // Check if Amazon image is present
1142                         if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1143                             w = img.width;
1144                             h = img.height;
1145                             if ((w == 1) || (h == 1)) {
1146                                 // Amazon returned single-pixel placeholder
1147                                 // Remove the container
1148                                 div.remove();
1149                             } else {
1150                                 lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1151                             }
1152                         } else if( div.attr("id") == "custom-coverimg" ){
1153                             if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1154                                 // No image was loaded via the CustomCoverImages system preference
1155                                 // Remove the container
1156                                 div.remove();
1157                             } else {
1158                                 lightbox_descriptions.push( _("Custom cover image") );
1159                             }
1160                         } else if ( div.attr("id") == "syndetics-bookcoverimg" ){
1161                                 lightbox_descriptions.push(_("Syndetics cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1162                         }
1163                         else if( div.hasClass("coce-coverimg" ) ){
1164                             // Identify which service's image is being loaded by Coce
1165                             var coce_description;
1166                             if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1167                                 coce_description = _("Coce image from Amazon.com");
1168                             } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1169                                 coce_description = _("Coce image from Google Books");
1170                             } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1171                                 coce_description = _("Coce image from Open Library");
1172                             }
1173                             div.find(".hint").html(coce_description);
1174                             lightbox_descriptions.push(coce_description);
1175                         } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1176                             lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1177                         } else {
1178                             lightbox_descriptions.push(_("Cover image source unknown"));
1179                         }
1180                     }
1181                 });
1182
1183                 // Lightbox for cover images
1184                 Chocolat(this.querySelectorAll('.cover-image a'), {
1185                     description: function(){
1186                         return lightbox_descriptions[this.settings.currentImageIndex];
1187                     }
1188                 });
1189
1190             });
1191
1192             $(".cover-slider").each(function(){
1193                 var coverSlide = this;
1194                 var coverImages = $(this).find(".cover-image");
1195                 if( coverImages.length > 1 ){
1196                     coverImages.each(function( index ){
1197                         // If more that one image is present, add a navigation link
1198                         // for activating the slide
1199                         var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1200                         if( index == 0 ){
1201                             // Set the first navigation link as active
1202                             $(covernav).addClass("nav-active");
1203                         }
1204                         $(covernav).html("<i class=\"fa fa-circle\"></i>");
1205                         $(coverSlide).append( covernav );
1206                     });
1207                 }
1208
1209                 if( $(coverSlide).attr('id') == 'biblio-cover-slider' // Hide if not visible, but only for the biblio images. Images for items are only local cover images
1210                     && $(coverSlide).find(".cover-image:visible").length < 1 ){
1211                     $(coverSlide).remove();
1212                 } else {
1213                     $(coverSlide).addClass("cover-slides");
1214                     var img = $(coverSlide).find(".cover-image:visible").find("img")[0];
1215                     if( $(img).length > 0 && img.complete && img.naturalHeight > 0 ){
1216                         $(".cover-slides").css({"background-image":"none"});
1217                     }
1218                 }
1219             });
1220
1221             $("#editions img").each(function(i){
1222                 if ( this.src.indexOf('amazon.com') >= 0 ) {
1223                     w = this.width;
1224                     h = this.height;
1225                     if ((w == 1) || (h == 1)) {
1226                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1227                     } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1228                         this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1229                     }
1230                 }
1231             });
1232         }
1233
1234         function removeLocalImage(imagenumber) {
1235             var thumbnail = $("#imagenumber-" + imagenumber );
1236             var copy = thumbnail.html();
1237             thumbnail.find("img").css("opacity", ".2");
1238             thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1239             const client = APIClient.cover_image;
1240             client.cover_images.delete(imagenumber).then(
1241                 success => {
1242                     if ( success.deleted == 1 ) {
1243                         thumbnail.remove();
1244                     } else {
1245                         thumbnail.html( copy );
1246                         alert(_("An error occurred on deleting this image"));
1247                     }
1248                     if ( $('ul.thumbnails > li').length == 0 ) {
1249                         showNoImageMessage();
1250                     }
1251                 },
1252                 error => {
1253                     thumbnail.html( copy );
1254                     alert(_("An error occurred on deleting this image"));
1255                     console.warn("Something wrong happened: %s".format(error));
1256                 }
1257             );
1258         }
1259
1260         function showNoImageMessage() {
1261             var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1262             no_images_msg = '<p>' + no_images_msg + '</p>';
1263             [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1264                 var please_upload = _("Upload an image file: %sUpload%s").format("<a class='btn btn-default btn-xs' href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=" + biblionumber + "&amp;filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>");
1265                 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1266             [% END %]
1267             $('#images').html(no_images_msg);
1268         }
1269
1270
1271         $(document).ready(function() {
1272             // Pick details tab to display by default
1273             [% IF count == 0 %]
1274                 [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %]
1275                     $(".nav-tabs a[href='#html5media']").tab("show");
1276                 [% ELSIF ComponentParts && ComponentParts.size %]
1277                     $(".nav-tabs a[href='#components']").tab("show");
1278                 [% ELSE %]
1279                     $(".nav-tabs a[href='#holdings']").tab("show");
1280                 [% END %]
1281             [% ELSE %]
1282                 $(".nav-tabs a[href='#holdings']").tab("show");
1283             [% END %]
1284             $('#search-form').focus();
1285             $('.thumbnails > li > .remove').click(function() {
1286                 var result = confirm(_("Are you sure you want to delete this cover image?"));
1287
1288                 if ( result == true ) {
1289                     var imagenumber = $(this).parent().attr('id').split('-')[1];
1290                     removeLocalImage(imagenumber);
1291                 }
1292
1293                 return false;
1294             });
1295             [% IF ( IntranetCoce && CoceProviders ) %]
1296                 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1297             [% END %]
1298
1299             $("body").on("click",".previewMARC", function(e){
1300                 e.preventDefault();
1301                 var page = $(this).attr("href");
1302                 $("#marcPreview .modal-body").load(page + " table");
1303                 $('#marcPreview').modal({show:true});
1304
1305             });
1306
1307            [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
1308             $("body").on("click",".previewElastic", function(e){
1309                 e.preventDefault();
1310                 var pageElastic = $(this).attr("href");
1311                 $("#elasticPreview .modal-body").load(pageElastic, function( response, status, xhr ) {
1312                     if( status == 'error' ){
1313                         $("#elasticPreview .modal-body").html("<h1>"+_("An error has occurred!")+"</h1><h2><em>"+_("Error 404")+"</em></h2><ul><li>"+_("An internal link in the staff interface is broken and the page does not exist")+"</li></ul><h3>"+_("What's next?")+"</h3><ul style='margin-bottom: 1em; padding-bottom: 1em; border-bottom: 1px solid #CCC;'><li>"+_("Use top menu bar to navigate to another part of Koha.")+"</li><li>"+_("To report a broken link or any other issue, please contact the Koha administrator.")+" <a href='mailto:[% Koha.Preference("KohaAdminEmailAddress") | uri %]'>"+_("Send email")+"</a></li></ul>");
1314                     }
1315                 });
1316                 $('#elasticPreview').modal({show:true});
1317             });
1318            [% END %]
1319
1320             [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1321                 novSelect.loadContentForQuery({
1322                     ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1323                     ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1324                     version : '2.1'
1325                 },
1326                 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1327                 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1328                 function(d){
1329                     if ( d.length > 0 ){ //If no content
1330                         $(".NovelistSelect").show();
1331                     }
1332                  });
1333              [% END %]
1334              $(".print-label").on("click", function(e){
1335                 e.preventDefault();
1336                 link = $(this).attr("href");
1337                 openWindow(link,"Print spine label",400,400);
1338              });
1339              $(".cover-slider").on("click",".cover-nav", function(e){
1340                  e.preventDefault();
1341                 var cover_slider = $(this).parent();
1342                 // Adding click handler for cover image navigation links
1343                 var num = $(this).data("num");
1344                 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1345                 $(this).addClass("nav-active");
1346                 $(cover_slider).find(".cover-image").hide();
1347                 $(cover_slider).find(".cover-image").eq( num ).show();
1348              });
1349         });
1350
1351
1352         [% IF ( IntranetCoce && CoceProviders ) %]
1353             let counter_wait = 0;
1354             function wait_for_images(cb){
1355
1356                 var loaded = 1;
1357                 counter_wait++;
1358
1359                 if ( loaded ) {
1360                     loaded = KOHA.coce.done;
1361                 }
1362
1363                 if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1364                     window.setTimeout(function(){wait_for_images(cb);}, 100);
1365                 } else {
1366                     if (counter_wait >= 50 ) {
1367                         console.log("Could not retrieve the images")
1368                     }
1369                     cb();
1370                 }
1371             }
1372
1373             $(window).load(function() {
1374                 wait_for_images(verify_cover_images);
1375             });
1376         [% ELSE %]
1377             $(window).load(function() {
1378                 verify_cover_images();
1379             });
1380         [% END %]
1381     </script>
1382     [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1383         <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1384     [% END %]
1385     [% INCLUDE 'datatables.inc' %]
1386     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1387     [% INCLUDE 'columns_settings.inc' %]
1388     [% INCLUDE 'js-date-format.inc' %]
1389     [% INCLUDE 'js-patron-format.inc' %]
1390     [% INCLUDE 'js-biblio-format.inc' %]
1391     [% Asset.js("js/browser.js") | $raw %]
1392     [% Asset.js("js/table_filters.js") | $raw %]
1393     [% Asset.js("js/place_booking_modal.js") | $raw %]
1394     <script>
1395         var browser;
1396         browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1397         browser.show();
1398
1399         [% IF bundlesEnabled %]
1400         var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1401         var bundle_lost_value = [% Koha.Preference('BundleLostValue') | html %];
1402         [% END %]
1403
1404         $(document).ready(function() {
1405
1406             [% IF bundlesEnabled %] // Bundle handling
1407             function createChild ( row, itemnumber, duedate ) {
1408
1409                 // Toolbar
1410                 var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>');
1411                 bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>');
1412                 bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>');
1413
1414                 // Disable management if there's a duedate
1415                 if(duedate) {
1416                     bundle_toolbar.children('.btn').addClass("disabled");
1417                     bundle_toolbar.attr("title", _("This bundle is checked out, it cannot be modified"));
1418                 }
1419
1420                 // This is the table we'll convert into a DataTable
1421                 var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>');
1422
1423                 // Display it the child row
1424                 row.child( bundle_toolbar.add(bundles_table), 'bundle' ).show();
1425
1426                 // Initialise as a DataTable
1427                 var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?";
1428                 var bundle_table = bundles_table.kohaTable({
1429                     "ajax": {
1430                         "url": bundle_table_url
1431                     },
1432                     "embed": [
1433                         "biblio",
1434                         "return_claim.patron"
1435                     ],
1436                     "order": [[ 1, "asc" ]],
1437                     "columnDefs": [ {
1438                         "targets": [0,1,2,3],
1439                         "render": function (data, type, row, meta) {
1440                             if ( data && type == 'display' ) {
1441                                 return data.escapeHtml();
1442                             }
1443                             return data;
1444                         }
1445                     } ],
1446                     "columns": [
1447                         {
1448                             "data": "biblio.title:biblio.subtitle:biblio.medium",
1449                             "title": _("Title"),
1450                             "searchable": true,
1451                             "orderable": true,
1452                             "render": function(data, type, row, meta) {
1453                                 return $biblio_to_html(row.biblio, { link: 1 });
1454                             }
1455                         },
1456                         {
1457                             "data": "biblio.author",
1458                             "title": _("Author"),
1459                             "searchable": true,
1460                             "orderable": true,
1461                         },
1462                         {
1463                             "data": "callnumber",
1464                             "title": _("Callnumber"),
1465                             "searchable": true,
1466                             "orderable": true,
1467                         },
1468                         {
1469                             "data": "external_id",
1470                             "title": _("Barcode"),
1471                             "searchable": true,
1472                             "orderable": true,
1473                         },
1474                         {
1475                             "data": "lost_status:last_seen_date:return_claim.patron",
1476                             "title": _("Status"),
1477                             "searchable": false,
1478                             "orderable": false,
1479                             "render": function(data, type, row, meta) {
1480                                 if ( row.lost_status == bundle_lost_value ) {
1481                                     let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>';
1482                                     if ( row.return_claim ) {
1483                                         out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1484                                     }
1485                                     return out;
1486                                 }
1487                                 else if ( row.lost_status !== 0 ) {
1488                                     return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1489                                 }
1490                                 return '<span class="available">' + _("Present") + '</span>';
1491                             }
1492                         },
1493                         {
1494                             "data": function( row, type, val, meta ) {
1495                                 var result;
1496                                 if (duedate) {
1497                                     result = '<button class="btn btn-default btn-xs remove disabled" role="button" data-itemnumber="'+row.item_id+'" title="%s"><i class="fa fa-minus" aria-hidden="true"></i> %s</button>\n'.format(_("This bundle is checked out, it cannot be modified"), _("Remove"));
1498                                 } else {
1499                                     result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n';
1500                                 }
1501                                 return result;
1502                             },
1503                             "title": _("Actions"),
1504                             "searchable": false,
1505                             "orderable": false,
1506                             "class": "noExport"
1507                         }
1508                     ]
1509                 }, bundle_settings, 1);
1510                 $(".tbundle").on("click", ".remove:not(.disabled)", function(){
1511                     var bundle_table = $(this).closest('table');
1512                     var host_itemnumber = bundle_table.data('itemnumber');
1513                     var component_itemnumber = $(this).data('itemnumber');
1514                     var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/" + component_itemnumber;
1515                     $.ajax({
1516                         type: "DELETE",
1517                         url: unlink_item_url,
1518                         success: function(){
1519                             bundle_table.DataTable({ 'retrieve': true }).draw(false);
1520                         }
1521                     });
1522                 });
1523
1524                 return;
1525             }
1526
1527             var bundle_changed;
1528             var bundle_form_active;
1529             $("#addToBundleModal").on("shown.bs.modal", function(e){
1530                 var button = $(e.relatedTarget);
1531                 var item_id = button.data('item');
1532                 $("#addResult").replaceWith('<div id="addResult"></div>');
1533                 $("#addToBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items');
1534                 $("#external_id").focus();
1535                 bundle_changed = 0;
1536                 bundle_form_active = item_id;
1537             });
1538
1539             function addToBundle (url, data) {
1540                   /* Send the data using post with external_id */
1541                   var posting = $.post({
1542                       url: url,
1543                       data: JSON.stringify(data),
1544                       contentType: "application/json; charset=utf-8",
1545                       dataType: "json"
1546                   });
1547
1548                   const barcode = data.external_id;
1549
1550                   /* Report the results */
1551                   posting.done(function(data) {
1552                       $('#addResult').replaceWith('<div id="addResult" class="alert alert-success">'+_("Success: Added '%s'").format(barcode)+'</div>');
1553                       $('#external_id').val('').focus();
1554                       bundle_changed = 1;
1555                   });
1556                   posting.fail(function(data) {
1557                       if ( data.status === 409 ) {
1558                           var response = data.responseJSON;
1559                           if ( response.error_code === 'already_bundled' ) {
1560                               $('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
1561                           } else if (response.error_code === 'bundle_checkout_out') {
1562                               $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
1563                           } else if (response.error_code === 'checked_out') {
1564                               const button = $('<button type="button">')
1565                                 .addClass('btn btn-xs')
1566                                 .text(_("Check in and add to bundle"))
1567                                 .on('click', function () {
1568                                     addToBundle(url, { external_id: barcode, force_checkin: true });
1569                                 });
1570                               $('#addResult')
1571                                 .empty()
1572                                 .attr('class', 'alert alert-warning')
1573                                 .append(__x('Warning: Item {barcode} is checked out', { barcode }))
1574                                 .append(' ', button);
1575                           } else if (response.error_code === 'failed_checkin') {
1576                               $('#addResult')
1577                                 .empty()
1578                                 .attr('class', 'alert alert-danger')
1579                                 .append(__x('Failure: Item {barcode} cannot be checked in', { barcode }))
1580                           } else if (response.error_code === 'reserved') {
1581                               const button = $('<button type="button">')
1582                                 .addClass('btn btn-xs')
1583                                 .text(_("Ignore holds and add to bundle"))
1584                                 .on('click', function () {
1585                                     addToBundle(url, { external_id: barcode, ignore_holds: true });
1586                                 });
1587                               $('#addResult')
1588                                 .empty()
1589                                 .attr('class', 'alert alert-warning')
1590                                 .append(__x('Warning: Item {barcode} is on hold', { barcode }))
1591                                 .append(' ', button);
1592                           } else {
1593                               $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
1594                           }
1595                       } else if ( data.status === 404 ) {
1596                           $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
1597                       } else if ( data.status === 400 ) {
1598                           var response = data.responseJSON;
1599                           if ( response.error_code === "failed_nesting" ) {
1600                               $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>');
1601                           } else {
1602                               $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
1603                           }
1604                       } else {
1605                           $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
1606                       }
1607                       $('#external_id').val('').focus();
1608                   });
1609             }
1610
1611             $("#addToBundleForm").submit(function(event) {
1612                   /* stop form from submitting normally */
1613                   event.preventDefault();
1614
1615                   const url = this.action;
1616                   const data = { external_id: this.elements.external_id.value };
1617
1618                   addToBundle(url, data);
1619             });
1620
1621             $("#addToBundleModal").on("hidden.bs.modal", function(e){
1622                 if ( bundle_changed ) {
1623                     $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
1624                 }
1625                 bundle_form_active = 0;
1626                 bundle_changed = 0;
1627             });
1628
1629             $("#removeFromBundleModal").on("shown.bs.modal", function(e){
1630                 var button = $(e.relatedTarget);
1631                 var item_id = button.data('item');
1632                 $("#removeResult").replaceWith('<div id="removeResult"></div>');
1633                 $("#removeFromBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items/');
1634                 $("#rm_external_id").focus();
1635                 bundle_changed = 0;
1636                 bundle_form_active = item_id;
1637             });
1638
1639             $("#removeFromBundleForm").submit(function(event) {
1640
1641                 /* stop form from submitting normally */
1642                 event.preventDefault();
1643
1644                 /* get the action attribute from the <form action=""> element */
1645                 var $form = $(this),
1646                 url = $form.attr('action');
1647
1648                 var barcode = $('#rm_external_id').val();
1649
1650                 /* Fetch itemnumber using rm_external_id */
1651                 var itemReq = $.get('/api/v1/items', { q: JSON.stringify({
1652                     external_id: barcode
1653                 }) }, null, "json");
1654
1655                 var itemnumber;
1656                 itemReq.done(function(data) {
1657                     if (data.length === 1) {
1658                         itemnumber = data[0].item_id;
1659
1660                         /* Remove link using fetch itemnumber */
1661                         var deleteReq = $.ajax( url + itemnumber, {
1662                             type : 'DELETE'
1663                         });
1664
1665                         /* Report the results */
1666                         deleteReq.done(function(data) {
1667                             var barcode = $('#rm_external_id').val();
1668                             $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed '%s'").format(barcode)+'</div>');
1669                             $('#rm_external_id').val('').focus();
1670                             bundle_changed = 1;
1671                         });
1672                         deleteReq.fail(function(data) {
1673                             var barcode = $('#rm_external_id').val();
1674                             if ( data.status === 409 ) {
1675                                 var response = data.responseJSON;
1676                                 if (response.error_code === 'bundle_checkout_out') {
1677                                     $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
1678                                 } else if ( response.key === "PRIMARY" ) {
1679                                     $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
1680                                 } else {
1681                                     $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
1682                                 }
1683                             } else if ( data.status === 404 ) {
1684                                 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
1685                             } else {
1686                                 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
1687                             }
1688                             $('#rm_external_id').val('').focus();
1689                         });
1690                     } else {
1691                         $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>');
1692                     }
1693                 });
1694                 itemReq.fail(function(data) {
1695                      $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found '%s'").format(barcode)+'</div>');
1696                     $('#rm_external_id').val('').focus();
1697
1698                 });
1699             });
1700
1701             $("#removeFromBundleModal").on("hidden.bs.modal", function(e){
1702                 if ( bundle_changed ) {
1703                     $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
1704                 }
1705                 bundle_form_active = 0;
1706                 bundle_changed = 0;
1707             });
1708             // End bundle handling
1709             [% END %]
1710
1711             let items_tab_ids = [ 'holdings', 'otherholdings' ];
1712             items_tab_ids.forEach( function( tab_id, index ) {
1713                 build_items_table(tab_id, false);
1714
1715                 [% IF bundlesEnabled %]
1716                 // Add event listener for opening and closing bundle details
1717                 $('#' + tab_id + '_table tbody').on('click', 'button.details-control', function () {
1718                     var button = $(this);
1719                     var tr = button.closest('tr');
1720                     var dTable = button.closest('table').DataTable({ 'retrieve': true });
1721
1722                     let row = dTable.row( tr );
1723                     let data = row.data();
1724                     let itemnumber = data.item_id;
1725                     let duedate = (data.checkout&&data.checkout.due_date) || null;
1726
1727                     if ( row.child.isShown() ) {
1728                         // This row is already open - close it
1729                         row.child.hide();
1730                         tr.removeClass('shown');
1731                         button.removeClass('active');
1732                     }
1733                     else {
1734                         // Open this row
1735                         createChild(row, itemnumber, duedate);
1736                         tr.addClass('shown');
1737                         button.addClass('active');
1738                     }
1739                 } );
1740                 [% END %]
1741             });
1742
1743             [% IF Koha.Preference('AcquisitionDetails') %]
1744                 var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') | $raw %];
1745                 var acquisitiondetails_table = KohaTable("orders", {
1746                     "dom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1747                     "paginate": false,
1748                     "autoWidth": false,
1749                     "order": [[ 4, "desc" ]],
1750                 }, table_settings);
1751             [% END %]
1752
1753             [% IF suggestions.count %]
1754                 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
1755                     "columnDefs": [
1756                         { "orderable": false, "searchable":  false, "targets": [ 'NoSort' ] },
1757                         { "type": "anti-the", "targets":  [ "anti-the" ] }
1758                     ],
1759                     "pagingType": "full"
1760                 }));
1761             [% END %]
1762
1763         });
1764
1765         [% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %]
1766             $(document).ready(function() {
1767                 var search_index = localStorage.getItem("cat_search_pulldown_selection");
1768                 var search_value = localStorage.getItem("searchbox_value");
1769                 if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)};
1770                 if ( search_value ){ $('#cat-search-block #search-form').val(search_value)};
1771             });
1772         [% END %]
1773
1774         [% IF Koha.Preference('EnableItemGroups') %]
1775             // Load item groups table
1776             var itemGroupsTable = $("#items-group-table").kohaTable({
1777                 autoWidth: false,
1778                 dom: '<"top pager"ilp>t<"bottom pager"ip>r',
1779                 columns: [
1780                     {
1781                         data: "display_order",
1782                         title: _("Display order"),
1783                         searchable: true,
1784                         orderable: true,
1785                     },
1786                     {
1787                         data: "description",
1788                         title: _("Description"),
1789                         searchable: true,
1790                         orderable: true,
1791                     },
1792                     {
1793                         data: function( oObj ) {
1794                             [% IF CAN_user_editcatalogue_manage_item_groups %]
1795                                 return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
1796                                     <i class="fa-solid fa-pencil" aria-hidden="true"></i> ${_("Edit")}
1797                                 </button>`
1798                                 + '&nbsp'
1799                                 + `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
1800                                     <i class='fa fa-trash-can'></i> ${('Delete')}
1801                                 </button>`;
1802                             [% ELSE %]
1803                                 return "";
1804                             [% END %]
1805                         },
1806                         searchable: false,
1807                         orderable: false,
1808                     },
1809                 ],
1810                 paginate: false,
1811                 ajax: { url: `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1` },
1812             });
1813
1814             // Create new item groups
1815             $('.item-group-create').on('click', function(){
1816                 $('#modal-item-group-create-form-description').val("");
1817                 $('#modal-item-group-create-submit').removeAttr('disabled');
1818                 $('#modal-item-group-create').modal('show');
1819             });
1820
1821             $("#modal-item-group-create-form").validate({
1822                 submitHandler: function(form) {
1823                     $.ajax({
1824                         url: `/api/v1/biblios/${biblionumber}/item_groups`,
1825                         headers: { "x-koha-embed": "items" },
1826                         success: function(item_groups){
1827                             $('#modal-item-group-create-submit').attr('disabled', 'disabled');
1828
1829                             var settings = {
1830                               "url": `/api/v1/biblios/${biblionumber}/item_groups`,
1831                               "method": "POST",
1832                               "headers": {
1833                                 "Content-Type": "application/json"
1834                               },
1835                               "data": JSON.stringify(
1836                                   {
1837                                       "description": $("#modal-item-group-create-form-description").val(),
1838                                       "display_order": $("#modal-item-group-create-form-display_order").val(),
1839                                   }
1840                               ),
1841                             };
1842
1843                             $.ajax(settings)
1844                             .done(function (response) {
1845                                 $('#item-group-add-form-select').append($('<option>', {
1846                                     value: response.item_group_id,
1847                                     text: response.description
1848                                 }));
1849
1850                                 $('#modal-item-group-create').modal('hide');
1851                                 if ( item_groups.length == 0 ) {
1852                                     // This bib has no previous item groups, reload the page
1853                                     window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
1854                                 } else {
1855                                     // Has other item groups, just reload the table
1856                                     itemGroupsTable.api().ajax.reload();
1857                                 }
1858                             })
1859                             .fail(function(err) {
1860                                 var message = err.responseJSON.error;
1861                                 alert(message);
1862                             });
1863                         }
1864                     });
1865                 }
1866             });
1867
1868             $('#modal-item-group-create').on('shown.bs.modal', function () {
1869                 $('#modal-item-group-create-form-description').focus();
1870             })
1871
1872             // Edit existing item groups
1873             $('body').on( 'click', '.item-group-edit', function(){
1874                 const item_group_id = $(this).data('item-group-id');
1875                 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
1876                 $.get( url, function( data ) {
1877                     $('#modal-item-group-edit-form-description').val( data.description );
1878                     $('#modal-item-group-edit-form-display_order').val( data.display_order );
1879                     $('#modal-item-group-edit-submit').data('item-group-id', item_group_id );
1880                     $('#modal-item-group-edit-submit').removeAttr('disabled');
1881                     $('#modal-item-group-edit').modal('show');
1882                 });
1883             });
1884
1885             $("#modal-item-group-edit-form").validate({
1886                 submitHandler: function(form) {
1887                     $('#modal-item-group-edit-submit').attr('disabled', 'disabled');
1888
1889                     const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id');
1890                     const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
1891
1892                     var settings = {
1893                       "url": url,
1894                       "method": "PUT",
1895                       "headers": {
1896                         "Content-Type": "application/json"
1897                       },
1898                       "data": JSON.stringify(
1899                           {
1900                               "description": $("#modal-item-group-edit-form-description").val(),
1901                               "display_order": $("#modal-item-group-edit-form-display_order").val(),
1902                           }
1903                       ),
1904                     };
1905
1906                     $.ajax(settings)
1907                     .done(function (response) {
1908                         $('#modal-item-group-edit').modal('hide');
1909                         itemGroupsTable.api().ajax.reload();
1910                     })
1911                     .fail(function(err) {
1912                         var message = err.responseJSON.error;
1913                         alert(message);
1914                     });
1915                 }
1916             });
1917
1918             $('#modal-item-group-edit').on('shown.bs.modal', function () {
1919                 $('#modal-item-group-edit-form-description').focus();
1920             })
1921
1922             // Delete existing item groups
1923             $('body').on( 'click', '.item-group-delete', function(){
1924                 const item_group_id = $(this).data('item-group-id');
1925                 $('#modal-item-group-delete-submit').data('item-group-id', item_group_id );
1926                 $('#modal-item-group-delete-submit').removeAttr('disabled');
1927                 $('#modal-item-group-delete').modal('show');
1928             });
1929             $("#modal-item-group-delete-submit").on('click', function(){
1930                 $('#modal-item-group-delete-submit').attr('disabled', 'disabled');
1931                 const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id');
1932
1933                 $.ajax({
1934                     url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
1935                     headers: { "x-koha-embed": "items" },
1936                     success: function(item_group_data){
1937                         $.ajax({
1938                           "url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
1939                           "method": "DELETE",
1940                         })
1941                         .done(function (response) {
1942                             $('#modal-item-group-delete').modal('hide');
1943                             $(`#item-group-add-form-select option[value='${item_group_id}']`).remove();
1944                             if ( item_group_data.items === null ) {
1945                                 // No items for this item group, we can just refresh the table
1946                                 itemGroupsTable.api().ajax.reload();
1947                             } else {
1948                                 // This item group had items attached to it, we need to reload the page
1949                                 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
1950                             }
1951                         })
1952                         .fail(function(err) {
1953                             var message = err.responseJSON.error;
1954                             alert(message);
1955                         });
1956                     }
1957                 });
1958             });
1959
1960             // Add item(s) to a item group
1961             $('.itemselection_action_item_group_set').on('click', function(){
1962                 $('#modal-item-group-set').modal('show');
1963             });
1964
1965             $("#modal-item-group-set-form").validate({
1966                 submitHandler: function(form) {
1967                     $('#modal-item-group-set-submit').attr('disabled', 'disabled');
1968
1969                     const item_group_id = $('#item-group-add-form-select').val();
1970
1971                     let itemnumbers = new Array();
1972                     $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
1973                         const itemnumber = $(this).val();
1974                         itemnumbers.push( itemnumber );
1975                     });
1976                     if (itemnumbers.length > 0) {
1977                         let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group';
1978                         url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1979                         url += '&biblionumber=[% biblionumber | uri %]';
1980                         url += `&item_group_id=${item_group_id}`;
1981
1982                         window.location.replace(url);
1983                     }
1984
1985                     $('#modal-item-group-set').modal('hide');
1986                 }
1987             });
1988
1989             // Remove item(s) from an item group
1990             $('.itemselection_action_item_group_unset').on('click', function(){
1991                 $('#modal-item-group-unset').modal('show');
1992             });
1993
1994             $("#modal-item-group-unset-submit").on('click', function(){
1995                 $('#modal-item-group-unset-submit').attr('disabled', 'disabled');
1996
1997                 let itemnumbers = new Array();
1998                 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
1999                     const itemnumber = $(this).val();
2000                     itemnumbers.push( itemnumber );
2001                 });
2002                 if (itemnumbers.length > 0) {
2003                     let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group';
2004                     url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2005                     url += '&biblionumber=[% biblionumber | uri %]';
2006
2007                     window.location.replace(url);
2008                 }
2009
2010                 $('#modal-item-group-unset').modal('hide');
2011
2012             });
2013         [% END %]
2014
2015     </script>
2016
2017     [%# The following PROCESS needs: %]
2018     [%# can_edit_items_from item_type_image_locations %]
2019     [% PROCESS build_items_table_js biblio => biblio %]
2020
2021     [% CoverImagePlugins | $raw %]
2022 [% END %]
2023 [% INCLUDE 'intranet-bottom.inc' %]