From 4ed8a5351c21cae05239959a4a8fa8cfff28ac37 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 15 Oct 2014 14:39:06 -0400 Subject: [PATCH] [PASSED QA] Bug 13083 - Hard-coded " by " in opac-tags.pl The OPAC's list of a logged-in user's tagged titles displays title and author, which for some reason are combined in the script into one variable. I can't see any reason to do it this way. This patch modifies the script so that title and author are passed as separate variables. In addition, subtitle is now passed as well. To test you must log into the OPAC as a user who has tagged multiple titles, at least one of which should have an author and at least one with a subtitle. View the list of tagged titles and confirm that this information is being displayed correctly. Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Works as described, passes tests and QA script. --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt | 2 +- opac/opac-tags.pl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt index 8e9a477..2811bd0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt @@ -126,7 +126,7 @@ Title: - [% MY_TAG.bib_summary |html %] + [% MY_TAG.title |html %][% IF ( MY_TAG.subtitle ) %][% FOREACH subtitle IN MY_TAG.subtitle %] [% subtitle.subfield |html %][% END %][% END %] [% IF ( MY_TAG.author ) %]by [% MY_TAG.author %][% END %] Date added: diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index 1810ed3..6c402a5 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -228,8 +228,10 @@ if ($loggedinuser) { $my_tags = get_tag_rows({borrowernumber=>$loggedinuser}); foreach (@$my_tags) { my $biblio = GetBiblioData($_->{biblionumber}); - $_->{bib_summary} = $biblio->{title}; - ($biblio->{author}) and $_->{bib_summary} .= " by " . $biblio->{author}; + my $record = &GetMarcBiblio( $_->{biblionumber} ); + $_->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $_->{biblionumber} ) ); + $_->{title} = $biblio->{title}; + $_->{author} = $biblio->{author}; my $date = $_->{date_created} || ''; $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; $_->{time_created_display} = $1; -- 1.9.1