Lines 23-28
use Modern::Perl;
Link Here
|
23 |
use CGI; |
23 |
use CGI; |
24 |
use List::MoreUtils qw( uniq ); |
24 |
use List::MoreUtils qw( uniq ); |
25 |
use JSON qw( encode_json ); |
25 |
use JSON qw( encode_json ); |
|
|
26 |
use Try::Tiny; |
26 |
|
27 |
|
27 |
use C4::Auth qw( get_template_and_user ); |
28 |
use C4::Auth qw( get_template_and_user ); |
28 |
use C4::Output qw( output_html_with_http_headers ); |
29 |
use C4::Output qw( output_html_with_http_headers ); |
Lines 149-165
if ( $op eq 'form' ) {
Link Here
|
149 |
# We want to modify selected records! |
150 |
# We want to modify selected records! |
150 |
my @record_ids = $input->multi_param('record_id'); |
151 |
my @record_ids = $input->multi_param('record_id'); |
151 |
|
152 |
|
152 |
my $job_id = Koha::BackgroundJob::BatchUpdateBiblio->new->enqueue( |
153 |
try { |
153 |
{ |
154 |
my $job_id = Koha::BackgroundJob::BatchUpdateBiblio->new->enqueue( |
154 |
mmtid => $mmtid, |
155 |
{ |
155 |
record_type => $recordtype, |
156 |
mmtid => $mmtid, |
156 |
record_ids => \@record_ids, |
157 |
record_type => $recordtype, |
157 |
} |
158 |
record_ids => \@record_ids, |
158 |
); |
159 |
} |
159 |
$template->param( |
160 |
); |
160 |
view => 'enqueued', |
161 |
$template->param( |
161 |
job_id => $job_id, |
162 |
view => 'enqueued', |
162 |
); |
163 |
job_id => $job_id, |
|
|
164 |
); |
165 |
} catch { |
166 |
push @messages, { |
167 |
type => 'error', |
168 |
code => 'cannot_enqueue_job', |
169 |
error => $_, |
170 |
}; |
171 |
$template->param( view => 'errors' ); |
172 |
}; |
163 |
} |
173 |
} |
164 |
|
174 |
|
165 |
$template->param( |
175 |
$template->param( |
166 |
- |
|
|