X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=admin%2Fz3950servers.pl;h=f0a4dbb4ca71d022305194b9de94f8101f729475;hb=b3cae766949599c88095930b8fd37dabfc79a5cc;hp=37d577c7c6df4095805e91cd7ea612ba37a207e0;hpb=a3d111ae97f80c6252d4cccd9cbd31b1a2ca8d3c;p=koha.git diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index 37d577c7c6..f0a4dbb4ca 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -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) {