Bugzilla – Attachment 164309 Details for
Bug 33568
Use the REST API to display items on the staff biblio detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33568: Starting up
Bug-33568-Starting-up.patch (text/plain), 14.80 KB, created by
Jonathan Druart
on 2024-04-03 07:37:25 UTC
(
hide
)
Description:
Bug 33568: Starting up
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-04-03 07:37:25 UTC
Size:
14.80 KB
patch
obsolete
>From 2252f253327857c02ef3a6fd2669ce14cd6e26b6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 13 Apr 2023 12:26:48 +0200 >Subject: [PATCH] Bug 33568: Starting up >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Copying the same thead and making a new table using the REST API >endpoint > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> >--- > .../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 0c1d677ad97..af97ac28643 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" %] >+ <table id="table_items"> >+ <thead> >+ [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %] >+ [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] >+ <th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th> >+ [% END %] >+ [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %] >+ <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> >+ <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> >+ [% IF ( itemdata_ccode ) %]<th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>[% END %] >+ [% IF Koha.Preference('EnableItemGroups') %] >+ <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th> >+ [% END %] >+ <th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th> >+ [% IF volinfo %] >+ <th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th> >+ [% END %] >+ <th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th> >+ <th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th> >+ <th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th> >+ <th id="[% tab | html %]_renewals" data-colname="[% tab | html %]_renewals">Renewals</th> >+ <th id="[% tab | html %]_dateaccessioned" data-colname="[% tab | html %]_dateaccessioned">Date accessioned</th> >+ <th id="[% tab | html %]_datelastborrowed" data-colname="[% tab | html %]_datelastborrowed">Date last borrowed</th> >+ <th id="[% tab | html %]_barcode" data-colname="[% tab | html %]_barcode">Barcode</th> >+ [% IF ( itemdata_uri ) %]<th id="[% tab | html %]_uri" data-colname="[% tab | html %]_uri">URL</th>[% END %] >+ [% IF ( itemdata_copynumber ) %]<th id="[% tab | html %]_copynumber" data-colname="[% tab | html %]_copynumber">Copy number</th>[% END %] >+ [% IF ( itemdata_stocknumber ) %]<th id="[% tab | html %]_stocknumber" data-colname="[% tab | html %]_stocknumber">Inventory number</th>[% END %] >+ [% IF materials %]<th id="[% tab | html %]_materials" data-colname="[% tab | html %]_materials">Materials specified</th>[% END %] >+ [% IF ( itemdata_itemnotes ) %]<th id="[% tab | html %]_itemnotes" data-colname="[% tab | html %]_itemnotes">Public notes</th>[% END %] >+ [% IF ( itemdata_nonpublicnotes ) %]<th id="[% tab | html %]_itemnotes_nonpublic" data-colname="[% tab | html %]_itemnotes_nonpublic">Non-public notes</th>[% END %] >+ [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %] >+ [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %] >+ [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %] >+ [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %] >+ [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort noExport"> </th>[% END %] >+ </tr> >+ </thead> >+ </table> > [% END %] >+ > [% IF ( hiddencount ) %] > <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&showallitems=1">Show all items ([% hiddencount | html %] hidden)</a> > [% 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 ('<input type="checkbox" value="%s" name="itemnumber" />'.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 %] >+ ], >+ }); > </script> > [% CoverImagePlugins | $raw %] > [% END %] >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33568
:
151339
|
153791
|
164308
|
164309
|
164310
|
164311
|
164312
|
164313
|
164314
|
164315
|
164316
|
164317
|
164318
|
164319
|
164320
|
164321
|
164322
|
164323
|
164324
|
164325
|
164326
|
164327
|
164328
|
164329
|
164330
|
164331
|
164332
|
164333
|
164334
|
164335
|
164336
|
164337
|
164338
|
164339
|
164340
|
164341
|
164342
|
164343
|
164344
|
164345
|
164346
|
164347
|
164348
|
164349
|
164350
|
164351
|
164352
|
164353
|
164354
|
164355
|
164356
|
164358
|
164359
|
164360
|
164361
|
164362
|
164363
|
164364
|
164365
|
164366
|
164367
|
164368
|
164369
|
164370
|
164371
|
164372
|
164373
|
164374
|
164472
|
164480
|
164482
|
164483
|
164485
|
164528