Bugzilla – Attachment 153042 Details for
Bug 33956
opac-user.pl should use Koha::Biblio->opac_summary_html
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33956: Use Koha::Biblio->opac_summary_html from opac-user.pl
Bug-33956-Use-KohaBiblio-opacsummaryhtml-from-opac.patch (text/plain), 4.70 KB, created by
Jonathan Druart
on 2023-07-05 09:09:47 UTC
(
hide
)
Description:
Bug 33956: Use Koha::Biblio->opac_summary_html from opac-user.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-07-05 09:09:47 UTC
Size:
4.70 KB
patch
obsolete
>From d447047bac46cd4b2bbd956acb601c355ea5b72f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Jul 2023 11:07:35 +0200 >Subject: [PATCH] Bug 33956: Use Koha::Biblio->opac_summary_html from > opac-user.pl > >This code is currently duplicated in controllers opac-readingrecord.pl and opac-user.pl. > >After bug 33949 it will be removed from opac-readingrecord.pl, and bug 33956 aims to remove it from opac-user.pl. > >Final situation will be: we have the code in a module, covered by tests \o/ > >Test plan: >Check an item out >Setup OPACMySummaryHTML ("biblionumber: {BIBLIONUMBER}" for instance) >Go to the "Your summary" at the OPAC and notice the "Links" column >Everything should work identically before and after this patch >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 +++--- > opac/opac-user.pl | 11 ----------- > 2 files changed, 3 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 3fc9f67f217..de99b178d76 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -344,7 +344,7 @@ > [% IF ( OPACFinesTab ) %] > <th>Fines</th> > [% END %] >- [% IF ( OPACMySummaryHTML ) %] >+ [% IF Koha.Preference('OPACMySummaryHTML') %] > <th class="nosort">Links</th> > [% END %] > [% IF ( Koha.Preference('AllowCheckoutNotes') ) %] >@@ -525,8 +525,8 @@ > [% END %] > </td> > [% END %] >- [% IF ( OPACMySummaryHTML ) %] >- <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td> >+ [% IF Koha.Preference('OPACMySummaryHTML') %] >+ <td class="links">[% ISSUE.biblio_object.opac_summary_html| $raw %]</td> > [% END %] > [% IF ( Koha.Preference('AllowCheckoutNotes') ) %] > <td> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index bc04c520a80..f5588c0aa35 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -178,7 +178,6 @@ $template->param( > amountoutstanding => $amountoutstanding, > borrowernumber => $borrowernumber, > patron_flagged => $borr->{flagged}, >- OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0, > surname => $borr->{surname}, > RENEW_ERROR => $renew_error, > borrower => $borr, >@@ -306,16 +305,6 @@ if ( $pending_checkouts->count ) { # Useless test > $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') ); > $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') ); > } >- # My Summary HTML >- if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){ >- $issue->{author} ? $my_summary_html =~ s/{AUTHOR}/$issue->{author}/g : $my_summary_html =~ s/{AUTHOR}//g; >- $issue->{title} =~ s/\/+$//; # remove trailing slash >- $issue->{title} =~ s/\s+$//; # remove trailing space >- $issue->{title} ? $my_summary_html =~ s/{TITLE}/$issue->{title}/g : $my_summary_html =~ s/{TITLE}//g; >- $issue->{isbn} ? $my_summary_html =~ s/{ISBN}/$isbn/g : $my_summary_html =~ s/{ISBN}//g; >- $issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g; >- $issue->{MySummaryHTML} = $my_summary_html; >- } > > if ( C4::Context->preference('UseRecalls') ) { > my $maybe_recalls = Koha::Recalls->search({ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 }); >-- >2.25.1
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 33956
:
153042
|
153074
|
153415