Bug 24789 [E|A|R] Add Estimated, Actual, Remaining Time Fields
patch by jeff.hedlund@matrixsi.com 2xr=joel,justdave git-svn-id: svn://10.0.0.236/trunk@131895 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -149,6 +149,11 @@ sub init {
|
||||
push(@specialchart, ["keywords", $t, $F{'keywords'}]);
|
||||
}
|
||||
|
||||
if (lsearch($fieldsref, "(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time") != -1) {
|
||||
push(@supptables, "longdescs AS ldtime");
|
||||
push(@wherepart, "ldtime.bug_id = bugs.bug_id");
|
||||
}
|
||||
|
||||
foreach my $id ("1", "2") {
|
||||
if (!defined ($F{"email$id"})) {
|
||||
next;
|
||||
@@ -323,6 +328,62 @@ sub init {
|
||||
push(@wherepart, "$table.bug_id = bugs.bug_id");
|
||||
$f = "$table.thetext";
|
||||
},
|
||||
"^work_time,changedby" => sub {
|
||||
my $table = "longdescs_$chartid";
|
||||
push(@supptables, "longdescs $table");
|
||||
push(@wherepart, "$table.bug_id = bugs.bug_id");
|
||||
my $id = &::DBNameToIdAndCheck($v);
|
||||
$term = "(($table.who = $id";
|
||||
$term .= ") AND ($table.work_time <> 0))";
|
||||
},
|
||||
"^work_time,changedbefore" => sub {
|
||||
my $table = "longdescs_$chartid";
|
||||
push(@supptables, "longdescs $table");
|
||||
push(@wherepart, "$table.bug_id = bugs.bug_id");
|
||||
$term = "(($table.bug_when < " . &::SqlQuote(SqlifyDate($v));
|
||||
$term .= ") AND ($table.work_time <> 0))";
|
||||
},
|
||||
"^work_time,changedafter" => sub {
|
||||
my $table = "longdescs_$chartid";
|
||||
push(@supptables, "longdescs $table");
|
||||
push(@wherepart, "$table.bug_id = bugs.bug_id");
|
||||
$term = "(($table.bug_when > " . &::SqlQuote(SqlifyDate($v));
|
||||
$term .= ") AND ($table.work_time <> 0))";
|
||||
},
|
||||
"^work_time," => sub {
|
||||
my $table = "longdescs_$chartid";
|
||||
push(@supptables, "longdescs $table");
|
||||
push(@wherepart, "$table.bug_id = bugs.bug_id");
|
||||
$f = "$table.work_time";
|
||||
},
|
||||
"^percentage_complete," => sub {
|
||||
my $oper;
|
||||
if ($t eq "equals") {
|
||||
$oper = "=";
|
||||
} elsif ($t eq "greaterthan") {
|
||||
$oper = ">";
|
||||
} elsif ($t eq "lessthan") {
|
||||
$oper = "<";
|
||||
} elsif ($t eq "notequal") {
|
||||
$oper = "<>";
|
||||
} elsif ($t eq "regexp") {
|
||||
$oper = "REGEXP";
|
||||
} elsif ($t eq "notregexp") {
|
||||
$oper = "NOT REGEXP";
|
||||
} else {
|
||||
$oper = "noop";
|
||||
}
|
||||
if ($oper ne "noop") {
|
||||
my $table = "longdescs_$chartid";
|
||||
push(@supptables, "longdescs $table");
|
||||
push(@wherepart, "$table.bug_id = bugs.bug_id");
|
||||
my $field = "(100*((SUM($table.work_time)*COUNT(DISTINCT $table.bug_when)/COUNT(bugs.bug_id))/((SUM($table.work_time)*COUNT(DISTINCT $table.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS percentage_complete_$table";
|
||||
push(@fields, $field);
|
||||
push(@having,
|
||||
"percentage_complete_$table $oper " . &::SqlQuote($v));
|
||||
}
|
||||
$term = "0=0";
|
||||
},
|
||||
"^bug_group,(?!changed)" => sub {
|
||||
push(@supptables, "LEFT JOIN bug_group_map bug_group_map_$chartid ON bugs.bug_id = bug_group_map_$chartid.bug_id");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user