Bug 40933

showdependencygraph.cgi: 
alt="ID: bugtitle" вместо alt="bug #bugid" 
Более богатая раскраска багов по состояниям


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@91 6955db30-a419-402b-8a0d-67ecbb4d7f56
custis
vfilippov 2009-01-12 16:26:55 +00:00
parent 1c7f753312
commit 15d8fc692b
2 changed files with 32 additions and 6 deletions

View File

@ -173,7 +173,7 @@ foreach my $result (@$results) {
$row = "" if ($row eq $columns{''});
$col = "" if ($col eq $columns{''});
$tbl = "" if ($tbl eq $columns{''});
# account for the fact that names may start with '_' or '.'. Change this
# so the template doesn't hide hash elements with those keys
$row =~ s/^([._])/ $1/;
@ -184,7 +184,7 @@ foreach my $result (@$results) {
$names{"col"}{$col}++;
$names{"row"}{$row}++;
$names{"tbl"}{$tbl}++;
$col_isnumeric &&= ($col =~ /^-?\d+(\.\d+)?$/o);
$row_isnumeric &&= ($row =~ /^-?\d+(\.\d+)?$/o);
$tbl_isnumeric &&= ($tbl =~ /^-?\d+(\.\d+)?$/o);

View File

@ -73,7 +73,7 @@ sub CreateImagemap {
# bugtitle hash instead of mapdata allows us to get the summary even
# when showsummary is off, and also gives us status and resolution.
my $bugtitle = html_quote(clean_text($bugtitles{$bugid}));
$map .= qq{<area alt="bug $bugid" name="bug$bugid" shape="rect" } .
$map .= qq{<area alt="$bugtitle" name="bug$bugid" shape="rect" } .
qq{title="$bugtitle" href="$url" } .
qq{coords="$leftx,$topy,$rightx,$bottomy">\n};
}
@ -214,9 +214,7 @@ foreach my $k (keys(%seen)) {
push(@params, "shape=box");
}
if (is_open_state($stat)) {
push(@params, "color=green");
}
push(@params, "color=" . GetColorByState($stat) );
if (@params) {
print $fh "$k [" . join(',', @params) . "]\n";
@ -236,6 +234,34 @@ foreach my $k (keys(%seen)) {
}
}
sub GetColorByState {
my ($state) = (@_);
if ( $state eq "UNCONFIRMED" ) {
return "white";
}
if ( $state eq "NEW" ) {
return "orange";
}
if ( $state eq "ASSIGNED" ) {
return "yellow";
}
if ( $state eq "RESOLVED" ) {
return "green";
}
if ( $state eq "VERIFIED" ) {
return "slateblue";
}
if ( $state eq "CLOSED" ) {
return "lightgrey";
}
if ( $state eq "REOPENED" ) {
return "orangered";
}
if ( IsOpenedState($state)) {
return "green";
}
return "lightgrey";
}
print $fh "}\n";
close $fh;