use C4::VirtualShelves;
use C4::XSLT;
use C4::ShelfBrowser;
+use C4::Charset;
+use MARC::Record;
+use MARC::Field;
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
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') );
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->{$_} : '' );
}