--- bugzilla-2.18/whineatnews.pl 2005-01-01 08:47:54.000000000 -0500 +++ bugzilla-2.18.formattedwhine/whineatnews.pl 2005-03-19 23:52:56.013683558 -0500 @@ -20,7 +20,10 @@ # # Contributor(s): Terry Weissman # Joseph Heenan - +# +# Additional Customizations by: +# Daniel Savarese (https://www.savarese.org/contact.html) +# # This is a script suitable for running once a day from a cron job. It # looks at all the bugs, and sends whiny mail to anyone who has a bug @@ -33,17 +36,23 @@ use Bugzilla::BugMail; -SendSQL("select bug_id,short_desc,login_name from bugs,profiles where " . - "(bug_status = 'NEW' or bug_status = 'REOPENED') and " . - "to_days(now()) - to_days(delta_ts) > " . Param('whinedays') . - " and userid=assigned_to order by bug_id"); +SendSQL( + "select bug_id,short_desc,login_name,bug_status,bug_severity,creation_ts " . + "from bugs,profiles where " . + "(bug_status != 'CLOSED' and bug_status != 'RESOLVED') and " . + "to_days(now()) - to_days(delta_ts) > " . Param('whinedays') . + " and userid=assigned_to order by bug_id"); my %bugs; my %desc; +my %status; +my %severity; +my %created; my @row; + while (@row = FetchSQLData()) { - my ($id, $desc, $email) = (@row); + my ($id, $desc, $email, $status, $severity, $created) = (@row); if (!defined $bugs{$email}) { $bugs{$email} = []; } @@ -52,12 +61,30 @@ } push @{$bugs{$email}}, $id; push @{$desc{$email}}, $desc; + push @{$status{$email}}, $status; + push @{$severity{$email}}, $severity; + push @{$created{$email}}, $created; } my $template = Param('whinemail'); my $urlbase = Param('urlbase'); my $emailsuffix = Param('emailsuffix'); +my $msgheader ="\ ++---------------------------------------------------------------------------+\ +| Issue ID |\ +| +---------------------------------------------------------------------+\ +| | Status: UNC=Unconfirmed NEW=New ASS=Assigned |\ +| | REO=Reopened VER=Verified (Skipped Closed/Resolved) |\ +| | +-----------------------------------------------------------------+\ +| | | Severity: BLK=Blocker CRI=Critical MAJ=Major |\ +| | | MIN=Minor NOR=Normal ENH=Enhancement |\ +| | | +-------------------------------------------------------------+\ +| | | | Date Posted |\ +| | | | +--------------------------------------------------+\ +| | | | | Description |\ +| | | | | |"; + foreach my $email (sort (keys %bugs)) { my %substs; @@ -65,12 +92,26 @@ $substs{'userid'} = $email; my $msg = PerformSubsts($template, \%substs); + $msg .= $msgheader; + foreach my $i (@{$bugs{$email}}) { - $msg .= " " . shift(@{$desc{$email}}) . "\n"; - $msg .= " -> ${urlbase}show_bug.cgi?id=$i\n"; + my $id = $i; + my $status = shift(@{$status{$email}}); + my $severity = uc shift(@{$severity{$email}}); + my $created = shift(@{$created{$email}}); + my $desc = shift(@{$desc{$email}}); + + $severity =~ s/BLO/BLK/; + + $msg .= sprintf("\n|%5.5s|%3.3s|%3.3s|%10.10s|%-50.50s|", $id, + $status, $severity, $created, $desc); } + $msg .= "\n+-----+---+---+----------+--------------------------------------------------+"; + $msg .= + sprintf("\n| Total %4.4s issues" . + " |", + scalar(@{$bugs{$email}})); + $msg .= "\n+---------------------------------------------------------------------------+\n"; Bugzilla::BugMail::MessageToMTA($msg); - - print "$email " . join(" ", @{$bugs{$email}}) . "\n"; }