diff options
author | lpsolit%gmail.com <> | 2007-04-10 17:07:16 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-04-10 17:07:16 +0000 |
commit | 8918a55e52c9badc177a791a4e70b1033c6615b7 (patch) | |
tree | 7a244379b60d3f084833d870b56cf622bfa29ce4 | |
parent | 49ac4e07d266ab55285e6c497cab5d17c56e8fcf (diff) | |
download | bugs-8918a55e52c9badc177a791a4e70b1033c6615b7.tar bugs-8918a55e52c9badc177a791a4e70b1033c6615b7.tar.gz bugs-8918a55e52c9badc177a791a4e70b1033c6615b7.tar.bz2 bugs-8918a55e52c9badc177a791a4e70b1033c6615b7.tar.xz bugs-8918a55e52c9badc177a791a4e70b1033c6615b7.zip |
Bug 344969: Remove hardcoded bug statuses from collectstats.pl and reports.cgi (prepare them for custom statuses) - Patch by Frédéric Buclin <LpSolit@gmail.com> r=gerv a=LpSolit
-rwxr-xr-x | collectstats.pl | 36 | ||||
-rwxr-xr-x | reports.cgi | 2 |
2 files changed, 21 insertions, 17 deletions
diff --git a/collectstats.pl b/collectstats.pl index 7bc2b6174..ca97c0043 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -72,19 +72,21 @@ my $datadir = bz_locations()->{'datadir'}; my @myproducts = map {$_->name} Bugzilla::Product->get_all; unshift(@myproducts, "-All-"); -# As we can now customize the list of resolutions, looking at the actual list -# of available resolutions only is not enough as some now removed resolutions +# As we can now customize statuses and resolutions, looking at the current list +# of legal values only is not enough as some now removed statuses and resolutions # may have existed in the past, or have been renamed. We want them all. -my @resolutions = @{get_legal_field_values('resolution')}; -my $old_resolutions = - $dbh->selectcol_arrayref('SELECT bugs_activity.added +my $fields = {}; +foreach my $field ('bug_status', 'resolution') { + my $values = get_legal_field_values($field); + my $old_values = $dbh->selectcol_arrayref( + "SELECT bugs_activity.added FROM bugs_activity INNER JOIN fielddefs ON fielddefs.id = bugs_activity.fieldid - LEFT JOIN resolution - ON resolution.value = bugs_activity.added + LEFT JOIN $field + ON $field.value = bugs_activity.added WHERE fielddefs.name = ? - AND resolution.id IS NULL + AND $field.id IS NULL UNION @@ -92,19 +94,21 @@ my $old_resolutions = FROM bugs_activity INNER JOIN fielddefs ON fielddefs.id = bugs_activity.fieldid - LEFT JOIN resolution - ON resolution.value = bugs_activity.removed + LEFT JOIN $field + ON $field.value = bugs_activity.removed WHERE fielddefs.name = ? - AND resolution.id IS NULL', - undef, ('resolution', 'resolution')); + AND $field.id IS NULL", + undef, ($field, $field)); -push(@resolutions, @$old_resolutions); + push(@$values, @$old_values); + $fields->{$field} = $values; +} + +my @statuses = @{$fields->{'bug_status'}}; +my @resolutions = @{$fields->{'resolution'}}; # Exclude "" from the resolution list. @resolutions = grep {$_} @resolutions; -# Actually, the list of statuses is predefined. This will change in the near future. -my @statuses = qw(NEW ASSIGNED REOPENED UNCONFIRMED RESOLVED VERIFIED CLOSED); - my $tstart = time; foreach (@myproducts) { my $dir = "$datadir/mining"; diff --git a/reports.cgi b/reports.cgi index 2c9f8facc..0be2ab64b 100755 --- a/reports.cgi +++ b/reports.cgi @@ -75,7 +75,7 @@ if (! defined $cgi->param('product')) { || ThrowCodeError('chart_dir_nonexistent', {dir => $dir, graph_dir => $graph_dir}); - my %default_sel = map { $_ => 1 } qw/UNCONFIRMED NEW ASSIGNED REOPENED/; + my %default_sel = map { $_ => 1 } BUG_STATE_OPEN; my @datasets; my @data = get_data($dir); |