X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-detail.pl;h=f2308347a2805b4d15fbd80ce453aa272f62b00c;hb=9a54047b6d10eb4b553ad29c6130a1e276252fe5;hp=93edc15e8a0cd202410e5d2f0e7c471e51c1ae06;hpb=8e3fdc6d6b46bb368167b6ae2cb0ebbe590f5e00;p=koha_gimpoz diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 93edc15e8a..f2308347a2 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright 2000-2002 Katipo Communications +# Copyright 2010 BibLibre # # This file is part of Koha. # @@ -40,6 +41,9 @@ use C4::Members; use C4::VirtualShelves; use C4::XSLT; use C4::ShelfBrowser; +use C4::Charset; +use MARC::Record; +use MARC::Field; BEGIN { if (C4::Context->preference('BakerTaylorEnabled')) { @@ -70,6 +74,9 @@ if ( ! $record ) { exit; } $template->param( biblionumber => $biblionumber ); + +SetUTF8Flag($record); + # XSLT processing of some stuff if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail', 'opac') ); @@ -101,7 +108,7 @@ my $collections = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'} #coping with subscriptions my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber); -my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber ); +my @subscriptions = GetSubscriptions( undef, undef, $biblionumber ); my @subs; $dat->{'serial'}=1 if $subscriptionsnumber; @@ -222,6 +229,33 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib subtitle => $subtitle, ); +if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) { + my $fieldspec = C4::Context->preference("AlternateHoldingsField"); + my $subfields = substr $fieldspec, 3; + my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' '; + my @alternateholdingsinfo = (); + my @holdingsfields = $record->field(substr $fieldspec, 0, 3); + + for my $field (@holdingsfields) { + my %holding = ( holding => '' ); + my $havesubfield = 0; + for my $subfield ($field->subfields()) { + if ((index $subfields, $$subfield[0]) >= 0) { + $holding{'holding'} .= $holdingsep if (length $holding{'holding'} > 0); + $holding{'holding'} .= $$subfield[1]; + $havesubfield++; + } + } + if ($havesubfield) { + push(@alternateholdingsinfo, \%holding); + } + } + + $template->param( + ALTERNATEHOLDINGS => \@alternateholdingsinfo, + ); +} + foreach ( keys %{$dat} ) { $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' ); }