From 2ed253639be5188d765b5a947492e531c969bfb3 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 19 Mar 2008 07:29:27 -0400 Subject: [PATCH] Modifications to viewlog.pl to keep it in the context from which it was called. Signed-off-by: Joshua Ferraro --- .../prog/en/modules/tools/viewlog.tmpl | 9 +++-- tools/viewlog.pl | 36 ++++++++++--------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl index 4c7010c0bd..06ac6669af 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl @@ -19,6 +19,11 @@
+ " /> + " /> + " /> + " /> + " />
Additional parameters

@@ -39,7 +44,7 @@ // } // if (dateFrom > today) { // alert("The starting date cannot be in the future."); - // document.getElementById(from_id).select(); + // document.getElementById(from_id).select(); // return false; // } // } @@ -100,7 +105,7 @@ - + diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 7ae10e29b9..b5505d2e5e 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -27,6 +27,7 @@ use C4::Dates; use C4::Output; use C4::Log; use C4::Items; +use Data::Dumper; use vars qw($debug); @@ -41,6 +42,7 @@ plugin that shows a stats on borrowers =cut my $input = new CGI; + $debug or $debug = $input->param('debug') || 0; my $do_it = $input->param('do_it'); my $module = $input->param("module"); @@ -67,29 +69,27 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); -warn "Source of call was $src"; - if ($src eq 'circ') { # if we were called from circulation, use the circulation menu and get data to populate it -fbcit use C4::Members; my $borrowernumber = $object; my $data = GetMember($borrowernumber,'borrowernumber'); my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); $template->param( picture => 1 ) if $picture; - $template->param( menu => 1, - title => $data->{'title'}, - initials => $data->{'initials'}, - surname => $data->{'surname'}, - borrowernumber => $borrowernumber, - firstname => $data->{'firstname'}, - cardnumber => $data->{'cardnumber'}, - categorycode => $data->{'categorycode'}, - address => $data->{'address'}, - address2 => $data->{'address2'}, - city => $data->{'city'}, - phone => $data->{'phone'}, - phonepro => $data->{'phonepro'}, - email => $data->{'email'}, - branchcode => $data->{'branchcode'}, + $template->param( menu => 1, + title => $data->{'title'}, + initials => $data->{'initials'}, + surname => $data->{'surname'}, + borrowernumber => $borrowernumber, + firstname => $data->{'firstname'}, + cardnumber => $data->{'cardnumber'}, + categorycode => $data->{'categorycode'}, + address => $data->{'address'}, + address2 => $data->{'address2'}, + city => $data->{'city'}, + phone => $data->{'phone'}, + phonepro => $data->{'phonepro'}, + email => $data->{'email'}, + branchcode => $data->{'branchcode'}, ); } @@ -103,6 +103,7 @@ if ($do_it) { my $results = GetLogs($datefrom,$dateto,$user,$module,$action,$object,$info); my $total = scalar @$results; + warn "Total records retrieved = $total"; foreach my $result (@$results){ if ($result->{'info'} eq 'item'){ # get item information so we can create a working link @@ -127,6 +128,7 @@ if ($do_it) { object => $object, action => $action, info => $info, + src => $src, ); output_html_with_http_headers $input, $cookie, $template->output; } else { -- 2.39.5