Lines 1992-2002
sub TransformKohaToMarc {
Link Here
|
1992 |
my $tagsubfield = $fld->{tagsubfield}; |
1992 |
my $tagsubfield = $fld->{tagsubfield}; |
1993 |
next if !$tagfield; |
1993 |
next if !$tagfield; |
1994 |
|
1994 |
|
1995 |
# BZ 21800: split value if field is repeatable; NOTE that this also |
1995 |
# BZ 21800: split value if field is repeatable. |
1996 |
# depends on the Default framework. |
1996 |
my @values = _check_split($params, $fld, $value) |
1997 |
my @values = $params->{no_split} || !$fld->{repeatable} |
1997 |
? split(/\s?\|\s?/, $value, -1) |
1998 |
? ( $value ) |
1998 |
: ( $value ); |
1999 |
: split(/\s?\|\s?/, $value, -1); |
|
|
2000 |
foreach my $value ( @values ) { |
1999 |
foreach my $value ( @values ) { |
2001 |
next if $value eq ''; |
2000 |
next if $value eq ''; |
2002 |
$tag_hr->{$tagfield} //= []; |
2001 |
$tag_hr->{$tagfield} //= []; |
Lines 2017-2022
sub TransformKohaToMarc {
Link Here
|
2017 |
return $record; |
2016 |
return $record; |
2018 |
} |
2017 |
} |
2019 |
|
2018 |
|
|
|
2019 |
sub _check_split { |
2020 |
my ($params, $fld, $value) = @_; |
2021 |
return if index($value,'|') == -1; # nothing to worry about |
2022 |
return if $params->{no_split}; |
2023 |
|
2024 |
# if we did not get a specific framework, check default in $mss |
2025 |
return $fld->{repeatable} if !$params->{framework}; |
2026 |
|
2027 |
# here we need to check the specific framework |
2028 |
my $mss = Koha::MarcSubfieldStructures->find( $params->{framework}, $fld->{tagfield}, $fld->{tagsubfield} ); |
2029 |
return 1 if $mss && $mss->repeatable; |
2030 |
} |
2031 |
|
2020 |
=head2 PrepHostMarcField |
2032 |
=head2 PrepHostMarcField |
2021 |
|
2033 |
|
2022 |
$hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour ) |
2034 |
$hostfield = PrepHostMarcField ( $hostbiblionumber,$hostitemnumber,$marcflavour ) |