From: Frank Becker Date: Thu, 12 Apr 2012 22:55:00 +0000 (+0200) Subject: Bug 340439: Include classifications in config.cgi X-Git-Tag: bugzilla-4.3.1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0354373916176c202632a7cb8965b1afd578ab8d;p=thirdparty%2Fbugzilla.git Bug 340439: Include classifications in config.cgi r/a=LpSolit --- diff --git a/config.cgi b/config.cgi index 51b33ed7e4..891a2f8a36 100755 --- a/config.cgi +++ b/config.cgi @@ -69,6 +69,18 @@ if ($cgi->param('product')) { # We set the 2nd argument to 1 to also preload flag types. Bugzilla::Product::preload($vars->{'products'}, 1); +if (Bugzilla->params->{'useclassification'}) { + my $class = {}; + # Get all classifications with at least one selectable product. + foreach my $product (@{$vars->{'products'}}) { + $class->{$product->classification_id} ||= $product->classification; + } + my @classifications = sort {$a->sortkey <=> $b->sortkey + || lc($a->name) cmp lc($b->name)} (values %$class); + $vars->{'class_names'} = $class; + $vars->{'classifications'} = \@classifications; +} + # Allow consumers to specify whether or not they want flag data. if (defined $cgi->param('flags')) { $vars->{'show_flags'} = $cgi->param('flags'); diff --git a/template/en/default/config.rdf.tmpl b/template/en/default/config.rdf.tmpl index 4fb51d1098..c6ecac7ce8 100644 --- a/template/en/default/config.rdf.tmpl +++ b/template/en/default/config.rdf.tmpl @@ -105,6 +105,23 @@ [% END %] +[% IF Param('useclassification') %] + + + [% FOREACH classification = classifications %] +
  • + + [% classification.name FILTER html %] + [% classification.description FILTER html %] + [% classification.sortkey FILTER html %] + +
  • + [% END %] +
    +
    +[% END %] + [% FOREACH product = products %] @@ -112,7 +129,9 @@ [% product.name FILTER html %] [% product.allows_unconfirmed FILTER html %] - + [% IF Param('useclassification') %] + [% class_names.${product.classification_id}.name FILTER html %] + [% END %] [% FOREACH component = product.components %]