use strict;
-require Exporter;
+use warnings;
+
use C4::AuthoritiesMarc;
use C4::Auth;
use C4::Context;
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);
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);
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;