Lines 134-141
if ( $op ne "do_search" ) {
Link Here
|
134 |
} |
134 |
} |
135 |
else { |
135 |
else { |
136 |
my @id = $input->param('id'); |
136 |
my @id = $input->param('id'); |
|
|
137 |
|
138 |
if ( not defined @id ) { |
139 |
# empty server list -> report and exit |
140 |
$template->param( emptyserverlist => 1 ); |
141 |
output_html_with_http_headers $input, $cookie, $template->output; |
142 |
exit; |
143 |
} |
144 |
|
137 |
my @oConnection; |
145 |
my @oConnection; |
138 |
my @oResult; |
146 |
my @oResult; |
|
|
147 |
my @errconn; |
139 |
my $s = 0; |
148 |
my $s = 0; |
140 |
my $query; |
149 |
my $query; |
141 |
my $nterms; |
150 |
my $nterms; |
Lines 164-170
else {
Link Here
|
164 |
$query .= " \@attr 1=21 \"$subject\" "; |
173 |
$query .= " \@attr 1=21 \"$subject\" "; |
165 |
$nterms++; |
174 |
$nterms++; |
166 |
} |
175 |
} |
167 |
if ($lccn) { |
176 |
if ($lccn) { |
168 |
$query .= " \@attr 1=9 $lccn "; |
177 |
$query .= " \@attr 1=9 $lccn "; |
169 |
$nterms++; |
178 |
$nterms++; |
170 |
} |
179 |
} |
Lines 186-192
warn "query ".$query if $DEBUG;
Link Here
|
186 |
$sth->execute($servid); |
195 |
$sth->execute($servid); |
187 |
while ( $server = $sth->fetchrow_hashref ) { |
196 |
while ( $server = $sth->fetchrow_hashref ) { |
188 |
warn "serverinfo ".join(':',%$server) if $DEBUG; |
197 |
warn "serverinfo ".join(':',%$server) if $DEBUG; |
189 |
my $noconnection = 0; |
|
|
190 |
my $option1 = new ZOOM::Options(); |
198 |
my $option1 = new ZOOM::Options(); |
191 |
$option1->option( 'async' => 1 ); |
199 |
$option1->option( 'async' => 1 ); |
192 |
$option1->option( 'elementSetName', 'F' ); |
200 |
$option1->option( 'elementSetName', 'F' ); |
Lines 237-245
sub displayresults {
Link Here
|
237 |
my ( $error, $errmsg, $addinfo, $diagset ) = |
245 |
my ( $error, $errmsg, $addinfo, $diagset ) = |
238 |
$oConnection[$k]->error_x(); |
246 |
$oConnection[$k]->error_x(); |
239 |
if ($error) { |
247 |
if ($error) { |
240 |
warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n" |
248 |
if ($error =~ m/^(10000|10007)$/ ) { |
241 |
if $DEBUG; |
249 |
push(@errconn, {'server' => $serverhost[$k]}); |
242 |
|
250 |
} |
|
|
251 |
$DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n"; |
243 |
} |
252 |
} |
244 |
else { |
253 |
else { |
245 |
my $numresults = $oResult[$k]->size(); |
254 |
my $numresults = $oResult[$k]->size(); |
Lines 280-292
sub displayresults {
Link Here
|
280 |
) |
289 |
) |
281 |
= ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' ); |
290 |
= ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' ); |
282 |
my %row_data; |
291 |
my %row_data; |
283 |
if ( $i % 2 ) { |
|
|
284 |
$toggle = 1; |
285 |
} |
286 |
else { |
287 |
$toggle = 0; |
288 |
} |
289 |
$row_data{toggle} = $toggle; |
290 |
$row_data{server} = $servername[$k]; |
292 |
$row_data{server} = $servername[$k]; |
291 |
$row_data{isbn} = $oldbiblio->{isbn}; |
293 |
$row_data{isbn} = $oldbiblio->{isbn}; |
292 |
$row_data{lccn} = $oldbiblio->{lccn}; |
294 |
$row_data{lccn} = $oldbiblio->{lccn}; |
Lines 295-303
sub displayresults {
Link Here
|
295 |
$row_data{breedingid} = $breedingid; |
297 |
$row_data{breedingid} = $breedingid; |
296 |
$row_data{biblionumber} = $biblionumber; |
298 |
$row_data{biblionumber} = $biblionumber; |
297 |
push( @breeding_loop, \%row_data ); |
299 |
push( @breeding_loop, \%row_data ); |
298 |
|
300 |
|
299 |
} else { |
301 |
} else { |
300 |
push(@breeding_loop,{'toggle'=>($i % 2)?1:0,'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1}); |
302 |
push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1}); |
301 |
} # $rec |
303 |
} # $rec |
302 |
} # upto 5 results |
304 |
} # upto 5 results |
303 |
} #$numresults |
305 |
} #$numresults |
Lines 308-317
sub displayresults {
Link Here
|
308 |
breeding_loop => \@breeding_loop, |
310 |
breeding_loop => \@breeding_loop, |
309 |
server => $servername[$k], |
311 |
server => $servername[$k], |
310 |
numberpending => $numberpending, |
312 |
numberpending => $numberpending, |
|
|
313 |
errconn => \@errconn |
311 |
); |
314 |
); |
312 |
output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0; |
315 |
output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0; |
313 |
|
316 |
|
314 |
# print $template->output if $firstresult !=1; |
317 |
# print $template->output if $firstresult !=1; |
315 |
$firstresult++; |
318 |
$firstresult++; |
316 |
} |
319 |
} |
317 |
displayresults(); |
320 |
displayresults(); |