More changes to quickstats.
[clearscm.git] / maps / bin / detail.cgi
index f4885fd..ef67882 100755 (executable)
@@ -160,6 +160,8 @@ sub Body($) {
 
   MakeButtons $type;
 
+  print start_div {-id => 'highlightrow'};
+
   print start_table({-align        => 'center',
                      -id           => $table_name,
                      -border       => 0,
@@ -169,7 +171,7 @@ sub Body($) {
 
   print
     Tr [
-      td {-class  => 'tablebordertopleft'},  ' ',
+      th {-class  => 'tablebordertopleft'},  '',
       th {-class  => 'tableborder'},         'Sender',
       th {-class  => 'tableborder'},         'List',
       th {-class  => 'tableborder'},         'Hit Count',
@@ -240,7 +242,11 @@ sub Body($) {
       } # unless
     } # unless
 
-    my ($list, $sequence, $comment);
+    $hit_count //= '';
+
+    my $list     = '';
+    my $sequence = 0;
+    my $comment  = '';
 
     # Parse rule
     if ($rule) {
@@ -259,6 +265,7 @@ sub Body($) {
       $rule =~ s/\\@/\@/;
     } # if
 
+    $sequence //= 0;
     $next++;
 
     # Start Sender line
@@ -311,12 +318,18 @@ sub Body($) {
     }, $comment;
     print end_Tr;
 
+    my $msgnbr = 0;
+
     for my $rec (@$msgs) {
+      $msgnbr++;
+
       # We increased $next earlier so do not add 1 here
       if (($next % $lines) == (@senders % $lines)) {
         $dataclass    = 'tablebottomdata';
-        $rightclass   = 'tablebottomright';
-        $subjectclass = 'subjectbottom';
+        $rightclass   = 'tablebottomright' if $msgnbr == @$msgs;
+
+        # Only subjectbottom the last message
+        $subjectclass = 'subjectbottom' if $msgnbr == @$msgs;
       } # if
 
       if ($date eq substr ($rec->{timestamp}, 0, 10)) {
@@ -336,20 +349,22 @@ sub Body($) {
             -class   => $subjectclass,
             -colspan => 4,
           }, a {
-            -href  => "display.cgi?sender=$sender;msg_date=$rec->{timestamp}",
+            -href    => "display.cgi?sender=$sender;msg_date=$rec->{timestamp}",
            }, '    ' . $rec->{subject},
-          td {-class   => $rightclass,
-              -width   => '150',
-              -align   => 'right'}, span {-class => 'date'}, $rec->{date} . '&nbsp',
+          td {-class => $rightclass,
+              -width => '150',
+              -align => 'right'}, span {-class => 'date'}, $rec->{date} . '&nbsp',
         ];
     } # for
   } # for
 
   print end_table;
-  print end_form;
+  print end_div;
 
   MakeButtons $type;
 
+  print end_form;
+
   return;
 } # Body
 
@@ -388,8 +403,10 @@ if ($date eq '') {
   $condition .= "type = '$type' and timestamp > '$sod' and timestamp < '$eod'";
 } # if
 
-$total = CountLog(
+# Need to count distinct on sender
+$total = CountLogDistinct(
   userid     => $userid,
+  column     => 'sender',
   additional => $condition,
 );