6 [% USE AuthorisedValues %]
11 [% USE TablesSettings %]
12 [% PROCESS 'i18n.inc' %]
13 [% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %]
15 [% IF Koha.Preference('AmazonAssocTag') %]
16 [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
18 [% AmazonAssocTag = '' %]
21 [% ShowCourseReserves = 0 | html %]
22 [% IF UseCourseReserves %]
23 [% FOREACH item IN itemloop %]
24 [% IF item.course_reserves %]
25 [% FOREACH r IN item.course_reserves %]
26 [% IF r.course.enabled == 'yes' %]
27 [% ShowCourseReserves = 1 | html %]
34 [% SET plugins_intranet_catalog_biblio_tabs = KohaPlugins.get_plugins_intranet_catalog_biblio_tab({ biblio => biblio, biblio_id => biblionumber }) %]
36 [% SET footerjs = 1 %]
37 [% INCLUDE 'doc-head-open.inc' %]
38 <title>[% FILTER collapse %]
39 [% IF ( unknownbiblionumber ) %]
40 [% t("Unknown record") | html %]
42 [% title_in_title = INCLUDE 'biblio-title-head.inc' %]
43 [% tx("Details for {title}", { title = title_in_title }) | html %]
45 [% t("Catalog") | html %] ›
46 [% t("Koha") | html %]
48 [% INCLUDE 'doc-head-close.inc' %]
49 [% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %]
52 <body id="catalog_detail" class="catalog">
54 [% WRAPPER 'header.inc' %]
55 [% INCLUDE 'cat-search.inc' %]
58 [% WRAPPER 'sub-header.inc' %]
59 [% WRAPPER breadcrumbs %]
60 [% WRAPPER breadcrumb_item %]
61 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
64 [% IF ( unknownbiblionumber ) %]
65 [% WRAPPER breadcrumb_item bc_active= 1 %]
66 <span>Unknown record</span>
69 [% WRAPPER breadcrumb_item %]
70 [% INCLUDE 'biblio-title.inc' link = 1 %]
72 [% WRAPPER breadcrumb_item bc_active= 1 %]
76 [% END #/ WRAPPER breadcrumbs %]
77 [% END #/ WRAPPER sub-header.inc %]
79 <div class="main container-fluid">
81 <div class="col-sm-10 col-sm-push-2">
83 [% INCLUDE 'messages.inc' %]
86 [% IF ( unknownbiblionumber ) %]
87 <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
90 [% IntranetCoce = Koha.Preference('IntranetCoce') %]
91 [% CoceProviders = Koha.Preference('CoceProviders') %]
92 [% CoceHost = Koha.Preference('CoceHost') %]
93 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
95 [% INCLUDE 'cat-toolbar.inc' %]
97 <!-- COinS / OpenURL -->
98 <span class="Z3988" title="[% ocoins | html %]"></span>
101 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
102 <div id="catalogue_detail_biblio" class="col-xs-9">
104 <div id="catalogue_detail_biblio" class="col-xs-12">
106 [% IF decoding_error || analytics_error %]
107 <div class="page-section bg-danger">
108 <h1>Errors found</h1>
109 [% IF decoding_error %]
110 <h2>Encoding errors</h2>
111 <p class="biberror">There is at least one encoding error with this bibliographic record, the view may be degraded.</p>
112 <pre class="error">[% decoding_error | html %]</pre>
114 [% IF analytics_error %]
115 <h2>Analytics errors</h2>
116 <p class="analytics_error">There was an error searching for analytic records, please see the logs for details.</p>
121 <div class="page-section">
123 [% XSLTBloc | $raw %]
125 [% IF shelves.count %]
126 <span class="results_summary"><span class="label">Lists that include this title: </span>
127 [% FOREACH s IN shelves %]
128 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
129 [% IF ( loop.last ) %][% ELSE %]|[% END %]
133 [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %]
134 <span class="results_summary"><span class="label">Tags:</span>
135 [% FOREACH TagLoo IN TagLoop %]
136 [% IF ( CAN_user_tools_moderate_tags ) %]
137 <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |uri %]">[% TagLoo.term | html %]</a>
139 [% TagLoo.term | html %]
141 <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
145 <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>
146 <span id="catalogue_detail_framework" class="results_summary">
147 <span class="label">MARC framework:</span>
148 <span class="frameworkcode">[% Frameworks.GetName(biblio.frameworkcode) | html %]</span>
150 [% IF !item_level_itypes || Koha.Preference("BiblioItemtypeInfo") %]
151 <span class="results_summary itemtype"><span class="label">Itemtype:</span>
152 [% IF ( !noItemTypeImages && imageurl ) %]
153 <img src="[% imageurl | html %]" alt="" />
155 [% IF ( description ) %]
156 <span class="itypetext">[% description | html %]</span>
158 <span class="itypetext">[% itemtype | html %]</span>
163 [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
164 <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>
167 [% IF ( holdcount ) %]
168 <span class="results_summary">
169 <span class="label">Holds:</span>
170 <span class="number_box">
171 [% IF CAN_user_reserveforothers_place_holds %]
172 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
174 <span>[% holdcount | html %]</span>
180 [% IF illrequests.count %]
181 <span class="results_summary">
182 <span class="label">ILL requests:</span>
183 [% IF CAN_user_ill %]
184 [% FOREACH ill IN illrequests %]
185 <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 %]
188 [% FOREACH ill IN illrequests %]
189 <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
195 [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
196 <span class="results_summary">
197 <span class="label">Article requests:</span>
198 <span class="number_box">
199 <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
204 [% IF course_reserves %]
205 <span class="results_summary"><span class="label">Courses that have reserved this title: </span>
206 [% FOREACH c IN course_reserves %]
207 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% c.course_id | uri %]">[% c.course.course_name | html %]</a>
208 [% IF ( loop.last ) %][% ELSE %]|[% END %]
212 </div> [%# .page-section %]
214 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
216 <div class="col-xs-3 bookcoverimg">
217 <div id="biblio-cover-slider" class="cover-slider" data-isbn="[% normalized_isbn | html %]">
218 [% IF ( LocalCoverImages ) %]
219 [% IF localimages.count %]
220 [% FOREACH image IN localimages %]
221 <div class="cover-image local-coverimg">
222 <a href="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
223 <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 %]" />
225 <div class="hint">Local cover image</div>
231 [% IF ( AmazonCoverImages && normalized_isbn) %]
232 <div class="cover-image" id="amazon-bookcoverimg">
233 <a href="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.LZZZZZZZ.jpg" title="Amazon cover image">
234 <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"/>
236 <div class="hint">Image from Amazon.com</div>
240 [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
241 [% coce_id = normalized_ean || normalized_isbn %]
242 <div class="cover-image coce-coverimg">
244 <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
246 <span class="no-image">No cover image available</span>
248 <div class="hint">Image from Coce</div>
252 [% IF ( SyndeticsCovers ) %]
253 [% IF ( content_identifier_exists ) %]
254 <div class="cover-image" id="syndetics-bookcoverimg">
255 <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">
256 <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" />
258 <div class="hint">Image from Syndetics</div>
261 <span class="no-image">No cover image available</span>
265 [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
266 [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
267 [% IF custom_cover_image_url %]
268 <div class="cover-image" id="custom-coverimg">
269 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" title="Custom cover image">
270 <img id="custom-img" alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
272 <div class="hint">Custom cover image</div>
276 </div> <!-- /.cover-slider -->
277 </div> <!-- /.bookcoverimg.col-xs-3 -->
279 </div> <!-- /.col-xs-* -->
280 [% END # /IF ( AmazonCoverImages, etc ) %]
283 <div id="bibliodetails" class="toptabs">
285 <ul class="nav nav-tabs" role="tablist">
286 [% IF (SeparateHoldings) %]
287 <li role="presentation">
288 <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">[% Branches.GetLoggedInBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
290 <li role="presentation">
291 <a href="#otherholdings" aria-controls="otherholdings" role="tab" data-toggle="tab">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
294 <li role="presentation">
295 <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% itemloop.size() || 0 | html %])</a>
298 [% IF Koha.Preference('EnableItemGroups') %]
299 <li role="presentation">
300 <a href="#item_groups" aria-controls="item_groups" role="tab" data-toggle="tab">Item groups</a>
303 [% 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 %]
304 [% 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 %]
305 [% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions" aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %]
306 [% 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 %]
307 [% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details" aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %]
308 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions" aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %]
309 [% 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 %]
310 [% IF ( LocalCoverImages ) %]
311 <li role="presentation">
312 <a href="#images" aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a>
315 [% IF HTML5MediaEnabled && HTML5MediaSets.size %]
316 <li id="media_tab" role="presentation"><a href="#html5media" aria-controls="html5media" role="tab" data-toggle="tab">Play media</a></li>
318 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
319 <li class="NovelistSelect" style="display:none;" role="presentation"><a href="#NovelistSelect" aria-controls="NovelistSelect" role="tab" data-toggle="tab">NoveList Select</a></li>
321 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
322 <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>
326 <div class="tab-content">
327 [% items_table_block_iter = 0 %]
328 [% BLOCK items_table %]
329 [% items_table_block_iter = items_table_block_iter + 1 %]
330 <div class="[% tab | html %]_table_table_controls">
331 [% IF (StaffDetailItemSelection) %]
332 | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> |
333 <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</a>
334 <span class="itemselection_actions">
336 [% IF CAN_user_tools_items_batchdel %]
337 <a class="itemselection_action_delete"><i class="fa fa-trash-can"></i> Delete selected items</a>
339 [% IF CAN_user_tools_items_batchmod %]
340 <a class="itemselection_action_modify"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Modify selected items</a>
342 [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %]
343 <a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a>
344 <a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a>
349 <table class="items_table" id="[% tab | html %]_table">
352 [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %]
353 [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
354 <th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th>
356 [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
357 <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th>
358 <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
359 [% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %]
360 [% IF Koha.Preference('EnableItemGroups') %]
361 <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
363 <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
365 <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
367 <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
368 <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
369 <th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
370 <th id="[% tab | html %]_renewals" data-colname="[% tab | html %]_renewals">Renewals</th>
371 <th id="[% tab | html %]_dateaccessioned" data-colname="[% tab | html %]_dateaccessioned">Date accessioned</th>
372 <th id="[% tab | html %]_datelastborrowed" data-colname="[% tab | html %]_datelastborrowed">Date last borrowed</th>
373 <th id="[% tab | html %]_barcode" data-colname="[% tab | html %]_barcode">Barcode</th>
374 [% IF ( itemdata_uri ) %]<th id="[% tab | html %]_uri" data-colname="[% tab | html %]_uri">URL</th>[% END %]
375 [% IF ( itemdata_copynumber ) %]<th id="[% tab | html %]_copynumber" data-colname="[% tab | html %]_copynumber">Copy number</th>[% END %]
376 [% IF ( itemdata_stocknumber ) %]<th id="[% tab | html %]_stocknumber" data-colname="[% tab | html %]_stocknumber">Inventory number</th>[% END %]
377 [% IF materials %]<th id="[% tab | html %]_materials" data-colname="[% tab | html %]_materials">Materials specified</th>[% END %]
378 [% IF ( itemdata_itemnotes ) %]<th id="[% tab | html %]_itemnotes" data-colname="[% tab | html %]_itemnotes">Public notes</th>[% END %]
379 [% IF ( itemdata_nonpublicnotes ) %]<th id="[% tab | html %]_itemnotes_nonpublic" data-colname="[% tab | html %]_itemnotes_nonpublic">Non-public notes</th>[% END %]
380 [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
381 [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
382 [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
383 [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
384 [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort noExport"> </th>[% END %]
388 [% FOREACH item IN items %]
389 [% SET date_due = item.object.checkout.date_due %]
390 <tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]" data-duedate="[% date_due | html %]">
391 [% IF (StaffDetailItemSelection) %]
392 <td style="text-align:center;vertical-align:middle">
393 [% IF item.can_be_edited %]
394 <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
398 [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
400 <div class="bookcoverimg">
401 <div class="cover-slider">
402 [% FOREACH image IN item.object.cover_images %]
403 <div class="cover-image local-coverimg">
404 <a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=[% image.itemnumber | uri %]&imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
405 <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?itemnumber=[% item.itemnumber | uri %]&imagenumber=[% image.imagenumber | uri %]" />
414 [% IF ( item_level_itypes ) %]
416 [% SET itemtype = item.itemtype %]
417 [% IF !noItemTypeImages && itemtype.image_location('intranet') %]
418 <img src="[% itemtype.image_location('intranet') | html %]" alt="[% itemtype.translated_description | html %]" title="[% itemtype.translated_description | html %]" />
420 <span class="itypedesc itypetext">[% itemtype.translated_description | html %]</span>
423 <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.holdingbranch ) | html %] [% END %]</td>
424 <td class="homebranch">
425 <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
426 <span class="shelvingloc">
427 [%# If permanent location is defined, show description or code and %]
428 [%# display current location in parentheses. If not, display current location. %]
429 [%# Note that permanent location is a code, and location may be an authval. %]
430 [% SET item_location = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) %]
431 [% IF item.permanent_location %]
432 [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
433 [% permloc_authval | html %]
434 [% IF item_location AND item_location != permloc_authval AND item.location != item.permanent_location %]
435 ([% item_location | html %])
438 [% item_location | html %]
442 [% IF ( itemdata_ccode ) %]<td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>[% END %]
443 [% IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %]
444 <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
446 [% SET serial = item.serial %]
447 [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %]
448 <td class="enumchron" data-order="[% serial.publisheddate | html %]">
450 <td class="enumchron">
452 [% IF ( itemdata_enumchron ) %]
453 [% IF item.enumchron && serial.serialseq %]
454 <span class="enum">[% item.enumchron | html %]</span>
455 [% IF ( serial.serialseq && item.enumchron != serial.serialseq ) %]
456 <span class="sep"> -- </span>
457 <span class="serialseq">[% serial.serialseq | html %]</span>
459 [% ELSIF item.enumchron %]
460 <span class="enum">[% item.enumchron | html %]</span>
461 [% ELSIF item.serialseq %]
462 <span class="serialseq">[% serial.serialseq | html %]</span>
464 [% IF serial.publisheddate %]
465 <span class="pubdate">([% serial.publisheddate | $KohaDates %])</span>
473 [% IF item.object.checkout %]
474 [% IF item.object.checkout.onsite_checkout %]
475 <div class="item_status localuse">Currently in local use
477 <div class="item_status datedue">Checked out
479 [% IF item.object.checkout.onsite_checkout %]
484 [% INCLUDE 'patron-title.inc' patron=item.object.checkout.patron hide_patron_infos_if_needed=1 %]
485 : due [% date_due | $KohaDates as_due_date => 1 %]
487 [% ELSIF ( transfer = item.object.get_transfer ) %]
488 [% IF (transfer.datesent) %]
489 <div class="item_status intransit">In transit from [% Branches.GetName( transfer.frombranch ) | html %] to [% Branches.GetName( transfer.tobranch ) | html %] since [% transfer.datesent | $KohaDates %]</div>
491 <div class="item_status transitrequested">Transit pending from [% Branches.GetName( transfer.frombranch ) | html %] to [% Branches.GetName( transfer.tobranch ) | html %] since [% transfer.daterequested | $KohaDates %]</div>
495 [% IF ( item.itemlost ) %]
496 [% SET itemlost_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
497 [% IF itemlostloop %]
498 <div class="item_status lost">[% itemlost_description | html %]</div>
500 <div class="item_status lost">Unavailable (lost or missing)</div>
504 [% IF ( item.withdrawn ) %]
505 [% SET withdrawn_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
506 [% IF withdrawn_description %]
507 <div class="item_status wdn">[% withdrawn_description | html %]</div>
509 <div class="item_status wdn">Withdrawn</div>
513 [% IF ( item.damaged ) %]
514 [% SET damaged_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) %]
515 [% IF damaged_description %]
516 <div class="item_status dmg">[% damaged_description | html %]</div>
518 <div class="item_status dmg">Damaged</div>
522 [% IF ( item.notforloan || item.itemtype.notforloan ) %]
523 <div class="item_status notforloan">Not for loan
524 [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
525 [% IF not_for_loan_description %]
526 <span class="reason">([% not_for_loan_description | html %])</span>
531 [% SET hold = item.first_hold %]
533 [% IF hold.waitingdate %]
534 <div class="item_status waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</div>
535 [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
536 <span class="heldfor">Hold for:</span>
537 [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
540 <div class="item_status holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</div>
544 [% IF Koha.Preference('UseRecalls') %]
545 [% SET recall = item.object.recall %]
547 [% IF recall.waiting_date %]
548 <div class="item_status recallat">Waiting at [% Branches.GetName( recall.pickup_library_id ) | html %] since [% recall.waiting_date | $KohaDates %]</div>
550 [% patron_link = BLOCK %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %] ([% recall.patron.cardnumber | html %])</a>[% END %]
551 <div class="item_status recallby">recalled by [% patron_link| $raw %] on [% recall.created_date | $KohaDates %]</div>
556 [% UNLESS ( item.notforloan || item.itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfer || hold || ( Koha.Preference('UseRecalls') && recall ) ) %]
557 <div class="item_status available">Available</div>
560 [% IF ( item.restricted ) %]
561 <div class="item_status restricted">([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %])</div>
564 [% IF ( item.bundle_host ) %]
565 <div class="item_status bundled">In bundle: [% INCLUDE 'biblio-title.inc' biblio = item.bundle_host.biblio link = 1 %]</div>
569 <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
570 <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
571 <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
572 <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
573 <td class="datelastborrowed" data-order="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</td>
574 <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | uri %]&biblionumber=[% item.biblionumber | uri %]&bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
575 [% IF ( itemdata_uri ) %]
576 [% IF item.uri.split(' \| ').size > 1 %]
578 [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
583 <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
588 [% IF ( itemdata_copynumber ) %]
589 <td class="copynumber">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.copynumber', authorised_value => item.copynumber ) | html %]</td>
591 [% IF ( itemdata_stocknumber ) %]
592 <td class="stocknumber">[% item.stocknumber | html %]</td>
595 <td class="materials"> [% item.materials | html %] </td>
597 [% IF ( itemdata_itemnotes ) %]
598 <td><div class="itemnotes">[% item.object.itemnotes.replace('\n','<br />') | $raw %]</div></td>
600 [% IF itemdata_nonpublicnotes %]
601 <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
603 [% IF ( hostrecords ) %]
604 <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
608 [% IF ( item.countanalytics ) %]
609 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
614 <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
617 [% IF ShowCourseReserves %]
619 [% IF item.course_reserves %]
620 [% FOREACH r IN item.course_reserves %]
621 [% IF r.course.enabled == 'yes' %]
623 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
624 [% r.course.course_name | html %]
625 <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
626 [% IF r.course.section %] [% r.course.section | html %] [% END %]
627 [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
636 [% IF ( SpineLabelShowPrintOnBibDetails ) %]
637 <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
640 [% IF CAN_user_editcatalogue_edit_items %]
642 [% IF item.can_be_edited %]
643 [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
644 <div class="btn-group">
645 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
646 <ul class="dropdown-menu pull-right">
647 <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
651 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
654 [% IF bundlesEnabled %]
655 <button class="btn btn-default btn-xs details-control"><i class="fa fa-folder"></i> Manage bundle ([% item.bundled | html %]|[% item.bundled_lost | html %])</button>
664 [% END %][%# end of block items_table %]
666 [% IF Koha.Preference('EnableItemGroups') %]
667 <div role="tabpanel" class="tab-pane" id="item_groups">
668 [% IF CAN_user_editcatalogue_manage_item_groups %]
669 <div class="item_groups_table_table_controls">
670 <a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a>
673 <table class="items-group-table" id="items-group-table">
676 <th>Display order</th>
678 <th class="NoSort"> </th>
686 <div role="tabpanel" class="tab-pane" id="holdings">
688 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
689 <span class="results_summary NovelistSelect" style="display:none;">
690 <span class="label">Novelist Select: </span>
691 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
696 [% IF ( showncount ) %]
697 [% PROCESS items_table tab="holdings" items=itemloop %]
699 [% IF ( hiddencount ) %]
700 <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
702 [% IF ( debug_display ) %]
705 <tr><td>itemdata_enumchron</td><td>[% itemdata_enumchron | html %]</td></tr>
706 <tr><td>itemdata_copynumber</td><td>[% itemdata_copynumber | html %]</td></tr>
707 <tr><td>serial</td><td>[% serial | html %]</td></tr>
711 [% IF ( ALTERNATEHOLDINGS ) %]
712 [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
713 <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
716 <div id="noitems">No physical items for this record</div>
720 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
721 <span class="results_summary NovelistSelect" style="display:none;">
722 <span class="label">Novelist Select: </span>
723 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
728 [% IF (SeparateHoldings) %]
729 <div role="tabpanel" class="tab-pane" id="otherholdings">
730 [% IF (otheritemloop.size) %]
731 [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
733 <span class="nootheritems">No other items.</span>
738 [% IF ( MARCNOTES ) %]
740 <div role="tabpanel" class="tab-pane" id="description">
741 <div class="content_set">
743 [% FOREACH MARCNOTE IN MARCNOTES %]
744 <p class="marcnote marcnote-[% MARCNOTE.tag | html %]" id="marcnote-[% MARCNOTE.tag | html %]-[% loop.count | html %]">
745 [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
746 <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
748 [% MARCNOTE.marcnote | html | html_line_break %]
757 [% IF ComponentParts && ComponentParts.size %]
758 <div role="tabpanel" class="tab-pane" id="components">
759 <div class="content_set">
761 [% FOR PART IN ComponentParts %]
769 [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%]
770 <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>
772 </div> <!-- /.content_set -->
773 </div> <!-- /#components -->
777 [% IF ( subscriptionsnumber ) %]
778 <div role="tabpanel" class="tab-pane" id="subscriptions">
779 <div id="catalogue_detail_subscriptions">
780 <h2>This is a serial subscription</h2>
781 <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p>
782 [% FOREACH subscription IN subscriptions %]
783 [% IF subscription.branchcode %]
784 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
786 [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
787 [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
788 [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
789 [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
790 [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
791 [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
792 [% IF ( subscription.latestserials ) %]
793 <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
797 <th>Date arrived</th>
798 <th>Date published</th>
799 <th>Date published (text)</th>
803 [% FOREACH latestserial IN subscription.latestserials %]
805 <td>[% latestserial.serialseq | html %]</td>
806 <td data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td>
807 <td data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td>
808 <td>[% latestserial.publisheddatetext | html %]</td>
810 [% INCLUDE 'serial-status.inc' serial = latestserial %]
812 <td>[% latestserial.notes | html %]</td>
817 [% IF ( CAN_user_serials ) %]
819 <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>
827 [% IF Koha.Preference('AcquisitionDetails') %]
828 <div role="tabpanel" class="tab-pane" id="acq_details">
829 [% IF orders.count %]
835 <th>Basket group</th>
837 <th>Order number</th>
838 <th>Creation date</th>
839 <th>Receive date</th>
842 <th title="Estimated cost tax incl. while pending, actual cost tax incl. once received">Price</th>
843 <th>Internal note</th>
844 <th>Subscription</th>
845 <th>Subscription call number</th>
849 [% FOR order IN orders %]
850 [% SET basket = order.basket %]
851 [% SET vendor = basket.bookseller %]
854 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
857 [% IF order.invoiceid %]
858 [% IF CAN_user_acquisition %]
859 <div><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
860 title="Invoice detail page">
861 [% order.invoice.invoicenumber | html %]</a></div>
863 <div>[% order.invoice.invoicenumber | html %]</div>
866 [% IF ( Koha.Preference('EDIFACT') && CAN_user_acquisition_edi_manage && order.invoice.message_id ) %]
867 <div><a href="/cgi-bin/koha/acqui/edimsg.pl?id=[% order.invoice.message_id | uri %]" title="EDI INVOICE message">EDI message</a></div>
872 [% IF basket.basketgroupid %]
873 [% SET basket_group = basket.basket_group %]
874 [% IF CAN_user_acquisition_group_manage %]
875 <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>
877 [% basket_group.name | html %] ([% basket_group.id | html %])
881 <td>[% IF CAN_user_acquisition_order_manage %]
882 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
884 [% basket.basketname | html %] ([% basket.basketno | html %])
886 <td>[% order.ordernumber | html %]</td>
887 <td data-order="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</td>
888 <td data-order="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</td>
890 [% SWITCH order.orderstatus %]
891 [% CASE 'new' %]<span>New</span>
892 [% CASE 'ordered' %]<span>Ordered</span>
893 [% CASE 'partial' %]<span>Partial</span>
894 [% CASE 'complete' %]<span>Complete</span>
895 [% CASE 'cancelled' %]<span>Cancelled</span>
898 <td>[% order.quantity | html %]</td>
899 <td>[% IF ( order.orderstatus == "complete" ) %][% order.unitprice_tax_included | $Price %][% ELSE %][% order.ecost_tax_included | $Price %][% END %]
900 <td>[% order.order_internalnote | html %]</td>
902 [% IF order.subscriptionid %]
903 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
907 [% IF order.subscriptionid %]
908 [% order.subscription.callnumber | html %]
916 <span class="noorder">There is no order for this bibliographic record.</span>
921 [% IF suggestions.count %]
922 <div role="tabpanel" class="tab-pane" id="suggestion_details">
923 [% IF nb_archived_suggestions > 0 %]
924 <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw %]
926 <table id="suggestions" class="sorted">
929 <th class="NoSort"> </th>
930 <th class="anti-the">Suggestion</th>
931 <th>Suggested by - on</th>
932 <th>Managed by - on</th>
933 <th>Last modification by - on</th>
940 [% FOREACH suggestion IN suggestions %]
942 <td>[% suggestion.suggestionid | html %]</td>
944 <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&op=show" title="suggestion" >
945 [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
947 [% IF ( suggestion.copyrightdate ) %]© [% suggestion.copyrightdate | html %] [% END %]
948 [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
949 [% 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 %]
952 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
953 [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
956 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
957 [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
960 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
961 [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
964 [% Branches.GetName( suggestion.branchcode ) | html %]
967 [% suggestion.fund.budget_name | html %]
970 [% IF suggestion.STATUS == 'ASKED' %]<span>Pending</span>
971 [% ELSIF suggestion.STATUS == 'ACCEPTED' %]<span>Accepted</span>
972 [% ELSIF suggestion.STATUS == 'ORDERED' %]<span>Ordered</span>
973 [% ELSIF suggestion.STATUS == 'REJECTED' %]<span>Rejected</span>
974 [% ELSIF suggestion.STATUS == 'CHECKED' %]<span>Checked</span>
975 [% ELSIF suggestion.STATUS == 'AVAILABLE' %]<span>Available</span>
976 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
977 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
978 [% ELSE %]<span>Status unknown</span>
980 [% IF suggestion.reason %]
981 <br />([% suggestion.reason | html %])
991 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
992 <div role="tabpanel" class="tab-pane" id="editions"><h4>Editions</h4>
994 [% 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 %]
995 [% 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 %]
996 <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 %]
997 [% IF ( XISBN.publishercode ) %]
998 [% 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 %]
1000 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
1001 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
1005 </table></div>[% END %]
1008 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1009 <div role="tabpanel" class="tab-pane" id="concerns">
1010 <fieldset class="action" style="cursor:pointer;">
1011 <a id="hideResolved"><i class="fa fa-minus-square"></i> Hide resolved</a>
1012 | <a id="showAll"><i class="fa fa-bars"></i> Show all</a>
1015 <table id="table_concerns" width="100%">
1021 <th data-class-name="actions noExport">Actions</th>
1028 [% IF ( LocalCoverImages ) %]
1029 <div role="tabpanel" class="tab-pane" id="images">
1030 [% IF localimages.count %]
1031 <p>Click on an image to view it in the image viewer</p>
1032 <ul class="thumbnails">
1033 [% FOREACH image IN localimages %]
1035 <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
1036 <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image.imagenumber | uri %]">
1037 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image.imagenumber | uri %]" />
1039 [% IF CAN_user_tools_upload_local_cover_images %]
1040 <a href="#" class="remove"><i class="fa fa-trash-can"></i> Delete image</a>
1046 [% ELSE # - No image passed JavaScript takes care %]
1047 <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
1049 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1050 <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>
1056 [% IF ( HTML5MediaEnabled ) %]
1057 <div role="tabpanel" class="tab-pane" id="html5media">
1058 [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1060 [% IF HTML5MediaSet.is_youtube %]
1061 <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
1063 <[% HTML5MediaParent | html %] controls preload=none>
1064 <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
1065 [[% HTML5MediaParent | html %] tag not supported by your browser.]
1066 </[% HTML5MediaParent | html %]>
1074 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
1075 <div role="tabpanel" class="tab-pane" id="NovelistSelect" class="novelistSelect">
1076 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
1080 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
1081 <div role="tabpanel" class="tab-pane" id="[% plugins_intranet_catalog_biblio_tab.id | html %]">
1082 [% plugins_intranet_catalog_biblio_tab.content | $raw %]
1086 </div><!-- /tab-content -->
1087 </div><!-- /bibliodetails -->
1089 <div id="export" style="margin-top: 1em;">
1090 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
1092 <th>Save record</th> </tr>
1093 <tr><td> Select download format: <select name="format">
1094 <option value="mods">MODS (XML)</option>
1095 <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
1096 <option value="marcxml">MARCXML</option>
1097 <option value="marc8">MARC (non-Unicode/MARC-8)</option>
1098 <option value="utf8">MARC (Unicode/UTF-8)</option> </select>
1099 <input type="submit" name="save" class="btn btn-primary" value="Download record" /></td>
1102 <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
1108 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
1109 <div class="modal-dialog modal-lg">
1110 <div class="modal-content">
1111 <div class="modal-header">
1112 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1113 <h3 id="marcPreviewLabel">MARC preview</h3>
1115 <div class="modal-body">
1116 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
1118 <div class="modal-footer">
1119 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1125 <div id="elasticPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="elasticPreviewLabel" aria-hidden="true">
1126 <div class="modal-dialog modal-lg">
1127 <div class="modal-content">
1128 <div class="modal-header">
1129 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1130 <h3 id="elasticPreviewLabel">Elasticsearch record</h3>
1132 <div class="modal-body">
1133 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
1135 <div class="modal-footer">
1136 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1143 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1145 <div class="col-sm-2 col-sm-pull-10">
1147 [% INCLUDE 'biblio-view-menu.inc' %]
1149 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1150 </div> <!-- /.row -->
1154 <div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label">
1155 <div class="modal-dialog">
1156 <div class="modal-content">
1157 <div class="modal-header">
1158 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1159 <h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3>
1161 <form method="get" id="modal-item-group-create-form" class="validated">
1162 <div class="modal-body">
1165 <label for="item_group_description" class="required">Name: </label>
1166 <input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" />
1167 <span class="required">Required</span>
1170 <label for="item_group_display_order" class="required">Display order: </label>
1171 <input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" />
1172 <span class="required">Required</span>
1174 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
1178 <div class="modal-footer">
1179 <button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button>
1180 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1187 <div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label">
1188 <div class="modal-dialog">
1189 <div class="modal-content">
1190 <div class="modal-header">
1191 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1192 <h3 id="modal-item-group-edit-label"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit item group</h3>
1194 <form method="get" id="modal-item-group-edit-form" class="validated">
1195 <div class="modal-body">
1198 <label for="item_group_description" class="required">Name: </label>
1199 <input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" />
1200 <span class="required">Required</span>
1203 <label for="item_group_display_order" class="required">Sort order: </label>
1204 <input name="display_order" id="modal-item-group-edit-form-display_order" size="5" />
1205 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
1209 <div class="modal-footer">
1210 <button id="modal-item-group-edit-submit" class="btn btn-default"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Submit</button>
1211 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1218 <div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label">
1219 <div class="modal-dialog">
1220 <div class="modal-content">
1221 <div class="modal-header">
1222 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1223 <h3 id="modal-item-group-delete-label"><i class='fa fa-trash-can'></i> Delete item group</h3>
1225 <div class="modal-body">
1226 Are you sure you want to delete this item group?
1228 <div class="modal-footer">
1229 <button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash-can'></i> Delete</button>
1230 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1236 <div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label">
1237 <div class="modal-dialog">
1238 <div class="modal-content">
1239 <div class="modal-header">
1240 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1241 <h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3>
1243 <form method="get" id="modal-item-group-set-form" class="validated">
1244 <div class="modal-body">
1247 <label for="item_group" class="required">Item group: </label>
1248 <select name="item_group" id="item-group-add-form-select">
1249 [% FOREACH ig IN biblio.item_groups %]
1250 <option value="[% ig.id | html %]">[% ig.description | html %]</option>
1253 <span class="required">Required</span>
1257 <div class="modal-footer">
1258 <button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button>
1259 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1266 <div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label">
1267 <div class="modal-dialog">
1268 <div class="modal-content">
1269 <div class="modal-header">
1270 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1271 <h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3>
1273 <div class="modal-body">
1274 Are you sure you want to remove these item(s) from their item group(s)?
1276 <div class="modal-footer">
1277 <button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button>
1278 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1284 [% IF bundlesEnabled %]
1285 <div class="modal" id="addToBundleModal" tabindex="-1" role="dialog" aria-labelledby="addToBundleLabel">
1286 <form method="get" id="addToBundleForm" action="">
1287 <div class="modal-dialog" role="document">
1288 <div class="modal-content">
1289 <div class="modal-header">
1290 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1291 <h3 id="addToBundleLabel">Add to bundle</h3>
1293 <div class="modal-body">
1294 <div id="addResult"></div>
1295 <fieldset class="rows">
1298 <label class="required" for="external_id">Item barcode: </label>
1299 <input type="text" id="external_id" name="external_id" required="required">
1300 <span class="required">Required</span>
1305 <div class="modal-footer">
1306 <button type="submit" class="btn btn-default">Submit</button>
1307 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1314 <div class="modal" id="removeFromBundleModal" tabindex="-1" role="dialog" aria-labelledby="removeFromBundleLabel">
1315 <form method="get" id="removeFromBundleForm" action="">
1316 <div class="modal-dialog" role="document">
1317 <div class="modal-content">
1318 <div class="modal-header">
1319 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1320 <h3 id="removeFromBundleLabel">Remove from bundle</h3>
1322 <div class="modal-body">
1323 <div id="removeResult"></div>
1324 <fieldset class="rows">
1327 <label class="required" for="external_id">Item barcode: </label>
1328 <input type="text" id="rm_external_id" name="external_id" required="required">
1329 <span class="required">Required</span>
1334 <div class="modal-footer">
1335 <button type="submit" class="btn btn-default">Submit</button>
1336 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1344 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1345 [% INCLUDE 'modals/add_catalog_concern.inc' %]
1348 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1349 [% INCLUDE 'modals/display_ticket.inc' %]
1352 [% MACRO jsinclude BLOCK %]
1353 [% INCLUDE 'catalog-strings.inc' %]
1354 [% INCLUDE 'calendar.inc' %]
1355 [% INCLUDE 'select2.inc' %]
1356 [% INCLUDE 'js-date-format.inc' %]
1357 [% Asset.js("js/catalog.js") | $raw %]
1358 [% Asset.js("js/recalls.js") | $raw %]
1359 [% Asset.js("js/coce.js") | $raw %]
1360 [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1361 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1363 /* Set a variable needed by add_catalog_concern.js */
1364 var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1366 [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1368 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1370 $(document).ready(function() {
1371 var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %];
1373 var filtered = false;
1374 let additional_filters = {
1375 resolved_date: function(){
1377 return { "=": null };
1382 biblio_id: [% biblionumber | uri %]
1385 var tickets_url = '/api/v1/tickets';
1386 var tickets = $("#table_concerns").kohaTable({
1395 'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
1398 "render": function (data, type, row, meta) {
1399 if ( type == 'display' ) {
1400 if ( data != null ) {
1401 return data.escapeHtml();
1412 "data": "reported_date:reporter.firstname",
1413 "render": function(data, type, row, meta) {
1414 let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>';
1415 reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, {
1416 display_cardnumber: false,
1425 "data": "title:body",
1426 "render": function(data, type, row, meta) {
1427 let resolved = ( row.resolved_date ) ? true : false;
1428 let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '">' + row.title + '</a>';
1429 if (row.updates_count) {
1430 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>';
1432 result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>';
1439 "data": "resolved_date",
1440 "render": function(data, type, row, meta) {
1442 if (row.resolved_date) {
1443 result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, {
1444 display_cardnumber: false,
1447 result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
1449 result += _("Open");
1457 "data": function(row, type, val, meta) {
1458 let resolved = ( row.resolved_date ) ? true : false;
1459 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>';
1462 "searchable": false,
1466 }, table_settings, 0, additional_filters);
1468 $('#hideResolved').on("click", function() {
1470 tickets.DataTable().draw();
1473 $('#showAll').on("click", function() {
1475 tickets.DataTable().draw();
1479 [% Asset.js("js/modals/display_ticket.js") | $raw %]
1482 var interface = "[% interface | html %]";
1483 var theme = "[% theme | html %]";
1484 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1485 function verify_cover_images() {
1486 // Loop over each container in the template which contains covers
1487 $(".cover-slider").each(function(){
1488 var lightbox_descriptions = [];
1489 var first_shown = 0;
1490 $(this).find(".cover-image").each( function( index ){
1492 // Find the image in the container
1493 var img = div.find("img")[0];
1494 if( $(img).length > 0 ){
1495 var description = "";
1496 // All slides start hidden. If this is the first one, show it.
1497 if( first_shown == 0 ){
1501 // Check if Amazon image is present
1502 if ( div.attr("id") == "amazon-bookcoverimg" ) {
1505 if ((w == 1) || (h == 1)) {
1506 // Amazon returned single-pixel placeholder
1507 // Remove the container
1510 lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1512 } else if( div.attr("id") == "custom-coverimg" ){
1513 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1514 // No image was loaded via the CustomCoverImages system preference
1515 // Remove the container
1518 lightbox_descriptions.push( _("Custom cover image") );
1520 } else if ( div.attr("id") == "syndetics-bookcoverimg" ){
1521 lightbox_descriptions.push(_("Syndetics cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1523 else if( div.hasClass("coce-coverimg" ) ){
1524 // Identify which service's image is being loaded by Coce
1525 var coce_description;
1526 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1527 coce_description = _("Coce image from Amazon.com");
1528 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1529 coce_description = _("Coce image from Google Books");
1530 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1531 coce_description = _("Coce image from Open Library");
1533 div.find(".hint").html(coce_description);
1534 lightbox_descriptions.push(coce_description);
1535 } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1536 lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1538 lightbox_descriptions.push(_("Cover image source unknown"));
1543 // Lightbox for cover images
1544 Chocolat(this.querySelectorAll('.cover-image a'), {
1545 description: function(){
1546 return lightbox_descriptions[this.settings.currentImageIndex];
1552 $(".cover-slider").each(function(){
1553 var coverSlide = this;
1554 var coverImages = $(this).find(".cover-image");
1555 if( coverImages.length > 1 ){
1556 coverImages.each(function( index ){
1557 // If more that one image is present, add a navigation link
1558 // for activating the slide
1559 var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1561 // Set the first navigation link as active
1562 $(covernav).addClass("nav-active");
1564 $(covernav).html("<i class=\"fa fa-circle\"></i>");
1565 $(coverSlide).append( covernav );
1569 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
1570 && $(coverSlide).find(".cover-image:visible").length < 1 ){
1571 $(coverSlide).remove();
1573 $(coverSlide).addClass("cover-slides");
1574 var img = $(coverSlide).find(".cover-image:visible").find("img")[0];
1575 if( $(img).length > 0 && img.complete && img.naturalHeight > 0 ){
1576 $(".cover-slides").css({"background-image":"none"});
1581 $("#editions img").each(function(i){
1582 if ( this.src.indexOf('amazon.com') >= 0 ) {
1585 if ((w == 1) || (h == 1)) {
1586 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1587 } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1588 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1594 function removeLocalImage(imagenumber) {
1595 var thumbnail = $("#imagenumber-" + imagenumber );
1596 var copy = thumbnail.html();
1597 thumbnail.find("img").css("opacity", ".2");
1598 thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1599 const client = APIClient.cover_image;
1600 client.cover_images.delete(imagenumber).then(
1602 if ( success.deleted == 1 ) {
1605 thumbnail.html( copy );
1606 alert(_("An error occurred on deleting this image"));
1608 if ( $('ul.thumbnails > li').length == 0 ) {
1609 showNoImageMessage();
1613 thumbnail.html( copy );
1614 alert(_("An error occurred on deleting this image"));
1615 console.warn("Something wrong happened: %s".format(error));
1620 function showNoImageMessage() {
1621 var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1622 no_images_msg = '<p>' + no_images_msg + '</p>';
1623 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1624 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>");
1625 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1627 $('#images').html(no_images_msg);
1630 [% IF StaffDetailItemSelection %]
1631 function itemSelectionBuildDeleteLink(div) {
1632 var itemnumbers = new Array();
1633 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1634 itemnumbers.push($(this).val());
1636 if (itemnumbers.length > 0) {
1637 var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
1638 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1639 url += '&biblionumber=[% biblionumber | uri %]';
1640 url += '&src=CATALOGUING';
1641 $('a.itemselection_action_delete').attr('href', url);
1648 function itemSelectionBuildModifyLink(div) {
1649 var itemnumbers = new Array();
1650 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1651 itemnumbers.push($(this).val());
1653 if (itemnumbers.length > 0) {
1654 var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
1655 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1656 url += '&biblionumber=[% biblionumber | uri %]';
1657 url += '&src=CATALOGUING';
1658 $('a.itemselection_action_modify').attr('href', url);
1665 function itemSelectionBuildActionLinks(tab) {
1666 var div = $("#" + tab);
1667 var delete_link_ok = itemSelectionBuildDeleteLink(div);
1668 var modify_link_ok = itemSelectionBuildModifyLink(div);
1669 if (modify_link_ok || delete_link_ok) {
1670 $('.itemselection_actions', div).show();
1672 $('.itemselection_actions', div).hide();
1676 $(document).ready(function() {
1677 $('table.items_table').each(function() {
1678 var div = $(this).parent().attr("id");
1679 itemSelectionBuildActionLinks(div);
1682 $("input[name='itemnumber'][type='checkbox']").change(function() {
1683 var div = $(this).parents('table').parent().parent().attr("id");
1684 itemSelectionBuildActionLinks(div);
1687 $(".SelectAll").on("click",function(e){
1689 var tab = $(this).data("tab");
1690 $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1691 itemSelectionBuildActionLinks(tab);
1694 $(".ClearAll").on("click",function(e){
1696 var tab = $(this).data("tab");
1697 $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1698 itemSelectionBuildActionLinks(tab);
1703 $(document).ready(function() {
1704 // Pick details tab to display by default
1706 [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %]
1707 $(".nav-tabs a[href='#html5media']").tab("show");
1708 [% ELSIF ComponentParts && ComponentParts.size %]
1709 $(".nav-tabs a[href='#components']").tab("show");
1711 $(".nav-tabs a[href='#holdings']").tab("show");
1714 $(".nav-tabs a[href='#holdings']").tab("show");
1716 $('#search-form').focus();
1717 $('.thumbnails > li > .remove').click(function() {
1718 var result = confirm(_("Are you sure you want to delete this cover image?"));
1720 if ( result == true ) {
1721 var imagenumber = $(this).parent().attr('id').split('-')[1];
1722 removeLocalImage(imagenumber);
1727 [% IF ( IntranetCoce && CoceProviders ) %]
1728 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1731 $("body").on("click",".previewMARC", function(e){
1733 var page = $(this).attr("href");
1734 $("#marcPreview .modal-body").load(page + " table");
1735 $('#marcPreview').modal({show:true});
1739 [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
1740 $("body").on("click",".previewElastic", function(e){
1742 var pageElastic = $(this).attr("href");
1743 $("#elasticPreview .modal-body").load(pageElastic, function( response, status, xhr ) {
1744 if( status == 'error' ){
1745 $("#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>");
1748 $('#elasticPreview').modal({show:true});
1752 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1753 novSelect.loadContentForQuery({
1754 ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1755 ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1758 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1759 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1761 if ( d.length > 0 ){ //If no content
1762 $(".NovelistSelect").show();
1766 $(".print-label").on("click", function(e){
1768 link = $(this).attr("href");
1769 openWindow(link,"Print spine label",400,400);
1771 $(".cover-slider").on("click",".cover-nav", function(e){
1773 var cover_slider = $(this).parent();
1774 // Adding click handler for cover image navigation links
1775 var num = $(this).data("num");
1776 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1777 $(this).addClass("nav-active");
1778 $(cover_slider).find(".cover-image").hide();
1779 $(cover_slider).find(".cover-image").eq( num ).show();
1784 [% IF ( IntranetCoce && CoceProviders ) %]
1785 let counter_wait = 0;
1786 function wait_for_images(cb){
1792 loaded = KOHA.coce.done;
1795 if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1796 window.setTimeout(function(){wait_for_images(cb);}, 100);
1798 if (counter_wait >= 50 ) {
1799 console.log("Could not retrieve the images")
1805 $(window).load(function() {
1806 wait_for_images(verify_cover_images);
1809 $(window).load(function() {
1810 verify_cover_images();
1814 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1815 <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1817 [% INCLUDE 'datatables.inc' %]
1818 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1819 [% INCLUDE 'columns_settings.inc' %]
1820 [% INCLUDE 'js-date-format.inc' %]
1821 [% INCLUDE 'js-patron-format.inc' %]
1822 [% INCLUDE 'js-biblio-format.inc' %]
1823 [% Asset.js("js/browser.js") | $raw %]
1824 [% Asset.js("js/table_filters.js") | $raw %]
1825 [% Asset.js("js/place_booking_modal.js") | $raw %]
1828 browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1831 [% IF bundlesEnabled %]
1832 var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1833 var bundle_lost_value = [% Koha.Preference('BundleLostValue') | html %];
1835 $(document).ready(function() {
1837 [% IF bundlesEnabled %] // Bundle handling
1838 function createChild ( row, itemnumber, duedate ) {
1841 var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>');
1842 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>');
1843 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>');
1845 // Disable management if there's a duedate
1847 bundle_toolbar.children('.btn').addClass("disabled");
1848 bundle_toolbar.attr("title", _("This bundle is checked out, it cannot be modified"));
1851 // This is the table we'll convert into a DataTable
1852 var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>');
1854 // Display it the child row
1855 row.child( bundle_toolbar.add(bundles_table), 'bundle' ).show();
1857 // Initialise as a DataTable
1858 var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?";
1859 var bundle_table = bundles_table.kohaTable({
1861 "url": bundle_table_url
1865 "return_claim.patron"
1867 "order": [[ 1, "asc" ]],
1869 "targets": [0,1,2,3],
1870 "render": function (data, type, row, meta) {
1871 if ( data && type == 'display' ) {
1872 return data.escapeHtml();
1879 "data": "biblio.title:biblio.subtitle:biblio.medium",
1880 "title": _("Title"),
1883 "render": function(data, type, row, meta) {
1884 return $biblio_to_html(row.biblio, { link: 1 });
1888 "data": "biblio.author",
1889 "title": _("Author"),
1894 "data": "callnumber",
1895 "title": _("Callnumber"),
1900 "data": "external_id",
1901 "title": _("Barcode"),
1906 "data": "lost_status:last_seen_date:return_claim.patron",
1907 "title": _("Status"),
1908 "searchable": false,
1910 "render": function(data, type, row, meta) {
1911 if ( row.lost_status == bundle_lost_value ) {
1912 let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>';
1913 if ( row.return_claim ) {
1914 out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1918 else if ( row.lost_status !== 0 ) {
1919 return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1921 return '<span class="available">' + _("Present") + '</span>';
1925 "data": function( row, type, val, meta ) {
1928 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"));
1930 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';
1934 "title": _("Actions"),
1935 "searchable": false,
1940 }, bundle_settings, 1);
1941 $(".tbundle").on("click", ".remove:not(.disabled)", function(){
1942 var bundle_table = $(this).closest('table');
1943 var host_itemnumber = bundle_table.data('itemnumber');
1944 var component_itemnumber = $(this).data('itemnumber');
1945 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/" + component_itemnumber;
1948 url: unlink_item_url,
1949 success: function(){
1950 bundle_table.DataTable({ 'retrieve': true }).draw(false);
1959 var bundle_form_active;
1960 $("#addToBundleModal").on("shown.bs.modal", function(e){
1961 var button = $(e.relatedTarget);
1962 var item_id = button.data('item');
1963 $("#addResult").replaceWith('<div id="addResult"></div>');
1964 $("#addToBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items');
1965 $("#external_id").focus();
1967 bundle_form_active = item_id;
1970 function addToBundle (url, data) {
1971 /* Send the data using post with external_id */
1972 var posting = $.post({
1974 data: JSON.stringify(data),
1975 contentType: "application/json; charset=utf-8",
1979 const barcode = data.external_id;
1981 /* Report the results */
1982 posting.done(function(data) {
1983 $('#addResult').replaceWith('<div id="addResult" class="alert alert-success">'+_("Success: Added '%s'").format(barcode)+'</div>');
1984 $('#external_id').val('').focus();
1987 posting.fail(function(data) {
1988 if ( data.status === 409 ) {
1989 var response = data.responseJSON;
1990 if ( response.error_code === 'already_bundled' ) {
1991 $('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
1992 } else if (response.error_code === 'bundle_checkout_out') {
1993 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
1994 } else if (response.error_code === 'checked_out') {
1995 const button = $('<button type="button">')
1996 .addClass('btn btn-xs')
1997 .text(_("Check in and add to bundle"))
1998 .on('click', function () {
1999 addToBundle(url, { external_id: barcode, force_checkin: true });
2003 .attr('class', 'alert alert-warning')
2004 .append(__x('Warning: Item {barcode} is checked out', { barcode }))
2005 .append(' ', button);
2006 } else if (response.error_code === 'failed_checkin') {
2009 .attr('class', 'alert alert-danger')
2010 .append(__x('Failure: Item {barcode} cannot be checked in', { barcode }))
2011 } else if (response.error_code === 'reserved') {
2012 const button = $('<button type="button">')
2013 .addClass('btn btn-xs')
2014 .text(_("Ignore holds and add to bundle"))
2015 .on('click', function () {
2016 addToBundle(url, { external_id: barcode, ignore_holds: true });
2020 .attr('class', 'alert alert-warning')
2021 .append(__x('Warning: Item {barcode} is on hold', { barcode }))
2022 .append(' ', button);
2024 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
2026 } else if ( data.status === 404 ) {
2027 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
2028 } else if ( data.status === 400 ) {
2029 var response = data.responseJSON;
2030 if ( response.error_code === "failed_nesting" ) {
2031 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>');
2033 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
2036 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details.")+'</div>');
2038 $('#external_id').val('').focus();
2042 $("#addToBundleForm").submit(function(event) {
2043 /* stop form from submitting normally */
2044 event.preventDefault();
2046 const url = this.action;
2047 const data = { external_id: this.elements.external_id.value };
2049 addToBundle(url, data);
2052 $("#addToBundleModal").on("hidden.bs.modal", function(e){
2053 if ( bundle_changed ) {
2054 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
2056 bundle_form_active = 0;
2060 $("#removeFromBundleModal").on("shown.bs.modal", function(e){
2061 var button = $(e.relatedTarget);
2062 var item_id = button.data('item');
2063 $("#removeResult").replaceWith('<div id="removeResult"></div>');
2064 $("#removeFromBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items/');
2065 $("#rm_external_id").focus();
2067 bundle_form_active = item_id;
2070 $("#removeFromBundleForm").submit(function(event) {
2072 /* stop form from submitting normally */
2073 event.preventDefault();
2075 /* get the action attribute from the <form action=""> element */
2076 var $form = $(this),
2077 url = $form.attr('action');
2079 var barcode = $('#rm_external_id').val();
2081 /* Fetch itemnumber using rm_external_id */
2082 var itemReq = $.get('/api/v1/items', { q: JSON.stringify({
2083 external_id: barcode
2084 }) }, null, "json");
2087 itemReq.done(function(data) {
2088 if (data.length === 1) {
2089 itemnumber = data[0].item_id;
2091 /* Remove link using fetch itemnumber */
2092 var deleteReq = $.ajax( url + itemnumber, {
2096 /* Report the results */
2097 deleteReq.done(function(data) {
2098 var barcode = $('#rm_external_id').val();
2099 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed '%s'").format(barcode)+'</div>');
2100 $('#rm_external_id').val('').focus();
2103 deleteReq.fail(function(data) {
2104 var barcode = $('#rm_external_id').val();
2105 if ( data.status === 409 ) {
2106 var response = data.responseJSON;
2107 if (response.error_code === 'bundle_checkout_out') {
2108 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Bundle is currently checked out")+'</div>');
2109 } else if ( response.key === "PRIMARY" ) {
2110 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
2112 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
2114 } else if ( data.status === 404 ) {
2115 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
2117 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
2119 $('#rm_external_id').val('').focus();
2122 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>');
2125 itemReq.fail(function(data) {
2126 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found '%s'").format(barcode)+'</div>');
2127 $('#rm_external_id').val('').focus();
2132 $("#removeFromBundleModal").on("hidden.bs.modal", function(e){
2133 if ( bundle_changed ) {
2134 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
2136 bundle_form_active = 0;
2139 // End bundle handling
2142 var table_names = [ 'holdings_table', 'otherholdings_table' ];
2143 var table_settings = [ [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json') | $raw %] ];
2144 var has_images = [ "[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]" ];
2145 table_names.forEach( function( table_name, index ) {
2146 if ( !has_images[index] ) {
2147 table_settings[index].columns.splice(1,1);
2149 var dt_parameters = {
2153 "bKohaColumnsUseNames": true,
2154 "dom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
2156 var table = KohaTable( table_name, dt_parameters, table_settings[index], 'with_filters' );
2158 [% IF bundlesEnabled %]
2159 // Add event listener for opening and closing bundle details
2160 $('#' + table_name + ' tbody').on('click', 'button.details-control', function () {
2161 var button = $(this);
2162 var tr = button.closest('tr');
2163 var dTable = button.closest('table').DataTable({ 'retrieve': true });
2165 var itemnumber = tr.data('itemnumber');
2166 var duedate = tr.data('duedate');
2167 var row = dTable.row( tr );
2169 if ( row.child.isShown() ) {
2170 // This row is already open - close it
2172 tr.removeClass('shown');
2173 button.removeClass('active');
2177 createChild(row, itemnumber, duedate);
2178 tr.addClass('shown');
2179 button.addClass('active');
2185 [% IF Koha.Preference('AcquisitionDetails') %]
2186 var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') | $raw %];
2187 var acquisitiondetails_table = KohaTable("orders", {
2188 "dom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
2191 "order": [[ 4, "desc" ]],
2195 [% IF suggestions.count %]
2196 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
2198 { "orderable": false, "searchable": false, "targets": [ 'NoSort' ] },
2199 { "type": "anti-the", "targets": [ "anti-the" ] }
2201 "pagingType": "full"
2207 function columnsInit(table) {
2208 activate_filters(table.id, false);
2211 [% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %]
2212 $(document).ready(function() {
2213 var search_index = localStorage.getItem("cat_search_pulldown_selection");
2214 var search_value = localStorage.getItem("searchbox_value");
2215 if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)};
2216 if ( search_value ){ $('#cat-search-block #search-form').val(search_value)};
2220 [% IF Koha.Preference('EnableItemGroups') %]
2221 // Load item groups table
2222 var itemGroupsTable = $("#items-group-table").kohaTable({
2224 dom: '<"top pager"ilp>t<"bottom pager"ip>r',
2227 data: "display_order",
2228 title: _("Display order"),
2233 data: "description",
2234 title: _("Description"),
2239 data: function( oObj ) {
2240 [% IF CAN_user_editcatalogue_manage_item_groups %]
2241 return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
2242 <i class="fa-solid fa-pencil" aria-hidden="true"></i> ${_("Edit")}
2245 + `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
2246 <i class='fa fa-trash-can'></i> ${('Delete')}
2257 ajax: { url: `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1` },
2260 // Create new item groups
2261 $('.item-group-create').on('click', function(){
2262 $('#modal-item-group-create-form-description').val("");
2263 $('#modal-item-group-create-submit').removeAttr('disabled');
2264 $('#modal-item-group-create').modal('show');
2267 $("#modal-item-group-create-form").validate({
2268 submitHandler: function(form) {
2270 url: `/api/v1/biblios/${biblionumber}/item_groups`,
2271 headers: { "x-koha-embed": "items" },
2272 success: function(item_groups){
2273 $('#modal-item-group-create-submit').attr('disabled', 'disabled');
2276 "url": `/api/v1/biblios/${biblionumber}/item_groups`,
2279 "Content-Type": "application/json"
2281 "data": JSON.stringify(
2283 "description": $("#modal-item-group-create-form-description").val(),
2284 "display_order": $("#modal-item-group-create-form-display_order").val(),
2290 .done(function (response) {
2291 $('#item-group-add-form-select').append($('<option>', {
2292 value: response.item_group_id,
2293 text: response.description
2296 $('#modal-item-group-create').modal('hide');
2297 if ( item_groups.length == 0 ) {
2298 // This bib has no previous item groups, reload the page
2299 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
2301 // Has other item groups, just reload the table
2302 itemGroupsTable.api().ajax.reload();
2305 .fail(function(err) {
2306 var message = err.responseJSON.error;
2314 $('#modal-item-group-create').on('shown.bs.modal', function () {
2315 $('#modal-item-group-create-form-description').focus();
2318 // Edit existing item groups
2319 $('body').on( 'click', '.item-group-edit', function(){
2320 const item_group_id = $(this).data('item-group-id');
2321 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
2322 $.get( url, function( data ) {
2323 $('#modal-item-group-edit-form-description').val( data.description );
2324 $('#modal-item-group-edit-form-display_order').val( data.display_order );
2325 $('#modal-item-group-edit-submit').data('item-group-id', item_group_id );
2326 $('#modal-item-group-edit-submit').removeAttr('disabled');
2327 $('#modal-item-group-edit').modal('show');
2331 $("#modal-item-group-edit-form").validate({
2332 submitHandler: function(form) {
2333 $('#modal-item-group-edit-submit').attr('disabled', 'disabled');
2335 const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id');
2336 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
2342 "Content-Type": "application/json"
2344 "data": JSON.stringify(
2346 "description": $("#modal-item-group-edit-form-description").val(),
2347 "display_order": $("#modal-item-group-edit-form-display_order").val(),
2353 .done(function (response) {
2354 $('#modal-item-group-edit').modal('hide');
2355 itemGroupsTable.api().ajax.reload();
2357 .fail(function(err) {
2358 var message = err.responseJSON.error;
2364 $('#modal-item-group-edit').on('shown.bs.modal', function () {
2365 $('#modal-item-group-edit-form-description').focus();
2368 // Delete existing item groups
2369 $('body').on( 'click', '.item-group-delete', function(){
2370 const item_group_id = $(this).data('item-group-id');
2371 $('#modal-item-group-delete-submit').data('item-group-id', item_group_id );
2372 $('#modal-item-group-delete-submit').removeAttr('disabled');
2373 $('#modal-item-group-delete').modal('show');
2375 $("#modal-item-group-delete-submit").on('click', function(){
2376 $('#modal-item-group-delete-submit').attr('disabled', 'disabled');
2377 const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id');
2380 url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
2381 headers: { "x-koha-embed": "items" },
2382 success: function(item_group_data){
2384 "url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
2387 .done(function (response) {
2388 $('#modal-item-group-delete').modal('hide');
2389 $(`#item-group-add-form-select option[value='${item_group_id}']`).remove();
2390 if ( item_group_data.items === null ) {
2391 // No items for this item group, we can just refresh the table
2392 itemGroupsTable.api().ajax.reload();
2394 // This item group had items attached to it, we need to reload the page
2395 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
2398 .fail(function(err) {
2399 var message = err.responseJSON.error;
2406 // Add item(s) to a item group
2407 $('.itemselection_action_item_group_set').on('click', function(){
2408 $('#modal-item-group-set').modal('show');
2411 $("#modal-item-group-set-form").validate({
2412 submitHandler: function(form) {
2413 $('#modal-item-group-set-submit').attr('disabled', 'disabled');
2415 const item_group_id = $('#item-group-add-form-select').val();
2417 let itemnumbers = new Array();
2418 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
2419 const itemnumber = $(this).val();
2420 itemnumbers.push( itemnumber );
2422 if (itemnumbers.length > 0) {
2423 let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group';
2424 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2425 url += '&biblionumber=[% biblionumber | uri %]';
2426 url += `&item_group_id=${item_group_id}`;
2428 window.location.replace(url);
2431 $('#modal-item-group-set').modal('hide');
2435 // Remove item(s) from an item group
2436 $('.itemselection_action_item_group_unset').on('click', function(){
2437 $('#modal-item-group-unset').modal('show');
2440 $("#modal-item-group-unset-submit").on('click', function(){
2441 $('#modal-item-group-unset-submit').attr('disabled', 'disabled');
2443 let itemnumbers = new Array();
2444 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
2445 const itemnumber = $(this).val();
2446 itemnumbers.push( itemnumber );
2448 if (itemnumbers.length > 0) {
2449 let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group';
2450 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2451 url += '&biblionumber=[% biblionumber | uri %]';
2453 window.location.replace(url);
2456 $('#modal-item-group-unset').modal('hide');
2461 [% CoverImagePlugins | $raw %]
2463 [% INCLUDE 'intranet-bottom.inc' %]