use C4::Output;
use C4::Log;
use C4::Items;
+use C4::Branch;
+use C4::Debug;
+# use Data::Dumper;
-use vars qw($debug);
-
-BEGIN {
- $debug = $ENV{DEBUG} || 0;
-}
+use vars qw($debug $cgi_debug);
=head1 viewlog.pl
-plugin that shows a stats on borrowers
+plugin that shows stats
=cut
my $input = new CGI;
-$debug or $debug = $input->param('debug') || 0;
+
+$debug or $debug = $cgi_debug;
my $do_it = $input->param('do_it');
my $module = $input->param("module");
my $user = $input->param("user");
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { tools => 1 },
+ flagsrequired => { tools => 'view_system_logs' },
debug => 1,
}
);
-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 = GetPatronImage($data->{'cardnumber'});
- $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'},
- picture => $picture,
+ 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'},
+ categoryname => $data->{'description'},
+ address => $data->{'address'},
+ address2 => $data->{'address2'},
+ city => $data->{'city'},
+ zipcode => $data->{'zipcode'},
+ phone => $data->{'phone'},
+ phonepro => $data->{'phonepro'},
+ email => $data->{'email'},
+ branchcode => $data->{'branchcode'},
+ branchname => GetBranchName($data->{'branchcode'}),
);
}
if ( $output eq "screen" ) {
# Printing results to screen
$template->param (
+ logview => 1,
total => $total,
$module => 1,
looprow => $results,
object => $object,
action => $action,
info => $info,
+ src => $src,
);
output_html_with_http_headers $input, $cookie, $template->output;
} else {