From f474ca509581d988919b4fcb004ceb77f3d8a850 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 Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- C4/XSLT.pm | 10 +++++++--- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 7 +++++-- .../prog/en/xslt/MARC21slim2intranetResults.xsl | 7 +++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index dd13c501bc..1ee548887f 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 873db930f0..64d7a01791 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 2019142f40..972e484d45 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.39.5