Lines 81-88
sub process {
Link Here
|
81 |
|
81 |
|
82 |
$self->start; |
82 |
$self->start; |
83 |
|
83 |
|
84 |
my @record_ids = @{ $args->{record_ids} }; |
84 |
my @record_ids = @{ $args->{record_ids} }; |
85 |
my $delete_biblios = $args->{delete_biblios}; |
85 |
my $delete_biblios = $args->{delete_biblios}; |
|
|
86 |
my $delete_serial_issues = $args->{delete_serial_issues}; |
86 |
|
87 |
|
87 |
my $report = { |
88 |
my $report = { |
88 |
total_records => scalar @record_ids, |
89 |
total_records => scalar @record_ids, |
Lines 104-110
sub process {
Link Here
|
104 |
|
105 |
|
105 |
my $item = Koha::Items->find($record_id) || next; |
106 |
my $item = Koha::Items->find($record_id) || next; |
106 |
|
107 |
|
107 |
my $return = $item->safe_delete({ skip_record_index => 1, skip_holds_queue => 1 }); |
108 |
my $return = $item->safe_delete({ skip_record_index => 1, skip_holds_queue => 1, delete_serial_issues => $delete_serial_issues }); |
108 |
unless ( $return ) { |
109 |
unless ( $return ) { |
109 |
|
110 |
|
110 |
# FIXME Do we need to rollback the whole transaction if a deletion failed? |
111 |
# FIXME Do we need to rollback the whole transaction if a deletion failed? |
Lines 221-235
sub enqueue {
Link Here
|
221 |
# TODO Raise exception instead |
222 |
# TODO Raise exception instead |
222 |
return unless exists $args->{record_ids}; |
223 |
return unless exists $args->{record_ids}; |
223 |
|
224 |
|
224 |
my @record_ids = @{ $args->{record_ids} }; |
225 |
my @record_ids = @{ $args->{record_ids} }; |
225 |
my $delete_biblios = $args->{delete_biblios} || 0; |
226 |
my $delete_biblios = $args->{delete_biblios} || 0; |
|
|
227 |
my $delete_serial_issues = $args->{delete_serial_issues} || 0; |
226 |
|
228 |
|
227 |
$self->SUPER::enqueue( |
229 |
$self->SUPER::enqueue( |
228 |
{ |
230 |
{ |
229 |
job_size => scalar @record_ids, |
231 |
job_size => scalar @record_ids, |
230 |
job_args => { |
232 |
job_args => { |
231 |
record_ids => \@record_ids, |
233 |
record_ids => \@record_ids, |
232 |
delete_biblios => $delete_biblios, |
234 |
delete_biblios => $delete_biblios, |
|
|
235 |
delete_serial_issues => $delete_serial_issues, |
233 |
}, |
236 |
}, |
234 |
job_queue => 'long_tasks', |
237 |
job_queue => 'long_tasks', |
235 |
} |
238 |
} |