summaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-08-11 16:50:50 +0200
committergerv%gerv.net <>2002-08-11 16:50:50 +0200
commit17e3e995f357cf33670436264607a965b38a671d (patch)
treee976cbabdf14be2b0c1a6aec20c033f30b778c9f /query.cgi
parent8cadcb8c21498f7184879d1c2797ee531ea05c26 (diff)
downloadbugzilla-17e3e995f357cf33670436264607a965b38a671d.tar.gz
bugzilla-17e3e995f357cf33670436264607a965b38a671d.tar.xz
Bug 160557 - products that start with _ do not show up properly in query.cgi. Patch by pbaker@where2getit.com and gerv; r=bbaetz.
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi48
1 files changed, 18 insertions, 30 deletions
diff --git a/query.cgi b/query.cgi
index daa34cd1f..af4b54164 100755
--- a/query.cgi
+++ b/query.cgi
@@ -242,46 +242,34 @@ foreach my $m (@::legal_target_milestone) {
}
}
-# Sort the component list...
-my $comps = \%::components;
-foreach my $p (@products) {
- my @tmp = sort { lc($a) cmp lc($b) } @{$comps->{$p}};
- $comps->{$p} = \@tmp;
-}
-
-# and the version list...
-my $vers = \%::versions;
-foreach my $p (@products) {
- my @tmp = sort { lc($a) cmp lc($b) } @{$vers->{$p}};
- $vers->{$p} = \@tmp;
-}
-
-# and the milestone list.
-my $mstones;
-if (Param('usetargetmilestone')) {
- $mstones = \%::target_milestone;
- foreach my $p (@products) {
- my @tmp = sort { lc($a) cmp lc($b) } @{$mstones->{$p}};
- $mstones->{$p} = \@tmp;
- }
+# Create data structures representing each product.
+for (my $i = 0; $i < @products; ++$i) {
+ my $p = $products[$i];
+
+ # Create hash to hold attributes for each product.
+ my %product = (
+ 'name' => $p,
+ 'components' => [ sort { lc($a) cmp lc($b) } @{$::components{$p}} ],
+ 'versions' => [ sort { lc($a) cmp lc($b) } @{$::versions{$p}} ]
+ );
+
+ if (Param('usetargetmilestone')) {
+ $product{'milestones'} =
+ [ sort { lc($a) cmp lc($b) } @{$::target_milestone{$p}} ];
+ }
+
+ # Assign hash back to product array.
+ $products[$i] = \%product;
}
-# "foo" or "foos" is a list of all the possible (or legal) products,
-# components, versions or target milestones.
-# "foobyproduct" is a hash, keyed by product, of sorted lists
-# of the same data.
-
$vars->{'product'} = \@products;
# We use 'component_' because 'component' is a Template Toolkit reserved word.
-$vars->{'componentsbyproduct'} = $comps;
$vars->{'component_'} = \@components;
-$vars->{'versionsbyproduct'} = $vers;
$vars->{'version'} = \@versions;
if (Param('usetargetmilestone')) {
- $vars->{'milestonesbyproduct'} = $mstones;
$vars->{'target_milestone'} = \@milestones;
}