Bugzilla – Attachment 153073 Details for
Bug 33954
Add Koha::Biblio->opac_summary_html
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33954: Koha::Biblio->opac_summary_html
Bug-33954-KohaBiblio-opacsummaryhtml.patch (text/plain), 1.54 KB, created by
Owen Leonard
on 2023-07-05 17:19:34 UTC
(
hide
)
Description:
Bug 33954: Koha::Biblio->opac_summary_html
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-07-05 17:19:34 UTC
Size:
1.54 KB
patch
obsolete
>From b34174a9b00a02353b555de8162767e06950adf3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jun 2023 11:38:01 +0200 >Subject: [PATCH] Bug 33954: Koha::Biblio->opac_summary_html > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > Koha/Biblio.pm | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 1627d235c3..0d120b85c2 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -1545,6 +1545,36 @@ sub ratings { > return Koha::Ratings->_new_from_dbic($rs); > } > >+=head3 opac_summary_html >+ >+ my $summary_html = $biblio->opac_summary_html >+ >+Based on the syspref OPACMySummaryHTML, returns a string representing the >+summary of this bibliographic record. >+{AUTHOR}, {TITLE}, {ISBN} and {BIBLIONUMBER} will be replaced. >+ >+=cut >+ >+sub opac_summary_html { >+ my ($self) = @_; >+ >+ my $summary_html = C4::Context->preference('OPACMySummaryHTML'); >+ return q{} unless $summary_html; >+ my $author = $self->author || q{}; >+ my $title = $self->title || q{}; >+ $title =~ s/\/+$//; # remove trailing slash >+ $title =~ s/\s+$//; # remove trailing space >+ my $normalized_isbn = $self->normalized_isbn || q{}; >+ my $biblionumber = $self->biblionumber; >+ >+ $summary_html =~ s/{AUTHOR}/$author/g; >+ $summary_html =~ s/{TITLE}/$title/g; >+ $summary_html =~ s/{ISBN}/$normalized_isbn/g; >+ $summary_html =~ s/{BIBLIONUMBER}/$biblionumber/g; >+ >+ return $summary_html; >+} >+ > =head2 Internal methods > > =head3 type >-- >2.30.2
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 33954
:
152150
|
152151
|
153072
|
153073
|
153413
|
153414