viewlog.pl - fixes bug 1657, passes DHTMLcalendar_dateformat
authorJoe Atzberger <joe.atzberger@liblime.com>
Wed, 19 Dec 2007 18:29:02 +0000 (12:29 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 20 Dec 2007 00:54:48 +0000 (18:54 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
tools/viewlog.pl

index 0d5379e..69254fc 100755 (executable)
@@ -27,6 +27,12 @@ use C4::Dates;
 use C4::Output;
 use C4::Log;
 
+use vars qw($debug);
+
+BEGIN {
+       $debug = $ENV{DEBUG} || 0;
+}
+
 =head1 viewlog.pl
 
 plugin that shows a stats on borrowers
@@ -34,6 +40,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");
 my $user     = $input->param("user");
@@ -58,6 +65,12 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     }
 );
 
+$template->param(
+       DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+                     dateformat => C4::Dates->new()->format(),
+                                      debug => $debug,
+);
+
 if ($do_it) {
 
     my $results = GetLogs($datefrom,$dateto,$user,$module,$action,$object,$info);
@@ -119,7 +132,6 @@ if ($do_it) {
         total        => 0,
         CGIextChoice => $CGIextChoice,
         CGIsepChoice => $CGIsepChoice,
-        DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
     );
     output_html_with_http_headers $input, $cookie, $template->output;
 }