Bug 21242: If not searching for patron, move to log viewer
authorNick Clemens <nick@bywatersolutions.com>
Fri, 17 Aug 2018 12:22:50 +0000 (12:22 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 29 Oct 2018 01:02:21 +0000 (01:02 +0000)
To test:
1 - Bring up a patron
2 - Click 'Modification log'
3 - Note you get borrower info
4 - Move the object field into info field
5 - Submit
6 - You are now on the 'Log viewer' page with admin options, not
borrower circ options

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

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

tools/viewlog.pl

index b8979ec..2f8bc30 100755 (executable)
@@ -74,9 +74,9 @@ if ( $src eq 'circ' ) {
     use C4::Members::Attributes qw(GetBorrowerAttributes);
     my $borrowernumber = $object;
     my $patron = Koha::Patrons->find( $borrowernumber );
+    my $circ_info = 1;
     unless ( $patron ) {
-        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
-        exit;
+         $circ_info = 0;
     }
     if ( C4::Context->preference('ExtendedPatronAttributes') ) {
         my $attributes = GetBorrowerAttributes( $borrowernumber );
@@ -88,7 +88,7 @@ if ( $src eq 'circ' ) {
 
     $template->param(
         patron      => $patron,
-        circulation => 1,
+        circulation => $circ_info,
     );
 }