functions that were in C4::Interface::CGI::Output are now in C4::Output.
[koha_gimpoz] / authorities / authorities-home.pl
index 5fa365f..efe3259 100755 (executable)
@@ -22,16 +22,14 @@ use strict;
 require Exporter;
 use CGI;
 use C4::Auth;
-use HTML::Template;
+
 use C4::Context;
-use C4::Search;
 use C4::Auth;
 use C4::Output;
-use C4::Interface::CGI::Output;
 use C4::AuthoritiesMarc;
-use C4::SearchMarc;
 use C4::Acquisition;
 use C4::Koha; # XXX subfield_is_koha_internal_p
+use C4::Biblio;
 
 my $query=new CGI;
 my $op = $query->param('op');
@@ -57,13 +55,13 @@ if ($op eq "do_search") {
        my @and_or = $query->param('and_or');
        my @excluding = $query->param('excluding');
        my @operator = $query->param('operator');
+       my $orderby = $query->param('orderby');
        my @value = $query->param('value');
 
     my $startfrom = $query->param('startfrom') || 1;
     my $resultsperpage = $query->param('resultsperpage') || 19;
 
-       my ($results,$total) = authoritysearch(
-        $dbh,
+       my ($results,$total) = SearchAuthorities(
         \@marclist,
         \@and_or,
         \@excluding,
@@ -71,7 +69,8 @@ if ($op eq "do_search") {
         \@value,
         ($startfrom - 1)*$resultsperpage,
         $resultsperpage,
-        $authtypecode
+        $authtypecode,
+        $orderby
     );
 
        ($template, $loggedinuser, $cookie)
@@ -80,7 +79,6 @@ if ($op eq "do_search") {
             query => $query,
             type => 'intranet',
             authnotrequired => 0,
-            flagsrequired => {borrowers => 1},
             flagsrequired => {catalogue => 1},
             debug => 1,
         });
@@ -114,7 +112,8 @@ if ($op eq "do_search") {
                 {term => 'resultsperpage', val => $resultsperpage},
                 {term => 'type'          , val => 'intranet'},
                 {term => 'op'            , val => 'do_search'},
-                {term => 'authtypecode'  , val => $authtypecode}
+                {term => 'authtypecode'  , val => $authtypecode},
+                {term => 'orderby'       , val => $orderby},
             )
         )
         ;
@@ -146,7 +145,7 @@ if ($op eq "do_search") {
 
 } elsif ($op eq "delete") {
 
-       &AUTHdelauthority($dbh,$authid, 1);
+       &DelAuthority($authid, 1);
 
        ($template, $loggedinuser, $cookie)
                = get_template_and_user({template_name => "authorities/authorities-home.tmpl",