From f995fbfc6f09f520ec140a99c09acce5328f552e Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 9 Aug 2018 21:28:30 +0000 Subject: [PATCH] Bug 20450: Add collection to item table when placing a hold on a specific copy (Intranet) This patch adds a new collection column to the item table when selecting a specific item for a hold. The column will only appear if at least one item has a collection set. To test, in staff: - Place a specific hold on - a record with one or more items with collections - a record with one or more items without collections - Verify the collections display correctly when they exist - Verify the table still works as expected Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/reserve/request.tt | 9 +++++++++ reserve/request.pl | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 68ed8a69a9..46f99daf9f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -5,6 +5,7 @@ [% USE Branches %] [% USE Categories %] [% USE ItemTypes %] +[% USE AuthorisedValues %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] [% UNLESS ( multi_hold ) %] @@ -292,6 +293,9 @@ Barcode Home library Last location + [% IF itemdata_ccode %] + Collection + [% END %] Call no. Copy number [% IF itemdata_enumchron %] @@ -359,6 +363,11 @@ [% Branches.GetName( itemloo.holdingbranch ) | html %] + [% IF itemdata_ccode %] + + [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetByCode( 'CCODE', itemloo.ccode ) %][% END %] + + [% END %] [% itemloo.itemcallnumber | html %] diff --git a/reserve/request.pl b/reserve/request.pl index 3ebd8733bc..10b167933f 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -203,6 +203,7 @@ my $patron = Koha::Patrons->find( $borrowernumber_hold ); my $logged_in_patron = Koha::Patrons->find( $borrowernumber ); my $itemdata_enumchron = 0; +my $itemdata_ccode = 0; my @biblioloop = (); foreach my $biblionumber (@biblionumbers) { next unless $biblionumber =~ m|^\d+$|; @@ -497,6 +498,10 @@ foreach my $biblionumber (@biblionumbers) { if ($item->{enumchron}) { $itemdata_enumchron = 1; } + # Show collection when needed + if ($item->{ccode}) { + $itemdata_ccode = 1; + } } push @{ $biblioitem->{itemloop} }, $item; @@ -608,6 +613,7 @@ foreach my $biblionumber (@biblionumbers) { optionloop => \@optionloop, bibitemloop => \@bibitemloop, itemdata_enumchron => $itemdata_enumchron, + itemdata_ccode => $itemdata_ccode, date => $date, biblionumber => $biblionumber, findborrower => $findborrower, -- 2.19.1