From 2152d95b3c6b0be2849ef75ca1972fa517022fe7 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 25 Aug 2009 11:53:50 +0200 Subject: [PATCH] (bug #3550) use GetRecordValue to retrieve subtitle This patch, is the first use of GetRecordValue, that use the Field mapping. It retrieve the subtitle in Intranet using it, instead of the use an old function that doesn't work anymore. This is a way to made koha more generic with each framework. Signed-off-by: Henri-Damien LAURENT --- C4/Search.pm | 18 ++++++++++++--- catalogue/detail.pl | 2 +- .../prog/en/modules/catalogue/detail.tmpl | 2 +- .../prog/en/modules/catalogue/results.tmpl | 22 +++++-------------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a883289e76..2c5085039c 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1184,12 +1184,24 @@ sub searchResults { else { $times = $hits; # FIXME: if $hits is undefined, why do we want to equal it? } - my $marcflavour = C4::Context->preference("marcflavour"); + my $marcflavour = C4::Context->preference("marcflavour"); + + # We get the biblionumber position in MARC + my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblio.biblionumber',''); + my $fw; + # loop through all of the records we've retrieved 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, ''); + + if ($bibliotag<10){ + $fw = GetFrameworkCode($marcrecord->field($bibliotag)->data); + }else{ + $fw = GetFrameworkCode($marcrecord->subfield($bibliotag,$bibliosubf)); + } + + my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, $fw ); + $oldbiblio->{subtitle} = GetRecordValue('subtitle', $marcrecord, $fw); $oldbiblio->{result_number} = $i + 1; # add imageurl to itemtype if there is one diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 9d11368b1a..a615f1605d 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -66,7 +66,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, ''); +my $subtitle = GetRecordValue('subtitle', $record, $fw); # Get Branches, Itemtypes and Locations my $branches = GetBranches(); 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 6df283bc89..fca4cf89e8 100644 --- 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="">

By ">

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index a3ea38415f..098e86d6bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -340,24 +340,14 @@ function yuiZ3950button() {

. - - "> + "> + "> + "> + "> + No title - + , , , - - "> - - , , - - "> - No title - , , - - "> - No title - , , -

-- 2.39.5