7 [% USE AuthorisedValues %]
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 %]
17 [% IF Koha.Preference('AmazonAssocTag') %]
18 [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
20 [% AmazonAssocTag = '' %]
23 [% SET plugins_intranet_catalog_biblio_tabs = KohaPlugins.get_plugins_intranet_catalog_biblio_tab({ biblio => biblio, biblio_id => biblionumber }) %]
25 [% SET footerjs = 1 %]
26 [% INCLUDE 'doc-head-open.inc' %]
27 <title>[% FILTER collapse %]
28 [% IF ( unknownbiblionumber ) %]
29 [% t("Unknown record") | html %]
31 [% title_in_title = INCLUDE 'biblio-title-head.inc' %]
32 [% tx("Details for {title}", { title = title_in_title }) | html %]
34 [% t("Catalog") | html %] ›
35 [% t("Koha") | html %]
37 [% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %]
38 [% INCLUDE 'doc-head-close.inc' %]
41 <body id="catalog_detail" class="catalog">
43 [% WRAPPER 'header.inc' %]
44 [% INCLUDE 'cat-search.inc' %]
47 [% WRAPPER 'sub-header.inc' %]
48 [% WRAPPER breadcrumbs %]
49 [% WRAPPER breadcrumb_item %]
50 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
53 [% IF ( unknownbiblionumber ) %]
54 [% WRAPPER breadcrumb_item bc_active= 1 %]
55 <span>Unknown record</span>
58 [% WRAPPER breadcrumb_item %]
59 [% INCLUDE 'biblio-title.inc' link = 1 %]
61 [% WRAPPER breadcrumb_item bc_active= 1 %]
65 [% END #/ WRAPPER breadcrumbs %]
66 [% END #/ WRAPPER sub-header.inc %]
68 <div class="main container-fluid">
70 <div class="col-sm-10 col-sm-push-2">
72 [% INCLUDE 'messages.inc' %]
75 [% IF ( unknownbiblionumber ) %]
76 <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
79 [% IntranetCoce = Koha.Preference('IntranetCoce') %]
80 [% CoceProviders = Koha.Preference('CoceProviders') %]
81 [% CoceHost = Koha.Preference('CoceHost') %]
82 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
84 [% INCLUDE 'cat-toolbar.inc' %]
86 <!-- COinS / OpenURL -->
87 <span class="Z3988" title="[% ocoins | html %]"></span>
90 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
91 <div id="catalogue_detail_biblio" class="col-xs-9">
93 <div id="catalogue_detail_biblio" class="col-xs-12">
95 [% IF decoding_error || analytics_error %]
96 <div class="page-section bg-danger">
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>
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>
110 <div class="page-section">
112 [% XSLTBloc | $raw %]
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&shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
118 [% IF ( loop.last ) %][% ELSE %]|[% 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>
128 [% TagLoo.term | html %]
130 <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% 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 %]&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>
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="" />
144 [% IF ( description ) %]
145 <span class="itypetext">[% description | html %]</span>
147 <span class="itypetext">[% itemtype | html %]</span>
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>
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>
163 <span>[% holdcount | html %]</span>
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 %]
177 [% FOREACH ill IN illrequests %]
178 <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
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>
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 %]
201 </div> [%# .page-section %]
203 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
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&imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image.imagenumber | uri %]" />
214 <div class="hint">Local cover image</div>
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"/>
225 <div class="hint">Image from Amazon.com</div>
229 [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
230 [% coce_id = normalized_ean || normalized_isbn %]
231 <div class="cover-image coce-coverimg">
233 <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
235 <span class="no-image">No cover image available</span>
237 <div class="hint">Image from Coce</div>
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&client=[% Koha.Preference('SyndeticsClientCode') | url %]&type=xw10&upc=[% normalized_upc | url %]&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&client=[% Koha.Preference('SyndeticsClientCode') | url %]&type=xw10&upc=[% normalized_upc | url %]&oclc=[% normalized_oclc | url %]" alt="" class="thumbnail" />
247 <div class="hint">Image from Syndetics</div>
250 <span class="no-image">No cover image available</span>
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 %]" />
261 <div class="hint">Custom cover image</div>
265 </div> <!-- /.cover-slider -->
266 </div> <!-- /.bookcoverimg.col-xs-3 -->
268 </div> <!-- /.col-xs-* -->
269 [% END # /IF ( AmazonCoverImages, etc ) %]
272 <div id="bibliodetails" class="toptabs">
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>
280 <li role="presentation">
281 <a href="#otherholdings" aria-controls="otherholdings" role="tab" data-toggle="tab">Other holdings ([% other_holdings_count || 0 | html %])</a>
284 <li role="presentation">
285 <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% items_to_display_count || 0 | html %])</a>
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>
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>
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>
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>
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>
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>
324 <table class="items-group-table" id="items-group-table">
327 <th>Display order</th>
329 <th class="NoSort"> </th>
337 <div role="tabpanel" class="tab-pane" id="holdings">
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>
346 [% SET hidden_count = all_items_count - items_to_display_count %]
347 [% IF all_items_count %]
348 [% PROCESS items_table tab="holdings" %]
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 %]&showallitems=1">Show all items ([% hidden_count | html %] hidden)</a>
355 [% IF ( ALTERNATEHOLDINGS ) %]
356 [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
357 <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
360 <div id="noitems">No physical items for this record</div>
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>
372 [% IF Koha.Preference('SeparateHoldings') %]
373 <div role="tabpanel" class="tab-pane" id="otherholdings">
374 [% PROCESS items_table tab="otherholdings" %]
378 [% IF ( MARCNOTES ) %]
380 <div role="tabpanel" class="tab-pane" id="description">
381 <div class="content_set">
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>
388 [% MARCNOTE.marcnote | html | html_line_break %]
397 [% IF ComponentParts && ComponentParts.size %]
398 <div role="tabpanel" class="tab-pane" id="components">
399 <div class="content_set">
401 [% FOR PART IN ComponentParts %]
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>
412 </div> <!-- /.content_set -->
413 </div> <!-- /#components -->
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>
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>
437 <th>Date arrived</th>
438 <th>Date published</th>
439 <th>Date published (text)</th>
443 [% FOREACH latestserial IN subscription.latestserials %]
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>
450 [% INCLUDE 'serial-status.inc' serial = latestserial %]
452 <td>[% latestserial.notes | html %]</td>
457 [% IF ( CAN_user_serials ) %]
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>
467 [% IF Koha.Preference('AcquisitionDetails') %]
468 <div role="tabpanel" class="tab-pane" id="acq_details">
469 [% IF orders.count %]
475 <th>Basket group</th>
477 <th>Order number</th>
478 <th>Creation date</th>
479 <th>Receive date</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>
489 [% FOR order IN orders %]
490 [% SET basket = order.basket %]
491 [% SET vendor = basket.bookseller %]
494 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
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>
503 <div>[% order.invoice.invoicenumber | html %]</div>
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>
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>
517 [% basket_group.name | html %] ([% basket_group.id | html %])
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>
524 [% basket.basketname | html %] ([% basket.basketno | html %])
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>
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>
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>
542 [% IF order.subscriptionid %]
543 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
547 [% IF order.subscriptionid %]
548 [% order.subscription.callnumber | html %]
556 <span class="noorder">There is no order for this bibliographic record.</span>
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 %]
566 <table id="suggestions" class="sorted">
569 <th class="NoSort"> </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>
580 [% FOREACH suggestion IN suggestions %]
582 <td>[% suggestion.suggestionid | html %]</td>
584 <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&op=show" title="suggestion" >
585 [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
587 [% IF ( suggestion.copyrightdate ) %]© [% 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 %]
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 %]
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 %]
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 %]
604 [% Branches.GetName( suggestion.branchcode ) | html %]
607 [% suggestion.fund.budget_name | html %]
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>
620 [% IF suggestion.reason %]
621 <br />([% suggestion.reason | html %])
631 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
632 <div role="tabpanel" class="tab-pane" id="editions"><h4>Editions</h4>
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 %] ©[% 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 %]
640 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
641 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
645 </table></div>[% END %]
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>
655 <table id="table_concerns" width="100%">
661 <th data-class-name="actions noExport">Actions</th>
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 %]
675 <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
676 <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image.imagenumber | uri %]">
677 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image.imagenumber | uri %]" />
679 [% IF CAN_user_tools_upload_local_cover_images %]
680 <a href="#" class="remove"><i class="fa fa-trash-can"></i> Delete image</a>
686 [% ELSE # - No image passed JavaScript takes care %]
687 <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
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 %]&filetype=image"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
696 [% IF ( HTML5MediaEnabled ) %]
697 <div role="tabpanel" class="tab-pane" id="html5media">
698 [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
700 [% IF HTML5MediaSet.is_youtube %]
701 <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
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 %]>
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>
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 %]
726 </div><!-- /tab-content -->
727 </div><!-- /bibliodetails -->
729 <div id="export" style="margin-top: 1em;">
730 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
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>
742 <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
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>
755 <div class="modal-body">
756 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
758 <div class="modal-footer">
759 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
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>
772 <div class="modal-body">
773 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
775 <div class="modal-footer">
776 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
783 </div> <!-- /.col-sm-10.col-sm-push-2 -->
785 <div class="col-sm-2 col-sm-pull-10">
787 [% INCLUDE 'biblio-view-menu.inc' %]
789 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
790 </div> <!-- /.row -->
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>
801 <form method="get" id="modal-item-group-create-form" class="validated">
802 <div class="modal-body">
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>
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>
814 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
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>
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>
834 <form method="get" id="modal-item-group-edit-form" class="validated">
835 <div class="modal-body">
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>
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>
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>
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>
865 <div class="modal-body">
866 Are you sure you want to delete this item group?
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>
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>
883 <form method="get" id="modal-item-group-set-form" class="validated">
884 <div class="modal-body">
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>
893 <span class="required">Required</span>
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>
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>
913 <div class="modal-body">
914 Are you sure you want to remove these item(s) from their item group(s)?
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>
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>
933 <div class="modal-body">
934 <div id="addResult"></div>
935 <fieldset class="rows">
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>
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>
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>
962 <div class="modal-body">
963 <div id="removeResult"></div>
964 <fieldset class="rows">
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>
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>
984 [% IF ( Koha.Preference('CatalogConcerns') ) %]
985 [% INCLUDE 'modals/add_catalog_concern.inc' %]
988 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
989 [% INCLUDE 'modals/display_ticket.inc' %]
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') ) %]
1003 /* Set a variable needed by add_catalog_concern.js */
1004 var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1006 [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1008 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1010 $(document).ready(function() {
1011 var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %];
1013 var filtered = false;
1014 let additional_filters = {
1015 resolved_date: function(){
1017 return { "=": null };
1022 biblio_id: [% biblionumber | uri %]
1025 var tickets_url = '/api/v1/tickets';
1026 var tickets = $("#table_concerns").kohaTable({
1035 'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
1038 "render": function (data, type, row, meta) {
1039 if ( type == 'display' ) {
1040 if ( data != null ) {
1041 return data.escapeHtml();
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,
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>';
1072 result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>';
1079 "data": "resolved_date",
1080 "render": function(data, type, row, meta) {
1082 if (row.resolved_date) {
1083 result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, {
1084 display_cardnumber: false,
1087 result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
1089 result += _("Open");
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>';
1102 "searchable": false,
1106 }, table_settings, 0, additional_filters);
1108 $('#hideResolved').on("click", function() {
1110 tickets.DataTable().draw();
1113 $('#showAll').on("click", function() {
1115 tickets.DataTable().draw();
1119 [% Asset.js("js/modals/display_ticket.js") | $raw %]
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 ){
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 ){
1141 // Check if Amazon image is present
1142 if ( div.attr("id") == "amazon-bookcoverimg" ) {
1145 if ((w == 1) || (h == 1)) {
1146 // Amazon returned single-pixel placeholder
1147 // Remove the container
1150 lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
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
1158 lightbox_descriptions.push( _("Custom cover image") );
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')));
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");
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')));
1178 lightbox_descriptions.push(_("Cover image source unknown"));
1183 // Lightbox for cover images
1184 Chocolat(this.querySelectorAll('.cover-image a'), {
1185 description: function(){
1186 return lightbox_descriptions[this.settings.currentImageIndex];
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>");
1201 // Set the first navigation link as active
1202 $(covernav).addClass("nav-active");
1204 $(covernav).html("<i class=\"fa fa-circle\"></i>");
1205 $(coverSlide).append( covernav );
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();
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"});
1221 $("#editions img").each(function(i){
1222 if ( this.src.indexOf('amazon.com') >= 0 ) {
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';
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(
1242 if ( success.deleted == 1 ) {
1245 thumbnail.html( copy );
1246 alert(_("An error occurred on deleting this image"));
1248 if ( $('ul.thumbnails > li').length == 0 ) {
1249 showNoImageMessage();
1253 thumbnail.html( copy );
1254 alert(_("An error occurred on deleting this image"));
1255 console.warn("Something wrong happened: %s".format(error));
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 + "&filetype=image'><i class='fa fa-upload' aria-hidden='true'></i> ","</a>");
1265 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1267 $('#images').html(no_images_msg);
1271 $(document).ready(function() {
1272 // Pick details tab to display by default
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");
1279 $(".nav-tabs a[href='#holdings']").tab("show");
1282 $(".nav-tabs a[href='#holdings']").tab("show");
1284 $('#search-form').focus();
1285 $('.thumbnails > li > .remove').click(function() {
1286 var result = confirm(_("Are you sure you want to delete this cover image?"));
1288 if ( result == true ) {
1289 var imagenumber = $(this).parent().attr('id').split('-')[1];
1290 removeLocalImage(imagenumber);
1295 [% IF ( IntranetCoce && CoceProviders ) %]
1296 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1299 $("body").on("click",".previewMARC", function(e){
1301 var page = $(this).attr("href");
1302 $("#marcPreview .modal-body").load(page + " table");
1303 $('#marcPreview').modal({show:true});
1307 [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
1308 $("body").on("click",".previewElastic", function(e){
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>");
1316 $('#elasticPreview').modal({show:true});
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 %]',
1326 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1327 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1329 if ( d.length > 0 ){ //If no content
1330 $(".NovelistSelect").show();
1334 $(".print-label").on("click", function(e){
1336 link = $(this).attr("href");
1337 openWindow(link,"Print spine label",400,400);
1339 $(".cover-slider").on("click",".cover-nav", function(e){
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();
1352 [% IF ( IntranetCoce && CoceProviders ) %]
1353 let counter_wait = 0;
1354 function wait_for_images(cb){
1360 loaded = KOHA.coce.done;
1363 if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1364 window.setTimeout(function(){wait_for_images(cb);}, 100);
1366 if (counter_wait >= 50 ) {
1367 console.log("Could not retrieve the images")
1373 $(window).load(function() {
1374 wait_for_images(verify_cover_images);
1377 $(window).load(function() {
1378 verify_cover_images();
1382 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1383 <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
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 %]
1396 browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1399 [% IF bundlesEnabled %]
1400 var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1401 var bundle_lost_value = [% Koha.Preference('BundleLostValue') | html %];
1404 $(document).ready(function() {
1406 [% IF bundlesEnabled %] // Bundle handling
1407 function createChild ( row, itemnumber, duedate ) {
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>');
1414 // Disable management if there's a duedate
1416 bundle_toolbar.children('.btn').addClass("disabled");
1417 bundle_toolbar.attr("title", _("This bundle is checked out, it cannot be modified"));
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%"/>');
1423 // Display it the child row
1424 row.child( bundle_toolbar.add(bundles_table), 'bundle' ).show();
1426 // Initialise as a DataTable
1427 var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?";
1428 var bundle_table = bundles_table.kohaTable({
1430 "url": bundle_table_url
1434 "return_claim.patron"
1436 "order": [[ 1, "asc" ]],
1438 "targets": [0,1,2,3],
1439 "render": function (data, type, row, meta) {
1440 if ( data && type == 'display' ) {
1441 return data.escapeHtml();
1448 "data": "biblio.title:biblio.subtitle:biblio.medium",
1449 "title": _("Title"),
1452 "render": function(data, type, row, meta) {
1453 return $biblio_to_html(row.biblio, { link: 1 });
1457 "data": "biblio.author",
1458 "title": _("Author"),
1463 "data": "callnumber",
1464 "title": _("Callnumber"),
1469 "data": "external_id",
1470 "title": _("Barcode"),
1475 "data": "lost_status:last_seen_date:return_claim.patron",
1476 "title": _("Status"),
1477 "searchable": 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>';
1487 else if ( row.lost_status !== 0 ) {
1488 return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1490 return '<span class="available">' + _("Present") + '</span>';
1494 "data": function( row, type, val, meta ) {
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"));
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';
1503 "title": _("Actions"),
1504 "searchable": false,
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;
1517 url: unlink_item_url,
1518 success: function(){
1519 bundle_table.DataTable({ 'retrieve': true }).draw(false);
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();
1536 bundle_form_active = item_id;
1539 function addToBundle (url, data) {
1540 /* Send the data using post with external_id */
1541 var posting = $.post({
1543 data: JSON.stringify(data),
1544 contentType: "application/json; charset=utf-8",
1548 const barcode = data.external_id;
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();
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 });
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') {
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 });
1589 .attr('class', 'alert alert-warning')
1590 .append(__x('Warning: Item {barcode} is on hold', { barcode }))
1591 .append(' ', button);
1593 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
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>');
1602 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
1605 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
1607 $('#external_id').val('').focus();
1611 $("#addToBundleForm").submit(function(event) {
1612 /* stop form from submitting normally */
1613 event.preventDefault();
1615 const url = this.action;
1616 const data = { external_id: this.elements.external_id.value };
1618 addToBundle(url, data);
1621 $("#addToBundleModal").on("hidden.bs.modal", function(e){
1622 if ( bundle_changed ) {
1623 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
1625 bundle_form_active = 0;
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();
1636 bundle_form_active = item_id;
1639 $("#removeFromBundleForm").submit(function(event) {
1641 /* stop form from submitting normally */
1642 event.preventDefault();
1644 /* get the action attribute from the <form action=""> element */
1645 var $form = $(this),
1646 url = $form.attr('action');
1648 var barcode = $('#rm_external_id').val();
1650 /* Fetch itemnumber using rm_external_id */
1651 var itemReq = $.get('/api/v1/items', { q: JSON.stringify({
1652 external_id: barcode
1653 }) }, null, "json");
1656 itemReq.done(function(data) {
1657 if (data.length === 1) {
1658 itemnumber = data[0].item_id;
1660 /* Remove link using fetch itemnumber */
1661 var deleteReq = $.ajax( url + itemnumber, {
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();
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>');
1681 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
1683 } else if ( data.status === 404 ) {
1684 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
1686 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
1688 $('#rm_external_id').val('').focus();
1691 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>');
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();
1701 $("#removeFromBundleModal").on("hidden.bs.modal", function(e){
1702 if ( bundle_changed ) {
1703 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
1705 bundle_form_active = 0;
1708 // End bundle handling
1711 let items_tab_ids = [ 'holdings', 'otherholdings' ];
1712 items_tab_ids.forEach( function( tab_id, index ) {
1713 build_items_table(tab_id, false);
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 });
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;
1727 if ( row.child.isShown() ) {
1728 // This row is already open - close it
1730 tr.removeClass('shown');
1731 button.removeClass('active');
1735 createChild(row, itemnumber, duedate);
1736 tr.addClass('shown');
1737 button.addClass('active');
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>',
1749 "order": [[ 4, "desc" ]],
1753 [% IF suggestions.count %]
1754 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
1756 { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] },
1757 { "type": "anti-the", "targets": [ "anti-the" ] }
1759 "pagingType": "full"
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)};
1774 [% IF Koha.Preference('EnableItemGroups') %]
1775 // Load item groups table
1776 var itemGroupsTable = $("#items-group-table").kohaTable({
1778 dom: '<"top pager"ilp>t<"bottom pager"ip>r',
1781 data: "display_order",
1782 title: _("Display order"),
1787 data: "description",
1788 title: _("Description"),
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")}
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')}
1811 ajax: { url: `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1` },
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');
1821 $("#modal-item-group-create-form").validate({
1822 submitHandler: function(form) {
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');
1830 "url": `/api/v1/biblios/${biblionumber}/item_groups`,
1833 "Content-Type": "application/json"
1835 "data": JSON.stringify(
1837 "description": $("#modal-item-group-create-form-description").val(),
1838 "display_order": $("#modal-item-group-create-form-display_order").val(),
1844 .done(function (response) {
1845 $('#item-group-add-form-select').append($('<option>', {
1846 value: response.item_group_id,
1847 text: response.description
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}`);
1855 // Has other item groups, just reload the table
1856 itemGroupsTable.api().ajax.reload();
1859 .fail(function(err) {
1860 var message = err.responseJSON.error;
1868 $('#modal-item-group-create').on('shown.bs.modal', function () {
1869 $('#modal-item-group-create-form-description').focus();
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');
1885 $("#modal-item-group-edit-form").validate({
1886 submitHandler: function(form) {
1887 $('#modal-item-group-edit-submit').attr('disabled', 'disabled');
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}`;
1896 "Content-Type": "application/json"
1898 "data": JSON.stringify(
1900 "description": $("#modal-item-group-edit-form-description").val(),
1901 "display_order": $("#modal-item-group-edit-form-display_order").val(),
1907 .done(function (response) {
1908 $('#modal-item-group-edit').modal('hide');
1909 itemGroupsTable.api().ajax.reload();
1911 .fail(function(err) {
1912 var message = err.responseJSON.error;
1918 $('#modal-item-group-edit').on('shown.bs.modal', function () {
1919 $('#modal-item-group-edit-form-description').focus();
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');
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');
1934 url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
1935 headers: { "x-koha-embed": "items" },
1936 success: function(item_group_data){
1938 "url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
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();
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}`);
1952 .fail(function(err) {
1953 var message = err.responseJSON.error;
1960 // Add item(s) to a item group
1961 $('.itemselection_action_item_group_set').on('click', function(){
1962 $('#modal-item-group-set').modal('show');
1965 $("#modal-item-group-set-form").validate({
1966 submitHandler: function(form) {
1967 $('#modal-item-group-set-submit').attr('disabled', 'disabled');
1969 const item_group_id = $('#item-group-add-form-select').val();
1971 let itemnumbers = new Array();
1972 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
1973 const itemnumber = $(this).val();
1974 itemnumbers.push( itemnumber );
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}`;
1982 window.location.replace(url);
1985 $('#modal-item-group-set').modal('hide');
1989 // Remove item(s) from an item group
1990 $('.itemselection_action_item_group_unset').on('click', function(){
1991 $('#modal-item-group-unset').modal('show');
1994 $("#modal-item-group-unset-submit").on('click', function(){
1995 $('#modal-item-group-unset-submit').attr('disabled', 'disabled');
1997 let itemnumbers = new Array();
1998 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
1999 const itemnumber = $(this).val();
2000 itemnumbers.push( itemnumber );
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 %]';
2007 window.location.replace(url);
2010 $('#modal-item-group-unset').modal('hide');
2017 [%# The following PROCESS needs: %]
2018 [%# can_edit_items_from item_type_image_locations %]
2019 [% PROCESS build_items_table_js biblio => biblio %]
2021 [% CoverImagePlugins | $raw %]
2023 [% INCLUDE 'intranet-bottom.inc' %]