From f683c181acdd0e7c285f6930c2067b6f20ff00a4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 24 Oct 2018 15:31:02 -0300 Subject: [PATCH] Bug 21650: Remove the subroutine C4::Items::GetLastAcquisitions C4::Items::GetLastAcquisitions has been added by commit 7753bbad4fb4df47c8fb4f959fc68764a71cb623 Adding Some new functions (?) Apparently it has never been used, we should remove it to avoid unnecessary maintenance. Test plan: git grep GetLastAcquisitions must not return any results NOTE: POD Coverage test failure is expected on removal Signed-off-by: Mark Tompsett Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- C4/Items.pm | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 8f3ef33469..ec2c0a4a6e 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -47,7 +47,6 @@ BEGIN { ItemSafeToDelete DelItemCheck MoveItemFromBiblio - GetLastAcquisitions CartToShelf ShelfToCart GetAnalyticsCount @@ -1177,57 +1176,6 @@ sub GetHostItemsInfo { return @returnitemsInfo; } -=head2 GetLastAcquisitions - - my $lastacq = GetLastAcquisitions({'branches' => ('branch1','branch2'), - 'itemtypes' => ('BK','BD')}, 10); - -=cut - -sub GetLastAcquisitions { - my ($data,$max) = @_; - - my $itemtype = C4::Context->preference('item-level_itypes') ? 'itype' : 'itemtype'; - - my $number_of_branches = @{$data->{branches}}; - my $number_of_itemtypes = @{$data->{itemtypes}}; - - - my @where = ('WHERE 1 '); - $number_of_branches and push @where - , 'AND holdingbranch IN (' - , join(',', ('?') x $number_of_branches ) - , ')' - ; - - $number_of_itemtypes and push @where - , "AND $itemtype IN (" - , join(',', ('?') x $number_of_itemtypes ) - , ')' - ; - - my $query = "SELECT biblio.biblionumber as biblionumber, title, dateaccessioned - FROM items RIGHT JOIN biblio ON (items.biblionumber=biblio.biblionumber) - RIGHT JOIN biblioitems ON (items.biblioitemnumber=biblioitems.biblioitemnumber) - @where - GROUP BY biblio.biblionumber - ORDER BY dateaccessioned DESC LIMIT $max"; - - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare($query); - - $sth->execute((@{$data->{branches}}, @{$data->{itemtypes}})); - - my @results; - while( my $row = $sth->fetchrow_hashref){ - push @results, {date => $row->{dateaccessioned} - , biblionumber => $row->{biblionumber} - , title => $row->{title}}; - } - - return @results; -} - =head2 get_hostitemnumbers_of my @itemnumbers_of = get_hostitemnumbers_of($biblionumber); -- 2.39.5