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 <claire_gravely@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
470d76c635
commit
974bcdf260
1 changed files with 0 additions and 89 deletions
89
C4/Search.pm
89
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()
|
||||
|
|
Loading…
Reference in a new issue