From 12b3b674e4dac42707c39ce2389907f2e4e6a74c Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 14 Jul 2006 01:00:40 +0000 Subject: Bug 94534: Customised resolutions - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collectstats.pl | 195 ++++++++++++++------- editvalues.cgi | 68 ++++--- reports.cgi | 6 +- t/008filter.t | 2 +- .../admin/fieldvalues/confirm-delete.html.tmpl | 4 +- .../en/default/admin/fieldvalues/edit.html.tmpl | 11 +- .../en/default/admin/fieldvalues/list.html.tmpl | 39 ++++- template/en/default/bug/activity/table.html.tmpl | 4 +- template/en/default/bug/edit.html.tmpl | 2 +- template/en/default/bug/knob.html.tmpl | 4 +- template/en/default/bug/show-multiple.html.tmpl | 2 +- template/en/default/email/whine.txt.tmpl | 2 +- template/en/default/global/field-descs.none.tmpl | 2 + template/en/default/global/user-error.html.tmpl | 10 ++ template/en/default/list/edit-multiple.html.tmpl | 4 +- template/en/default/list/table.html.tmpl | 2 +- template/en/default/pages/fields.html.tmpl | 12 +- template/en/default/reports/report-bar.png.tmpl | 4 +- template/en/default/reports/report-line.png.tmpl | 4 +- template/en/default/reports/report-pie.png.tmpl | 2 +- template/en/default/reports/report-table.csv.tmpl | 4 +- template/en/default/reports/report-table.html.tmpl | 4 +- template/en/default/search/form.html.tmpl | 7 +- template/en/default/whine/mail.html.tmpl | 2 +- template/en/default/whine/mail.txt.tmpl | 2 +- 25 files changed, 268 insertions(+), 130 deletions(-) diff --git a/collectstats.pl b/collectstats.pl index 0739d0312..5ba56fe4b 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -23,6 +23,7 @@ # Gervase Markham # Richard Walters # Jean-Sebastien Guay +# Frédéric Buclin # Run me out of cron at midnight to collect Bugzilla statistics. # @@ -41,6 +42,7 @@ use Bugzilla::Util; use Bugzilla::Search; use Bugzilla::User; use Bugzilla::Product; +use Bugzilla::Field; # Turn off output buffering (probably needed when displaying output feedback # in the regenerate mode.) @@ -55,7 +57,7 @@ if (chdir("graphs")) { # Let Throw*Error() work correctly outside a web browser. Bugzilla->batch(1); -Bugzilla->switch_to_shadow_db(); +my $dbh = Bugzilla->switch_to_shadow_db(); # To recreate the daily statistics, run "collectstats.pl --regenerate" . my $regenerate = 0; @@ -69,6 +71,39 @@ my $datadir = bz_locations()->{'datadir'}; my @myproducts = map {$_->name} Bugzilla::Product::get_all_products(); 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 +# 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 + FROM bugs_activity + INNER JOIN fielddefs + ON fielddefs.fieldid = bugs_activity.fieldid + LEFT JOIN resolution + ON resolution.value = bugs_activity.added + WHERE fielddefs.name = ? + AND resolution.id IS NULL + + UNION + + SELECT bugs_activity.removed + FROM bugs_activity + INNER JOIN fielddefs + ON fielddefs.fieldid = bugs_activity.fieldid + LEFT JOIN resolution + ON resolution.value = bugs_activity.removed + WHERE fielddefs.name = ? + AND resolution.id IS NULL', + undef, ('resolution', 'resolution')); + +push(@resolutions, @$old_resolutions); +# 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"; @@ -143,56 +178,108 @@ sub collect_stats { my $file = join '/', $dir, $file_product; my $exists = -f $file; - if (open DATA, ">>$file") { - push (my @row, &today); - my $status_sql = q{SELECT COUNT(*) - FROM bugs - WHERE bug_status = ?}; - - my $reso_sql = q{SELECT COUNT(*) - FROM bugs - WHERE resolution = ?}; - - if ($product ne '-All-') { - $status_sql .= q{ AND product_id = ?}; - $reso_sql .= q{ AND product_id = ?}; - } - - my $sth_status = $dbh->prepare($status_sql); - my $sth_reso = $dbh->prepare($reso_sql); - - my @values ; - foreach my $status ('NEW', 'ASSIGNED', 'REOPENED', 'UNCONFIRMED', 'RESOLVED', 'VERIFIED', 'CLOSED') { - @values = ($status); - push (@values, $product_id) if ($product ne '-All-'); - my $count = $dbh->selectrow_array($sth_status, undef, @values); - push(@row, $count); - } - foreach my $resolution ('FIXED', 'INVALID', 'WONTFIX', 'LATER', 'REMIND', 'DUPLICATE', 'WORKSFORME', 'MOVED') { - @values = ($resolution); - push (@values, $product_id) if ($product ne '-All-'); - my $count = $dbh->selectrow_array($sth_reso, undef, @values); - push(@row, $count); - } + # if the file exists, get the old status and resolution list for that product. + my @data; + @data = get_old_data($file) if $exists; + + # If @data is not empty, then we have to recreate the data file. + if (scalar(@data)) { + open(DATA, '>', $file) + || ThrowCodeError('chart_file_open_fail', {'filename' => $file}); + } + else { + open(DATA, '>>', $file) + || ThrowCodeError('chart_file_open_fail', {'filename' => $file}); + } + + # Now collect current data. + my @row = (today()); + my $status_sql = q{SELECT COUNT(*) FROM bugs WHERE bug_status = ?}; + my $reso_sql = q{SELECT COUNT(*) FROM bugs WHERE resolution = ?}; + + if ($product ne '-All-') { + $status_sql .= q{ AND product_id = ?}; + $reso_sql .= q{ AND product_id = ?}; + } + + my $sth_status = $dbh->prepare($status_sql); + my $sth_reso = $dbh->prepare($reso_sql); + + my @values ; + foreach my $status (@statuses) { + @values = ($status); + push (@values, $product_id) if ($product ne '-All-'); + my $count = $dbh->selectrow_array($sth_status, undef, @values); + push(@row, $count); + } + foreach my $resolution (@resolutions) { + @values = ($resolution); + push (@values, $product_id) if ($product ne '-All-'); + my $count = $dbh->selectrow_array($sth_reso, undef, @values); + push(@row, $count); + } - if (! $exists) { - print DATA <{$_} ? $data->{$_} : ''} + ('DATE', @statuses, @resolutions)) . "\n"; + } + print DATA (join '|', @row) . "\n"; + close DATA; + chmod 0644, $file; +} + +sub get_old_data { + my $file = shift; + + open(DATA, '<', $file) + || ThrowCodeError('chart_file_open_fail', {'filename' => $file}); + + my @data; + my @columns; + my $recreate = 0; + while () { + chomp; + next unless $_; + if (/^# fields?:\s*(.+)\s*$/) { + @columns = split(/\|/, $1); + # Compare this list with @statuses and @resolutions. + # If they are identical, then we can safely append new data + # to the end of the file; else we have to recreate it. + $recreate = 1; + my @new_cols = ($columns[0], @statuses, @resolutions); + if (scalar(@columns) == scalar(@new_cols)) { + my ($removed, $added) = diff_arrays(\@columns, \@new_cols); + last if (!scalar(@$removed) && !scalar(@$added)); + } + } + next unless $recreate; + next if (/^#/); # Ignore comments. + # If we have to recreate the file, we have to load all existing + # data first. + my @line = split /\|/; + my %data; + foreach my $column (@columns) { + $data{$column} = shift @line; + } + push(@data, \%data); } + close(DATA); + return @data; } sub calculate_dupes { @@ -317,12 +404,13 @@ sub regenerate_stats { if (open DATA, ">$file") { DATA->autoflush(1); + my $fields = join('|', ('DATE', @statuses, @resolutions)); print DATA < Show nice list of fields # @@ -156,9 +161,9 @@ unless ($action) { {Slice =>{}}); $vars->{'field'} = $field; $vars->{'values'} = $fieldvalues; - $vars->{'default'} = Bugzilla->params->{$defaults{$field}}; - $template->process("admin/fieldvalues/list.html.tmpl", - $vars) + $vars->{'default'} = Bugzilla->params->{$defaults{$field}} if defined $defaults{$field}; + $vars->{'static'} = $static{$field} if exists $static{$field}; + $template->process("admin/fieldvalues/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; @@ -245,6 +250,12 @@ if ($action eq 'del') { $vars->{'value'} = $value; $vars->{'field'} = $field; $vars->{'param_name'} = $defaults{$field}; + + # If the value cannot be deleted, throw an error. + if (lsearch($static{$field}, $value) >= 0) { + ThrowUserError('fieldvalue_not_deletable', $vars); + } + $template->process("admin/fieldvalues/confirm-delete.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -258,11 +269,21 @@ if ($action eq 'del') { # if ($action eq 'delete') { ValueMustExist($field, $value); - if ($value eq Bugzilla->params->{$defaults{$field}}) { - ThrowUserError('fieldvalue_is_default', {field => $field, - value => $value, - param_name => $defaults{$field}}) + + $vars->{'value'} = $value; + $vars->{'field'} = $field; + $vars->{'param_name'} = $defaults{$field}; + + if (defined $defaults{$field} + && ($value eq Bugzilla->params->{$defaults{$field}})) + { + ThrowUserError('fieldvalue_is_default', $vars); + } + # If the value cannot be deleted, throw an error. + if (lsearch($static{$field}, $value) >= 0) { + ThrowUserError('fieldvalue_not_deletable', $vars); } + trick_taint($field); trick_taint($value); @@ -284,8 +305,6 @@ if ($action eq 'delete') { $dbh->bz_unlock_tables(); - $vars->{'value'} = $value; - $vars->{'field'} = $field; $template->process("admin/fieldvalues/deleted.html.tmpl", $vars) || ThrowTemplateError($template->error()); @@ -307,9 +326,9 @@ if ($action eq 'edit') { $vars->{'value'} = $value; $vars->{'field'} = $field; + $vars->{'is_static'} = (lsearch($static{$field}, $value) >= 0) ? 1 : 0; - $template->process("admin/fieldvalues/edit.html.tmpl", - $vars) + $template->process("admin/fieldvalues/edit.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; @@ -327,9 +346,17 @@ if ($action eq 'update') { trick_taint($field); trick_taint($valueold); + $vars->{'value'} = $value; + $vars->{'field'} = $field; + + # If the value cannot be renamed, throw an error. + if (lsearch($static{$field}, $valueold) >= 0 && $value ne $valueold) { + $vars->{'old_value'} = $valueold; + ThrowUserError('fieldvalue_not_editable', $vars); + } + if (length($value) > 60) { - ThrowUserError('fieldvalue_name_too_long', - {'value' => $value}); + ThrowUserError('fieldvalue_name_too_long', $vars); } $dbh->bz_lock_tables('bugs WRITE', "$field WRITE"); @@ -359,9 +386,7 @@ if ($action eq 'update') { ThrowUserError('fieldvalue_undefined'); } if (ValueExists($field, $value)) { - ThrowUserError('fieldvalue_already_exists', - {'value' => $value, - 'field' => $field}); + ThrowUserError('fieldvalue_already_exists', $vars); } trick_taint($value); @@ -380,7 +405,8 @@ if ($action eq 'update') { # update data/params accordingly. # This update is done while tables are unlocked due to the # annoying calls in Bugzilla/Config/Common.pm. - if ($value ne $valueold + if (defined $defaults{$field} + && $value ne $valueold && $valueold eq Bugzilla->params->{$defaults{$field}}) { SetParam($defaults{$field}, $value); @@ -388,8 +414,6 @@ if ($action eq 'update') { $vars->{'default_value_updated'} = 1; } - $vars->{'value'} = $value; - $vars->{'field'} = $field; $template->process("admin/fieldvalues/updated.html.tmpl", $vars) || ThrowTemplateError($template->error()); diff --git a/reports.cgi b/reports.cgi index 9df5824d7..e0ef55daf 100755 --- a/reports.cgi +++ b/reports.cgi @@ -228,10 +228,10 @@ sub chart_image_name { # is that we have to check the safety of doing this. We can't just require # that the fields exist, because what stats were collected could change # over time (eg by changing the resolutions available) - # Instead, just require that each field name consists only of letters - # and number + # Instead, just require that each field name consists only of letters, + # numbers, underscores and hyphens. - if ($datasets !~ m/^[A-Za-z0-9:]+$/) { + if ($datasets !~ m/^[A-Za-z0-9:_-]+$/) { $vars->{'datasets'} = $datasets; ThrowUserError('invalid_datasets', $vars); } diff --git a/t/008filter.t b/t/008filter.t index 1046218a8..02d4d4a7e 100644 --- a/t/008filter.t +++ b/t/008filter.t @@ -176,7 +176,7 @@ sub directive_ok { return 1 if $directive =~ /^(IF|END|UNLESS|FOREACH|PROCESS|INCLUDE| BLOCK|USE|ELSE|NEXT|LAST|DEFAULT|FLUSH| ELSIF|SET|SWITCH|CASE|WHILE|RETURN|STOP| - TRY|CATCH|FINAL|THROW|CLEAR)/x; + TRY|CATCH|FINAL|THROW|CLEAR|MACRO)/x; # ? : if ($directive =~ /.+\?(.+):(.+)/) { diff --git a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl index 317f1f4b3..d29c124d6 100644 --- a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl +++ b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl @@ -61,13 +61,13 @@

