From 484b7ec7320b73519def7ef25487c942d93f5059 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 16 Aug 2013 15:36:10 +0000 Subject: [PATCH] bug 5825: (follow-up) consult item-level_itypes This patch teaches GetHoldsQueueItems to consult the item-level_itypes system preference and return the item-level or bib-level item type accordingly. To test: - Arrange so that an item that shows up on the holds queue report has one item type while its bib has a different one. - Run the report with item-level_itypes ON. Verify that the item-level item type is displayed. - Change item-level_itypes to OFF. Run the report again and verify that the bib-level item type is displayed. Signed-off-by: Galen Charlton --- C4/HoldsQueue.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 1242fc578f..094fbe7b8c 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -119,7 +119,7 @@ sub GetHoldsQueueItems { my $dbh = C4::Context->dbh; my @bind_params = (); - my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber + my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, biblioitems.itemtype, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber FROM tmp_holdsqueue JOIN biblio USING (biblionumber) LEFT JOIN biblioitems USING (biblionumber) @@ -141,6 +141,13 @@ sub GetHoldsQueueItems { $row->{parts} = GetRecordValue('parts',$record,'')->[0]->{subfield}; $row->{numbers} = GetRecordValue('numbers',$record,'')->[0]->{subfield}; } + + # return the bib-level or item-level itype per syspref + if (!C4::Context->preference('item-level_itypes')) { + $row->{itype} = $row->{itemtype}; + } + delete $row->{itemtype}; + push @$items, $row; } return $items; -- 2.20.1