Bug 2505 Enabled warnings in authorities/*
[koha_fer] / authorities / detail.pl
index 425b155..66f931c 100755 (executable)
@@ -39,7 +39,8 @@ parameters tables.
 
 
 use strict;
-require Exporter;
+use warnings;
+
 use C4::AuthoritiesMarc;
 use C4::Auth;
 use C4::Context;
@@ -324,12 +325,11 @@ sub build_tabs ($$$$$) {
         foreach my $tag (sort @tab_data) {
             $i++;
             next if ! $tag;
-            my $indicator;
             my $index_tag = CreateKey;
 
             # if MARC::Record is not empty =>use it as master loop, then add missing subfields that should be in the tab.
             # if MARC::Record is empty => use tab as master loop.
-            if ( $record ne -1 && ( $record->field($tag) || $tag eq '000' ) ) {
+            if ( $record != -1 && ( $record->field($tag) || $tag eq '000' ) ) {
                 my @fields;
                 if ( $tag ne '000' ) {
                     @fields = $record->field($tag);
@@ -439,7 +439,6 @@ if (C4::Context->preference("AuthDisplayHierarchy")){
     my $cnt=0;
     my @loophierarchy;
     foreach my $element (@tree){
-      my $cell;
       my $elementdata = GetAuthority($element);
       $record= $elementdata if ($authid==$element);
       push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
@@ -476,10 +475,9 @@ my $tag;
 
 my $authtypes = getauthtypes;
 my @authtypesloop;
-foreach my $thisauthtype (keys %$authtypes) {
-       my $selected = 1 if $thisauthtype eq $authtypecode;
+foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$authtypes) {
        my %row =(value => $thisauthtype,
-                               selected => $selected,
+                               selected => $thisauthtype eq $authtypecode,
                                authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
                        );
        push @authtypesloop, \%row;