Bug 19940: Koha::Biblio - Remove GetBiblioItemInfosOf

This subroutine is only used once and can be replaced easily with a
Koha::Biblioitems->search call

Test plan:
Test this on top of bug 19941 and confirm that the correct item types
are displayed

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-01-09 13:58:53 -03:00
parent cb336e633b
commit 2ebc2aa6e2
2 changed files with 10 additions and 25 deletions

View File

@ -68,7 +68,6 @@ BEGIN {
GetBiblioData
GetMarcBiblio
GetBiblioItemData
GetBiblioItemInfosOf
&GetRecordValue
@ -885,28 +884,6 @@ sub GetISBDView {
return $res;
}
=head2 GetBiblioItemInfosOf
GetBiblioItemInfosOf(@biblioitemnumbers);
=cut
sub GetBiblioItemInfosOf {
my @biblioitemnumbers = @_;
my $biblioitemnumber_values = @biblioitemnumbers ? join( ',', @biblioitemnumbers ) : "''";
my $dbh = C4::Context->dbh;
my $query = "
SELECT biblioitemnumber,
publicationyear,
itemtype
FROM biblioitems
WHERE biblioitemnumber IN ($biblioitemnumber_values)
";
return $dbh->selectall_hashref($query, 'biblioitemnumber');
}
=head1 FUNCTIONS FOR HANDLING MARC MANAGEMENT
=head2 IsMarcStructureInternal

View File

@ -316,8 +316,16 @@ foreach my $biblionumber (@biblionumbers) {
## Should be same as biblionumber
my @biblioitemnumbers = keys %itemnumbers_of_biblioitem;
## Hash of biblioitemnumber to 'biblioitem' table records
my $biblioiteminfos_of = GetBiblioItemInfosOf(@biblioitemnumbers);
my $biblioiteminfos_of = {
map {
my $biblioitem = $_;
( $biblioitem->{biblioitemnumber} => $biblioitem )
} @{ Koha::Biblioitems->search(
{ biblioitemnumber => { -in => \@biblioitemnumbers } },
{ select => ['biblioitemnumber', 'publicationyear', 'itemtype']}
)->unblessed
}
};
my $frameworkcode = GetFrameworkCode( $biblionumber );
my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode });