Bug 22206: (follow-up) Voted RFC changes
[koha.git] / authorities / detail.pl
index b253238..f9724ff 100755 (executable)
@@ -36,9 +36,7 @@ parameters tables.
 
 =cut
 
-
-use strict;
-use warnings;
+use Modern::Perl;
 
 use C4::AuthoritiesMarc;
 use C4::Auth;
@@ -139,16 +137,13 @@ sub build_tabs {
                     }
                     if ($#subfields_data>=0) {
                       my %tag_data;
-                      $tag_data{tag}=$field->tag(). ' '  
-                                     . C4::Koha::display_marc_indicators($field) 
-                                     . ' - '
-                                     . $tagslib->{$field->tag()}->{lib};
                       $tag_data{tag_number} = $tag;
                       $tag_data{tag_desc} = $tagslib->{$field->tag()}->{lib};
                       $tag_data{subfield} = \@subfields_data;
-                      if ($tag >= 10){ # no indicator for theses tag
-                            $tag_data{ind1} = $field->indicator(1);
-                            $tag_data{ind2} = $field->indicator(2);
+                      my $indicators = C4::Koha::display_marc_indicators($field);
+                      if ( $indicators ) {
+                          $tag_data{ind1} = substr $indicators, 0, 1;
+                          $tag_data{ind2} = substr $indicators, 1, 1;
                       }
 
                       push (@loop_data, \%tag_data);
@@ -191,7 +186,7 @@ my $authtypecode = $authobj ? $authobj->authtypecode : q{};
 $tagslib = &GetTagsLabels(1,$authtypecode);
 
 # Build list of authtypes for showing them
-my $authority_types = Koha::Authority::Types->search({}, { order_by => ['authtypecode']});
+my $authority_types = Koha::Authority::Types->search({}, { order_by => ['authtypetext']});
 
 my $record=GetAuthority($authid);