From c1ae207d54a8c075e78265d1eb47515c16daceb8 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 13 May 2008 12:32:06 -0500 Subject: [PATCH] kohabug 1621 - add subtitle to main results and details pages Including the subtitle in search results and OPAC and staff details templates. The subtitle is expected to be in the MARC subfield that is mapped to the (now nonexistant) column bibliosubtitle.subtitle. This is a fairly hackish patch that is meant to be minimally disruptive while allowing subtitles to be displayed for those not using the experimental XSLT bib display feature. It does *not* cover all cases where you have a MARC record and want to display its subtitle. UNIMARC notes: at the moment, none of the fr-FR UNIMARC frameworks appear to be map any subfields to bibliosubtitle.subtitle. This could be changed, but caveat programmer: the UNIMARC 200$e is repeatable (meaning that get_koha_field_from_marc will put in ' | ' between multiple subtitles) and one may want to also include the 200$d (parallel title). A GetMarcSubtitle routine may be in order if absolutely necessary. This points to a long-term need to make display of MARC (and later, hopefully, non-MARC) bib records more flexible - the XSLT feature is one approach; there may be others. Signed-off-by: Joshua Ferraro --- C4/Search.pm | 1 + catalogue/detail.pl | 4 +++- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl | 2 +- opac/opac-detail.pl | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 45a4a069a3..8dcfe4b8d2 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1242,6 +1242,7 @@ sub searchResults { for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] ); my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, '' ); + $oldbiblio->{subtitle} = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $marcrecord, ''); $oldbiblio->{result_number} = $i + 1; # add imageurl to itemtype if there is one diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 0eb3304aa4..f753e665d1 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -57,6 +57,7 @@ my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries($record,$marcflavour); +my $subtitle = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $record, ''); # Get Branches, Itemtypes and Locations my $branches = GetBranches(); @@ -157,7 +158,8 @@ $template->param( norequests => $norequests ); MARCNOTES => $marcnotesarray, MARCSUBJCTS => $marcsubjctsarray, MARCAUTHORS => $marcauthorsarray, - MARCSERIES => $marcseriesarray + MARCSERIES => $marcseriesarray, + subtitle => $subtitle, ); my @results = ( $dat, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 1603b26ad6..3f97394c2e 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -56,7 +56,7 @@ function verify_images() {
-

+

" alt="" title=""> , diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index d881bbaa3c..3c72873b34 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -163,6 +163,7 @@ my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); +my $subtitle = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $record, ''); $template->param( MARCNOTES => $marcnotesarray, @@ -176,6 +177,7 @@ my $marcurlsarray = GetMarcUrls ($record,$marcflavour); itemdata_enumchron => $itemfields{enumchron}, itemdata_copynumber => $itemfields{copynumber}, authorised_value_images => $biblio_authorised_value_images, + subtitle => $subtitle, ); foreach ( keys %{$dat} ) { -- 2.39.5