Bug 22069: Make log viewer find item renewals
authorKatrin Fischer <katrin.fischer.83@web.de>
Sun, 7 Apr 2019 17:51:13 +0000 (17:51 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 16 Apr 2019 13:17:32 +0000 (13:17 +0000)
Without this patch renewals for checkouts wouldn't
show in the log viewer. The log viewre was using
RENEW, which we use for patrons, but for issue
RENEWAL is used.

The patch adds RENEWAL to the search params, when
Renew was selected in the form, so both terms are
included in the query.

To test:
- Make sure you have RenewalLog turned on
- Make a patron renewal
- Check something out and renew it
- Go to Tools > Log viewer and test different
  searches
  - Modules All - Actions All
  - Modules All - Actions Renew
  - Modules Circulation - Actions Renew
  ...
- Make sure results show as expected

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
tools/viewlog.pl

index d036880..64afbe2 100644 (file)
@@ -52,6 +52,7 @@
 [%        CASE 'RESUME' %]Resume
 [%        CASE 'SUSPEND' %]Suspend
 [%        CASE 'RENEW'  %]Renew
+[%        CASE 'RENEWAL' %]Renew
 [%        CASE 'CHANGE PASS' %]Change password
 [%        CASE 'ADDCIRCMESSAGE' %]Add circulation message
 [%        CASE 'DELCIRCMESSAGE' %]Delete circulation message
index f38ca19..e86aa04 100755 (executable)
@@ -126,6 +126,9 @@ if ($do_it) {
             '<=' => $dtf->format_datetime( $dateto_endday )
         };
     }
+    # Circulation uses RENEWAL, but Patorns uses RENEW, this helps to find both
+    if ( grep { $_ eq 'RENEW'} @actions ) { push @actions, 'RENEWAL' };
+
     $search_params{user} = $user if $user;
     $search_params{module} = { -in => [ @modules ] } if ( defined $modules[0] and $modules[0] ne '' ) ;
     $search_params{action} = { -in => [ @actions ] } if ( defined $actions[0] && $actions[0] ne '' );