diff --git a/tools/batch_modify_holds.pl b/tools/batch_modify_holds.pl index 4ba25f9cf4..eddfbcb02d 100755 --- a/tools/batch_modify_holds.pl +++ b/tools/batch_modify_holds.pl @@ -25,6 +25,7 @@ use JSON qw( to_json ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); +use C4::Log qw( logaction ); use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; @@ -65,6 +66,7 @@ if ( $op eq 'cud-form' ) { Koha::Holds->search( { reserve_id => { -in => \@hold_ids } }, { join => [ "item", "biblio" ] } ); while ( my $hold = $holds_to_update->next ) { + my $hold_before_mod = $hold->unblessed; if ($new_expiration_date) { $hold->expirationdate($new_expiration_date)->store; @@ -98,6 +100,10 @@ if ( $op eq 'cud-form' ) { if ($clear_hold_notes) { $hold->reservenotes(undef)->store; } + + logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold, undef, $hold_before_mod ) + if C4::Context->preference('HoldsLog'); + push @holds_data, $hold; }