Bug 19436: Add SRU support for authorities
[koha.git] / cataloguing / z3950_auth_search.pl
index 8ea4f41..e65b8aa 100755 (executable)
@@ -16,8 +16,8 @@
 # You should have received a copy of the GNU General Public License along
 # with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
+
 use CGI qw / -utf8 /;
 
 use C4::Auth;
@@ -66,7 +66,7 @@ $template->param(
 );
 
 if ( $op ne "do_search" ) {
-    my $sth = $dbh->prepare("SELECT id,host,servername,checked FROM z3950servers WHERE recordtype = 'authority' AND servertype='zed' ORDER BY rank, servername");
+    my $sth = $dbh->prepare("SELECT id,host,servername,checked FROM z3950servers WHERE recordtype = 'authority' ORDER BY rank, servername");
     $sth->execute();
     my $serverloop = $sth->fetchall_arrayref( {} );
     $template->param(
@@ -77,7 +77,7 @@ if ( $op ne "do_search" ) {
     exit;
 }
 
-my @id = $input->param('id');
+my @id = $input->multi_param('id');
 if ( @id==0 ) {
         # empty server list -> report and exit
         $template->param( emptyserverlist => 1 );
@@ -86,7 +86,7 @@ if ( @id==0 ) {
 }
 
 my $pars= {
-        random => $input->param('random') || rand(1000000000),
+        random => scalar $input->param('random') || rand(1000000000),
         page => $page,
         id => \@id,
         nameany => $nameany,