aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Becker <Frank@Frank-Becker.de>2012-04-13 00:55:00 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-04-13 00:55:00 +0200
commit0354373916176c202632a7cb8965b1afd578ab8d (patch)
tree2772056a15f13febc155aeb5178966fff9e429b4 /config.cgi
parentBug 741078: Release notes for Bugzilla 4.2.1 (diff)
downloadbugzilla-0354373916176c202632a7cb8965b1afd578ab8d.tar.gz
bugzilla-0354373916176c202632a7cb8965b1afd578ab8d.tar.bz2
bugzilla-0354373916176c202632a7cb8965b1afd578ab8d.zip
Bug 340439: Include classifications in config.cgi
r/a=LpSolit
Diffstat (limited to 'config.cgi')
-rwxr-xr-xconfig.cgi12
1 files changed, 12 insertions, 0 deletions
diff --git a/config.cgi b/config.cgi
index 51b33ed7e..891a2f8a3 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');