From 08ef42582fea11a4283a386ce6744939ee574e22 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 2 Jun 2020 11:27:02 +0400 Subject: [PATCH] Bug 25650: Add location and itype descriptions in ILS-DI GetRecords Test plan: 1. Create a record with an item, and set the item's shelving location and itemtype. 2. Go to http:///cgi-bin/koha/ilsdi.pl?service=GetRecords&id= 3. Check that there is and and that their value is correct. Signed-off-by: Arthur Suzuki Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- C4/ILSDI/Services.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 5ebba3435d..bc5cb8676d 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -246,6 +246,20 @@ sub GetRecords { $item{'homebranchname'} = $home_library ? $home_library->branchname : ''; $item{'holdingbranchname'} = $holding_library ? $holding_library->branchname : ''; + if ($item->location) { + my $authorised_value = Koha::AuthorisedValues->find_by_koha_field({ kohafield => 'items.location', authorised_value => $item->location }); + if ($authorised_value) { + $item{location_description} = $authorised_value->opac_description; + } + } + + if ($item->itype) { + my $itemtype = Koha::ItemTypes->find($item->itype); + if ($itemtype) { + $item{itype_description} = $itemtype->description; + } + } + my $transfer = $item->get_transfer; if ($transfer) { $item{transfer} = { -- 2.39.5