Lines 1169-1192
sub GetMarcSubfieldStructure {
Link Here
|
1169 |
|
1169 |
|
1170 |
=head2 GetMarcFromKohaField |
1170 |
=head2 GetMarcFromKohaField |
1171 |
|
1171 |
|
1172 |
( $field,$subfield ) = GetMarcFromKohaField( $kohafield ); |
1172 |
my ( $field, $subfield ) = GetMarcFromKohaField($kohafield); |
1173 |
@fields = GetMarcFromKohaField( $kohafield ); |
1173 |
my ( $f1, $sf1, $f2, $sf2 ) = GetMarcFromKohaField($kohafield); |
1174 |
$field = GetMarcFromKohaField( $kohafield ); |
|
|
1175 |
|
1174 |
|
1176 |
Returns the MARC fields & subfields mapped to $kohafield. |
1175 |
Returns list of MARC fields and subfields mapped to $kohafield. |
1177 |
Since the Default framework is considered as authoritative for such |
1176 |
Since the Default framework is considered as authoritative for such |
1178 |
mappings, the former frameworkcode parameter is obsoleted. |
1177 |
mappings, the former frameworkcode parameter is obsoleted. |
1179 |
|
1178 |
|
1180 |
In list context all mappings are returned; there can be multiple |
1179 |
NOTE: There may be multiple mappings! In the first example above |
1181 |
mappings. Note that in the above example you could miss a second |
1180 |
you could miss the second mapping (altough only a few of these |
1182 |
mappings in the first call. |
1181 |
will normally exist). |
1183 |
In scalar context only the field tag of the first mapping is returned. |
1182 |
Calling in scalar context has been deprecated as of 10/2023. |
1184 |
|
1183 |
|
1185 |
=cut |
1184 |
=cut |
1186 |
|
1185 |
|
1187 |
sub GetMarcFromKohaField { |
1186 |
sub GetMarcFromKohaField { |
1188 |
my ( $kohafield ) = @_; |
1187 |
my ($kohafield) = @_; |
|
|
1188 |
warn "GetMarcFromKohaField: framework parameter has been obsoleted for long" if @_ > 1; # TODO Remove later |
1189 |
return unless $kohafield; |
1189 |
return unless $kohafield; |
|
|
1190 |
|
1190 |
# The next call uses the Default framework since it is AUTHORITATIVE |
1191 |
# The next call uses the Default framework since it is AUTHORITATIVE |
1191 |
# for all Koha to MARC mappings. |
1192 |
# for all Koha to MARC mappings. |
1192 |
my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework |
1193 |
my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework |
Lines 1194-1200
sub GetMarcFromKohaField {
Link Here
|
1194 |
foreach( @{ $mss->{$kohafield} } ) { |
1195 |
foreach( @{ $mss->{$kohafield} } ) { |
1195 |
push @retval, $_->{tagfield}, $_->{tagsubfield}; |
1196 |
push @retval, $_->{tagfield}, $_->{tagsubfield}; |
1196 |
} |
1197 |
} |
1197 |
return wantarray ? @retval : ( @retval ? $retval[0] : undef ); |
1198 |
return @retval; |
1198 |
} |
1199 |
} |
1199 |
|
1200 |
|
1200 |
=head2 GetMarcSubfieldStructureFromKohaField |
1201 |
=head2 GetMarcSubfieldStructureFromKohaField |