projects
/
koha.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 7641 - Followup - Suspend Until not set on by suspend button.
[koha.git]
/
cataloguing
/
z3950_search.pl
diff --git
a/cataloguing/z3950_search.pl
b/cataloguing/z3950_search.pl
index
6311c0b
..
6e6b417
100755
(executable)
--- a/
cataloguing/z3950_search.pl
+++ b/
cataloguing/z3950_search.pl
@@
-82,7
+82,7
@@
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
$template->param( frameworkcode => $frameworkcode, );
if ( $op ne "do_search" ) {
$template->param( frameworkcode => $frameworkcode, );
if ( $op ne "do_search" ) {
- my $sth = $dbh->prepare("
select id,host,name,checked from z3950servers order by host
");
+ my $sth = $dbh->prepare("
SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name
");
$sth->execute();
my $serverloop = $sth->fetchall_arrayref( {} );
$template->param(
$sth->execute();
my $serverloop = $sth->fetchall_arrayref( {} );
$template->param(
@@
-103,6
+103,14
@@
if ( $op ne "do_search" ) {
}
else {
my @id = $input->param('id');
}
else {
my @id = $input->param('id');
+
+ if ( not defined @id ) {
+ # empty server list -> report and exit
+ $template->param( emptyserverlist => 1 );
+ output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
+ }
+
my @oConnection;
my @oResult;
my @errconn;
my @oConnection;
my @oResult;
my @errconn;
@@
-160,7
+168,7
@@
for my $i (1..$nterms-1) {
warn "query ".$query if $DEBUG;
foreach my $servid (@id) {
warn "query ".$query if $DEBUG;
foreach my $servid (@id) {
- my $sth = $dbh->prepare("
select * from z3950servers where id=?
");
+ my $sth = $dbh->prepare("
SELECT * FROM z3950servers WHERE id=? ORDER BY rank, name
");
$sth->execute($servid);
while ( $server = $sth->fetchrow_hashref ) {
warn "serverinfo ".join(':',%$server) if $DEBUG;
$sth->execute($servid);
while ( $server = $sth->fetchrow_hashref ) {
warn "serverinfo ".join(':',%$server) if $DEBUG;
@@
-171,6
+179,7
@@
warn "query ".$query if $DEBUG;
$option1->option('user', $server->{userid} ) if $server->{userid};
$option1->option('password', $server->{password}) if $server->{password};
$option1->option('preferredRecordSyntax', $server->{syntax});
$option1->option('user', $server->{userid} ) if $server->{userid};
$option1->option('password', $server->{password}) if $server->{password};
$option1->option('preferredRecordSyntax', $server->{syntax});
+ $option1->option( 'timeout', $server->{timeout} ) if ($server->{timeout});
$oConnection[$s] = create ZOOM::Connection($option1)
|| $DEBUG
&& warn( "" . $oConnection[$s]->errmsg() );
$oConnection[$s] = create ZOOM::Connection($option1)
|| $DEBUG
&& warn( "" . $oConnection[$s]->errmsg() );
@@
-214,7
+223,7
@@
warn "query ".$query if $DEBUG;
$oConnection[$k]->error_x();
if ($error) {
if ($error =~ m/^(10000|10007)$/ ) {
$oConnection[$k]->error_x();
if ($error) {
if ($error =~ m/^(10000|10007)$/ ) {
- push(@errconn, {'server' => $serverhost[$k]});
+ push(@errconn, {'server' => $serverhost[$k]
, 'error' => $error
});
}
$DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
}
}
$DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
}