Bugzilla – Attachment 141593 Details for
Bug 31732
880 titles missing from OPAC and staff interface checkout summary
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31732: Add 880 titles to OPAC checkout summary
Bug-31732-Add-880-titles-to-OPAC-checkout-summary.patch (text/plain), 3.13 KB, created by
David Cook
on 2022-10-11 00:34:43 UTC
(
hide
)
Description:
Bug 31732: Add 880 titles to OPAC checkout summary
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-10-11 00:34:43 UTC
Size:
3.13 KB
patch
obsolete
>From 6b16acb86217abd1b066235254ec513e55a2edd4 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 11 Oct 2022 00:33:44 +0000 >Subject: [PATCH] Bug 31732: Add 880 titles to OPAC checkout summary > >Written for 21.11 and not tested on master yet >--- > Koha/Biblio.pm | 19 +++++++++++++++++++ > .../bootstrap/en/modules/opac-user.tt | 3 +++ > opac/opac-user.pl | 5 +++++ > 3 files changed, 27 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 3c8e5cb4b2..d43c94d387 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -1373,6 +1373,25 @@ sub can_be_recalled { > return @items; > } > >+sub alt_graph_titles { >+ my ($class,$args) = @_; >+ my @alt_titles; >+ my $record = $args->{record}; >+ if ( C4::Context->preference('marcflavour') eq 'MARC21' ){ >+ my @fields = $record->field('880'); >+ foreach my $field (@fields){ >+ my $sub6 = $field->subfield('6'); >+ if ($sub6 && $sub6 =~ m/^245-/){ >+ my $alt_title = {}; >+ $alt_title->{title} = $field->as_string('a'); >+ $alt_title->{subtitle} = $field->as_string('b'); >+ push(@alt_titles,$alt_title); >+ } >+ } >+ } >+ return \@alt_titles; >+} >+ > =head2 Internal methods > > =head3 type >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 d131abc175..0cf4974907 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -352,6 +352,9 @@ > [% END # / IF JacketImages %] > > <td class="title"> >+ [% FOREACH alt_title IN ISSUE.alt_titles %] >+ [% INCLUDE 'biblio-title.inc' biblio=alt_title link=> 1 %] >+ [% END %] > [% INCLUDE 'biblio-title.inc' biblio=ISSUE link=> 1 %] > [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %] > >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index ba45ddd237..5241dc6841 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -286,6 +286,11 @@ if ( $pending_checkouts->count ) { # Useless test > my $marcrecord = $biblio_object->metadata->record({ embed_items => 1, opac => 1, patron => $patron,}); > $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') ); > >+ my $alt_titles = Koha::Biblio->alt_graph_titles({ record => $marcrecord }); >+ if ($alt_titles){ >+ $issue->{alt_titles} = $alt_titles; >+ } >+ > # 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; >-- >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 31732
: 141593