Bug 5596 [REVISED 2] add author to holds to pull report
[koha.git] / admin / z3950servers.pl
index 37d577c..f0a4dbb 100755 (executable)
@@ -20,6 +20,7 @@
 #      - we delete the record having primkey=$primkey
 
 use strict;
+#use warnings; FIXME - Bug 2505
 use CGI;
 use C4::Context;
 use C4::Auth;
@@ -90,6 +91,7 @@ if ($op eq 'add_form') {
        my $dbh=C4::Context->dbh;
        my $sth=$dbh->prepare("select * from z3950servers where name=?");
        $sth->execute($input->param('searchfield'));
+       my $checked = $input->param('checked') ? 1 : 0;
        if ($sth->rows) {
                $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?");
                $sth->execute($input->param('host'),
@@ -98,7 +100,7 @@ if ($op eq 'add_form') {
                      $input->param('userid'),
                      $input->param('password'),
                      $input->param('searchfield'),
-                     $input->param('checked'),
+                     $checked,
                      $input->param('rank'),
                          $input->param('syntax'),
               $input->param('encoding'),
@@ -160,7 +162,6 @@ if ($op eq 'add_form') {
        $template->param(else => 1);
        my ($count,$results)=StringSearch($searchfield,'web');
        my @loop;
-       my $toggle = 0;
        for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
                        
                my $urlsearchfield=$results->[$i]{name};
@@ -174,19 +175,9 @@ if ($op eq 'add_form') {
                        checked => $results->[$i]{'checked'},
                        rank => $results->[$i]{'rank'},
                        syntax => $results->[$i]{'syntax'},
-      encoding => $results->[$i]{'encoding'},
-                       toggle => $toggle);
+      encoding => $results->[$i]{'encoding'});
                push @loop, \%row;
 
-                if ( $toggle eq 0 )
-                {
-                        $toggle = 1;
-                }
-                else
-                {
-                        $toggle = 0;
-                }
-
        }
        $template->param(loop => \@loop);
        if ($offset>0) {