X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=admin%2Fz3950servers.pl;h=87711c1bb08c8ebcd0678165fe9d8e02a33d236c;hb=b7cd95bcc909f7db330b5acbfcf9e8f817328a67;hp=d6044fc45415ce33050eeb864778e768f3e209b2;hpb=31a0ed0a43bb4ecfde0b762eb6e654c51da6f66e;p=koha.git diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index d6044fc454..87711c1bb0 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -53,13 +53,12 @@ sub StringSearch { $sth->execute; } - my @results; - while (my $data=$sth->fetchrow_hashref) { - push(@results,$data); - } - $sth->finish; - $dbh->disconnect; - return (scalar(@results),\@results); + my @results; + while (my $data=$sth->fetchrow_hashref) { + push(@results,$data); + } + $sth->finish; + return (scalar(@results),\@results); } my $input = new CGI; @@ -98,19 +97,19 @@ if ($op eq 'add_form') { $sth->finish; } $template->param( $_ => $data->{$_} ) - for ( qw( host port db userid password checked rank timeout ) ); + for ( qw( host port db userid password checked rank timeout encoding ) ); $template->param( $_ . $data->{$_} => 1) - for ( qw( syntax encoding ) ); + for ( qw( syntax ) ); # END $OP eq ADD_FORM ################## ADD_VALIDATE ################################## # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { - $template->param(add_validate => 1); 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) { + $template->param(confirm_update => 1); $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?"); $sth->execute($input->param('host'), $input->param('port'), @@ -127,6 +126,7 @@ if ($op eq 'add_form') { ); } else { + $template->param(confirm_add => 1); $sth=$dbh->prepare( "INSERT INTO z3950servers " . "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " .