# sort people by the number of bugs they have assigned to this milestone
sub bybugs{
$bugsperperson{$a}<=>$bugsperperson{$b}
}
@people=sortbybugs@people;
my$totalpeople=@people;
...
...
@@ -640,3 +642,110 @@ FIN
}
sub most_recently_doomed
{
my$when=localtime(time);
my$ms="M".Param("curmilestone");
my$quip="Summary";
print"<center>\n<h1>";
if($::FORM{'product'}ne"-All-"){
print"Most Recently Doomed ($::FORM{'product'})";
}else{
print"Most Recently Doomed";
}
print"</h1>\n$when<p>\n";
#########################
# start painting report #
#########################
if($::FORM{'quip'})
{
if(open(COMMENTS,"<data/comments"))
{
my@cdata;
while(<COMMENTS>)
{
push@cdata,$_;
}
closeCOMMENTS;
$quip="<i>".$cdata[int(rand($#cdata+1))]."</i>";}
}
# Build up $query string
my$query;
$query="select distinct assigned_to from bugs where bugs.bug_status='NEW' and target_milestone='' and bug_severity!='enhancement' and status_whiteboard='' and (product='Browser' or product='MailNews')";
if($::FORM{'product'}ne"-All-"){
$query.="and bugs.product='$::FORM{'product'}'";
}
# End build up $query string
SendSQL($query);
my@people=();
while(my($person)=FetchSQLData())
{
push@people,$person;
}
#############################
# suck contents of database #
#############################
my$person="";
my$bugtotal=0;
foreach$person(@people)
{
my$query="select count(bug_id) from bugs,profiles where bugs.bug_status='NEW' and userid=assigned_to and userid='$person' and target_milestone='' and bug_severity!='enhancement' and status_whiteboard='' and (product='Browser' or product='MailNews')";
if($::FORM{'product'}ne"-All-"){
$query.="and bugs.product='$::FORM{'product'}'";
}
SendSQL($query);
my$bugcount=FetchSQLData();
$bugsperperson{$person}=$bugcount;
$bugtotal+=$bugcount;
}
# sort people by the number of bugs they have assigned to this milestone
@people=sortbybugs@people;
my$totalpeople=@people;
print"<TABLE>\n";
print"<TR><TD COLSPAN=2>\n";
print"$totalpeople engineers have $bugtotal untouched new bugs.\n";
print"</TD></TR>\n";
while(@people)
{
$person=pop@people;
print"<TR><TD>\n";
SendSQL("select login_name from profiles where userid=$person");