|
Lines 156-162
if ( $op eq 'form' ) {
Link Here
|
| 156 |
my ( $job ); |
156 |
my ( $job ); |
| 157 |
if ( $runinbackground ) { |
157 |
if ( $runinbackground ) { |
| 158 |
my $job_size = scalar( @record_ids ); |
158 |
my $job_size = scalar( @record_ids ); |
| 159 |
$job = C4::BackgroundJob->new( $sessionID, "FIXME", '/cgi-bin/koha/tools/batch_record_modification.pl', $job_size ); |
159 |
$job = C4::BackgroundJob->new( $sessionID, "FIXME", $ENV{SCRIPT_NAME}, $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; |
162 |
$dbh->{InactiveDestroy} = 1; |
|
Lines 169-175
if ( $op eq 'form' ) {
Link Here
|
| 169 |
close STDOUT; |
169 |
close STDOUT; |
| 170 |
close STDERR; |
170 |
close STDERR; |
| 171 |
} else { |
171 |
} else { |
| 172 |
warn "fork failed while attempting to run tools/batch_record_modification.pl as a background job"; |
172 |
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job"; |
| 173 |
exit 0; |
173 |
exit 0; |
| 174 |
} |
174 |
} |
| 175 |
} |
175 |
} |
|
Lines 192-198
if ( $op eq 'form' ) {
Link Here
|
| 192 |
my $error = eval { |
192 |
my $error = eval { |
| 193 |
my $record = GetMarcBiblio( $biblionumber ); |
193 |
my $record = GetMarcBiblio( $biblionumber ); |
| 194 |
ModifyRecordWithTemplate( $mmtid, $record ); |
194 |
ModifyRecordWithTemplate( $mmtid, $record ); |
| 195 |
ModBiblio( $record, $biblionumber ); |
195 |
my ($member) = C4::Members::GetMember('borrowernumber' => $loggedinuser); |
|
|
196 |
ModBiblio( $record, $biblionumber, '', |
| 197 |
{ |
| 198 |
source => 'batchmod', |
| 199 |
category => $member->{'category_type'}, |
| 200 |
borrower => $loggedinuser |
| 201 |
} |
| 202 |
); |
| 196 |
}; |
203 |
}; |
| 197 |
if ( $error and $error != 1 or $@ ) { # ModBiblio returns 1 if everything as gone well |
204 |
if ( $error and $error != 1 or $@ ) { # ModBiblio returns 1 if everything as gone well |
| 198 |
push @messages, { |
205 |
push @messages, { |
| 199 |
- |
|
|