@@ -, +, @@ --- C4/ShelfBrowser.pm | 23 ++++++++-------------- .../bootstrap/en/includes/shelfbrowser.inc | 4 ++++ 2 files changed, 12 insertions(+), 15 deletions(-) --- a/C4/ShelfBrowser.pm +++ a/C4/ShelfBrowser.pm @@ -25,6 +25,7 @@ use warnings; use C4::Biblio; use C4::Context; use C4::Koha; +use Koha::Biblios; use Koha::Libraries; use vars qw(@ISA @EXPORT @EXPORT_OK); @@ -220,10 +221,13 @@ sub GetShelfInfo { my $marcflavour = C4::Context->preference("marcflavour"); my @valid_items; for my $item ( @items ) { - my $this_biblio = GetBibData($item->{biblionumber}); - next unless defined $this_biblio; - $item->{'title'} = $this_biblio->{'title'}; - my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} }); + my $biblio = Koha::Biblios->find( $item->{biblionumber} ); + next unless defined $biblio; + + $item->{biblio_object} = $biblio; + $item->{biblionumber} = $biblio->biblionumber; + $item->{title} = $biblio->title; + my $this_record = GetMarcBiblio({ biblionumber => $biblio->biblionumber }); $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour); $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour); $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour); @@ -234,15 +238,4 @@ sub GetShelfInfo { return @valid_items; } -# Fetches some basic biblio data needed by the shelf stuff -sub GetBibData { - my ($bibnum) = @_; - - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("SELECT biblionumber, title FROM biblio WHERE biblionumber=?"); - $sth->execute($bibnum); - my $bib = $sth->fetchrow_hashref(); - return $bib; -} - 1; --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc @@ -61,6 +61,10 @@ No cover image available [% END %] [% END %] + [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] + Cover image + [% END %] + [% END %] --