Lines 513-519
sub marcrecord2csv {
Link Here
|
513 |
my @fields; |
513 |
my @fields; |
514 |
while ( $content =~ m|(\d{3})\$?(.)?|g ) { |
514 |
while ( $content =~ m|(\d{3})\$?(.)?|g ) { |
515 |
my $fieldtag = $1; |
515 |
my $fieldtag = $1; |
516 |
my $subfieldtag = $2 || undef; |
516 |
my $subfieldtag = $2; |
517 |
push @fields, { fieldtag => $fieldtag, subfieldtag => $subfieldtag }; |
517 |
push @fields, { fieldtag => $fieldtag, subfieldtag => $subfieldtag }; |
518 |
} |
518 |
} |
519 |
if ( @result == 2) { |
519 |
if ( @result == 2) { |
Lines 558-564
sub marcrecord2csv {
Link Here
|
558 |
} else { |
558 |
} else { |
559 |
# If not, we get the matching tag name from koha |
559 |
# If not, we get the matching tag name from koha |
560 |
my $tag = $tags->[0]; |
560 |
my $tag = $tags->[0]; |
561 |
if ( $tag->{subfieldtag} ) { |
561 |
if (defined $tag->{subfieldtag} ) { |
562 |
my $query = "SELECT liblibrarian FROM marc_subfield_structure WHERE tagfield=? AND tagsubfield=?"; |
562 |
my $query = "SELECT liblibrarian FROM marc_subfield_structure WHERE tagfield=? AND tagsubfield=?"; |
563 |
my @results = $dbh->selectrow_array( $query, {}, $tag->{fieldtag}, $tag->{subfieldtag} ); |
563 |
my @results = $dbh->selectrow_array( $query, {}, $tag->{fieldtag}, $tag->{subfieldtag} ); |
564 |
push @marcfieldsheaders, $results[0]; |
564 |
push @marcfieldsheaders, $results[0]; |
Lines 585-591
sub marcrecord2csv {
Link Here
|
585 |
my @fields = $record->field( $tag->{fieldtag} ); |
585 |
my @fields = $record->field( $tag->{fieldtag} ); |
586 |
# If it is a subfield |
586 |
# If it is a subfield |
587 |
my @loop_values; |
587 |
my @loop_values; |
588 |
if ( $tag->{subfieldtag} ) { |
588 |
if (defined $tag->{subfieldtag} ) { |
589 |
my $av = Koha::AuthorisedValues->search_by_marc_field({ frameworkcode => $frameworkcode, tagfield => $tag->{fieldtag}, tagsubfield => $tag->{subfieldtag}, }); |
589 |
my $av = Koha::AuthorisedValues->search_by_marc_field({ frameworkcode => $frameworkcode, tagfield => $tag->{fieldtag}, tagsubfield => $tag->{subfieldtag}, }); |
590 |
$av = $av->count ? $av->unblessed : []; |
590 |
$av = $av->count ? $av->unblessed : []; |
591 |
my $av_description_mapping = { map { ( $_->{authorised_value} => $_->{lib} ) } @$av }; |
591 |
my $av_description_mapping = { map { ( $_->{authorised_value} => $_->{lib} ) } @$av }; |