X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=authorities%2Fblinddetail-biblio-search.pl;h=7de7db3095621ab06259800f1bfbc30ced5dcde6;hb=7a8bed557618e26f867a74f53c1391c12acfb77a;hp=0f734b20622fa8610914adbfbe0a48fe4bef88da;hpb=f098258e8cf2d616c6bbc35e44c6a1df47be8517;p=koha_fer diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl index 0f734b2062..7de7db3095 100755 --- a/authorities/blinddetail-biblio-search.pl +++ b/authorities/blinddetail-biblio-search.pl @@ -80,10 +80,20 @@ if ($authid) { my @fields = $record->field( $auth_type->{auth_tag_to_report} ); my $repet = ($query->param('repet') || 1) - 1; my $field = $fields[$repet]; + + # Get all values for each distinct subfield + my %subfields; for ( $field->subfields ) { - my ($letter, $value) = @$_; - $letter = '@' unless $letter; - push @subfield_loop, { marc_subfield => $letter, marc_value => $value }; + my $letter = $_->[0]; + next if defined $subfields{$letter}; + my @values = $field->subfield($letter); + $subfields{$letter} = \@values; + } + + # Add all subfields to the subfield_loop + for( keys %subfields ) { + my $letter = $_ || '@'; + push( @subfield_loop, {marc_subfield => $letter, marc_values => $subfields{$_}} ); } } else { @@ -91,11 +101,16 @@ else { $template->param( "clear" => 1 ); } +# Extract the tag number from the index +my $tag_number = $index; +$tag_number =~ s/^tag_(\d*)_.*$/$1/; + $template->param( authid => $authid ? $authid : "", index => $index, tagid => $tagid, SUBFIELD_LOOP => \@subfield_loop, + tag_number => $tag_number, ); output_html_with_http_headers $query, $cookie, $template->output;