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 [% SET record_source = biblio.metadata.record_source %]
157 [% IF ( record_source ) %]
158 <span id="catalogue_detail_record_source" class="results_summary">
159 <span class="label">Record source:</span>
160 [% IF record_source.can_be_edited %]
161 [% record_source.name | html %]
163 [% record_source.name | html %] <i class="fa fa-lock"></i>
168 [% IF ( holdcount ) %]
169 <span class="results_summary">
170 <span class="label">Holds:</span>
171 <span class="number_box">
172 [% IF CAN_user_reserveforothers_place_holds %]
173 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
175 <span>[% holdcount | html %]</span>
181 [% IF illrequests.count %]
182 <span class="results_summary">
183 <span class="label">ILL requests:</span>
184 [% IF CAN_user_ill %]
185 [% FOREACH ill IN illrequests %]
186 <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 %]
189 [% FOREACH ill IN illrequests %]
190 <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
196 [% IF ( article_requests_count = biblio.article_requests.filter_by_current.count ) %]
197 <span class="results_summary">
198 <span class="label">Article requests:</span>
199 <span class="number_box">
200 <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
205 [% IF course_reserves %]
206 <span class="results_summary"><span class="label">Courses that have reserved this title: </span>
207 [% FOREACH c IN course_reserves %]
208 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% c.course_id | uri %]">[% c.course.course_name | html %]</a>
209 [% IF ( loop.last ) %][% ELSE %]|[% END %]
213 </div> [%# .page-section %]
215 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
217 <div class="col-xs-3 bookcoverimg">
218 <div id="biblio-cover-slider" class="cover-slider" data-isbn="[% normalized_isbn | html %]">
219 [% IF ( LocalCoverImages ) %]
220 [% IF localimages.count %]
221 [% FOREACH image IN localimages %]
222 <div class="cover-image local-coverimg">
223 <a href="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
224 <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 %]" />
226 <div class="hint">Local cover image</div>
232 [% IF ( AmazonCoverImages && normalized_isbn) %]
233 <div class="cover-image" id="amazon-bookcoverimg">
234 <a href="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.LZZZZZZZ.jpg" title="Amazon cover image">
235 <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"/>
237 <div class="hint">Image from Amazon.com</div>
241 [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
242 [% coce_id = normalized_ean || normalized_isbn %]
243 <div class="cover-image coce-coverimg">
245 <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
247 <span class="no-image">No cover image available</span>
249 <div class="hint">Image from Coce</div>
253 [% IF ( SyndeticsCovers ) %]
254 [% IF ( content_identifier_exists ) %]
255 <div class="cover-image" id="syndetics-bookcoverimg">
256 <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">
257 <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" />
259 <div class="hint">Image from Syndetics</div>
262 <span class="no-image">No cover image available</span>
266 [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
267 [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
268 [% IF custom_cover_image_url %]
269 <div class="cover-image" id="custom-coverimg">
270 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" title="Custom cover image">
271 <img id="custom-img" alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
273 <div class="hint">Custom cover image</div>
277 </div> <!-- /.cover-slider -->
278 </div> <!-- /.bookcoverimg.col-xs-3 -->
280 </div> <!-- /.col-xs-* -->
281 [% END # /IF ( AmazonCoverImages, etc ) %]
284 <div id="bibliodetails" class="toptabs">
286 <ul class="nav nav-tabs" role="tablist">
287 [% IF Koha.Preference('SeparateHoldings') %]
288 [% IF items_to_display_count - ( other_holdings_count || 0 ) %]
289 <li role="presentation">
290 [%# FIXME We could build the numbers from DataTable's info %]
291 <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>
294 [% IF other_holdings_count %]
295 <li role="presentation">
296 <a href="#otherholdings" aria-controls="otherholdings" role="tab" data-toggle="tab">Other holdings ([% other_holdings_count || 0 | html %])</a>
300 <li role="presentation">
301 <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% items_to_display_count || 0 | html %])</a>
304 [% IF Koha.Preference('EnableItemGroups') %]
305 <li role="presentation">
306 <a href="#item_groups" aria-controls="item_groups" role="tab" data-toggle="tab">Item groups</a>
309 [% 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 %]
310 [% 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 %]
311 [% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions" aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %]
312 [% 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 %]
313 [% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details" aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %]
314 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions" aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %]
315 [% 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 %]
316 [% IF ( LocalCoverImages ) %]
317 <li role="presentation">
318 <a href="#images" aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a>
321 [% IF HTML5MediaEnabled && HTML5MediaSets.size %]
322 <li id="media_tab" role="presentation"><a href="#html5media" aria-controls="html5media" role="tab" data-toggle="tab">Play media</a></li>
324 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
325 <li class="NovelistSelect" style="display:none;" role="presentation"><a href="#NovelistSelect" aria-controls="NovelistSelect" role="tab" data-toggle="tab">NoveList Select</a></li>
327 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
328 <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>
332 <div class="tab-content">
333 [% IF Koha.Preference('EnableItemGroups') %]
334 <div role="tabpanel" class="tab-pane" id="item_groups">
335 [% IF CAN_user_editcatalogue_manage_item_groups %]
336 <div class="item_groups_table_table_controls">
337 <a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a>
340 <table class="items-group-table" id="items-group-table">
343 <th>Display order</th>
345 <th class="NoSort"> </th>
353 <div role="tabpanel" class="tab-pane" id="holdings">
355 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
356 <span class="results_summary NovelistSelect" style="display:none;">
357 <span class="label">Novelist Select: </span>
358 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
362 [% SET hidden_count = all_items_count - items_to_display_count %]
363 [% IF all_items_count %]
364 [% PROCESS items_table tab="holdings" %]
366 [% IF hidden_count %]
367 [%# FIXME We could deal with that in JS and prevent a full refresh %]
368 <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&showallitems=1">Show all items ([% hidden_count | html %] hidden)</a>
371 [% IF ( ALTERNATEHOLDINGS ) %]
372 [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
373 <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
376 <div id="noitems">No physical items for this record</div>
380 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
381 <span class="results_summary NovelistSelect" style="display:none;">
382 <span class="label">Novelist Select: </span>
383 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
388 [% IF Koha.Preference('SeparateHoldings') %]
389 <div role="tabpanel" class="tab-pane" id="otherholdings">
390 [% PROCESS items_table tab="otherholdings" %]
394 [% IF ( MARCNOTES ) %]
396 <div role="tabpanel" class="tab-pane" id="description">
397 <div class="content_set">
399 [% FOREACH MARCNOTE IN MARCNOTES %]
400 <p class="marcnote marcnote-[% MARCNOTE.tag | html %]" id="marcnote-[% MARCNOTE.tag | html %]-[% loop.count | html %]">
401 [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
402 <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
404 [% MARCNOTE.marcnote | html | html_line_break %]
413 [% IF ComponentParts && ComponentParts.size %]
414 <div role="tabpanel" class="tab-pane" id="components">
415 <div class="content_set">
417 [% FOR PART IN ComponentParts %]
425 [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%]
426 <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>
428 </div> <!-- /.content_set -->
429 </div> <!-- /#components -->
433 [% IF ( subscriptionsnumber ) %]
434 <div role="tabpanel" class="tab-pane" id="subscriptions">
435 <div id="catalogue_detail_subscriptions">
436 <h2>This is a serial subscription</h2>
437 <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p>
438 [% FOREACH subscription IN subscriptions %]
439 [% IF subscription.branchcode %]
440 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
442 [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
443 [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
444 [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
445 [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
446 [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
447 [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
448 [% IF ( subscription.latestserials ) %]
449 <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
453 <th>Date arrived</th>
454 <th>Date published</th>
455 <th>Date published (text)</th>
459 [% FOREACH latestserial IN subscription.latestserials %]
461 <td>[% latestserial.serialseq | html %]</td>
462 <td data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td>
463 <td data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td>
464 <td>[% latestserial.publisheddatetext | html %]</td>
466 [% INCLUDE 'serial-status.inc' serial = latestserial %]
468 <td>[% latestserial.notes | html %]</td>
473 [% IF ( CAN_user_serials ) %]
475 <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>
483 [% IF Koha.Preference('AcquisitionDetails') %]
484 <div role="tabpanel" class="tab-pane" id="acq_details">
485 [% IF orders.count %]
491 <th>Basket group</th>
493 <th>Order number</th>
494 <th>Creation date</th>
495 <th>Receive date</th>
498 <th title="Estimated cost tax incl. while pending, actual cost tax incl. once received">Price</th>
499 <th>Internal note</th>
500 <th>Subscription</th>
501 <th>Subscription call number</th>
505 [% FOR order IN orders %]
506 [% SET basket = order.basket %]
507 [% SET vendor = basket.bookseller %]
510 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
513 [% IF order.invoiceid %]
514 [% IF CAN_user_acquisition %]
515 <div><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
516 title="Invoice detail page">
517 [% order.invoice.invoicenumber | html %]</a></div>
519 <div>[% order.invoice.invoicenumber | html %]</div>
522 [% IF ( Koha.Preference('EDIFACT') && CAN_user_acquisition_edi_manage && order.invoice.message_id ) %]
523 <div><a href="/cgi-bin/koha/acqui/edimsg.pl?id=[% order.invoice.message_id | uri %]" title="EDI INVOICE message">EDI message</a></div>
528 [% IF basket.basketgroupid %]
529 [% SET basket_group = basket.basket_group %]
530 [% IF CAN_user_acquisition_group_manage %]
531 <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>
533 [% basket_group.name | html %] ([% basket_group.id | html %])
537 <td>[% IF CAN_user_acquisition_order_manage %]
538 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
540 [% basket.basketname | html %] ([% basket.basketno | html %])
542 <td>[% order.ordernumber | html %]</td>
543 <td data-order="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</td>
544 <td data-order="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</td>
546 [% SWITCH order.orderstatus %]
547 [% CASE 'new' %]<span>New</span>
548 [% CASE 'ordered' %]<span>Ordered</span>
549 [% CASE 'partial' %]<span>Partial</span>
550 [% CASE 'complete' %]<span>Complete</span>
551 [% CASE 'cancelled' %]<span>Cancelled</span>
554 <td>[% order.quantity | html %]</td>
555 <td>[% IF ( order.orderstatus == "complete" ) %][% order.unitprice_tax_included | $Price %][% ELSE %][% order.ecost_tax_included | $Price %][% END %]
556 <td>[% order.order_internalnote | html %]</td>
558 [% IF order.subscriptionid %]
559 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
563 [% IF order.subscriptionid %]
564 [% order.subscription.callnumber | html %]
572 <span class="noorder">There is no order for this bibliographic record.</span>
577 [% IF suggestions.count %]
578 <div role="tabpanel" class="tab-pane" id="suggestion_details">
579 [% IF nb_archived_suggestions > 0 %]
580 <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw %]
582 <table id="suggestions" class="sorted">
585 <th class="NoSort"> </th>
586 <th class="anti-the">Suggestion</th>
587 <th>Suggested by - on</th>
588 <th>Managed by - on</th>
589 <th>Last modification by - on</th>
596 [% FOREACH suggestion IN suggestions %]
598 <td>[% suggestion.suggestionid | html %]</td>
600 <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&op=show" title="suggestion" >
601 [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
603 [% IF ( suggestion.copyrightdate ) %]© [% suggestion.copyrightdate | html %] [% END %]
604 [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
605 [% 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 %]
608 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
609 [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
612 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
613 [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
616 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
617 [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
620 [% Branches.GetName( suggestion.branchcode ) | html %]
623 [% suggestion.fund.budget_name | html %]
626 [% IF suggestion.STATUS == 'ASKED' %]<span>Pending</span>
627 [% ELSIF suggestion.STATUS == 'ACCEPTED' %]<span>Accepted</span>
628 [% ELSIF suggestion.STATUS == 'ORDERED' %]<span>Ordered</span>
629 [% ELSIF suggestion.STATUS == 'REJECTED' %]<span>Rejected</span>
630 [% ELSIF suggestion.STATUS == 'CHECKED' %]<span>Checked</span>
631 [% ELSIF suggestion.STATUS == 'AVAILABLE' %]<span>Available</span>
632 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
633 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
634 [% ELSE %]<span>Status unknown</span>
636 [% IF suggestion.reason %]
637 <br />([% suggestion.reason | html %])
647 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
648 <div role="tabpanel" class="tab-pane" id="editions"><h4>Editions</h4>
650 [% 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 %]
651 [% 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 %]
652 <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 %]
653 [% IF ( XISBN.publishercode ) %]
654 [% 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 %]
656 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
657 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
661 </table></div>[% END %]
664 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
665 <div role="tabpanel" class="tab-pane" id="concerns">
666 <fieldset class="action" style="cursor:pointer;">
667 <a id="hideResolved"><i class="fa fa-minus-square"></i> Hide resolved</a>
668 | <a id="showAll"><i class="fa fa-bars"></i> Show all</a>
671 <table id="table_concerns" width="100%">
678 <th data-class-name="actions noExport">Actions</th>
685 [% IF ( LocalCoverImages ) %]
686 <div role="tabpanel" class="tab-pane" id="images">
687 [% IF localimages.count %]
688 <p>Click on an image to view it in the image viewer</p>
689 <ul class="thumbnails">
690 [% FOREACH image IN localimages %]
692 <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
693 <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image.imagenumber | uri %]">
694 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image.imagenumber | uri %]" />
696 [% IF CAN_user_tools_upload_local_cover_images %]
697 <a href="#" class="remove"><i class="fa fa-trash-can"></i> Delete image</a>
703 [% ELSE # - No image passed JavaScript takes care %]
704 <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
706 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
707 <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>
713 [% IF ( HTML5MediaEnabled ) %]
714 <div role="tabpanel" class="tab-pane" id="html5media">
715 [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
717 [% IF HTML5MediaSet.is_youtube %]
718 <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
720 <[% HTML5MediaParent | html %] controls preload=none>
721 <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
722 [[% HTML5MediaParent | html %] tag not supported by your browser.]
723 </[% HTML5MediaParent | html %]>
731 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
732 <div role="tabpanel" class="tab-pane" id="NovelistSelect" class="novelistSelect">
733 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
737 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
738 <div role="tabpanel" class="tab-pane" id="[% plugins_intranet_catalog_biblio_tab.id | html %]">
739 [% plugins_intranet_catalog_biblio_tab.content | $raw %]
743 </div><!-- /tab-content -->
744 </div><!-- /bibliodetails -->
746 <div id="export" style="margin-top: 1em;">
747 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
749 <th>Save record</th> </tr>
750 <tr><td> Select download format: <select name="format">
751 <option value="mods">MODS (XML)</option>
752 <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
753 <option value="marcxml">MARCXML</option>
754 <option value="marc8">MARC (non-Unicode/MARC-8)</option>
755 <option value="utf8">MARC (Unicode/UTF-8)</option> </select>
756 <input type="submit" name="save" class="btn btn-primary" value="Download record" /></td>
759 <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
765 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" 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="marcPreviewLabel">MARC preview</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>
782 <div id="elasticPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="elasticPreviewLabel" aria-hidden="true">
783 <div class="modal-dialog modal-lg">
784 <div class="modal-content">
785 <div class="modal-header">
786 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
787 <h3 id="elasticPreviewLabel">Elasticsearch record</h3>
789 <div class="modal-body">
790 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
792 <div class="modal-footer">
793 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
800 </div> <!-- /.col-sm-10.col-sm-push-2 -->
802 <div class="col-sm-2 col-sm-pull-10">
804 [% INCLUDE 'biblio-view-menu.inc' %]
806 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
807 </div> <!-- /.row -->
811 <div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label">
812 <div class="modal-dialog">
813 <div class="modal-content">
814 <div class="modal-header">
815 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
816 <h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3>
818 <form method="get" id="modal-item-group-create-form" class="validated">
819 <div class="modal-body">
822 <label for="item_group_description" class="required">Name: </label>
823 <input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" />
824 <span class="required">Required</span>
827 <label for="item_group_display_order" class="required">Display order: </label>
828 <input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" />
829 <span class="required">Required</span>
831 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
835 <div class="modal-footer">
836 <button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button>
837 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
844 <div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label">
845 <div class="modal-dialog">
846 <div class="modal-content">
847 <div class="modal-header">
848 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
849 <h3 id="modal-item-group-edit-label"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit item group</h3>
851 <form method="get" id="modal-item-group-edit-form" class="validated">
852 <div class="modal-body">
855 <label for="item_group_description" class="required">Name: </label>
856 <input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" />
857 <span class="required">Required</span>
860 <label for="item_group_display_order" class="required">Sort order: </label>
861 <input name="display_order" id="modal-item-group-edit-form-display_order" size="5" />
862 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
866 <div class="modal-footer">
867 <button id="modal-item-group-edit-submit" class="btn btn-default"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Submit</button>
868 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
875 <div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label">
876 <div class="modal-dialog">
877 <div class="modal-content">
878 <div class="modal-header">
879 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
880 <h3 id="modal-item-group-delete-label"><i class='fa fa-trash-can'></i> Delete item group</h3>
882 <div class="modal-body">
883 Are you sure you want to delete this item group?
885 <div class="modal-footer">
886 <button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash-can'></i> Delete</button>
887 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
893 <div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label">
894 <div class="modal-dialog">
895 <div class="modal-content">
896 <div class="modal-header">
897 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
898 <h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3>
900 <form method="get" id="modal-item-group-set-form" class="validated">
901 <div class="modal-body">
904 <label for="item_group" class="required">Item group: </label>
905 <select name="item_group" id="item-group-add-form-select">
906 [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %]
907 <option value="[% ig.id | html %]">[% ig.description | html %]</option>
910 <span class="required">Required</span>
914 <div class="modal-footer">
915 <button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button>
916 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
923 <div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label">
924 <div class="modal-dialog">
925 <div class="modal-content">
926 <div class="modal-header">
927 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
928 <h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3>
930 <div class="modal-body">
931 Are you sure you want to remove these item(s) from their item group(s)?
933 <div class="modal-footer">
934 <button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button>
935 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
941 [% IF bundlesEnabled %]
942 <div class="modal" id="addToBundleModal" tabindex="-1" role="dialog" aria-labelledby="addToBundleLabel">
943 <form method="get" id="addToBundleForm" action="">
944 <div class="modal-dialog" role="document">
945 <div class="modal-content">
946 <div class="modal-header">
947 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
948 <h3 id="addToBundleLabel">Add to bundle</h3>
950 <div class="modal-body">
951 <div id="addResult"></div>
952 <fieldset class="rows">
955 <label class="required" for="external_id">Item barcode: </label>
956 <input type="text" id="external_id" name="external_id" required="required">
957 <span class="required">Required</span>
962 <div class="modal-footer">
963 <button type="submit" class="btn btn-default">Submit</button>
964 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
971 <div class="modal" id="removeFromBundleModal" tabindex="-1" role="dialog" aria-labelledby="removeFromBundleLabel">
972 <form method="get" id="removeFromBundleForm" action="">
973 <div class="modal-dialog" role="document">
974 <div class="modal-content">
975 <div class="modal-header">
976 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
977 <h3 id="removeFromBundleLabel">Remove from bundle</h3>
979 <div class="modal-body">
980 <div id="removeResult"></div>
981 <fieldset class="rows">
984 <label class="required" for="external_id">Item barcode: </label>
985 <input type="text" id="rm_external_id" name="external_id" required="required">
986 <span class="required">Required</span>
991 <div class="modal-footer">
992 <button type="submit" class="btn btn-default">Submit</button>
993 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1001 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1002 [% INCLUDE 'modals/add_catalog_concern.inc' %]
1005 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1006 [% INCLUDE 'modals/display_ticket.inc' %]
1009 [% MACRO jsinclude BLOCK %]
1010 [% INCLUDE 'catalog-strings.inc' %]
1011 [% INCLUDE 'calendar.inc' %]
1012 [% INCLUDE 'select2.inc' %]
1013 [% INCLUDE 'js-date-format.inc' %]
1014 [% Asset.js("js/catalog.js") | $raw %]
1015 [% Asset.js("js/recalls.js") | $raw %]
1016 [% Asset.js("js/coce.js") | $raw %]
1017 [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1018 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1020 /* Set a variable needed by add_catalog_concern.js */
1021 var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1023 [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1025 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1027 $(document).ready(function() {
1028 var table_settings = [% TablesSettings.GetTableSettings( 'catalogue', 'concerns', 'table_concerns', 'json' ) | $raw %];
1030 var filtered = false;
1031 let additional_filters = {
1032 resolved_date: function(){
1034 return { "=": null };
1040 biblio_id: [% biblionumber | uri %]
1043 var tickets_url = '/api/v1/tickets';
1044 var tickets = $("#table_concerns").kohaTable({
1056 'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
1058 "targets": [0,1,2,3],
1059 "render": function (data, type, row, meta) {
1060 if ( type == 'display' ) {
1061 if ( data != null ) {
1062 return data.escapeHtml();
1073 "data": "reported_date:reporter.firstname",
1074 "render": function(data, type, row, meta) {
1075 let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>';
1076 reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, {
1077 display_cardnumber: false,
1086 "data": "title:body",
1087 "render": function(data, type, row, meta) {
1088 let resolved = ( row.resolved_date ) ? true : false;
1089 let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '">' + row.title + '</a>';
1090 if (row.updates_count) {
1091 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>';
1093 result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>';
1100 "data": "biblio.title",
1101 "render": function(data, type, row, meta) {
1102 return $biblio_to_html(row.biblio, {
1110 "data": "assignee.firstname:assignee.surname:resolver.firstname:resolver.surname:resolved_date:status",
1111 "render": function(data, type, row, meta) {
1113 if (row.resolved_date) {
1114 result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, {
1115 display_cardnumber: false,
1119 result += ' ' + _("as") + ' ';
1120 result += row._strings.status ? escape_str(row._strings.status.str) : "";
1122 result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
1125 result += row._strings.status ? escape_str(row._strings.status.str) : "";
1127 result += _("Open");
1130 result += '<span class="clearfix">' + _("Assigned to: ") + $patron_to_html(row.assignee, {
1131 display_cardnumber: false,
1142 "data": function(row, type, val, meta) {
1143 let resolved = ( row.resolved_date ) ? true : false;
1144 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 + '" data-assignee="'+$patron_to_html(row.assignee, { display_cardnumber: false, url: false })+'"><i class="fa-solid fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
1147 "searchable": false,
1151 }, table_settings, 0, additional_filters);
1153 $('#hideResolved').on("click", function() {
1155 tickets.DataTable().draw();
1158 $('#showAll').on("click", function() {
1160 tickets.DataTable().draw();
1164 [% Asset.js("js/modals/display_ticket.js") | $raw %]
1167 var interface = "[% interface | html %]";
1168 var theme = "[% theme | html %]";
1169 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1170 function verify_cover_images(container) {
1171 // Loop over each container in the template which contains covers
1172 let cover_sliders = container ? container.find('.cover-slider') : $(".cover-slider");
1173 cover_sliders.each(function(){
1174 var lightbox_descriptions = [];
1175 var first_shown = 0;
1176 $(this).find(".cover-image").each( function( index ){
1178 // Find the image in the container
1179 var img = div.find("img")[0];
1180 if( $(img).length > 0 ){
1181 var description = "";
1182 // All slides start hidden. If this is the first one, show it.
1183 if( first_shown == 0 ){
1187 // Check if Amazon image is present
1188 if ( div.attr("id") == "amazon-bookcoverimg" ) {
1191 if ((w == 1) || (h == 1)) {
1192 // Amazon returned single-pixel placeholder
1193 // Remove the container
1196 lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1198 } else if( div.attr("id") == "custom-coverimg" ){
1199 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1200 // No image was loaded via the CustomCoverImages system preference
1201 // Remove the container
1204 lightbox_descriptions.push( _("Custom cover image") );
1206 } else if ( div.attr("id") == "syndetics-bookcoverimg" ){
1207 lightbox_descriptions.push(_("Syndetics cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1209 else if( div.hasClass("coce-coverimg" ) ){
1210 // Identify which service's image is being loaded by Coce
1211 var coce_description;
1212 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1213 coce_description = _("Coce image from Amazon.com");
1214 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1215 coce_description = _("Coce image from Google Books");
1216 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1217 coce_description = _("Coce image from Open Library");
1219 div.find(".hint").html(coce_description);
1220 lightbox_descriptions.push(coce_description);
1221 } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1222 lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1224 lightbox_descriptions.push(_("Cover image source unknown"));
1229 // Lightbox for cover images
1230 Chocolat(this.querySelectorAll('.cover-image a'), {
1231 description: function(){
1232 return lightbox_descriptions[this.settings.currentImageIndex];
1238 cover_sliders.each(function(){
1239 var coverSlide = this;
1240 var coverImages = $(this).find(".cover-image");
1241 if( coverImages.length > 1 ){
1242 coverImages.each(function( index ){
1243 // If more that one image is present, add a navigation link
1244 // for activating the slide
1245 var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1247 // Set the first navigation link as active
1248 $(covernav).addClass("nav-active");
1250 $(covernav).html("<i class=\"fa fa-circle\"></i>");
1251 $(coverSlide).append( covernav );
1255 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
1256 && $(coverSlide).find(".cover-image:visible").length < 1 ){
1257 $(coverSlide).remove();
1259 $(coverSlide).addClass("cover-slides");
1260 var img = $(coverSlide).find(".cover-image:visible").find("img")[0];
1261 if( $(img).length > 0 && img.complete && img.naturalHeight > 0 ){
1262 $(".cover-slides").css({"background-image":"none"});
1267 $("#editions img").each(function(i){
1268 if ( this.src.indexOf('amazon.com') >= 0 ) {
1271 if ((w == 1) || (h == 1)) {
1272 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1273 } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1274 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1280 let build_items_table_drawncallback = function (table) {
1281 let tab_id = table.parents('.tab-pane').attr('id');
1282 verify_cover_images($("#" + tab_id + '_table'));
1285 function removeLocalImage(imagenumber) {
1286 var thumbnail = $("#imagenumber-" + imagenumber );
1287 var copy = thumbnail.html();
1288 thumbnail.find("img").css("opacity", ".2");
1289 thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1290 const client = APIClient.cover_image;
1291 client.cover_images.delete(imagenumber).then(
1293 if ( success.deleted == 1 ) {
1296 thumbnail.html( copy );
1297 alert(_("An error occurred on deleting this image"));
1299 if ( $('ul.thumbnails > li').length == 0 ) {
1300 showNoImageMessage();
1304 thumbnail.html( copy );
1305 alert(_("An error occurred on deleting this image"));
1306 console.warn("Something wrong happened: %s".format(error));
1311 function showNoImageMessage() {
1312 var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1313 no_images_msg = '<p>' + no_images_msg + '</p>';
1314 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1315 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>");
1316 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1318 $('#images').html(no_images_msg);
1322 $(document).ready(function() {
1323 // Pick details tab to display by default
1325 [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %]
1326 $(".nav-tabs a[href='#html5media']").tab("show");
1327 [% ELSIF ComponentParts && ComponentParts.size %]
1328 $(".nav-tabs a[href='#components']").tab("show");
1330 $(".nav-tabs a[href='#holdings']").tab("show");
1333 [% IF items_to_display_count - ( other_holdings_count || 0 ) %]
1334 $(".nav-tabs a[href='#holdings']").tab("show");
1336 $(".nav-tabs a[href='#otherholdings']").tab("show");
1339 $('#search-form').focus();
1340 $('.thumbnails > li > .remove').click(function() {
1341 var result = confirm(_("Are you sure you want to delete this cover image?"));
1343 if ( result == true ) {
1344 var imagenumber = $(this).parent().attr('id').split('-')[1];
1345 removeLocalImage(imagenumber);
1350 [% IF ( IntranetCoce && CoceProviders ) %]
1351 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1354 $("body").on("click",".previewMARC", function(e){
1356 var page = $(this).attr("href");
1357 $("#marcPreview .modal-body").load(page + " table");
1358 $('#marcPreview').modal({show:true});
1362 [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
1363 $("body").on("click",".previewElastic", function(e){
1365 var pageElastic = $(this).attr("href");
1366 $("#elasticPreview .modal-body").load(pageElastic, function( response, status, xhr ) {
1367 if( status == 'error' ){
1368 $("#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>");
1371 $('#elasticPreview').modal({show:true});
1375 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1376 novSelect.loadContentForQuery({
1377 ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1378 ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1381 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1382 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1384 if ( d.length > 0 ){ //If no content
1385 $(".NovelistSelect").show();
1389 $(".cover-slider").on("click",".cover-nav", function(e){
1391 var cover_slider = $(this).parent();
1392 // Adding click handler for cover image navigation links
1393 var num = $(this).data("num");
1394 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1395 $(this).addClass("nav-active");
1396 $(cover_slider).find(".cover-image").hide();
1397 $(cover_slider).find(".cover-image").eq( num ).show();
1402 [% IF ( IntranetCoce && CoceProviders ) %]
1403 let counter_wait = 0;
1404 function wait_for_images(cb){
1410 loaded = KOHA.coce.done;
1413 if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1414 window.setTimeout(function(){wait_for_images(cb);}, 100);
1416 if (counter_wait >= 50 ) {
1417 console.log("Could not retrieve the images")
1423 $(window).load(function() {
1424 wait_for_images(verify_cover_images);
1427 $(window).load(function() {
1428 verify_cover_images();
1432 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1433 <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1435 [% INCLUDE 'datatables.inc' %]
1436 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1437 [% INCLUDE 'columns_settings.inc' %]
1438 [% INCLUDE 'js-date-format.inc' %]
1439 [% INCLUDE 'js-patron-format.inc' %]
1440 [% INCLUDE 'js-biblio-format.inc' %]
1441 [% Asset.js("js/browser.js") | $raw %]
1442 [% Asset.js("js/table_filters.js") | $raw %]
1443 [% Asset.js("js/modals/place_booking.js") | $raw %]
1446 browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1449 [% IF bundlesEnabled %]
1450 var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1451 var bundle_lost_value = [% Koha.Preference('BundleLostValue') | html %];
1454 $(document).ready(function() {
1456 [% IF bundlesEnabled %] // Bundle handling
1457 function createChild ( row, itemnumber, duedate ) {
1460 var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>');
1461 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>');
1462 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>');
1464 // Disable management if there's a duedate
1466 bundle_toolbar.children('.btn').addClass("disabled");
1467 bundle_toolbar.attr("title", _("This bundle is checked out, it cannot be modified"));
1470 // This is the table we'll convert into a DataTable
1471 var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>');
1473 // Display it the child row
1474 row.child( bundle_toolbar.add(bundles_table), 'bundle' ).show();
1476 // Initialise as a DataTable
1477 var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?";
1478 var bundle_table = bundles_table.kohaTable({
1480 "url": bundle_table_url
1484 "return_claim.patron"
1486 "order": [[ 1, "asc" ]],
1488 "targets": [0,1,2,3],
1489 "render": function (data, type, row, meta) {
1490 if ( data && type == 'display' ) {
1491 return data.escapeHtml();
1498 "data": "biblio.title:biblio.subtitle:biblio.medium",
1499 "title": _("Title"),
1502 "render": function(data, type, row, meta) {
1503 return $biblio_to_html(row.biblio, { link: 1 });
1507 "data": "biblio.author",
1508 "title": _("Author"),
1513 "data": "callnumber",
1514 "title": _("Callnumber"),
1519 "data": "external_id",
1520 "title": _("Barcode"),
1525 "data": "lost_status:last_seen_date:return_claim.patron",
1526 "title": _("Status"),
1527 "searchable": false,
1529 "render": function(data, type, row, meta) {
1530 if ( row.lost_status == bundle_lost_value ) {
1531 let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>';
1532 if ( row.return_claim ) {
1533 out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1537 else if ( row.lost_status !== 0 ) {
1538 return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1540 return '<span class="available">' + _("Present") + '</span>';
1544 "data": function( row, type, val, meta ) {
1547 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"));
1549 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';
1553 "title": _("Actions"),
1554 "searchable": false,
1559 }, bundle_settings, 1);
1560 $(".tbundle").on("click", ".remove:not(.disabled)", function(){
1561 var bundle_table = $(this).closest('table');
1562 var host_itemnumber = bundle_table.data('itemnumber');
1563 var component_itemnumber = $(this).data('itemnumber');
1564 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/" + component_itemnumber;
1567 url: unlink_item_url,
1568 success: function(){
1569 bundle_table.DataTable({ 'retrieve': true }).draw(false);
1578 var bundle_form_active;
1579 $("#addToBundleModal").on("shown.bs.modal", function(e){
1580 var button = $(e.relatedTarget);
1581 var item_id = button.data('item');
1582 $("#addResult").replaceWith('<div id="addResult"></div>');
1583 $("#addToBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items');
1584 $("#external_id").focus();
1586 bundle_form_active = item_id;
1589 function addToBundle (url, data) {
1590 /* Send the data using post with external_id */
1591 var posting = $.post({
1593 data: JSON.stringify(data),
1594 contentType: "application/json; charset=utf-8",
1598 const barcode = data.external_id;
1600 /* Report the results */
1601 posting.done(function(data) {
1602 $('#addResult').replaceWith('<div id="addResult" class="alert alert-success">'+_("Success: Added '%s'").format(barcode)+'</div>');
1603 $('#external_id').val('').focus();
1606 posting.fail(function(data) {
1607 if ( data.status === 409 ) {
1608 var response = data.responseJSON;
1609 if ( response.error_code === 'already_bundled' ) {
1610 $('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
1611 } else if (response.error_code === 'bundle_checkout_out') {
1612 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
1613 } else if (response.error_code === 'checked_out') {
1614 const button = $('<button type="button">')
1615 .addClass('btn btn-xs')
1616 .text(_("Check in and add to bundle"))
1617 .on('click', function () {
1618 addToBundle(url, { external_id: barcode, force_checkin: true });
1622 .attr('class', 'alert alert-warning')
1623 .append(__x('Warning: Item {barcode} is checked out', { barcode }))
1624 .append(' ', button);
1625 } else if (response.error_code === 'failed_checkin') {
1628 .attr('class', 'alert alert-danger')
1629 .append(__x('Failure: Item {barcode} cannot be checked in', { barcode }))
1630 } else if (response.error_code === 'reserved') {
1631 const button = $('<button type="button">')
1632 .addClass('btn btn-xs')
1633 .text(_("Ignore holds and add to bundle"))
1634 .on('click', function () {
1635 addToBundle(url, { external_id: barcode, ignore_holds: true });
1639 .attr('class', 'alert alert-warning')
1640 .append(__x('Warning: Item {barcode} is on hold', { barcode }))
1641 .append(' ', button);
1643 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
1645 } else if ( data.status === 404 ) {
1646 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
1647 } else if ( data.status === 400 ) {
1648 var response = data.responseJSON;
1649 if ( response.error_code === "failed_nesting" ) {
1650 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>');
1652 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
1655 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
1657 $('#external_id').val('').focus();
1661 $("#addToBundleForm").submit(function(event) {
1662 /* stop form from submitting normally */
1663 event.preventDefault();
1665 const url = this.action;
1666 const data = { external_id: this.elements.external_id.value };
1668 addToBundle(url, data);
1671 $("#addToBundleModal").on("hidden.bs.modal", function(e){
1672 if ( bundle_changed ) {
1673 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
1675 bundle_form_active = 0;
1679 $("#removeFromBundleModal").on("shown.bs.modal", function(e){
1680 var button = $(e.relatedTarget);
1681 var item_id = button.data('item');
1682 $("#removeResult").replaceWith('<div id="removeResult"></div>');
1683 $("#removeFromBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items/');
1684 $("#rm_external_id").focus();
1686 bundle_form_active = item_id;
1689 $("#removeFromBundleForm").submit(function(event) {
1691 /* stop form from submitting normally */
1692 event.preventDefault();
1694 /* get the action attribute from the <form action=""> element */
1695 var $form = $(this),
1696 url = $form.attr('action');
1698 var barcode = $('#rm_external_id').val();
1700 /* Fetch itemnumber using rm_external_id */
1701 var itemReq = $.get('/api/v1/items', { q: JSON.stringify({
1702 external_id: barcode
1703 }) }, null, "json");
1706 itemReq.done(function(data) {
1707 if (data.length === 1) {
1708 itemnumber = data[0].item_id;
1710 /* Remove link using fetch itemnumber */
1711 var deleteReq = $.ajax( url + itemnumber, {
1715 /* Report the results */
1716 deleteReq.done(function(data) {
1717 var barcode = $('#rm_external_id').val();
1718 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed '%s'").format(barcode)+'</div>');
1719 $('#rm_external_id').val('').focus();
1722 deleteReq.fail(function(data) {
1723 var barcode = $('#rm_external_id').val();
1724 if ( data.status === 409 ) {
1725 var response = data.responseJSON;
1726 if (response.error_code === 'bundle_checkout_out') {
1727 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
1728 } else if ( response.key === "PRIMARY" ) {
1729 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
1731 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
1733 } else if ( data.status === 404 ) {
1734 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
1736 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
1738 $('#rm_external_id').val('').focus();
1741 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>');
1744 itemReq.fail(function(data) {
1745 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found '%s'").format(barcode)+'</div>');
1746 $('#rm_external_id').val('').focus();
1751 $("#removeFromBundleModal").on("hidden.bs.modal", function(e){
1752 if ( bundle_changed ) {
1753 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
1755 bundle_form_active = 0;
1758 // End bundle handling
1761 let items_tab_ids = [ 'holdings', 'otherholdings' ];
1762 items_tab_ids.forEach( function( tab_id, index ) {
1763 build_items_table(tab_id, false, {}, build_items_table_drawncallback);
1765 [% IF bundlesEnabled %]
1766 // Add event listener for opening and closing bundle details
1767 $('#' + tab_id + '_table tbody').on('click', 'button.details-control', function () {
1768 var button = $(this);
1769 var tr = button.closest('tr');
1770 var dTable = button.closest('table').DataTable({ 'retrieve': true });
1772 let row = dTable.row( tr );
1773 let data = row.data();
1774 let itemnumber = data.item_id;
1775 let duedate = (data.checkout&&data.checkout.due_date) || null;
1777 if ( row.child.isShown() ) {
1778 // This row is already open - close it
1780 tr.removeClass('shown');
1781 button.removeClass('active');
1785 createChild(row, itemnumber, duedate);
1786 tr.addClass('shown');
1787 button.addClass('active');
1793 [% IF Koha.Preference('AcquisitionDetails') %]
1794 var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') | $raw %];
1795 var acquisitiondetails_table = KohaTable("orders", {
1796 "dom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
1799 "order": [[ 4, "desc" ]],
1803 [% IF suggestions.count %]
1804 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
1806 { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] },
1807 { "type": "anti-the", "targets": [ "anti-the" ] }
1809 "pagingType": "full"
1815 [% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %]
1816 $(document).ready(function() {
1817 var search_index = localStorage.getItem("cat_search_pulldown_selection");
1818 var search_value = localStorage.getItem("searchbox_value");
1819 if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)};
1820 if ( search_value ){ $('#cat-search-block #search-form').val(search_value)};
1824 [% IF Koha.Preference('EnableItemGroups') %]
1825 // Load item groups table
1826 var itemGroupsTable = $("#items-group-table").kohaTable({
1828 dom: '<"top pager"ilp>t<"bottom pager"ip>r',
1831 data: "display_order",
1832 title: _("Display order"),
1837 data: "description",
1838 title: _("Description"),
1843 data: function( oObj ) {
1844 [% IF CAN_user_editcatalogue_manage_item_groups %]
1845 return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
1846 <i class="fa-solid fa-pencil" aria-hidden="true"></i> ${_("Edit")}
1849 + `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
1850 <i class='fa fa-trash-can'></i> ${('Delete')}
1861 ajax: { url: `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1` },
1864 // Create new item groups
1865 $('.item-group-create').on('click', function(){
1866 $('#modal-item-group-create-form-description').val("");
1867 $('#modal-item-group-create-submit').removeAttr('disabled');
1868 $('#modal-item-group-create').modal('show');
1871 $("#modal-item-group-create-form").validate({
1872 submitHandler: function(form) {
1874 url: `/api/v1/biblios/${biblionumber}/item_groups`,
1875 headers: { "x-koha-embed": "items" },
1876 success: function(item_groups){
1877 $('#modal-item-group-create-submit').attr('disabled', 'disabled');
1880 "url": `/api/v1/biblios/${biblionumber}/item_groups`,
1883 "Content-Type": "application/json"
1885 "data": JSON.stringify(
1887 "description": $("#modal-item-group-create-form-description").val(),
1888 "display_order": $("#modal-item-group-create-form-display_order").val(),
1894 .done(function (response) {
1895 $('#item-group-add-form-select').append($('<option>', {
1896 value: response.item_group_id,
1897 text: response.description
1900 $('#modal-item-group-create').modal('hide');
1901 if ( item_groups.length == 0 ) {
1902 // This bib has no previous item groups, reload the page
1903 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
1905 // Has other item groups, just reload the table
1906 itemGroupsTable.api().ajax.reload();
1909 .fail(function(err) {
1910 var message = err.responseJSON.error;
1918 $('#modal-item-group-create').on('shown.bs.modal', function () {
1919 $('#modal-item-group-create-form-description').focus();
1922 // Edit existing item groups
1923 $('body').on( 'click', '.item-group-edit', function(){
1924 const item_group_id = $(this).data('item-group-id');
1925 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
1926 $.get( url, function( data ) {
1927 $('#modal-item-group-edit-form-description').val( data.description );
1928 $('#modal-item-group-edit-form-display_order').val( data.display_order );
1929 $('#modal-item-group-edit-submit').data('item-group-id', item_group_id );
1930 $('#modal-item-group-edit-submit').removeAttr('disabled');
1931 $('#modal-item-group-edit').modal('show');
1935 $("#modal-item-group-edit-form").validate({
1936 submitHandler: function(form) {
1937 $('#modal-item-group-edit-submit').attr('disabled', 'disabled');
1939 const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id');
1940 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
1946 "Content-Type": "application/json"
1948 "data": JSON.stringify(
1950 "description": $("#modal-item-group-edit-form-description").val(),
1951 "display_order": $("#modal-item-group-edit-form-display_order").val(),
1957 .done(function (response) {
1958 $('#modal-item-group-edit').modal('hide');
1959 itemGroupsTable.api().ajax.reload();
1961 .fail(function(err) {
1962 var message = err.responseJSON.error;
1968 $('#modal-item-group-edit').on('shown.bs.modal', function () {
1969 $('#modal-item-group-edit-form-description').focus();
1972 // Delete existing item groups
1973 $('body').on( 'click', '.item-group-delete', function(){
1974 const item_group_id = $(this).data('item-group-id');
1975 $('#modal-item-group-delete-submit').data('item-group-id', item_group_id );
1976 $('#modal-item-group-delete-submit').removeAttr('disabled');
1977 $('#modal-item-group-delete').modal('show');
1979 $("#modal-item-group-delete-submit").on('click', function(){
1980 $('#modal-item-group-delete-submit').attr('disabled', 'disabled');
1981 const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id');
1984 url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
1985 headers: { "x-koha-embed": "items" },
1986 success: function(item_group_data){
1988 "url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
1991 .done(function (response) {
1992 $('#modal-item-group-delete').modal('hide');
1993 $(`#item-group-add-form-select option[value='${item_group_id}']`).remove();
1994 if ( item_group_data.items === null ) {
1995 // No items for this item group, we can just refresh the table
1996 itemGroupsTable.api().ajax.reload();
1998 // This item group had items attached to it, we need to reload the page
1999 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
2002 .fail(function(err) {
2003 var message = err.responseJSON.error;
2010 // Add item(s) to a item group
2011 $('.itemselection_action_item_group_set').on('click', function(){
2012 $('#modal-item-group-set').modal('show');
2015 $("#modal-item-group-set-form").validate({
2016 submitHandler: function(form) {
2017 $('#modal-item-group-set-submit').attr('disabled', 'disabled');
2019 const item_group_id = $('#item-group-add-form-select').val();
2021 let itemnumbers = new Array();
2022 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
2023 const itemnumber = $(this).val();
2024 itemnumbers.push( itemnumber );
2026 if (itemnumbers.length > 0) {
2027 let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group';
2028 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2029 url += '&biblionumber=[% biblionumber | uri %]';
2030 url += `&item_group_id=${item_group_id}`;
2032 window.location.replace(url);
2035 $('#modal-item-group-set').modal('hide');
2039 // Remove item(s) from an item group
2040 $('.itemselection_action_item_group_unset').on('click', function(){
2041 $('#modal-item-group-unset').modal('show');
2044 $("#modal-item-group-unset-submit").on('click', function(){
2045 $('#modal-item-group-unset-submit').attr('disabled', 'disabled');
2047 let itemnumbers = new Array();
2048 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
2049 const itemnumber = $(this).val();
2050 itemnumbers.push( itemnumber );
2052 if (itemnumbers.length > 0) {
2053 let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group';
2054 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2055 url += '&biblionumber=[% biblionumber | uri %]';
2057 window.location.replace(url);
2060 $('#modal-item-group-unset').modal('hide');
2067 [%# The following PROCESS needs: %]
2068 [%# can_edit_items_from item_type_image_locations %]
2069 [% PROCESS build_items_table_js biblio => biblio %]
2071 [% CoverImagePlugins | $raw %]
2073 [% INCLUDE 'intranet-bottom.inc' %]