Bug 22445: Add new method Koha::Biblio->custom_cover_image_url

Sponsored-by: Orex Digital
Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Kyle Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-03-01 08:00:53 -03:00 committed by Martin Renvoize
parent 6f4994ff4d
commit be16257197
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -659,6 +659,29 @@ sub is_serial {
return 0;
}
=head3 custom_cover_image_url
my $image_url = $biblio->custom_cover_image_url
Return the specific url of the cover image for this bibliographic record.
It is built regaring the value of the system preference CustomCoverImagesURL
=cut
sub custom_cover_image_url {
my ( $self ) = @_;
my $url = C4::Context->preference('CustomCoverImagesURL');
if ( $url =~ m|%isbn%| ) {
my $isbn = $self->biblioitem->isbn;
$url =~ s|%isbn%|$isbn|g;
}
if ( $url =~ m|%issn%| ) {
my $issn = $self->biblioitem->issn;
$url =~ s|%issn%|$issn|g;
}
return $url;
}
=head3 type
=cut