From 1aef2ccf439c1604b3d3d11fbc825b109f3ae36d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 13 Apr 2023 12:26:48 +0200 Subject: [PATCH] Bug 33568: Starting up MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Copying the same thead and making a new table using the REST API endpoint Signed-off-by: Owen Leonard Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi Signed-off-by: Katrin Fischer --- .../prog/en/modules/catalogue/detail.tt | 303 ++++++++++++++++++ 1 file changed, 303 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 0c1d677ad9..af97ac2864 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -695,7 +695,48 @@ [% IF ( count ) %] [% IF ( showncount ) %] [% PROCESS items_table tab="holdings" items=itemloop %] + + [% SET tab="holdings" %] + + + [% IF (StaffDetailItemSelection) %][% END %] + [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] + + [% END %] + [% IF ( item_level_itypes ) %][% END %] + + + [% IF ( itemdata_ccode ) %][% END %] + [% IF Koha.Preference('EnableItemGroups') %] + + [% END %] + + [% IF volinfo %] + + [% END %] + + + + + + + + [% IF ( itemdata_uri ) %][% END %] + [% IF ( itemdata_copynumber ) %][% END %] + [% IF ( itemdata_stocknumber ) %][% END %] + [% IF materials %][% END %] + [% IF ( itemdata_itemnotes ) %][% END %] + [% IF ( itemdata_nonpublicnotes ) %][% END %] + [% IF ( hostrecords ) %][% END %] + [% IF ( analyze ) %][% END %] + [% IF ( ShowCourseReserves ) %][% END %] + [% IF ( SpineLabelShowPrintOnBibDetails ) %][% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %][% END %] + + +
Cover imageItem typeCurrent libraryHome libraryCollectionItem groupCall numberSerial enumeration / chronologyStatusLast seenCheckoutsRenewalsDate accessionedDate last borrowedBarcodeURLCopy numberInventory numberMaterials specifiedPublic notesNon-public notesHost recordsUsed inCourse reservesSpine label 
[% END %] + [% IF ( hiddencount ) %]

Show all items ([% hiddencount | html %] hidden) [% END %] @@ -2449,6 +2490,268 @@ }); [% END %] + + let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; + var items_table = $("#table_items").kohaTable({ + ajax: { url: table_url }, + order: [[ 0, "asc" ]], + bAutoWidth: false, + columns: [ + [% IF (StaffDetailItemSelection) %] + { + data: "me.item_id", + searchable: false, + orderable: false, + render: function (data, type, row, meta) { + // FIXME if item.can_be_edited + return (''.format(row.item_id)); + } + }, + [% END %] + [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return ""; // FIXME Build cover images + } + }, + [% END %] + [% IF ( item_level_itypes ) %] + { + data: "me.effective_item_type_id", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.effective_item_type_id; // FIXME Display the translated description and the image + } + }, + [% END %] + { + data: "me.holding_library_id", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.holding_library_id; // FIXME Display library name + } + }, + { + data: "me.home_library_id", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.home_library_id; // FIXME Display library name + } + // FIXME Display the shelving location + }, + [% IF ( itemdata_ccode ) %] + { + data: "me.collection_code", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.collection_code; // FIXME Display str version + } + }, + [% END %] + [% IF Koha.Preference('EnableItemGroups') %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return "item.item_group.description";// FIXME item.item_group.description + } + }, + [% END %] + { + data: "me.callnumber", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.callnumber; + } + + }, + [% IF volinfo %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return "volinfo"; // FIXME volinfo/enumchron/serial_issue_number + } + }, + [% END %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return "status"; // FIXME Display status + } + }, + { + data: "me.last_seen_date", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.last_seen_date; // FIXME Format date + } + }, + { + data: "me.checkouts_count", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.checkouts_count || 0; + } + }, + { + data: "me.renewals_count", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.renewals_count || 0; + } + }, + { + data: "me.acquisition_date", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.acquisition_date; // FIXME Format date + } + }, + { + data: "me.last_checkout_date", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.last_checkout_date; // FIXME Format date + } + }, + { + data: "me.external_id", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.external_id; // FIXME Display link to moredetail + } + }, + [% IF itemdata_uri %] + { + data: "me.uri", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.uri; // FIXME Display link + } + }, + [% END %] + [% IF ( itemdata_copynumber ) %] + { + data: "me.copy_number", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.copy_number; // FIXME Display str version + } + }, + [% END %] + [% IF ( itemdata_stocknumber ) %] + { + data: "me.inventory_number", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.inventory_number; + } + }, + [% END %] + [% IF materials %] + { + data: "me.materials_notes", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.materials_notes; + } + }, + [% END %] + [% IF ( itemdata_itemnotes ) %] + { + data: "me.public_notes", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.public_notes; // FIXME Replace \n with br + } + }, + [% END %] + [% IF itemdata_nonpublicnotes %] + { + data: "me.internal_notes", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return row.internal_notes; + } + }, + [% END %] + [% IF ( hostrecords ) %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return ""; // FIXME Display host title with link + } + }, + [% END %] + [% IF ( analyze ) %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return ""; // FIXME Display analytic count + link + } + }, + [% END %] + [% IF ( ShowCourseReserves ) %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return ""; // FIXME Display course reserves + } + }, + [% END %] + [% IF ( SpineLabelShowPrintOnBibDetails ) %] + { + data: "", + searchable: true, + orderable: true, + render: function (data, type, row, meta) { + return ""; // FIXME Print label + } + }, + [% END %] + [% IF CAN_user_editcatalogue_edit_items %] + { + data: function( row, type, val, meta ) { + let result = 'Edit + Delete'; // FIXME Add links + return result; + }, + searchable: false, + orderable: false + } + [% END %] + ], + }); [% CoverImagePlugins | $raw %] [% END %] -- 2.39.5