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
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;
}
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",
}
elsif ( $op eq "delete" ) {
- &AUTHdelauthority( $dbh, $authid, 1 );
+ &DelAuthority( $authid, 1 );
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{