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