Bugzilla – Attachment 85929 Details for
Bug 22445
Ability to define a URL for custom cover images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22445: Custom cover images - opac shelfbrowser
Bug-22445-Custom-cover-images---opac-shelfbrowser.patch (text/plain), 3.19 KB, created by
Jonathan Druart
on 2019-03-01 23:12:14 UTC
(
hide
)
Description:
Bug 22445: Custom cover images - opac shelfbrowser
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-01 23:12:14 UTC
Size:
3.19 KB
patch
obsolete
>From af6441f5faff25cdd8ea59ca1fae2bcf57980caa Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 1 Mar 2019 08:00:25 -0300 >Subject: [PATCH] Bug 22445: Custom cover images - opac shelfbrowser > >Test plan: >Go to the detail page of a bibliographic record (at the OPAC) >and confirm the at custom cover images are displayed in the shelf >browser > >Sponsored-by: Orex Digital >--- > C4/ShelfBrowser.pm | 23 ++++++++-------------- > .../bootstrap/en/includes/shelfbrowser.inc | 4 ++++ > 2 files changed, 12 insertions(+), 15 deletions(-) > >diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm >index ee551d2c83..f5ba92a4fb 100644 >--- a/C4/ShelfBrowser.pm >+++ b/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; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >index 276c0d2d5c..a89edbd013 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >@@ -61,6 +61,10 @@ > <span class="no-image">No cover image available</span> > [% END %] > [% END %] >+ [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] >+ <img alt="Cover image" src="[% item.biblio_object.custom_cover_image_url | url %]" /> >+ [% END %] >+ > </a> > </td> > [% END %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22445
:
85925
|
85926
|
85927
|
85928
|
85929
|
85930
|
85931
|
85932
|
85933
|
85934
|
85935
|
85936
|
85937
|
85938
|
86214
|
86726
|
86727
|
87434
|
89973
|
89974
|
89975
|
89976
|
89977
|
89978
|
89979
|
89980
|
89981
|
89982
|
89983
|
89984
|
89985
|
89986
|
89987
|
89988
|
89989
|
89996
|
89997
|
89998
|
89999
|
90000
|
90001
|
90002
|
90003
|
90004
|
90005
|
90006
|
90007
|
90009
|
90010
|
90011
|
90012
|
90013
|
94227
|
94228
|
94229
|
94230
|
94231
|
94232
|
94233
|
94234
|
94235
|
94236
|
94237
|
94238
|
94239
|
94240
|
94241
|
94242
|
94243
|
94244
|
94559
|
94560
|
94561
|
94562
|
94563
|
94564
|
94566
|
94567
|
94568
|
94569
|
94570
|
94571
|
94572
|
94573
|
94574
|
94575
|
94576
|
94577