From 0ad6498f6213b684b3571735808c54b8a42ba539 Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Mon, 31 Jan 2022 11:29:16 +0100 Subject: [PATCH] Bug 29982: Show itemtype in holds table on patron details Show item type in the holds tables on "Check out" and "Details" tabs in the intranet. To test: - Add an item level hold - Go to patron details and look at the "Check out" tab - Click on the "Holds" horizontal tab and verify the item type is shown in a column between "Title" and "Call number" - Go to the "Details" tab - Click on the "Holds" horizontal tab and verify the display is the same as above - Make a record level hold and verify the item type is not shown in the tables described above - Check in an item from the record level hold, so it is "waiting" for the patron - Verify the item type is now shown in the same way as for the item level hold, as described above Signed-off-by: Lucas Gass --- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 1 + .../intranet-tmpl/prog/en/modules/members/moremember.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/holds.js | 5 +++++ svc/holds | 7 ++++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index a5ada8c27b..c430df1200 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -839,6 +839,7 @@ Hold date Title + Item type Call number Barcode Pickup at diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 951c3e1023..7183030daf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -775,6 +775,7 @@ Hold date Title + Item type Call number Barcode Pickup at diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index 20ada49226..68ce82a7a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -168,6 +168,11 @@ $(document).ready(function() { return title; } }, + { + "mDataProp": function( oObj ) { + return oObj.itemtype_descr && oObj.itemtype_descr.escapeHtml() || ""; + } + }, { "mDataProp": function( oObj ) { return oObj.itemcallnumber && oObj.itemcallnumber.escapeHtml() || ""; diff --git a/svc/holds b/svc/holds index 77c260ff27..c30eda3062 100755 --- a/svc/holds +++ b/svc/holds @@ -132,9 +132,14 @@ while ( my $h = $holds_rs->next() ) { $hold->{not_transfered} = 0; if ($item) { + + my $effective_itemtype = $item->effective_itemtype(); + my $itemtype_obj = Koha::ItemTypes->find( $effective_itemtype ); + $hold->{itemnumber} = $item->itemnumber(); $hold->{barcode} = $item->barcode(); - $hold->{itemtype} = $item->effective_itemtype(); + $hold->{itemtype} = $effective_itemtype; + $hold->{itemtype_descr} = $itemtype_obj->translated_description; $hold->{enumchron} = $item->enumchron(); $hold->{itemcallnumber} = $item->itemcallnumber() || q{}; -- 2.20.1