Confirmation

-[% IF (Param(param_name) == value) || bug_count || (value_count == 1) %] +[% IF (param_name.defined && Param(param_name) == value) || bug_count || (value_count == 1) %]

Sorry, but the '[% value FILTER html %]' value cannot be deleted from the '[% field FILTER html %]' field for the following reason(s):

    - [% IF Param(param_name) == value %] + [% IF param_name.defined && Param(param_name) == value %]
  • '[% value FILTER html %]' is the default value for the '[% field FILTER html %]' field. [% IF user.groups.tweakparams %] diff --git a/template/en/default/admin/fieldvalues/edit.html.tmpl b/template/en/default/admin/fieldvalues/edit.html.tmpl index c798bb3a9..362ed4753 100644 --- a/template/en/default/admin/fieldvalues/edit.html.tmpl +++ b/template/en/default/admin/fieldvalues/edit.html.tmpl @@ -33,8 +33,15 @@ - + + [% IF is_static %] + + [% value FILTER html %] + [% ELSE %] + + [% END %] + diff --git a/template/en/default/admin/fieldvalues/list.html.tmpl b/template/en/default/admin/fieldvalues/list.html.tmpl index d25adf2b1..f446d0f96 100644 --- a/template/en/default/admin/fieldvalues/list.html.tmpl +++ b/template/en/default/admin/fieldvalues/list.html.tmpl @@ -21,6 +21,7 @@ # displayed to the user in a list. # # field: string; the name of the field we are editing values for. + # static: array; list of values which cannot be renamed nor deleted. #%] [% USE Bugzilla %] @@ -58,15 +59,35 @@ } ] %] -[% overrides.action = [ { - match_value => "$default" - match_field => 'name' - override_content => 1 - content => "(Default value)" - override_contentlink => 1 - contentlink => undef - } ] -%] +[% IF default.defined %] + [% overrides.action = [ { + match_value => "$default" + match_field => 'name' + override_content => 1 + content => "(Default value)" + override_contentlink => 1 + contentlink => undef + } ] + %] +[% END %] + +[% IF static.size %] + [% UNLESS overrides.action.size %] + [% overrides.action = [] %] + [% END %] + + [% FOREACH static_value = static %] + [% overrides.action.push({ + match_value => "$static_value" + match_field => 'name' + override_content => 1 + content => "(Non deletable value)" + override_contentlink => 1 + contentlink => undef + }) + %] + [% END %] +[% END %] [% PROCESS admin/table.html.tmpl columns = columns diff --git a/template/en/default/bug/activity/table.html.tmpl b/template/en/default/bug/activity/table.html.tmpl index 31556623d..5bfb79f37 100644 --- a/template/en/default/bug/activity/table.html.tmpl +++ b/template/en/default/bug/activity/table.html.tmpl @@ -85,7 +85,7 @@ [% ELSIF change.fieldname == 'bug_status' %] [% status_descs.${change.removed} FILTER html %] [% ELSIF change.fieldname == 'resolution' %] - [% resolution_descs.${change.removed} FILTER html %] + [% get_resolution(change.removed) FILTER html %] [% ELSIF change.fieldname == 'blocked' || change.fieldname == 'dependson' %] [% change.removed FILTER bug_list_link FILTER none %] @@ -105,7 +105,7 @@ [% ELSIF change.fieldname == 'bug_status' %] [% status_descs.${change.added} FILTER html %] [% ELSIF change.fieldname == 'resolution' %] - [% resolution_descs.${change.added} FILTER html %] + [% get_resolution(change.added) FILTER html %] [% ELSIF change.fieldname == 'blocked' || change.fieldname == 'dependson' %] [% change.added FILTER bug_list_link FILTER none %] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index adbccd141..2ea8d0db6 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -198,7 +198,7 @@ - [% resolution_descs.${bug.resolution} FILTER html %] + [% get_resolution(bug.resolution) FILTER html %] [% IF bug.resolution == "DUPLICATE" %] of [% terms.bug %] [%+ "${bug.dup_id}" FILTER bug_link(bug.dup_id) %] [% END %] diff --git a/template/en/default/bug/knob.html.tmpl b/template/en/default/bug/knob.html.tmpl index 38a4898fe..36712911e 100644 --- a/template/en/default/bug/knob.html.tmpl +++ b/template/en/default/bug/knob.html.tmpl @@ -28,7 +28,7 @@
    @@ -185,7 +185,7 @@
    diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index 023cb9573..22bc3db69 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -117,7 +117,7 @@ [% field_descs.bug_status FILTER html %]: [% status_descs.${bug.bug_status} FILTER html %] - [%+ resolution_descs.${bug.resolution} FILTER html %] + [%+ get_resolution(bug.resolution) FILTER html %] [% PROCESS rightcell %] diff --git a/template/en/default/email/whine.txt.tmpl b/template/en/default/email/whine.txt.tmpl index 2e1061709..214231394 100644 --- a/template/en/default/email/whine.txt.tmpl +++ b/template/en/default/email/whine.txt.tmpl @@ -37,7 +37,7 @@ You need to take a look at them, and decide on an initial action. Generally, this means one of three things: -(1) You decide this [% terms.bug %] is really quick to deal with (like, it's [% resolution_descs.INVALID %]), +(1) You decide this [% terms.bug %] is really quick to deal with (like, it's [% get_resolution("INVALID") %]), and so you get rid of it immediately. (2) You decide the [% terms.bug %] doesn't belong to you, and you reassign it to someone else. (Hint: if you don't know who to reassign it to, make diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index 8014fe255..7a2725121 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -88,4 +88,6 @@ "---" => "---", " " => " " } %] +[% MACRO get_resolution(res) GET resolution_descs.$res || res %] + [% Hook.process("end") %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 3b901929f..c615598b9 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -396,6 +396,16 @@ The value of a field is limited to 60 characters. '[% value FILTER html %]' is too long ([% value.length %] characters). + [% ELSIF error == "fieldvalue_not_editable" %] + [% title = "Field Value Not Editable" %] + The value '[% old_value FILTER html %]' cannot be renamed because + it plays some special role for the '[% field FILTER html %]' field. + + [% ELSIF error == "fieldvalue_not_deletable" %] + [% title = "Field Value Not Deletable" %] + The value '[% value FILTER html %]' cannot be removed because + it plays some special role for the '[% field FILTER html %]' field. + [% ELSIF error == "fieldvalue_not_specified" %] [% title = "Field Value Not Specified" %] No field value specified when trying to edit a field value. diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index 687888b24..92a083a68 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -300,8 +300,8 @@
    diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl index 7ef53058a..0387adafb 100644 --- a/template/en/default/list/table.html.tmpl +++ b/template/en/default/list/table.html.tmpl @@ -193,7 +193,7 @@ [% ELSIF column == 'bug_status' %] [%- status_descs.${bug.$column}.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] [% ELSIF column == 'resolution' %] - [%- resolution_descs.${bug.$column}.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] + [%- get_resolution(bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html %] [% ELSE %] [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] [% END %] diff --git a/template/en/default/pages/fields.html.tmpl b/template/en/default/pages/fields.html.tmpl index a45fa0b87..7a41801f4 100644 --- a/template/en/default/pages/fields.html.tmpl +++ b/template/en/default/pages/fields.html.tmpl @@ -148,7 +148,7 @@ cycle of [% terms.abug %].
    - [% resolution_descs.FIXED FILTER html %] + [% get_resolution("FIXED") FILTER html %]
    A fix for this [% terms.bug %] is checked into the tree and @@ -156,14 +156,14 @@ cycle of [% terms.abug %].
    - [% resolution_descs.INVALID FILTER html %] + [% get_resolution("INVALID") FILTER html %]
    The problem described is not [% terms.abug %].
    - [% resolution_descs.WONTFIX FILTER html %] + [% get_resolution("WONTFIX") FILTER html %]
    The problem described is [% terms.abug %] which will never be @@ -171,7 +171,7 @@ cycle of [% terms.abug %].
    - [% resolution_descs.DUPLICATE FILTER html %] + [% get_resolution("DUPLICATE") FILTER html %]
    The problem is a duplicate of an existing [% terms.bug %]. @@ -181,7 +181,7 @@ cycle of [% terms.abug %].
    - [% resolution_descs.WORKSFORME FILTER html %] + [% get_resolution("WORKSFORME") FILTER html %]
    All attempts at reproducing this [% terms.bug %] were futile, @@ -191,7 +191,7 @@ cycle of [% terms.abug %].
    - [% resolution_descs.MOVED FILTER html %] + [% get_resolution("MOVED") FILTER html %]
    The problem was specific to a related product diff --git a/template/en/default/reports/report-bar.png.tmpl b/template/en/default/reports/report-bar.png.tmpl index bb5dab7cd..2c29a3558 100644 --- a/template/en/default/reports/report-bar.png.tmpl +++ b/template/en/default/reports/report-bar.png.tmpl @@ -35,7 +35,7 @@ [% IF col_field == 'resolution' %] [% FOR i IN [ 0 .. data.0.0.max ] %] - [% data.0.0.$i = resolution_descs.${data.0.0.$i} %] + [% data.0.0.$i = get_resolution(data.0.0.$i) %] [% END %] [% END %] @@ -47,7 +47,7 @@ [% IF row_field == 'resolution' %] [% FOR i IN [ 0 .. row_names.max ] %] - [% row_names.$i = resolution_descs.${row_names.$i} %] + [% row_names.$i = get_resolution(row_names.$i) %] [% END %] [% END %] diff --git a/template/en/default/reports/report-line.png.tmpl b/template/en/default/reports/report-line.png.tmpl index 60e9f261a..24215af98 100644 --- a/template/en/default/reports/report-line.png.tmpl +++ b/template/en/default/reports/report-line.png.tmpl @@ -35,7 +35,7 @@ [% IF col_field == 'resolution' %] [% FOR i IN [ 0 .. data.0.0.max ] %] - [% data.0.0.$i = resolution_descs.${data.0.0.$i} %] + [% data.0.0.$i = get_resolution(data.0.0.$i) %] [% END %] [% END %] @@ -47,7 +47,7 @@ [% IF row_field == 'resolution' %] [% FOR i IN [ 0 .. row_names.max ] %] - [% row_names.$i = resolution_descs.${row_names.$i} %] + [% row_names.$i = get_resolution(row_names.$i) %] [% END %] [% END %] diff --git a/template/en/default/reports/report-pie.png.tmpl b/template/en/default/reports/report-pie.png.tmpl index c70b06bcf..3eb73b1b0 100644 --- a/template/en/default/reports/report-pie.png.tmpl +++ b/template/en/default/reports/report-pie.png.tmpl @@ -31,7 +31,7 @@ [% IF col_field == 'resolution' %] [% FOR i IN [ 0 .. data.0.0.max ] %] - [% data.0.0.$i = resolution_descs.${data.0.0.$i} %] + [% data.0.0.$i = get_resolution(data.0.0.$i) %] [% END %] [% END %] diff --git a/template/en/default/reports/report-table.csv.tmpl b/template/en/default/reports/report-table.csv.tmpl index 0abb68ece..2f7f867af 100644 --- a/template/en/default/reports/report-table.csv.tmpl +++ b/template/en/default/reports/report-table.csv.tmpl @@ -44,7 +44,7 @@ [% IF col_field == 'bug_status' %] [% status_descs.$col FILTER csv -%] [% ELSIF col_field == 'resolution' %] - [% resolution_descs.$col FILTER csv -%] + [% get_resolution(col) FILTER csv -%] [% ELSE %] [% col FILTER csv -%] [% END %] @@ -57,7 +57,7 @@ [% IF row_field == 'bug_status' %] [% status_descs.$row FILTER csv -%] [% ELSIF row_field == 'resolution' %] - [% resolution_descs.$row FILTER csv -%] + [% get_resolution(row) FILTER csv -%] [% ELSE %] [% row FILTER csv -%] [% END %] diff --git a/template/en/default/reports/report-table.html.tmpl b/template/en/default/reports/report-table.html.tmpl index 0e2ae62c8..679eb1c1d 100644 --- a/template/en/default/reports/report-table.html.tmpl +++ b/template/en/default/reports/report-table.html.tmpl @@ -88,7 +88,7 @@ [% IF col_field == 'bug_status' %] [% status_descs.$col FILTER html FILTER replace('^ $',' ') %] [% ELSIF col_field == 'resolution' %] - [% resolution_descs.$col FILTER html FILTER replace('^ $',' ') %] + [% get_resolution(col) FILTER html FILTER replace('^ $',' ') %] [% ELSE %] [% col FILTER html FILTER replace('^ $',' ') %] [% END %] @@ -109,7 +109,7 @@ [% IF row_field == 'bug_status' %] [% status_descs.$row FILTER html FILTER replace('^ $',' ') %] [% ELSIF row_field == 'resolution' %] - [% resolution_descs.$row FILTER html FILTER replace('^ $',' ') %] + [% get_resolution(row) FILTER html FILTER replace('^ $',' ') %] [% ELSE %] [% row FILTER html FILTER replace('^ $',' ') %] [% END %] diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index ee8567586..230a438c1 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -628,12 +628,13 @@ function doOnSelectProduct(selectmode) { + [% status_descs.${name} FILTER html %] [% ELSIF sel.name == "resolution" %] - [% resolution_descs.${name} FILTER html %] + [% get_resolution(name) FILTER html %] [% ELSE %] - [% name FILTER html %] + [% name FILTER html %] [% END %] + [% END %] diff --git a/template/en/default/whine/mail.html.tmpl b/template/en/default/whine/mail.html.tmpl index d81043a36..8fe11d657 100644 --- a/template/en/default/whine/mail.html.tmpl +++ b/template/en/default/whine/mail.html.tmpl @@ -84,7 +84,7 @@ [% bug.rep_platform FILTER html %] [% bug.$assignee_login_string FILTER html %] [% status_descs.${bug.bug_status} FILTER html %] - [% resolution_descs.${bug.resolution} FILTER html %] + [% get_resolution(bug.resolution) FILTER html %] [% bug.short_desc FILTER html %] [% END %] diff --git a/template/en/default/whine/mail.txt.tmpl b/template/en/default/whine/mail.txt.tmpl index 962972197..c7dcef3dc 100644 --- a/template/en/default/whine/mail.txt.tmpl +++ b/template/en/default/whine/mail.txt.tmpl @@ -59,7 +59,7 @@ Platform: [%+ bug.rep_platform %] Assignee: [%+ bug.$assignee_login_string %] Status: [%+ status_descs.${bug.bug_status} %] - [%- IF bug.resolution -%] Resolution: [% resolution_descs.${bug.resolution} -%] + [%- IF bug.resolution -%] Resolution: [% get_resolution(bug.resolution) -%] [%- END %] Summary: [% bug.short_desc %] -- cgit v1.2.3-24-g4f1b