From 503dd6036974b4208bd5cd60a87bb28599987f45 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 26 Aug 2015 10:54:30 +0200 Subject: [PATCH] Bug 14766: Complete cataloguing plugin unimarc_field_4XX Add subfields l, n and o for better UNIMARC compliance Signed-off-by: Chris Cormack Note: I just did a code audit here, as I don't know enough about UNIMARC to know if the 4XX fields should have these subfields. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- cataloguing/value_builder/unimarc_field_4XX.pl | 18 ++++++++++++++++++ .../value_builder/unimarc_field_4XX.tt | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index 56b5e14866..a3786186f9 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -241,6 +241,18 @@ sub plugin { $subfield_value_i = $marcrecord->field('500')->subfield("i"); } + my $subfield_value_l; + $subfield_value_l = $marcrecord->field('200')->subfield("d") + if ( $marcrecord->field('200') ); + + my $subfield_value_n; + $subfield_value_n = $marcrecord->field('210')->subfield("c") + if ( $marcrecord->field('210') ); + + my $subfield_value_o; + $subfield_value_o = $marcrecord->field('200')->subfield("e") + if ( $marcrecord->field('200') ); + my $subfield_value_p; $subfield_value_p = $marcrecord->field('215')->subfield("a") if ( $marcrecord->field('215') ); @@ -301,6 +313,9 @@ sub plugin { $subfield_value_e =~ s/'/\\'/g; $subfield_value_h =~ s/'/\\'/g; $subfield_value_i =~ s/'/\\'/g; + $subfield_value_l =~ s/'/\\'/g; + $subfield_value_n =~ s/'/\\'/g; + $subfield_value_o =~ s/'/\\'/g; $subfield_value_p =~ s/'/\\'/g; $subfield_value_t =~ s/'/\\'/g; $subfield_value_u =~ s/'/\\'/g; @@ -319,6 +334,9 @@ sub plugin { subfield_value_e => "$subfield_value_e", subfield_value_h => "$subfield_value_h", subfield_value_i => "$subfield_value_i", + subfield_value_l => "$subfield_value_l", + subfield_value_n => "$subfield_value_n", + subfield_value_o => "$subfield_value_o", subfield_value_p => "$subfield_value_p", subfield_value_t => "$subfield_value_t", subfield_value_u => "$subfield_value_u", diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt index 447257ae5b..868a839618 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt @@ -48,6 +48,15 @@ if(code.value == 'i'){ subfield.value = "[% subfield_value_i |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"; } + if(code.value == 'l'){ + subfield.value = "[% subfield_value_l %]"; + } + if(code.value == 'n'){ + subfield.value = "[% subfield_value_n %]"; + } + if(code.value == 'o'){ + subfield.value = "[% subfield_value_o %]"; + } if(code.value == 'p'){ subfield.value = "[% subfield_value_p |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"; } -- 2.39.5