Lines 32-37
use C4::Koha;
Link Here
|
32 |
use C4::Charset; |
32 |
use C4::Charset; |
33 |
use C4::Bookseller qw/ GetBookSellerFromId /; |
33 |
use C4::Bookseller qw/ GetBookSellerFromId /; |
34 |
use ZOOM; |
34 |
use ZOOM; |
|
|
35 |
use List::MoreUtils qw(uniq); |
35 |
|
36 |
|
36 |
my $input = new CGI; |
37 |
my $input = new CGI; |
37 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
38 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
Lines 230-235
warn "query ".$query if $DEBUG;
Link Here
|
230 |
|
231 |
|
231 |
warn "# nremaining = $nremaining\n" if $DEBUG; |
232 |
warn "# nremaining = $nremaining\n" if $DEBUG; |
232 |
|
233 |
|
|
|
234 |
my @batch_id; |
233 |
while ( $nremaining-- ) { |
235 |
while ( $nremaining-- ) { |
234 |
|
236 |
|
235 |
my $k; |
237 |
my $k; |
Lines 289-297
warn "query ".$query if $DEBUG;
Link Here
|
289 |
$oldbiblio->{issn} =~ s/\(/ \(/g if $oldbiblio->{issn}; |
291 |
$oldbiblio->{issn} =~ s/\(/ \(/g if $oldbiblio->{issn}; |
290 |
my ( |
292 |
my ( |
291 |
$notmarcrecord, $alreadyindb, $alreadyinfarm, |
293 |
$notmarcrecord, $alreadyindb, $alreadyinfarm, |
292 |
$imported, $breedingid |
294 |
$imported, $breedingid, $batch_id |
293 |
) |
295 |
) |
294 |
= ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' ); |
296 |
= ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950', 0 ); |
|
|
297 |
|
298 |
# Delay the updating of batch record counts until the very end |
299 |
push( @batch_id, $batch_id ); |
300 |
|
295 |
my %row_data; |
301 |
my %row_data; |
296 |
$row_data{server} = $servername[$k]; |
302 |
$row_data{server} = $servername[$k]; |
297 |
$row_data{isbn} = $oldbiblio->{isbn}; |
303 |
$row_data{isbn} = $oldbiblio->{isbn}; |
Lines 320-323
breeding_loop => \@breeding_loop,
Link Here
|
320 |
numberpending => $nremaining > 0 ? $nremaining : 0, |
326 |
numberpending => $nremaining > 0 ? $nremaining : 0, |
321 |
errconn => \@errconn |
327 |
errconn => \@errconn |
322 |
); |
328 |
); |
|
|
329 |
|
330 |
# Process the delayed batch record count updates |
331 |
my $pid; |
332 |
if ( $pid = fork ) { |
333 |
# Parent, continue on as usual |
334 |
|
335 |
# prevent parent exiting from |
336 |
# destroying the kid's database handle |
337 |
# FIXME: according to DBI doc, this may not work for Oracle |
338 |
$dbh->{InactiveDestroy} = 1; |
339 |
} else { |
340 |
close STDOUT; |
341 |
close STDERR; |
342 |
|
343 |
@batch_id = uniq(@batch_id); |
344 |
foreach my $bid (@batch_id) { |
345 |
C4::ImportBatch::UpdateBatchRecordCounts::UpdateBatchRecordCounts($bid); |
346 |
} |
347 |
|
348 |
exit; |
349 |
} |
350 |
|
323 |
output_html_with_http_headers $input, $cookie, $template->output; |
351 |
output_html_with_http_headers $input, $cookie, $template->output; |