From 974bcdf260dc1892a75e8798f76a2fd5d654a5a0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 25 Aug 2016 10:41:52 +0100 Subject: [PATCH] Bug 17193: Remove C4::Search::SearchAcquisitions This subroutine is not used and can be removed Test plan: git grep SearchAcquisitions should not return any results. Signed-off-by: Claire Gravely Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- C4/Search.pm | 89 ---------------------------------------------------- 1 file changed, 89 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 22e57184ea..a1296f9171 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2282,95 +2282,6 @@ sub searchResults { return @newresults; } -=head2 SearchAcquisitions - Search for acquisitions -=cut - -sub SearchAcquisitions{ - my ($datebegin, $dateend, $itemtypes,$criteria, $orderby) = @_; - - my $dbh=C4::Context->dbh; - # Variable initialization - my $str=qq| - SELECT marcxml - FROM biblio - LEFT JOIN biblioitems ON biblioitems.biblionumber=biblio.biblionumber - LEFT JOIN items ON items.biblionumber=biblio.biblionumber - WHERE dateaccessioned BETWEEN ? AND ? - |; - - my (@params,@loopcriteria); - - push @params, $datebegin->output("iso"); - push @params, $dateend->output("iso"); - - if (scalar(@$itemtypes)>0 and $criteria ne "itemtype" ){ - if(C4::Context->preference("item-level_itypes")){ - $str .= "AND items.itype IN (?".( ',?' x scalar @$itemtypes - 1 ).") "; - }else{ - $str .= "AND biblioitems.itemtype IN (?".( ',?' x scalar @$itemtypes - 1 ).") "; - } - push @params, @$itemtypes; - } - - if ($criteria =~/itemtype/){ - if(C4::Context->preference("item-level_itypes")){ - $str .= "AND items.itype=? "; - }else{ - $str .= "AND biblioitems.itemtype=? "; - } - - if(scalar(@$itemtypes) == 0){ - my $itypes = GetItemTypes(); - for my $key (keys %$itypes){ - push @$itemtypes, $key; - } - } - - @loopcriteria= @$itemtypes; - }elsif ($criteria=~/itemcallnumber/){ - $str .= "AND (items.itemcallnumber LIKE CONCAT(?,'%') - OR items.itemcallnumber is NULL - OR items.itemcallnumber = '')"; - - @loopcriteria = ("AA".."ZZ", "") unless (scalar(@loopcriteria)>0); - }else { - $str .= "AND biblio.title LIKE CONCAT(?,'%') "; - @loopcriteria = ("A".."z") unless (scalar(@loopcriteria)>0); - } - - if ($orderby =~ /date_desc/){ - $str.=" ORDER BY dateaccessioned DESC"; - } else { - $str.=" ORDER BY title"; - } - - my $qdataacquisitions=$dbh->prepare($str); - - my @loopacquisitions; - foreach my $value(@loopcriteria){ - push @params,$value; - my %cell; - $cell{"title"}=$value; - $cell{"titlecode"}=$value; - - eval{$qdataacquisitions->execute(@params);}; - - if ($@){ warn "recentacquisitions Error :$@";} - else { - my @loopdata; - while (my $data=$qdataacquisitions->fetchrow_hashref){ - push @loopdata, {"summary"=>GetBiblioSummary( $data->{'marcxml'} ) }; - } - $cell{"loopdata"}=\@loopdata; - } - push @loopacquisitions,\%cell if (scalar(@{$cell{loopdata}})>0); - pop @params; - } - $qdataacquisitions->finish; - return \@loopacquisitions; -} - =head2 enabled_staff_search_views %hash = enabled_staff_search_views() -- 2.39.5