|
Lines 17-22
package Koha::BackgroundJob::BatchUpdateBiblio;
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
|
|
20 |
use Koha::Patrons; |
| 20 |
use Koha::Biblios; |
21 |
use Koha::Biblios; |
| 21 |
use Koha::Virtualshelves; |
22 |
use Koha::Virtualshelves; |
| 22 |
use Koha::SearchEngine; |
23 |
use Koha::SearchEngine; |
|
Lines 133-138
sub enqueue {
Link Here
|
| 133 |
return unless exists $args->{mmtid}; |
134 |
return unless exists $args->{mmtid}; |
| 134 |
return unless exists $args->{record_ids}; |
135 |
return unless exists $args->{record_ids}; |
| 135 |
|
136 |
|
|
|
137 |
my $borrowernumber = (C4::Context->userenv) ? C4::Context->userenv->{number} : undef; |
| 138 |
my $patron = Koha::Patrons->find($borrowernumber); |
| 139 |
unless ( $patron->has_permission( { editcatalogue => 'edit_locked_records' } ) ) { |
| 140 |
my @actions = GetModificationTemplateActions($args->{mmtid}); |
| 141 |
foreach my $a ( @actions ) { |
| 142 |
Koha::Exceptions::BackgroundJob->throw('You must have record source permissions to schedule this job') if $a->{'action'} eq 'set_record_source'; |
| 143 |
} |
| 144 |
} |
| 145 |
|
| 136 |
$self->SUPER::enqueue({ |
146 |
$self->SUPER::enqueue({ |
| 137 |
job_size => scalar @{$args->{record_ids}}, |
147 |
job_size => scalar @{$args->{record_ids}}, |
| 138 |
job_args => $args, |
148 |
job_args => $args, |
| 139 |
- |
|
|