Lines 42-47
use Koha::Patrons;
Link Here
|
42 |
use Koha::SearchEngine::Indexer; |
42 |
use Koha::SearchEngine::Indexer; |
43 |
use Koha::UI::Form::Builder::Item; |
43 |
use Koha::UI::Form::Builder::Item; |
44 |
use Koha::Result::Boolean; |
44 |
use Koha::Result::Boolean; |
|
|
45 |
use Koha::BackgroundJob; |
45 |
|
46 |
|
46 |
use Encode qw( encode_utf8 ); |
47 |
use Encode qw( encode_utf8 ); |
47 |
use List::MoreUtils qw( any uniq ); |
48 |
use List::MoreUtils qw( any uniq ); |
Lines 407-412
if ( $op eq "cud-additem" ) {
Link Here
|
407 |
my $testbarcode; |
408 |
my $testbarcode; |
408 |
my $barcodeobj = C4::Barcodes->new; |
409 |
my $barcodeobj = C4::Barcodes->new; |
409 |
$testbarcode = $barcodeobj->next_value($oldbarcode) if $barcodeobj; |
410 |
$testbarcode = $barcodeobj->next_value($oldbarcode) if $barcodeobj; |
|
|
411 |
Koha::BackgroundJob->before_batch_action_hooks(); |
410 |
if ( $oldbarcode && !$testbarcode ) { |
412 |
if ( $oldbarcode && !$testbarcode ) { |
411 |
|
413 |
|
412 |
push @errors, "no_next_barcode"; |
414 |
push @errors, "no_next_barcode"; |
Lines 484-489
if ( $op eq "cud-additem" ) {
Link Here
|
484 |
|
486 |
|
485 |
undef($current_item); |
487 |
undef($current_item); |
486 |
} |
488 |
} |
|
|
489 |
Koha::BackgroundJob->after_batch_action_hooks(); |
487 |
} |
490 |
} |
488 |
if ( $frameworkcode eq 'FA' && $fa_circborrowernumber ) { |
491 |
if ( $frameworkcode eq 'FA' && $fa_circborrowernumber ) { |
489 |
print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?' |
492 |
print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?' |
Lines 546-555
if ( $op eq "cud-additem" ) {
Link Here
|
546 |
|
549 |
|
547 |
#------------------------------------------------------------------------------- |
550 |
#------------------------------------------------------------------------------- |
548 |
my $items = Koha::Items->search( { biblionumber => $biblionumber } ); |
551 |
my $items = Koha::Items->search( { biblionumber => $biblionumber } ); |
|
|
552 |
Koha::BackgroundJob->before_batch_action_hooks(); |
549 |
while ( my $item = $items->next ) { |
553 |
while ( my $item = $items->next ) { |
550 |
my $deleted = $item->safe_delete( { skip_record_index => 1 } ); |
554 |
my $deleted = $item->safe_delete( { skip_record_index => 1 } ); |
551 |
push @errors, @{ $deleted->messages }[0]->message unless $deleted; |
555 |
push @errors, @{ $deleted->messages }[0]->message unless $deleted; |
552 |
} |
556 |
} |
|
|
557 |
Koha::BackgroundJob->after_batch_action_hooks(); |
553 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
558 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
554 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
559 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
555 |
if (@errors) { |
560 |
if (@errors) { |