Bug 21650: Remove the subroutine C4::Items::GetLastAcquisitions
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 24 Oct 2018 18:31:02 +0000 (15:31 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 5 Nov 2018 14:41:11 +0000 (14:41 +0000)
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 <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/Items.pm

index 8f3ef33..ec2c0a4 100644 (file)
@@ -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);