RT#38217: Send email when logging conditions are met
[freeside.git] / httemplate / search / log.html
index d4fed54..9a61a71 100644 (file)
@@ -1,6 +1,7 @@
 <& elements/search.html, 
   'title'         => 'System Log',
   'name_singular' => 'event',
+  'menubar'       => \@menubar,
   'html_init'     => include('.head'),
   'query'         => $query,
   'count_query'   => $count_query,
@@ -64,14 +65,14 @@ a:visited {text-decoration: none}
 <TR>
   <TD>From 
     <& /elements/input-date-field.html, {
-      name => 'beginning',
-      value => $cgi->param('beginning'),
+      name   => 'beginning',
+      value  => scalar($cgi->param('beginning')),
     } &>
   </TD>
   <TD>To 
     <& /elements/input-date-field.html, {
-      name => 'ending',
-      value => $cgi->param('ending') || '',
+      name   => 'ending',
+      value  => scalar($cgi->param('ending')) || '',
       noinit => 1,
     } &>
   </TD>
@@ -79,17 +80,17 @@ a:visited {text-decoration: none}
 <TR>
   <TD>Level
     <& /elements/select.html,
-      field => 'min_level',
-      options => [ 0..7 ],
-      labels => { map {$_ => $FS::Log::LEVELS[$_]} 0..7 },
-      curr_value => $cgi->param('min_level'),
+      field      => 'min_level',
+      options    => [ 0..7 ],
+      labels     => { map {$_ => $FS::Log::LEVELS[$_]} 0..7 },
+      curr_value => scalar($cgi->param('min_level')),
     &>
      to
     <& /elements/select.html,
-      field => 'max_level',
-      options => [ 0..7 ],
-      labels => { map {$_ => $FS::Log::LEVELS[$_]} 0..7 },
-      curr_value => $cgi->param('max_level'),
+      field      => 'max_level',
+      options    => [ 0..7 ],
+      labels     => { map {$_ => $FS::Log::LEVELS[$_]} 0..7 },
+      curr_value => scalar($cgi->param('max_level')),
     &>
   </TD>
   <TD>
@@ -210,6 +211,9 @@ my $curuser = $FS::CurrentUser::CurrentUser;
 die "access denied"
   unless $curuser->access_right([ 'View system logs', 'Configuration' ]);
 
+my @menubar = ();
+push @menubar, qq(<A HREF="${fsurl}browse/log_email.html" STYLE="text-decoration: underline;">Configure conditions for sending email when logging</A>),
+
 $cgi->param('min_level', 0) unless defined($cgi->param('min_level'));
 $cgi->param('max_level', 7) unless defined($cgi->param('max_level'));