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 <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Katrin Fischer 2018-08-09 21:28:30 +00:00 committed by Nick Clemens
parent 45f90d9b6d
commit 2953c6c6cd
2 changed files with 15 additions and 0 deletions

View File

@ -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 @@
<th>Barcode</th>
<th>Home library</th>
<th>Last location</th>
[% IF itemdata_ccode %]
<th>Collection</th>
[% END %]
<th>Call no.</th>
<th>Copy number</th>
[% IF itemdata_enumchron %]
@ -361,6 +365,11 @@
<td>
[% Branches.GetName( itemloo.holdingbranch ) | html %]
</td>
[% IF itemdata_ccode %]
<td>
[% IF ( itemloo.ccode ) %][% AuthorisedValues.GetByCode( 'CCODE', itemloo.ccode ) %][% END %]
</td>
[% END %]
<td>
[% itemloo.itemcallnumber | html %]
</td>

View File

@ -204,6 +204,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+$|;
@ -498,6 +499,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;
@ -609,6 +614,7 @@ foreach my $biblionumber (@biblionumbers) {
optionloop => \@optionloop,
bibitemloop => \@bibitemloop,
itemdata_enumchron => $itemdata_enumchron,
itemdata_ccode => $itemdata_ccode,
date => $date,
biblionumber => $biblionumber,
findborrower => $findborrower,