Lines 159-173
if ( $op eq 'form' ) {
Link Here
|
159 |
$job = C4::BackgroundJob->new( $sessionID, "FIXME", '/cgi-bin/koha/tools/batch_record_modification.pl', $job_size ); |
159 |
$job = C4::BackgroundJob->new( $sessionID, "FIXME", '/cgi-bin/koha/tools/batch_record_modification.pl', $job_size ); |
160 |
my $job_id = $job->id; |
160 |
my $job_id = $job->id; |
161 |
if (my $pid = fork) { |
161 |
if (my $pid = fork) { |
162 |
$dbh->{InactiveDestroy} = 1; |
|
|
163 |
|
164 |
my $reply = CGI->new(""); |
162 |
my $reply = CGI->new(""); |
165 |
print $reply->header(-type => 'text/html'); |
163 |
print $reply->header(-type => 'application/json'); |
166 |
print '{"jobID":"' . $job_id . '"}'; |
164 |
print '{"jobID":"' . $job_id . '"}'; |
167 |
exit 0; |
165 |
exit 0; |
168 |
} elsif (defined $pid) { |
166 |
} elsif (not defined $pid) { |
169 |
close STDOUT; |
|
|
170 |
} else { |
171 |
warn "fork failed while attempting to run tools/batch_record_modification.pl as a background job"; |
167 |
warn "fork failed while attempting to run tools/batch_record_modification.pl as a background job"; |
172 |
exit 0; |
168 |
exit 0; |
173 |
} |
169 |
} |
Lines 244-251
if ( $op eq 'form' ) {
Link Here
|
244 |
} |
240 |
} |
245 |
|
241 |
|
246 |
if ($runinbackground) { |
242 |
if ($runinbackground) { |
247 |
$job->finish if defined $job; |
243 |
if ( $job ) { |
248 |
} else { |
244 |
$job->finish; |
|
|
245 |
print $input->redirect('/cgi-bin/koha/tools/background.pl?just_a_param=1'); |
246 |
} |
247 |
} |
248 |
else { |
249 |
# FIXME Do not think this is reach |
249 |
$template->param( |
250 |
$template->param( |
250 |
view => 'report', |
251 |
view => 'report', |
251 |
report => $report, |
252 |
report => $report, |
252 |
- |
|
|