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' %]
39 [% IF ( unknownbiblionumber ) %]
42 Details for [% INCLUDE 'biblio-title-head.inc' %]
43 [% END %] › Catalog › Koha
45 [% INCLUDE 'doc-head-close.inc' %]
46 [% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %]
49 <body id="catalog_detail" class="catalog">
51 [% WRAPPER 'header.inc' %]
52 [% INCLUDE 'cat-search.inc' %]
55 [% WRAPPER 'sub-header.inc' %]
56 [% WRAPPER breadcrumbs %]
57 [% WRAPPER breadcrumb_item %]
58 <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
61 [% IF ( unknownbiblionumber ) %]
62 [% WRAPPER breadcrumb_item bc_active= 1 %]
63 <span>Unknown record</span>
66 [% WRAPPER breadcrumb_item %]
67 [% INCLUDE 'biblio-title.inc' link = 1 %]
69 [% WRAPPER breadcrumb_item bc_active= 1 %]
73 [% END #/ WRAPPER breadcrumbs %]
74 [% END #/ WRAPPER sub-header.inc %]
76 <div class="main container-fluid">
78 <div class="col-sm-10 col-sm-push-2">
82 [% IF ( unknownbiblionumber ) %]
83 <div class="dialog message">The record you requested does not exist ([% biblionumber | html %]).</div>
86 [% IntranetCoce = Koha.Preference('IntranetCoce') %]
87 [% CoceProviders = Koha.Preference('CoceProviders') %]
88 [% CoceHost = Koha.Preference('CoceHost') %]
89 [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %]
91 [% INCLUDE 'cat-toolbar.inc' %]
92 [% IF decoding_error %]
94 <span class="biberror">
95 There is an error with this bibliographic record, the view may be degraded.</span>
96 <span class="error"><br/> Error: [% decoding_error | html %]</span>
99 [% IF analytics_error %]
101 <span class="analytics_error">
102 There was an error searching for analytic records, please see the logs for details.</span>
106 <!-- COinS / OpenURL -->
107 <span class="Z3988" title="[% ocoins | html %]"></span>
110 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
111 <div id="catalogue_detail_biblio" class="col-xs-9">
113 <div id="catalogue_detail_biblio" class="col-xs-12">
115 <div class="page-section">
117 [% XSLTBloc | $raw %]
119 [% IF shelves.count %]
120 <span class="results_summary"><span class="label">Lists that include this title: </span>
121 [% FOREACH s IN shelves %]
122 <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber | uri %]">[% s.shelfname | html %]</a>
123 [% IF ( loop.last ) %][% ELSE %]|[% END %]
127 [% IF ( TagsEnabled && TagsShowOnDetail && TagLoop ) %]
128 <span class="results_summary"><span class="label">Tags:</span>
129 [% FOREACH TagLoo IN TagLoop %]
130 [% IF ( CAN_user_tools_moderate_tags ) %]
131 <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |uri %]">[% TagLoo.term | html %]</a>
133 [% TagLoo.term | html %]
135 <span class="weight">([% TagLoo.weight_total | html %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
139 <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>
140 <span id="catalogue_detail_framework" class="results_summary">
141 <span class="label">MARC framework:</span>
142 <span class="frameworkcode">[% Frameworks.GetName(biblio.frameworkcode) | html %]</span>
144 [% IF !item_level_itypes || Koha.Preference("BiblioItemtypeInfo") %]
145 <span class="results_summary itemtype"><span class="label">Itemtype:</span>
146 [% IF ( !noItemTypeImages && imageurl ) %]
147 <img src="[% imageurl | html %]" alt="" />
149 [% IF ( description ) %]
150 <span class="itypetext">[% description | html %]</span>
152 <span class="itypetext">[% itemtype | html %]</span>
157 [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
158 <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>
161 [% IF ( holdcount ) %]
162 <span class="results_summary">
163 <span class="label">Holds:</span>
164 <span class="number_box">
165 [% IF CAN_user_reserveforothers_place_holds %]
166 <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber | uri %]">[% holdcount | html %]</a>
168 <span>[% holdcount | html %]</span>
174 [% IF illrequests.count %]
175 <span class="results_summary">
176 <span class="label">ILL requests:</span>
177 [% IF CAN_user_ill %]
178 [% FOREACH ill IN illrequests %]
179 <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 %]
182 [% FOREACH ill IN illrequests %]
183 <span>Request [% ill.illrequest_id | html %]</span>[% IF ! loop.last %], [% END %]
189 [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
190 <span class="results_summary">
191 <span class="label">Article requests:</span>
192 <span class="number_box">
193 <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber | uri %]">[% article_requests_count | html %]</a>
198 [% IF course_reserves %]
199 <span class="results_summary"><span class="label">Courses that have reserved this title: </span>
200 [% FOREACH c IN course_reserves %]
201 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% c.course_id | uri %]">[% c.course.course_name | html %]</a>
202 [% IF ( loop.last ) %][% ELSE %]|[% END %]
206 </div> [%# .page-section %]
208 [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
210 <div class="col-xs-3 bookcoverimg">
211 <div id="biblio-cover-slider" class="cover-slider" data-isbn="[% normalized_isbn | html %]">
212 [% IF ( LocalCoverImages ) %]
213 [% IF localimages.count %]
214 [% FOREACH image IN localimages %]
215 <div class="cover-image local-coverimg">
216 <a href="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
217 <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 %]" />
219 <div class="hint">Local cover image</div>
225 [% IF ( AmazonCoverImages && normalized_isbn) %]
226 <div class="cover-image" id="amazon-bookcoverimg">
227 <a href="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | uri %].01.LZZZZZZZ.jpg" title="Amazon cover image">
228 <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"/>
230 <div class="hint">Image from Amazon.com</div>
234 [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %]
235 [% coce_id = normalized_ean || normalized_isbn %]
236 <div class="cover-image coce-coverimg">
238 <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
240 <span class="no-image">No cover image available</span>
242 <div class="hint">Image from Coce</div>
246 [% IF ( SyndeticsCovers ) %]
247 [% IF ( content_identifier_exists ) %]
248 <div class="cover-image" id="syndetics-bookcoverimg">
249 <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">
250 <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" />
252 <div class="hint">Image from Syndetics</div>
255 <span class="no-image">No cover image available</span>
259 [% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
260 [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
261 [% IF custom_cover_image_url %]
262 <div class="cover-image" id="custom-coverimg">
263 <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" title="Custom cover image">
264 <img id="custom-img" alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
266 <div class="hint">Custom cover image</div>
270 </div> <!-- /.cover-slider -->
271 </div> <!-- /.bookcoverimg.col-xs-3 -->
273 </div> <!-- /.col-xs-* -->
274 [% END # /IF ( AmazonCoverImages, etc ) %]
277 <div id="bibliodetails" class="toptabs">
279 <ul class="nav nav-tabs" role="tablist">
280 [% IF (SeparateHoldings) %]
281 <li role="presentation">
282 <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">[% Branches.GetLoggedInBranchname | html %] holdings ([% itemloop.size() || 0 | html %])</a>
284 <li role="presentation">
285 <a href="#otherholdings" aria-controls="otherholdings" role="tab" data-toggle="tab">Other holdings ([% otheritemloop.size() || 0 | html %])</a>
288 <li role="presentation">
289 <a href="#holdings" aria-controls="holdings" role="tab" data-toggle="tab">Holdings ([% itemloop.size() || 0 | html %])</a>
292 [% IF Koha.Preference('EnableItemGroups') %]
293 <li role="presentation">
294 <a href="#item_groups" aria-controls="item_groups" role="tab" data-toggle="tab">Item groups</a>
297 [% 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 %]
298 [% 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 %]
299 [% IF ( subscriptionsnumber ) %]<li role="presentation"><a href="#subscriptions" aria-controls="subscriptions" role="tab" data-toggle="tab">Subscriptions</a></li>[% END %]
300 [% 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 %]
301 [% IF suggestions.count %]<li role="presentation"><a href="#suggestion_details" aria-controls="suggestion_details" role="tab" data-toggle="tab">Suggestion details</a></li>[% END %]
302 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li role="presentation"><a href="#editions" aria-controls="editions" role="tab" data-toggle="tab">Editions</a></li>[% END %][% END %]
303 [% 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 %]
304 [% IF ( LocalCoverImages ) %]
305 <li role="presentation">
306 <a href="#images" aria-controls="images" role="tab" data-toggle="tab">Images ([% localimages.count || 0 | html %])</a>
309 [% IF HTML5MediaEnabled && HTML5MediaSets.size %]
310 <li id="media_tab" role="presentation"><a href="#html5media" aria-controls="html5media" role="tab" data-toggle="tab">Play media</a></li>
312 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
313 <li class="NovelistSelect" style="display:none;" role="presentation"><a href="#NovelistSelect" aria-controls="NovelistSelect" role="tab" data-toggle="tab">NoveList Select</a></li>
315 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
316 <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>
320 <div class="tab-content">
321 [% items_table_block_iter = 0 %]
322 [% BLOCK items_table %]
323 [% items_table_block_iter = items_table_block_iter + 1 %]
324 <div class="[% tab | html %]_table_table_controls">
325 [% IF (StaffDetailItemSelection) %]
326 | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> |
327 <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-remove"></i> Clear all</a>
328 <span class="itemselection_actions">
330 [% IF CAN_user_tools_items_batchdel %]
331 <a class="itemselection_action_delete"><i class="fa fa-trash"></i> Delete selected items</a>
333 [% IF CAN_user_tools_items_batchmod %]
334 <a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected items</a>
336 [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %]
337 <a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a>
338 <a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a>
343 <table class="items_table" id="[% tab | html %]_table">
346 [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %]
347 [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
348 <th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th>
350 [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
351 <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th>
352 <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
353 [% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %]
354 [% IF Koha.Preference('EnableItemGroups') %]
355 <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
357 <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
359 <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
361 <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
362 <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
363 <th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
364 <th id="[% tab | html %]_renewals" data-colname="[% tab | html %]_renewals">Renewals</th>
365 <th id="[% tab | html %]_dateaccessioned" data-colname="[% tab | html %]_dateaccessioned">Date accessioned</th>
366 <th id="[% tab | html %]_datelastborrowed" data-colname="[% tab | html %]_datelastborrowed">Date last borrowed</th>
367 <th id="[% tab | html %]_barcode" data-colname="[% tab | html %]_barcode">Barcode</th>
368 [% IF ( itemdata_uri ) %]<th id="[% tab | html %]_uri" data-colname="[% tab | html %]_uri">URL</th>[% END %]
369 [% IF ( itemdata_copynumber ) %]<th id="[% tab | html %]_copynumber" data-colname="[% tab | html %]_copynumber">Copy number</th>[% END %]
370 [% IF ( itemdata_stocknumber ) %]<th id="[% tab | html %]_stocknumber" data-colname="[% tab | html %]_stocknumber">Inventory number</th>[% END %]
371 [% IF materials %]<th id="[% tab | html %]_materials" data-colname="[% tab | html %]_materials">Materials specified</th>[% END %]
372 [% IF ( itemdata_itemnotes ) %]<th id="[% tab | html %]_itemnotes" data-colname="[% tab | html %]_itemnotes">Public notes</th>[% END %]
373 [% IF ( itemdata_nonpublicnotes ) %]<th id="[% tab | html %]_itemnotes_nonpublic" data-colname="[% tab | html %]_itemnotes_nonpublic">Non-public notes</th>[% END %]
374 [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
375 [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
376 [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
377 [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
378 [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort noExport"> </th>[% END %]
382 [% FOREACH item IN items %]
383 <tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]" data-duedate="[% item.datedue | html %]">
384 [% IF (StaffDetailItemSelection) %]
385 <td style="text-align:center;vertical-align:middle">
386 [% IF item.can_be_edited %]
387 <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
391 [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
393 <div class="bookcoverimg">
394 <div class="cover-slider">
395 [% FOREACH image IN item.object.cover_images %]
396 <div class="cover-image local-coverimg">
397 <a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=[% image.itemnumber | uri %]&imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
398 <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 %]" />
407 [% IF ( item_level_itypes ) %]
409 [% SET itemtype = item.itemtype %]
410 [% IF !noItemTypeImages && itemtype.image_location('intranet') %]
411 <img src="[% itemtype.image_location('intranet') | html %]" alt="[% itemtype.translated_description | html %]" title="[% itemtype.translated_description | html %]" />
413 <span class="itypedesc itypetext">[% itemtype.translated_description | html %]</span>
416 <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.holdingbranch ) | html %] [% END %]</td>
417 <td class="homebranch">
418 <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
419 <span class="shelvingloc">
420 [%# If permanent location is defined, show description or code and %]
421 [%# display current location in parentheses. If not, display current location. %]
422 [%# Note that permanent location is a code, and location may be an authval. %]
423 [% IF item.permanent_location %]
424 [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
425 [% permloc_authval | html %]
426 [% SET item_location = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) %]
427 [% IF item_location AND item_location != permloc_authval AND item.location != item.permanent_location %]
428 ([% item_location | html %])
431 [% item_location | html %]
435 [% IF ( itemdata_ccode ) %]<td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>[% END %]
436 [% IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %]
437 <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
439 [% SET serial = item.serial %]
440 [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %]
441 <td class="enumchron" data-order="[% serial.publisheddate | html %]">
443 <td class="enumchron">
445 [% IF ( itemdata_enumchron ) %]
446 [% IF item.enumchron && serial.serialseq %]
447 <span class="enum">[% item.enumchron | html %]</span>
448 [% IF ( serial.serialseq && item.enumchron != serial.serialseq ) %]
449 <span class="sep"> -- </span>
450 <span class="serialseq">[% serial.serialseq | html %]</span>
452 [% ELSIF item.enumchron %]
453 <span class="enum">[% item.enumchron | html %]</span>
454 [% ELSIF item.serialseq %]
455 <span class="serialseq">[% serial.serialseq | html %]</span>
457 [% IF serial.publisheddate %]
458 <span class="pubdate">([% serial.publisheddate | $KohaDates %])</span>
466 [% IF item.object.checkout %]
467 [% IF item.object.checkout.onsite_checkout %]
468 <span>Currently in local use
470 <span class="datedue">Checked out
472 [% IF item.can_be_edited %]
473 [% IF item.object.checkout.onsite_checkout %]
478 [% INCLUDE 'patron-title.inc' patron=item.object.checkout.patron hide_patron_infos_if_needed=1 %]
480 : due [% item.object.checkout.date_due | $KohaDates as_due_date => 1 %]
482 [% ELSIF ( transfer = item.object.get_transfer ) %]
483 [% IF (transfer.datesent) %]
484 <span class="intransit">In transit from [% Branches.GetName( transfer.frombranch ) | html %] to [% Branches.GetName( transfer.tobranch ) | html %] since [% transfer.datesent | $KohaDates %]</span>
486 <span class="transitrequested">Transit pending from [% Branches.GetName( transfer.frombranch ) | html %] to [% Branches.GetName( transfer.tobranch ) | html %] since [% item.transfer.daterequested | $KohaDates %]</span>
491 [% IF ( item.itemlost ) %]
492 [% SET itemlost_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
493 [% IF itemlostloop %]
494 <span class="lost">[% itemlost_description | html %]</span>
496 <span class="lost">Unavailable (lost or missing)</span>
500 [% IF ( item.withdrawn ) %]
501 [% SET withdrawn_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
502 [% IF withdrawn_description %]
503 <span class="wdn">[% withdrawn_description | html %]</span>
505 <span class="wdn">Withdrawn</span>
509 [% IF ( item.damaged ) %]
510 [% SET damaged_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) %]
511 [% IF damaged_description %]
512 <span class="dmg">[% damaged_description | html %]</span>
514 <span class="dmg">Damaged</span>
518 [% IF ( item.notforloan || item.itemtype.notforloan ) %]
519 <span class="notforloan">Not for loan
520 [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
521 [% IF not_for_loan_description %]
522 <span class="reason">([% not_for_loan_description | html %])</span>
527 [% SET hold = item.first_hold %]
529 [% IF hold.waitingdate %]
530 <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
531 [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
532 <span class="heldfor">Hold for:</span>
533 [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
536 <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
540 [% IF Koha.Preference('UseRecalls') %]
541 [% SET recall = item.object.recall %]
543 [% IF recall.waiting_date %]
544 <span>Waiting at [% Branches.GetName( recall.pickup_library_id ) | html %] since [% recall.waiting_date | $KohaDates %]</span>
546 [% 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 %]
547 <span>recalled by [% patron_link| $raw %] on [% recall.created_date | $KohaDates %]</span>
552 [% UNLESS ( item.notforloan || item.itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfer || hold || ( Koha.Preference('UseRecalls') && recall ) ) %]
553 <span>Available</span>
556 [% IF ( item.restricted ) %]
557 <span class="restricted">([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %])</span>
560 [% IF ( item.bundle_host ) %]
561 <span class="bundled">In bundle: [% INCLUDE 'biblio-title.inc' biblio = item.bundle_host.biblio link = 1 %]</span>
565 <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates with_hours => 1 %]</td>
566 <td class="issues" data-order="[% item.issues || 0 | html %]">[% item.issues || 0 | html %]</td>
567 <td class="renewals" data-order="[% item.renewals || 0 | html %]">[% item.renewals || 0 | html %]</td>
568 <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
569 <td class="datelastborrowed" data-order="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</td>
570 <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>
571 [% IF ( itemdata_uri ) %]
572 [% IF item.uri.split(' \| ').size > 1 %]
574 [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
579 <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
584 [% IF ( itemdata_copynumber ) %]
585 <td class="copynumber">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.copynumber', authorised_value => item.copynumber ) | html %]</td>
587 [% IF ( itemdata_stocknumber ) %]
588 <td class="stocknumber">[% item.stocknumber | html %]</td>
591 <td class="materials"> [% item.materials | html %] </td>
593 [% IF ( itemdata_itemnotes ) %]
594 <td><div class="itemnotes">[% item.object.itemnotes.replace('\n','<br />') | $raw %]</div></td>
596 [% IF itemdata_nonpublicnotes %]
597 <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
599 [% IF ( hostrecords ) %]
600 <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
604 [% IF ( item.countanalytics ) %]
605 <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
610 <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
613 [% IF ShowCourseReserves %]
615 [% IF item.course_reserves %]
616 [% FOREACH r IN item.course_reserves %]
617 [% IF r.course.enabled == 'yes' %]
619 <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
620 [% r.course.course_name | html %]
621 <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
622 [% IF r.course.section %] [% r.course.section | html %] [% END %]
623 [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
632 [% IF ( SpineLabelShowPrintOnBibDetails ) %]
633 <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>
636 [% IF CAN_user_editcatalogue_edit_items %]
638 [% IF item.can_be_edited %]
639 [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
640 <div class="btn-group">
641 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
642 <ul class="dropdown-menu pull-right">
643 <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>
647 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a>
650 [% IF bundlesEnabled %]
651 <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>
660 [% END %][%# end of block items_table %]
662 [% IF Koha.Preference('EnableItemGroups') %]
663 <div role="tabpanel" class="tab-pane" id="item_groups">
664 [% IF CAN_user_editcatalogue_manage_item_groups %]
665 <div class="item_groups_table_table_controls">
666 <a href="#" class="item-group-create btn btn-default btn-xs"><i class="fa fa-plus"></i> New item group</a>
669 <table class="items-group-table" id="items-group-table">
672 <td>Display order</td>
682 <div role="tabpanel" class="tab-pane" id="holdings">
684 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'above' ) %]
685 <span class="results_summary NovelistSelect" style="display:none;">
686 <span class="label">Novelist Select: </span>
687 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
692 [% IF ( showncount ) %]
693 [% PROCESS items_table tab="holdings" items=itemloop %]
695 [% IF ( hiddencount ) %]
696 <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
698 [% IF ( debug_display ) %]
701 <tr><td>itemdata_enumchron</td><td>[% itemdata_enumchron | html %]</td></tr>
702 <tr><td>itemdata_copynumber</td><td>[% itemdata_copynumber | html %]</td></tr>
703 <tr><td>serial</td><td>[% serial | html %]</td></tr>
707 [% IF ( ALTERNATEHOLDINGS ) %]
708 [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
709 <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding | html %]</div>
712 <div id="noitems">No physical items for this record</div>
716 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'below' ) %]
717 <span class="results_summary NovelistSelect" style="display:none;">
718 <span class="label">Novelist Select: </span>
719 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
724 [% IF (SeparateHoldings) %]
725 <div role="tabpanel" class="tab-pane" id="otherholdings">
726 [% IF (otheritemloop.size) %]
727 [% PROCESS items_table tab="otherholdings" items=otheritemloop %]
729 <span class="nootheritems">No other items.</span>
734 [% IF ( MARCNOTES ) %]
736 <div role="tabpanel" class="tab-pane" id="description">
737 <div class="content_set">
739 [% FOREACH MARCNOTE IN MARCNOTES %]
741 [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
742 <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
744 [% MARCNOTE.marcnote | html | html_line_break %]
753 [% IF ComponentParts && ComponentParts.size %]
754 <div role="tabpanel" class="tab-pane" id="components">
755 <div class="content_set">
757 [% FOR PART IN ComponentParts %]
765 [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%]
766 <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>
768 </div> <!-- /.content_set -->
769 </div> <!-- /#components -->
773 [% IF ( subscriptionsnumber ) %]
774 <div role="tabpanel" class="tab-pane" id="subscriptions">
775 <div id="catalogue_detail_subscriptions">
776 <h2>This is a serial subscription</h2>
777 <p> (There are [% subscriptionsnumber | html %] subscriptions associated with this title).</p>
778 [% FOREACH subscription IN subscriptions %]
779 [% IF subscription.branchcode %]
780 <h3>At library: [% Branches.GetName(subscription.branchcode) || subscription.branchcode | html %]</h3>
782 [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
783 [% IF ( subscription.location ) %]<p class="subscription_location">Location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => subscription.location ) | html %]</p>[% END %]
784 [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber | html %] </p>[% END %]
785 [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes | html | html_line_break %] </p>[% END %]
786 [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist | html %] </p>[% END %]
787 [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote | html %])</p>[% END %]
788 [% IF ( subscription.latestserials ) %]
789 <p> The [% subscription.staffdisplaycount | html %] latest issues related to this subscription:</p>
793 <th>Date arrived</th>
794 <th>Date published</th>
795 <th>Date published (text)</th>
799 [% FOREACH latestserial IN subscription.latestserials %]
801 <td>[% latestserial.serialseq | html %]</td>
802 <td data-order="[% latestserial.planneddate | html %]">[% latestserial.planneddate | $KohaDates %]</td>
803 <td data-order="[% latestserial.publisheddate | html %]">[% latestserial.publisheddate | $KohaDates %]</td>
804 <td>[% latestserial.publisheddatetext | html %]</td>
806 [% INCLUDE 'serial-status.inc' serial = latestserial %]
808 <td>[% latestserial.notes | html %]</td>
813 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | uri %]">Subscription details</a>
819 [% IF Koha.Preference('AcquisitionDetails') %]
820 <div role="tabpanel" class="tab-pane" id="acq_details">
821 [% IF orders.count %]
827 <th>Basket group</th>
829 <th>Order number</th>
830 <th>Creation date</th>
831 <th>Receive date</th>
834 <th title="Estimated cost tax incl. while pending, actual cost tax incl. once received">Price</th>
835 <th>Internal note</th>
836 <th>Subscription</th>
837 <th>Subscription call number</th>
841 [% FOR order IN orders %]
842 [% SET basket = order.basket %]
843 [% SET vendor = basket.bookseller %]
846 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]" title="Vendor detail page">[% vendor.name | html %]</a>
849 [% IF order.invoiceid %]
850 [% IF CAN_user_acquisition %]
851 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]"
852 title="Invoice detail page">
853 [% order.invoice.invoicenumber | html %]</a>
855 [% order.invoice.invoicenumber | html %]
860 [% IF basket.basketgroupid %]
861 [% SET basket_group = basket.basket_group %]
862 [% IF CAN_user_acquisition_group_manage %]
863 <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>
865 [% basket_group.name | html %] ([% basket_group.id | html %])
869 <td>[% IF CAN_user_acquisition_order_manage %]
870 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %] ([% basket.basketno | html %])</a>
872 [% basket.basketname | html %] ([% basket.basketno | html %])
874 <td>[% order.ordernumber | html %]</td>
875 <td data-order="[% basket.creationdate | uri %]">[% basket.creationdate | $KohaDates%]</td>
876 <td data-order="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates%]</td>
878 [% SWITCH order.orderstatus %]
879 [% CASE 'new' %]<span>New</span>
880 [% CASE 'ordered' %]<span>Ordered</span>
881 [% CASE 'partial' %]<span>Partial</span>
882 [% CASE 'complete' %]<span>Complete</span>
883 [% CASE 'cancelled' %]<span>Cancelled</span>
886 <td>[% order.quantity | html %]</td>
887 <td>[% IF ( order.unitprice_tax_included > 0 ) %][% order.unitprice_tax_included | $Price %][% ELSE %][% order.ecost_tax_included | $Price %][% END %]
888 <td>[% order.order_internalnote | html %]</td>
890 [% IF order.subscriptionid %]
891 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% order.subscriptionid | uri %]">[% order.subscriptionid | html %]</a>
895 [% IF order.subscriptionid %]
896 [% order.subscription.callnumber | html %]
904 <span class="noorder">There is no order for this bibliographic record.</span>
909 [% IF suggestions.count %]
910 <div role="tabpanel" class="tab-pane" id="suggestion_details">
911 [% IF nb_archived_suggestions > 0 %]
912 <p>[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw %]
914 <table id="suggestions" class="sorted">
917 <th class="NoSort"> </th>
918 <th class="anti-the">Suggestion</th>
919 <th>Suggested by - on</th>
920 <th>Managed by - on</th>
921 <th>Last modification by - on</th>
928 [% FOREACH suggestion IN suggestions %]
930 <td>[% suggestion.suggestionid | html %]</td>
932 <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&op=show" title="suggestion" >
933 [% suggestion.title | html %][% IF ( suggestion.author ) %], by [% suggestion.author | html %][% END %]</a>
935 [% IF ( suggestion.copyrightdate ) %]© [% suggestion.copyrightdate | html %] [% END %]
936 [% IF ( suggestion.volumedesc ) %]; Volume:<em>[% suggestion.volumedesc | html %]</em> [% END %]
937 [% 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 %]
940 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.suggestedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</a>
941 [% IF suggestion.suggesteddate %] - [% suggestion.suggesteddate | $KohaDates %][% END %]
944 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.managedby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</a>
945 [% IF suggestion.manageddate %] - [% suggestion.manageddate | $KohaDates %][% END %]
948 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggestion.lastmodificationby | uri %]">[% INCLUDE 'patron-title.inc' patron => suggestion.last_modifier %]</a>
949 [% IF suggestion.lastmodificationdate %] - [% suggestion.lastmodificationdate | $KohaDates %][% END %]
952 [% Branches.GetName( suggestion.branchcode ) | html %]
955 [% suggestion.fund.budget_name | html %]
958 [% IF suggestion.STATUS == 'ASKED' %]<span>Pending</span>
959 [% ELSIF suggestion.STATUS == 'ACCEPTED' %]<span>Accepted</span>
960 [% ELSIF suggestion.STATUS == 'ORDERED' %]<span>Ordered</span>
961 [% ELSIF suggestion.STATUS == 'REJECTED' %]<span>Rejected</span>
962 [% ELSIF suggestion.STATUS == 'CHECKED' %]<span>Checked</span>
963 [% ELSIF suggestion.STATUS == 'AVAILABLE' %]<span>Available</span>
964 [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) %]
965 [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', suggestion.STATUS ) | html %]
966 [% ELSE %]<span>Status unknown</span>
968 [% IF suggestion.reason %]
969 <br />([% suggestion.reason | html %])
979 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
980 <div role="tabpanel" class="tab-pane" id="editions"><h4>Editions</h4>
982 [% 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 %]
983 [% 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 %]
984 <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 %]
985 [% IF ( XISBN.publishercode ) %]
986 [% 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 %]
988 [% IF ( XISBN.pages ) %] [% END %][% XISBN.pages | html %] [% IF ( XISBN.illus ) %][% XISBN.illus | html %][% END %]
989 [% IF ( XISBN.size ) %], [% END %][% XISBN.size | html %]
993 </table></div>[% END %]
996 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
997 <div role="tabpanel" class="tab-pane" id="concerns">
998 <fieldset class="action" style="cursor:pointer;">
999 <a id="hideResolved"><i class="fa fa-minus-square"></i> Hide resolved</a>
1000 | <a id="showAll"><i class="fa fa-bars"></i> Show all</a>
1003 <table id="table_concerns" width="100%">
1009 <th data-class-name="actions noExport">Actions</th>
1016 [% IF ( LocalCoverImages ) %]
1017 <div role="tabpanel" class="tab-pane" id="images">
1018 [% IF localimages.count %]
1019 <p>Click on an image to view it in the image viewer</p>
1020 <ul class="thumbnails">
1021 [% FOREACH image IN localimages %]
1023 <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
1024 <a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image.imagenumber | uri %]">
1025 <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image.imagenumber | uri %]" />
1027 [% IF CAN_user_tools_upload_local_cover_images %]
1028 <a href="#" class="remove"><i class="fa fa-trash"></i> Delete image</a>
1034 [% ELSE # - No image passed JavaScript takes care %]
1035 <span class="noimagesuploaded">No images have been uploaded for this bibliographic record yet.</span>
1037 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1038 <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>
1044 [% IF ( HTML5MediaEnabled ) %]
1045 <div role="tabpanel" class="tab-pane" id="html5media">
1046 [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1048 [% IF HTML5MediaSet.is_youtube %]
1049 <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
1051 <[% HTML5MediaParent | html %] controls preload=none>
1052 <[% HTML5MediaSet.child | html %] src="[% HTML5MediaSet.srcblock | url %]"[% HTML5MediaSet.typeblock | html %] />
1053 [[% HTML5MediaParent | html %] tag not supported by your browser.]
1054 </[% HTML5MediaParent | html %]>
1062 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
1063 <div role="tabpanel" class="tab-pane" id="NovelistSelect" class="novelistSelect">
1064 <div data-novelist-novelistselect=[% normalized_isbn | html %]></div>
1068 [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %]
1069 <div role="tabpanel" class="tab-pane" id="[% plugins_intranet_catalog_biblio_tab.id | html %]">
1070 [% plugins_intranet_catalog_biblio_tab.content | $raw %]
1074 </div><!-- /tab-content -->
1075 </div><!-- /bibliodetails -->
1077 <div id="export" style="margin-top: 1em;">
1078 <form method="get" action="/cgi-bin/koha/catalogue/export.pl">
1080 <th>Save record</th> </tr>
1081 <tr><td> Select download format: <select name="format">
1082 <option value="mods">MODS (XML)</option>
1083 <option data-toggle="modal" data-target="#exportModal_">Dublin Core</option>
1084 <option value="marcxml">MARCXML</option>
1085 <option value="marc8">MARC (non-Unicode/MARC-8)</option>
1086 <option value="utf8">MARC (Unicode/UTF-8)</option> </select>
1087 <input type="submit" name="save" class="btn btn-primary" value="Download record" /></td>
1090 <input type="hidden" name="op" value="export" /><input type="hidden" name="bib" value="[% biblionumber | html %]" />
1096 <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
1097 <div class="modal-dialog modal-lg">
1098 <div class="modal-content">
1099 <div class="modal-header">
1100 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1101 <h3 id="marcPreviewLabel">MARC preview</h3>
1103 <div class="modal-body">
1104 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
1106 <div class="modal-footer">
1107 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1113 <div id="elasticPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="elasticPreviewLabel" aria-hidden="true">
1114 <div class="modal-dialog modal-lg">
1115 <div class="modal-content">
1116 <div class="modal-header">
1117 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1118 <h3 id="elasticPreviewLabel">Elasticsearch record</h3>
1120 <div class="modal-body">
1121 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
1123 <div class="modal-footer">
1124 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1131 </div> <!-- /.col-sm-10.col-sm-push-2 -->
1133 <div class="col-sm-2 col-sm-pull-10">
1135 [% INCLUDE 'biblio-view-menu.inc' %]
1137 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
1138 </div> <!-- /.row -->
1142 <div class="modal fade" id="modal-item-group-create" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-create-label">
1143 <div class="modal-dialog">
1144 <div class="modal-content">
1145 <div class="modal-header">
1146 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1147 <h3 id="modal-item-group-create-label"><i class="fa fa-plus"></i> Create a new item group</h3>
1149 <form id="modal-item-group-create-form" class="validated">
1150 <div class="modal-body">
1153 <label for="item_group_description" class="required">Name: </label>
1154 <input name="description" id="modal-item-group-create-form-description" type="text" size="30" required="required" class="required" />
1155 <span class="required">Required</span>
1158 <label for="item_group_display_order" class="required">Display order: </label>
1159 <input name="display_order" id="modal-item-group-create-form-display_order" value="0" size="5" required="required" class="required" />
1160 <span class="required">Required</span>
1162 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
1166 <div class="modal-footer">
1167 <button id="modal-item-group-create-submit" class="btn btn-default"><i class="fa fa-plus"></i> Submit</button>
1168 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1175 <div class="modal fade" id="modal-item-group-edit" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-edit-label">
1176 <div class="modal-dialog">
1177 <div class="modal-content">
1178 <div class="modal-header">
1179 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1180 <h3 id="modal-item-group-edit-label"><i class='fa fa-edit'></i> Edit item group</h3>
1182 <form id="modal-item-group-edit-form" class="validated">
1183 <div class="modal-body">
1186 <label for="item_group_description" class="required">Name: </label>
1187 <input name="description" id="modal-item-group-edit-form-description" type="text" size="30" required="required" class="required" />
1188 <span class="required">Required</span>
1191 <label for="item_group_display_order" class="required">Sort order: </label>
1192 <input name="display_order" id="modal-item-group-edit-form-display_order" size="5" />
1193 <span class="hint">Numbers only, item groups will be displayed in counting order</span>
1197 <div class="modal-footer">
1198 <button id="modal-item-group-edit-submit" class="btn btn-default"><i class='fa fa-edit'></i> Submit</button>
1199 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1206 <div class="modal fade" id="modal-item-group-delete" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-delete-label">
1207 <div class="modal-dialog">
1208 <div class="modal-content">
1209 <div class="modal-header">
1210 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1211 <h3 id="modal-item-group-delete-label"><i class='fa fa-trash'></i> Delete item group</h3>
1213 <div class="modal-body">
1214 Are you sure you want to delete this item group?
1216 <div class="modal-footer">
1217 <button id="modal-item-group-delete-submit" class="btn btn-danger"><i class='fa fa-trash'></i> Delete</button>
1218 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1224 <div class="modal fade" id="modal-item-group-set" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-set-label">
1225 <div class="modal-dialog">
1226 <div class="modal-content">
1227 <div class="modal-header">
1228 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1229 <h3 id="modal-item-group-set-label"><i class='fa fa-book'></i> Set item group for items</h3>
1231 <form id="modal-item-group-set-form" class="validated">
1232 <div class="modal-body">
1235 <label for="item_group" class="required">Item group: </label>
1236 <select name="item_group" id="item-group-add-form-select">
1237 [% FOREACH ig IN biblio.item_groups %]
1238 <option value="[% ig.id | html %]">[% ig.description | html %]</option>
1241 <span class="required">Required</span>
1245 <div class="modal-footer">
1246 <button id="modal-item-group-set-submit" class="btn btn-default"><i class='fa fa-book'></i> Set item group</button>
1247 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1254 <div class="modal fade" id="modal-item-group-unset" tabindex="-1" role="dialog" aria-labelledby="modal-item-group-unset-label">
1255 <div class="modal-dialog">
1256 <div class="modal-content">
1257 <div class="modal-header">
1258 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1259 <h3 id="modal-item-group-unset-label"><i class='fa fa-unlink'></i> Remove item from item group</h3>
1261 <div class="modal-body">
1262 Are you sure you want to remove these item(s) from their item group(s)?
1264 <div class="modal-footer">
1265 <button id="modal-item-group-unset-submit" class="btn btn-danger"><i class='fa fa-unlink'></i> Remove</button>
1266 <button class="btn btn-link" data-dismiss="modal" aria-hidden="true">Cancel</button>
1272 [% IF bundlesEnabled %]
1273 <div class="modal" id="addToBundleModal" tabindex="-1" role="dialog" aria-labelledby="addToBundleLabel">
1274 <form id="addToBundleForm" action="">
1275 <div class="modal-dialog" role="document">
1276 <div class="modal-content">
1277 <div class="modal-header">
1278 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1279 <h3 id="addToBundleLabel">Add to bundle</h3>
1281 <div class="modal-body">
1282 <div id="addResult"></div>
1283 <fieldset class="rows">
1286 <label class="required" for="external_id">Item barcode: </label>
1287 <input type="text" id="external_id" name="external_id" required="required">
1288 <span class="required">Required</span>
1293 <div class="modal-footer">
1294 <button type="submit" class="btn btn-default">Submit</button>
1295 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1302 <div class="modal" id="removeFromBundleModal" tabindex="-1" role="dialog" aria-labelledby="removeFromBundleLabel">
1303 <form id="removeFromBundleForm" action="">
1304 <div class="modal-dialog" role="document">
1305 <div class="modal-content">
1306 <div class="modal-header">
1307 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1308 <h3 id="removeFromBundleLabel">Remove from bundle</h3>
1310 <div class="modal-body">
1311 <div id="removeResult"></div>
1312 <fieldset class="rows">
1315 <label class="required" for="external_id">Item barcode: </label>
1316 <input type="text" id="rm_external_id" name="external_id" required="required">
1317 <span class="required">Required</span>
1322 <div class="modal-footer">
1323 <button type="submit" class="btn btn-default">Submit</button>
1324 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
1332 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1333 [% INCLUDE 'modals/add_catalog_concern.inc' %]
1336 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1337 [% INCLUDE 'modals/display_ticket.inc' %]
1340 [% MACRO jsinclude BLOCK %]
1341 [% INCLUDE 'catalog-strings.inc' %]
1342 [% Asset.js("js/catalog.js") | $raw %]
1343 [% Asset.js("js/recalls.js") | $raw %]
1344 [% Asset.js("js/coce.js") | $raw %]
1345 [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
1346 [% IF ( Koha.Preference('CatalogConcerns') ) %]
1348 /* Set a variable needed by add_catalog_concern.js */
1349 var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1351 [% Asset.js("js/modals/add_catalog_concern.js") | $raw %]
1353 [% IF ( ( Koha.Preference('CatalogConcerns') || Koha.Preference('OpacCatalogConcerns') ) && CAN_user_editcatalogue_edit_catalogue ) %]
1355 $(document).ready(function() {
1356 var table_settings = [% TablesSettings.GetTableSettings( 'cataloguing', 'concerns', 'table_concerns', 'json' ) | $raw %];
1358 var filtered = false;
1359 let additional_filters = {
1360 resolved_date: function(){
1362 return { "=": null };
1367 biblio_id: [% biblionumber | uri %]
1370 var tickets_url = '/api/v1/tickets';
1371 var tickets = $("#table_concerns").kohaTable({
1380 'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
1383 "render": function (data, type, row, meta) {
1384 if ( type == 'display' ) {
1385 if ( data != null ) {
1386 return data.escapeHtml();
1397 "data": "reported_date:reporter.firstname",
1398 "render": function(data, type, row, meta) {
1399 let reported = '<span class="date clearfix">' + $datetime(row.reported_date) + '</span>';
1400 reported += '<span class="reporter clearfix">' + $patron_to_html(row.reporter, {
1401 display_cardnumber: false,
1410 "data": "title:body",
1411 "render": function(data, type, row, meta) {
1412 let resolved = ( row.resolved_date ) ? true : false;
1413 let result = '<a role="button" href="#" data-toggle="modal" data-target="#ticketDetailsModal" data-concern="' + encodeURIComponent(row.ticket_id) + '" data-resolved="' + resolved + '">' + row.title + '</a>';
1414 if (row.updates_count) {
1415 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>';
1417 result += '<div id="detail_' + row.ticket_id + '" class="hidden">' + row.body + '</div>';
1424 "data": "resolved_date",
1425 "render": function(data, type, row, meta) {
1427 if (row.resolved_date) {
1428 result += _("Resolved by:") + ' <span>' + $patron_to_html(row.resolver, {
1429 display_cardnumber: false,
1432 result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
1434 result += _("Open");
1442 "data": function(row, type, val, meta) {
1443 let resolved = ( row.resolved_date ) ? true : false;
1444 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 fa-eye" aria-hidden="true"></i> ' + _("Details") + '</a>';
1447 "searchable": false,
1451 }, table_settings, 0, additional_filters);
1453 $('#hideResolved').on("click", function() {
1455 tickets.DataTable().draw();
1458 $('#showAll').on("click", function() {
1460 tickets.DataTable().draw();
1464 [% Asset.js("js/modals/display_ticket.js") | $raw %]
1467 var interface = "[% interface | html %]";
1468 var theme = "[% theme | html %]";
1469 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1470 function verify_cover_images() {
1471 // Loop over each container in the template which contains covers
1472 $(".cover-slider").each(function(){
1473 var lightbox_descriptions = [];
1474 var first_shown = 0;
1475 $(this).find(".cover-image").each( function( index ){
1477 // Find the image in the container
1478 var img = div.find("img")[0];
1479 if( $(img).length > 0 ){
1480 var description = "";
1481 // All slides start hidden. If this is the first one, show it.
1482 if( first_shown == 0 ){
1486 // Check if Amazon image is present
1487 if ( div.attr("id") == "amazon-bookcoverimg" ) {
1490 if ((w == 1) || (h == 1)) {
1491 // Amazon returned single-pixel placeholder
1492 // Remove the container
1495 lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1497 } else if( div.attr("id") == "custom-coverimg" ){
1498 if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1499 // No image was loaded via the CustomCoverImages system preference
1500 // Remove the container
1503 lightbox_descriptions.push("Custom cover image");
1505 } else if ( div.attr("id") == "syndetics-bookcoverimg" ){
1506 lightbox_descriptions.push(_("Syndetics cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1508 else if( div.hasClass("coce-coverimg" ) ){
1509 // Identify which service's image is being loaded by Coce
1510 var coce_description;
1511 if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1512 coce_description = ("Coce image from Amazon.com");
1513 } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1514 coce_description = _("Coce image from Google Books");
1515 } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1516 coce_description = _("Coce image from Open Library");
1518 div.find(".hint").html(coce_description);
1519 lightbox_descriptions.push(coce_description);
1520 } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1521 lightbox_descriptions.push(_("Local cover image (<a href='%s'>edit</a>)").format($(img).data('link')));
1523 lightbox_descriptions.push(_("Cover image source unknown"));
1528 // Lightbox for cover images
1529 Chocolat(this.querySelectorAll('.cover-image a'), {
1530 description: function(){
1531 return lightbox_descriptions[this.settings.currentImageIndex];
1537 $(".cover-slider").each(function(){
1538 var coverSlide = this;
1539 var coverImages = $(this).find(".cover-image");
1540 if( coverImages.length > 1 ){
1541 coverImages.each(function( index ){
1542 // If more that one image is present, add a navigation link
1543 // for activating the slide
1544 var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1546 // Set the first navigation link as active
1547 $(covernav).addClass("nav-active");
1549 $(covernav).html("<i class=\"fa fa-circle\"></i>");
1550 $(coverSlide).append( covernav );
1554 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
1555 && $(coverSlide).find(".cover-image:visible").length < 1 ){
1556 $(coverSlide).remove();
1558 $(coverSlide).addClass("cover-slides");
1559 var img = $(coverSlide).find(".cover-image:visible").find("img")[0];
1560 if( $(img).length > 0 && img.complete && img.naturalHeight > 0 ){
1561 $(".cover-slides").css({"background-image":"none"});
1566 $("#editions img").each(function(i){
1567 if ( this.src.indexOf('amazon.com') >= 0 ) {
1570 if ((w == 1) || (h == 1)) {
1571 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1572 } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1573 this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1579 function removeLocalImage(imagenumber) {
1580 var thumbnail = $("#imagenumber-" + imagenumber );
1581 var copy = thumbnail.html();
1582 thumbnail.find("img").css("opacity", ".2");
1583 thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
1585 url: "/cgi-bin/koha/svc/cover_images?action=delete&imagenumber=" + imagenumber,
1586 success: function(data) {
1587 $(data).each( function(i) {
1588 if ( this.deleted == 1 ) {
1591 thumbnail.html( copy );
1592 alert(_("An error occurred on deleting this image"));
1594 if ( $('ul.thumbnails > li').length == 0 ) {
1595 showNoImageMessage();
1599 error: function(data) {
1600 thumbnail.html( copy );
1601 alert(_("An error occurred on deleting this image"));
1606 function showNoImageMessage() {
1607 var no_images_msg = _("No images have been uploaded for this bibliographic record yet.");
1608 no_images_msg = '<p>' + no_images_msg + '</p>';
1609 [% IF ( CAN_user_tools_upload_local_cover_images ) %]
1610 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>");
1611 no_images_msg += "<p id='upload_image'>" + please_upload + '</p>';
1613 $('#images').html(no_images_msg);
1616 [% IF StaffDetailItemSelection %]
1617 function itemSelectionBuildDeleteLink(div) {
1618 var itemnumbers = new Array();
1619 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1620 itemnumbers.push($(this).val());
1622 if (itemnumbers.length > 0) {
1623 var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1';
1624 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1625 url += '&biblionumber=[% biblionumber | uri %]';
1626 url += '&src=CATALOGUING';
1627 $('a.itemselection_action_delete').attr('href', url);
1634 function itemSelectionBuildModifyLink(div) {
1635 var itemnumbers = new Array();
1636 $("input[name='itemnumber'][type='checkbox']:checked", div).each(function() {
1637 itemnumbers.push($(this).val());
1639 if (itemnumbers.length > 0) {
1640 var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
1641 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
1642 url += '&biblionumber=[% biblionumber | uri %]';
1643 url += '&src=CATALOGUING';
1644 $('a.itemselection_action_modify').attr('href', url);
1651 function itemSelectionBuildActionLinks(tab) {
1652 var div = $("#" + tab);
1653 var delete_link_ok = itemSelectionBuildDeleteLink(div);
1654 var modify_link_ok = itemSelectionBuildModifyLink(div);
1655 if (modify_link_ok || delete_link_ok) {
1656 $('.itemselection_actions', div).show();
1658 $('.itemselection_actions', div).hide();
1662 $(document).ready(function() {
1663 $('table.items_table').each(function() {
1664 var div = $(this).parent().attr("id");
1665 itemSelectionBuildActionLinks(div);
1668 $("input[name='itemnumber'][type='checkbox']").change(function() {
1669 var div = $(this).parents('table').parent().parent().attr("id");
1670 itemSelectionBuildActionLinks(div);
1673 $(".SelectAll").on("click",function(e){
1675 var tab = $(this).data("tab");
1676 $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', true);
1677 itemSelectionBuildActionLinks(tab);
1680 $(".ClearAll").on("click",function(e){
1682 var tab = $(this).data("tab");
1683 $("input[name='itemnumber'][type='checkbox']", $("#"+tab)).prop('checked', false);
1684 itemSelectionBuildActionLinks(tab);
1689 $(document).ready(function() {
1690 // Pick details tab to display by default
1692 [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %]
1693 $(".nav-tabs a[href='#html5media']").tab("show");
1694 [% ELSIF ComponentParts && ComponentParts.size %]
1695 $(".nav-tabs a[href='#components']").tab("show");
1697 $(".nav-tabs a[href='#holdings']").tab("show");
1700 $(".nav-tabs a[href='#holdings']").tab("show");
1702 $('#search-form').focus();
1703 $('.thumbnails > li > .remove').click(function() {
1704 var result = confirm(_("Are you sure you want to delete this cover image?"));
1706 if ( result == true ) {
1707 var imagenumber = $(this).parent().attr('id').split('-')[1];
1708 removeLocalImage(imagenumber);
1713 [% IF ( IntranetCoce && CoceProviders ) %]
1714 KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]');
1717 $("body").on("click",".previewMARC", function(e){
1719 var page = $(this).attr("href");
1720 $("#marcPreview .modal-body").load(page + " table");
1721 $('#marcPreview').modal({show:true});
1725 [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %]
1726 $("body").on("click",".previewElastic", function(e){
1728 var pageElastic = $(this).attr("href");
1729 $("#elasticPreview .modal-body").load(pageElastic, function( response, status, xhr ) {
1730 if( status == 'error' ){
1731 $("#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>");
1734 $('#elasticPreview').modal({show:true});
1738 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1739 novSelect.loadContentForQuery({
1740 ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1741 ISBN : '[% IF normalized_isbn %][% normalized_isbn | html %][% ELSE %][% normalized_upc | html %][% END %]',
1744 '[% Koha.Preference('NovelistSelectStaffProfile') | html %]',
1745 '[% Koha.Preference('NovelistSelectPassword') | html %]',
1747 if ( d.length > 0 ){ //If no content
1748 $(".NovelistSelect").show();
1752 $(".print-label").on("click", function(e){
1754 link = $(this).attr("href");
1755 openWindow(link,"Print spine label",400,400);
1757 $(".cover-slider").on("click",".cover-nav", function(e){
1759 var cover_slider = $(this).parent();
1760 // Adding click handler for cover image navigation links
1761 var num = $(this).data("num");
1762 $(cover_slider).find(".cover-nav").removeClass("nav-active");
1763 $(this).addClass("nav-active");
1764 $(cover_slider).find(".cover-image").hide();
1765 $(cover_slider).find(".cover-image").eq( num ).show();
1770 [% IF ( IntranetCoce && CoceProviders ) %]
1771 let counter_wait = 0;
1772 function wait_for_images(cb){
1778 loaded = KOHA.coce.done;
1781 if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
1782 window.setTimeout(function(){wait_for_images(cb);}, 100);
1784 if (counter_wait >= 50 ) {
1785 console.log("Could not retrieve the images")
1791 $(window).load(function() {
1792 wait_for_images(verify_cover_images);
1795 $(window).load(function() {
1796 verify_cover_images();
1800 [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %]
1801 <script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script>
1803 [% INCLUDE 'datatables.inc' %]
1804 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
1805 [% INCLUDE 'columns_settings.inc' %]
1806 [% INCLUDE 'js-date-format.inc' %]
1807 [% INCLUDE 'js-patron-format.inc' %]
1808 [% INCLUDE 'js-biblio-format.inc' %]
1809 [% Asset.js("js/browser.js") | $raw %]
1810 [% Asset.js("js/table_filters.js") | $raw %]
1813 browser = KOHA.browser('[% searchid | html %]', parseInt(biblionumber, 10));
1816 [% IF bundlesEnabled %]
1817 var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1818 var bundle_lost_value = [% Koha.Preference('BundleLostValue') | html %];
1820 $(document).ready(function() {
1822 [% IF bundlesEnabled %] // Bundle handling
1823 function createChild ( row, itemnumber, duedate ) {
1826 var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>');
1827 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>');
1828 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>');
1830 // Disable management if there's a duedate
1832 bundle_toolbar.children('.btn').addClass("disabled");
1835 // This is the table we'll convert into a DataTable
1836 var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>');
1838 // Display it the child row
1839 row.child( bundle_toolbar.add(bundles_table), 'bundle' ).show();
1841 // Initialise as a DataTable
1842 var bundle_table_url = "/api/v1/items/" + itemnumber + "/bundled_items?";
1843 var bundle_table = bundles_table.kohaTable({
1845 "url": bundle_table_url
1849 "return_claim.patron"
1851 "order": [[ 1, "asc" ]],
1853 "targets": [0,1,2,3],
1854 "render": function (data, type, row, meta) {
1855 if ( data && type == 'display' ) {
1856 return data.escapeHtml();
1863 "data": "biblio.title:biblio.subtitle:biblio.medium",
1864 "title": _("Title"),
1867 "render": function(data, type, row, meta) {
1868 return $biblio_to_html(row.biblio, { link: 1 });
1872 "data": "biblio.author",
1873 "title": _("Author"),
1878 "data": "callnumber",
1879 "title": _("Callnumber"),
1884 "data": "external_id",
1885 "title": _("Barcode"),
1890 "data": "lost_status:last_seen_date:return_claim.patron",
1891 "title": _("Status"),
1892 "searchable": false,
1894 "render": function(data, type, row, meta) {
1895 if ( row.lost_status == bundle_lost_value ) {
1896 let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>';
1897 if ( row.return_claim ) {
1898 out = out + '<span class="claims_return">' + _("Claims returned by") + ': ' + $patron_to_html( row.return_claim.patron, { display_cardnumber: false, url: true } ) + '</span>';
1902 else if ( row.lost_status !== 0 ) {
1903 return '<span class="lost">' + _("Lost") + ': ' + row.lost_status + '</span>';
1905 return '<span class="available">' + _("Present") + '</span>';
1909 "data": function( row, type, val, meta ) {
1912 result = '<button class="btn btn-default btn-xs remove disabled" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n';
1914 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';
1918 "title": _("Actions"),
1919 "searchable": false,
1924 }, bundle_settings, 1);
1925 $(".tbundle").on("click", ".remove:not(.disabled)", function(){
1926 var bundle_table = $(this).closest('table');
1927 var host_itemnumber = bundle_table.data('itemnumber');
1928 var component_itemnumber = $(this).data('itemnumber');
1929 var unlink_item_url = "/api/v1/items/" + host_itemnumber + "/bundled_items/" + component_itemnumber;
1932 url: unlink_item_url,
1933 success: function(){
1934 bundle_table.DataTable({ 'retrieve': true }).draw(false);
1943 var bundle_form_active;
1944 $("#addToBundleModal").on("shown.bs.modal", function(e){
1945 var button = $(e.relatedTarget);
1946 var item_id = button.data('item');
1947 $("#addResult").replaceWith('<div id="addResult"></div>');
1948 $("#addToBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items');
1949 $("#external_id").focus();
1951 bundle_form_active = item_id;
1954 function addToBundle (url, data) {
1955 /* Send the data using post with external_id */
1956 var posting = $.post({
1958 data: JSON.stringify(data),
1959 contentType: "application/json; charset=utf-8",
1963 const barcode = data.external_id;
1965 /* Report the results */
1966 posting.done(function(data) {
1967 $('#addResult').replaceWith('<div id="addResult" class="alert alert-success">'+_("Success: Added '%s'").format(barcode)+'</div>');
1968 $('#external_id').val('').focus();
1971 posting.fail(function(data) {
1972 if ( data.status === 409 ) {
1973 var response = data.responseJSON;
1974 if ( response.error_code === 'already_bundled' ) {
1975 $('#addResult').replaceWith('<div id="addResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
1976 } else if (response.error_code === 'checked_out') {
1977 const button = $('<button type="button">')
1978 .addClass('btn btn-xs')
1979 .text(__("Check in and add to bundle"))
1980 .on('click', function () {
1981 addToBundle(url, { external_id: barcode, force_checkin: true });
1985 .attr('class', 'alert alert-warning')
1986 .append(__x('Warning: Item {barcode} is checked out', { barcode }))
1987 .append(' ', button);
1988 } else if (response.error_code === 'failed_checkin') {
1991 .attr('class', 'alert alert-danger')
1992 .append(__x('Failure: Item {barcode} cannot be checked in', { barcode }))
1993 } else if (response.error_code === 'reserved') {
1994 const button = $('<button type="button">')
1995 .addClass('btn btn-xs')
1996 .text(__("Ignore holds and add to bundle"))
1997 .on('click', function () {
1998 addToBundle(url, { external_id: barcode, ignore_holds: true });
2002 .attr('class', 'alert alert-warning')
2003 .append(__x('Warning: Item {barcode} is on hold', { barcode }))
2004 .append(' ', button);
2006 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
2008 } else if ( data.status === 404 ) {
2009 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
2010 } else if ( data.status === 400 ) {
2011 var response = data.responseJSON;
2012 if ( response.error_code === "failed_nesting" ) {
2013 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' is a bundle and bundles cannot be nested").format(barcode)+'</div>');
2015 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
2018 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
2020 $('#external_id').val('').focus();
2024 $("#addToBundleForm").submit(function(event) {
2025 /* stop form from submitting normally */
2026 event.preventDefault();
2028 const url = this.action;
2029 const data = { external_id: this.elements.external_id.value };
2031 addToBundle(url, data);
2034 $("#addToBundleModal").on("hidden.bs.modal", function(e){
2035 if ( bundle_changed ) {
2036 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
2038 bundle_form_active = 0;
2042 $("#removeFromBundleModal").on("shown.bs.modal", function(e){
2043 var button = $(e.relatedTarget);
2044 var item_id = button.data('item');
2045 $("#removeResult").replaceWith('<div id="removeResult"></div>');
2046 $("#removeFromBundleForm").attr('action', '/api/v1/items/' + item_id + '/bundled_items/');
2047 $("#rm_external_id").focus();
2049 bundle_form_active = item_id;
2052 $("#removeFromBundleForm").submit(function(event) {
2054 /* stop form from submitting normally */
2055 event.preventDefault();
2057 /* get the action attribute from the <form action=""> element */
2058 var $form = $(this),
2059 url = $form.attr('action');
2061 var barcode = $('#rm_external_id').val();
2063 /* Fetch itemnumber using rm_external_id */
2064 var itemReq = $.get('/api/v1/items', { q: JSON.stringify({
2065 external_id: barcode
2066 }) }, null, "json");
2069 itemReq.done(function(data) {
2070 if (data.length === 1) {
2071 itemnumber = data[0].item_id;
2073 /* Remove link using fetch itemnumber */
2074 var deleteReq = $.ajax( url + itemnumber, {
2078 /* Report the results */
2079 deleteReq.done(function(data) {
2080 var barcode = $('#rm_external_id').val();
2081 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-success">'+_("Success: Removed '%s'").format(barcode)+'</div>');
2082 $('#rm_external_id').val('').focus();
2085 deleteReq.fail(function(data) {
2086 var barcode = $('#rm_external_id').val();
2087 if ( data.status === 409 ) {
2088 var response = data.responseJSON;
2089 if ( response.key === "PRIMARY" ) {
2090 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-warning">'+_("Warning: Item '%s' already attached").format(barcode)+'</div>');
2092 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Item '%s' belongs to another bundle").format(barcode)+'</div>');
2094 } else if ( data.status === 404 ) {
2095 $('#addResult').replaceWith('<div id="addResult" class="alert alert-danger">'+_("Failure: Item '%s' not found").format(barcode)+'</div>');
2097 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failure: Check the logs for details")+'</div>');
2099 $('#rm_external_id').val('').focus();
2102 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Barcode matched more than one item '%s'").format(barcode)+'</div>');
2105 itemReq.fail(function(data) {
2106 $('#removeResult').replaceWith('<div id="removeResult" class="alert alert-danger">'+_("Failed: Item not found '%s'").format(barcode)+'</div>');
2107 $('#rm_external_id').val('').focus();
2112 $("#removeFromBundleModal").on("hidden.bs.modal", function(e){
2113 if ( bundle_changed ) {
2114 $('#bundle_table_'+bundle_form_active).DataTable({ 'retrieve': true }).ajax.reload();
2116 bundle_form_active = 0;
2119 // End bundle handling
2122 var table_names = [ 'holdings_table', 'otherholdings_table' ];
2123 var table_settings = [ [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %], [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json') | $raw %] ];
2124 var has_images = [ "[% itemloop_has_images | html %]", "[% otheritemloop_has_images | html %]" ];
2125 table_names.forEach( function( table_name, index ) {
2126 if ( !has_images[index] ) {
2127 table_settings[index].columns.splice(1,1);
2129 var dt_parameters = {
2132 'bAutoWidth': false,
2133 "bKohaColumnsUseNames": true,
2134 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
2136 var table = KohaTable( table_name, dt_parameters, table_settings[index], 'with_filters' );
2138 [% IF bundlesEnabled %]
2139 // Add event listener for opening and closing bundle details
2140 $('#' + table_name + ' tbody').on('click', 'button.details-control', function () {
2141 var button = $(this);
2142 var tr = button.closest('tr');
2143 var dTable = button.closest('table').DataTable({ 'retrieve': true });
2145 var itemnumber = tr.data('itemnumber');
2146 var duedate = tr.data('duedate');
2147 var row = dTable.row( tr );
2149 if ( row.child.isShown() ) {
2150 // This row is already open - close it
2152 tr.removeClass('shown');
2153 button.removeClass('active');
2157 createChild(row, itemnumber, duedate);
2158 tr.addClass('shown');
2159 button.addClass('active');
2165 [% IF Koha.Preference('AcquisitionDetails') %]
2166 var table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail', 'acquisitiondetails-table', 'json') | $raw %];
2167 var acquisitiondetails_table = KohaTable("orders", {
2168 "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
2170 'bAutoWidth': false,
2171 "aaSorting": [[ 4, "desc" ]],
2175 [% IF suggestions.count %]
2176 $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
2178 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
2179 { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
2181 "sPaginationType": "full"
2187 function columnsInit(table) {
2188 activate_filters(table.id, false);
2191 [% IF found1 && Koha.Preference('RetainCatalogSearchTerms') %]
2192 $(document).ready(function() {
2193 var search_index = localStorage.getItem("cat_search_pulldown_selection");
2194 var search_value = localStorage.getItem("searchbox_value");
2195 if ( search_index ){ $('#cat-search-block select.advsearch').val(search_index)};
2196 if ( search_value ){ $('#cat-search-block #search-form').val(search_value)};
2200 [% IF Koha.Preference('EnableItemGroups') %]
2201 // Load item groups table
2202 var itemGroupsTable = KohaTable("items-group-table", {
2203 "bAutoWidth": false,
2204 'sDom': '<"top pager"ilp>t<"bottom pager"ip>r',
2207 "mDataProp": function( oObj ) {
2208 return oObj.display_order;
2212 "mDataProp": function( oObj ) {
2213 return oObj.description;
2217 "mDataProp": function( oObj ) {
2218 [% IF CAN_user_editcatalogue_manage_item_groups %]
2219 return `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
2220 <i class='fa fa-edit'></i> ${_("Edit")}
2223 + `<button class='item-group-delete btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
2224 <i class='fa fa-trash'></i> ${('Delete')}
2233 "bProcessing": true,
2234 "bServerSide": false,
2235 "sAjaxSource": `/api/v1/biblios/${biblionumber}/item_groups?_per_page=-1`,
2236 "sAjaxDataProp": "",
2237 "fnServerData": function ( sSource, aoData, fnCallback ) {
2238 $.getJSON( sSource, aoData, function (json) {
2244 // Create new item groups
2245 $('.item-group-create').on('click', function(){
2246 $('#modal-item-group-create-form-description').val("");
2247 $('#modal-item-group-create-submit').removeAttr('disabled');
2248 $('#modal-item-group-create').modal('show');
2251 $("#modal-item-group-create-form").validate({
2252 submitHandler: function(form) {
2254 url: `/api/v1/biblios/${biblionumber}/item_groups`,
2255 headers: { "x-koha-embed": "items" },
2256 success: function(item_groups){
2257 $('#modal-item-group-create-submit').attr('disabled', 'disabled');
2260 "url": `/api/v1/biblios/${biblionumber}/item_groups`,
2263 "Content-Type": "application/json"
2265 "data": JSON.stringify(
2267 "description": $("#modal-item-group-create-form-description").val(),
2268 "display_order": $("#modal-item-group-create-form-display_order").val(),
2274 .done(function (response) {
2275 $('#item-group-add-form-select').append($('<option>', {
2276 value: response.item_group_id,
2277 text: response.description
2280 $('#modal-item-group-create').modal('hide');
2281 if ( item_groups.length == 0 ) {
2282 // This bib has no previous item groups, reload the page
2283 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
2285 // Has other item groups, just reload the table
2286 itemGroupsTable.api().ajax.reload();
2289 .fail(function(err) {
2290 var message = err.responseJSON.error;
2298 $('#modal-item-group-create').on('shown.bs.modal', function () {
2299 $('#modal-item-group-create-form-description').focus();
2302 // Edit existing item groups
2303 $('body').on( 'click', '.item-group-edit', function(){
2304 const item_group_id = $(this).data('item-group-id');
2305 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
2306 $.get( url, function( data ) {
2307 $('#modal-item-group-edit-form-description').val( data.description );
2308 $('#modal-item-group-edit-form-display_order').val( data.display_order );
2309 $('#modal-item-group-edit-submit').data('item-group-id', item_group_id );
2310 $('#modal-item-group-edit-submit').removeAttr('disabled');
2311 $('#modal-item-group-edit').modal('show');
2315 $("#modal-item-group-edit-form").validate({
2316 submitHandler: function(form) {
2317 $('#modal-item-group-edit-submit').attr('disabled', 'disabled');
2319 const item_group_id = $('#modal-item-group-edit-submit').data('item-group-id');
2320 const url = `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`;
2326 "Content-Type": "application/json"
2328 "data": JSON.stringify(
2330 "description": $("#modal-item-group-edit-form-description").val(),
2331 "display_order": $("#modal-item-group-edit-form-display_order").val(),
2337 .done(function (response) {
2338 $('#modal-item-group-edit').modal('hide');
2339 itemGroupsTable.api().ajax.reload();
2341 .fail(function(err) {
2342 var message = err.responseJSON.error;
2348 $('#modal-item-group-edit').on('shown.bs.modal', function () {
2349 $('#modal-item-group-edit-form-description').focus();
2352 // Delete existing item groups
2353 $('body').on( 'click', '.item-group-delete', function(){
2354 const item_group_id = $(this).data('item-group-id');
2355 $('#modal-item-group-delete-submit').data('item-group-id', item_group_id );
2356 $('#modal-item-group-delete-submit').removeAttr('disabled');
2357 $('#modal-item-group-delete').modal('show');
2359 $("#modal-item-group-delete-submit").on('click', function(){
2360 $('#modal-item-group-delete-submit').attr('disabled', 'disabled');
2361 const item_group_id = $("#modal-item-group-delete-submit").data('item-group-id');
2364 url: `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
2365 headers: { "x-koha-embed": "items" },
2366 success: function(item_group_data){
2368 "url": `/api/v1/biblios/${biblionumber}/item_groups/${item_group_id}`,
2371 .done(function (response) {
2372 $('#modal-item-group-delete').modal('hide');
2373 $(`#item-group-add-form-select option[value='${item_group_id}']`).remove();
2374 if ( item_group_data.items === null ) {
2375 // No items for this item group, we can just refresh the table
2376 itemGroupsTable.api().ajax.reload();
2378 // This item group had items attached to it, we need to reload the page
2379 window.location.replace(`/cgi-bin/koha/catalogue/detail.pl?biblionumber=${biblionumber}`);
2382 .fail(function(err) {
2383 var message = err.responseJSON.error;
2390 // Add item(s) to a item group
2391 $('.itemselection_action_item_group_set').on('click', function(){
2392 $('#modal-item-group-set').modal('show');
2395 $("#modal-item-group-set-form").validate({
2396 submitHandler: function(form) {
2397 $('#modal-item-group-set-submit').attr('disabled', 'disabled');
2399 const item_group_id = $('#item-group-add-form-select').val();
2401 let itemnumbers = new Array();
2402 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
2403 const itemnumber = $(this).val();
2404 itemnumbers.push( itemnumber );
2406 if (itemnumbers.length > 0) {
2407 let url = '/cgi-bin/koha/catalogue/detail.pl?op=set_item_group';
2408 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2409 url += '&biblionumber=[% biblionumber | uri %]';
2410 url += `&item_group_id=${item_group_id}`;
2412 window.location.replace(url);
2415 $('#modal-item-group-set').modal('hide');
2419 // Remove item(s) from an item group
2420 $('.itemselection_action_item_group_unset').on('click', function(){
2421 $('#modal-item-group-unset').modal('show');
2424 $("#modal-item-group-unset-submit").on('click', function(){
2425 $('#modal-item-group-unset-submit').attr('disabled', 'disabled');
2427 let itemnumbers = new Array();
2428 $("input[name='itemnumber'][type='checkbox']:checked").each(function() {
2429 const itemnumber = $(this).val();
2430 itemnumbers.push( itemnumber );
2432 if (itemnumbers.length > 0) {
2433 let url = '/cgi-bin/koha/catalogue/detail.pl?op=unset_item_group';
2434 url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
2435 url += '&biblionumber=[% biblionumber | uri %]';
2437 window.location.replace(url);
2440 $('#modal-item-group-unset').modal('hide');
2445 [% CoverImagePlugins | $raw %]
2447 [% INCLUDE 'intranet-bottom.inc' %]