From e4c9ed20c62e9590706ea2cf43f0b75a2243c474 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 27 Jul 2020 13:03:31 +0200 Subject: [PATCH] Bug 25995: Log RENEWAL when "extend due dates" tool is used RENEWAL logs are created when an issue is renewed from the circulation module. We should log as well when the "extend due dates" tool is used to renew issues. Test plan: Turn on RenewalLog Create an issue Renew it using the "extend due dates" Confirm that the log has been created --- tools/batch_extend_due_dates.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/batch_extend_due_dates.pl b/tools/batch_extend_due_dates.pl index 572e57bdc9..9878878503 100755 --- a/tools/batch_extend_due_dates.pl +++ b/tools/batch_extend_due_dates.pl @@ -24,6 +24,7 @@ use CGI; use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); +use C4::Log qw( logaction ); use Koha::Checkouts; use Koha::DateUtils qw( dt_from_string output_pref ); @@ -132,6 +133,7 @@ elsif ( $op eq 'modify' ) { $new_hard_due_date &&= dt_from_string($new_hard_due_date); my $checkouts = Koha::Checkouts->search( { issue_id => { -in => \@issue_ids } } ); + my $RenewalLog = C4::Context->preference('RenewalLog'); while ( my $checkout = $checkouts->next ) { my $new_due_date = calc_new_due_date( { @@ -146,6 +148,8 @@ elsif ( $op eq 'modify' ) { # Update items.onloan $checkout->item->onloan($new_due_date)->store; + + logaction("CIRCULATION", "RENEWAL", $checkout->borrowernumber, $checkout->itemnumber) if $RenewalLog; } $template->param( -- 2.20.1