|
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 408-413
if ( $op eq "cud-additem" ) {
Link Here
|
| 408 |
my $testbarcode; |
409 |
my $testbarcode; |
| 409 |
my $barcodeobj = C4::Barcodes->new; |
410 |
my $barcodeobj = C4::Barcodes->new; |
| 410 |
$testbarcode = $barcodeobj->next_value($oldbarcode) if $barcodeobj; |
411 |
$testbarcode = $barcodeobj->next_value($oldbarcode) if $barcodeobj; |
|
|
412 |
Koha::BackgroundJob->before_batch_action_hooks(); |
| 411 |
if ( $oldbarcode && !$testbarcode ) { |
413 |
if ( $oldbarcode && !$testbarcode ) { |
| 412 |
|
414 |
|
| 413 |
push @errors, "no_next_barcode"; |
415 |
push @errors, "no_next_barcode"; |
|
Lines 485-490
if ( $op eq "cud-additem" ) {
Link Here
|
| 485 |
|
487 |
|
| 486 |
undef($current_item); |
488 |
undef($current_item); |
| 487 |
} |
489 |
} |
|
|
490 |
Koha::BackgroundJob->after_batch_action_hooks(); |
| 488 |
} |
491 |
} |
| 489 |
if ( $frameworkcode eq 'FA' && $fa_circborrowernumber ) { |
492 |
if ( $frameworkcode eq 'FA' && $fa_circborrowernumber ) { |
| 490 |
print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?' |
493 |
print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?' |
|
Lines 548-557
if ( $op eq "cud-additem" ) {
Link Here
|
| 548 |
|
551 |
|
| 549 |
#------------------------------------------------------------------------------- |
552 |
#------------------------------------------------------------------------------- |
| 550 |
my $items = Koha::Items->search( { biblionumber => $biblionumber } ); |
553 |
my $items = Koha::Items->search( { biblionumber => $biblionumber } ); |
|
|
554 |
Koha::BackgroundJob->before_batch_action_hooks(); |
| 551 |
while ( my $item = $items->next ) { |
555 |
while ( my $item = $items->next ) { |
| 552 |
my $deleted = $item->safe_delete( { skip_record_index => 1 } ); |
556 |
my $deleted = $item->safe_delete( { skip_record_index => 1 } ); |
| 553 |
push @errors, @{ $deleted->messages }[0]->message unless $deleted; |
557 |
push @errors, @{ $deleted->messages }[0]->message unless $deleted; |
| 554 |
} |
558 |
} |
|
|
559 |
Koha::BackgroundJob->after_batch_action_hooks(); |
| 555 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
560 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
| 556 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
561 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
| 557 |
if (@errors) { |
562 |
if (@errors) { |