From 73f402e4b627e0ed1fd2a52dffb1e497953ac09c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 18 Apr 2016 17:28:36 +0000 Subject: [PATCH] Bug 14377 - Don't replace 942$n with authorised value except when using UNIMARC --- C4/XSLT.pm | 10 +++++++--- .../intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl | 7 +++++-- .../intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl | 7 +++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index dd13c50..1ee5488 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -75,6 +75,7 @@ sub transformMARCXML4XSLT { @fields = $record->fields(); }; if ($@) { warn "PROBLEM WITH RECORD"; next; } + my $marcflavour = C4::Context->preference('marcflavour'); my $av = getAuthorisedValues4MARCSubfields($frameworkcode); foreach my $tag ( keys %$av ) { foreach my $field ( $record->field( $tag ) ) { @@ -82,8 +83,11 @@ sub transformMARCXML4XSLT { my @new_subfields = (); for my $subfield ( $field->subfields() ) { my ( $letter, $value ) = @$subfield; - $value = GetAuthorisedValueDesc( $tag, $letter, $value, '', $tagslib ) - if $av->{ $tag }->{ $letter }; + # Replace the field value with the authorised value *except* for 942$n ( record supression ) + if ( $tag ne '942' && $subfield ne 'n' && $marcflavour ne 'UNIMARC' ) { + $value = GetAuthorisedValueDesc( $tag, $letter, $value, '', $tagslib ) + if $av->{ $tag }->{ $letter }; + } push( @new_subfields, $letter, $value ); } $field ->replace_with( MARC::Field->new( @@ -206,7 +210,7 @@ sub XSLTParse4Display { UseControlNumber IntranetBiblioDefaultView BiblioDefaultView OPACItemLocation DisplayIconsXSLT AlternateHoldingsField AlternateHoldingsSeparator - TrackClicks opacthemes IdRef / ) + TrackClicks opacthemes IdRefi OpacSuppression / ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 873db93..64d7a01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -27,6 +27,7 @@ + { @@ -91,8 +92,10 @@ - - - Suppressed in OPAC + + + - Suppressed in OPAC + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 2019142..972e484 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -28,6 +28,7 @@ + @@ -282,8 +283,10 @@ - - - Suppressed in OPAC + + + - Suppressed in OPAC + -- 2.1.4