Correct number of args to getnextacctno.
[koha.git] / opac / opac-authorities-home.pl
index 4cd3fe8..6fef1b8 100755 (executable)
@@ -26,7 +26,6 @@ use C4::Auth;
 use C4::Context;
 use C4::Auth;
 use C4::Output;
-use C4::Interface::CGI::Output;
 use C4::AuthoritiesMarc;
 use C4::Koha;    # XXX subfield_is_koha_internal_p
 
@@ -43,7 +42,7 @@ my $resultsperpage;
 
 my $authtypes = getauthtypes;
 my @authtypesloop;
-foreach my $thisauthtype ( sort { $authtypes->{$a} <=> $authtypes->{$b} }
+foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'} }
     keys %$authtypes )
 {
     my $selected = 1 if $thisauthtype eq $authtypecode;
@@ -56,19 +55,20 @@ foreach my $thisauthtype ( sort { $authtypes->{$a} <=> $authtypes->{$b} }
 }
 
 if ( $op eq "do_search" ) {
-    my @marclist  = $query->param('marclist');
-    my @and_or    = $query->param('and_or');
+    my @marclist = $query->param('marclist');
+    my @and_or = $query->param('and_or');
     my @excluding = $query->param('excluding');
-    my @operator  = $query->param('operator');
-    my @value     = $query->param('value');
+    my @operator = $query->param('operator');
+    my $orderby = $query->param('orderby');
+    my @value = $query->param('value');
 
     $resultsperpage = $query->param('resultsperpage');
     $resultsperpage = 19 if ( !defined $resultsperpage );
     my @tags;
     my ( $results, $total, @fields ) =
-      authoritysearch( $dbh, \@marclist, \@and_or, \@excluding, \@operator,
+      SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator,
         \@value, $startfrom * $resultsperpage,
-        $resultsperpage, $authtypecode );
+        $resultsperpage, $authtypecode, $orderby );
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
             template_name   => "opac-authoritiessearchresultlist.tmpl",
@@ -146,7 +146,7 @@ if ( $op eq "do_search" ) {
 }
 elsif ( $op eq "delete" ) {
 
-    &AUTHdelauthority( $dbh, $authid, 1 );
+    &DelAuthority( $authid, 1 );
 
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {