# use C4::Biblio;
# use C4::Catalogue;
+use Koha::Authorities;
+use Koha::Authority::Types;
my $query=new CGI;
my $authid = $query->param('authid');
my $index = $query->param('index');
-my $authtypecode = &GetAuthTypeCode($authid);
+my $authtypecode = Koha::Authorities->find($authid)->authtypecode;
my $tagslib = &GetTagsLabels(1,$authtypecode);
my $record =GetAuthority($authid);
}
$template->param("0XX" =>\@loop_data);
-my $authtypes = getauthtypes;
-my @authtypesloop;
-foreach my $thisauthtype (keys %$authtypes) {
- my %row =(value => $thisauthtype,
- selected => $thisauthtype eq $authtypecode,
- authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
- );
- push @authtypesloop, \%row;
-}
-
-$template->param(authid => $authid,
- authtypesloop => \@authtypesloop, index => $index,
- );
+my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypetext'] } );
+
+$template->param(
+ authid => $authid,
+ authority_types => $authority_types,
+ index => $index,
+);
output_html_with_http_headers $query, $cookie, $template->output;