diff options
author | bugreport%peshkin.net <> | 2004-08-21 06:49:17 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-08-21 06:49:17 +0200 |
commit | 88d26275229b5f52f435130496169766313c87b7 (patch) | |
tree | c71532045500b6e2335b1e5e2512d10b8846551b /query.cgi | |
parent | 2f9f28d0bfb1f321d1548844a41aaf2d51789695 (diff) | |
download | bugzilla-88d26275229b5f52f435130496169766313c87b7.tar.gz bugzilla-88d26275229b5f52f435130496169766313c87b7.tar.xz |
Bug 224208 Add a higher level of categorization (.ie departments, locations, etc.)
patch by Albert Ting
r=joel, glob
a=myk
Diffstat (limited to 'query.cgi')
-rwxr-xr-x | query.cgi | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -127,7 +127,7 @@ sub PrefillForm { # Nothing must be undef, otherwise the template complains. foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform", "priority", "bug_severity", - "product", "reporter", "op_sys", + "classification", "product", "reporter", "op_sys", "component", "version", "chfield", "chfieldfrom", "chfieldto", "chfieldvalue", "target_milestone", "email", "emailtype", "emailreporter", @@ -274,9 +274,24 @@ for (my $i = 0; $i < @products; ++$i) { # Assign hash back to product array. $products[$i] = \%product; } - $vars->{'product'} = \@products; +# Create data structures representing each classification +if (Param('useclassification')) { + my @classifications = (); + + foreach my $c (sort(GetSelectableClassifications())) { + # Create hash to hold attributes for each classification. + my %classification = ( + 'name' => $c, + 'products' => [ GetSelectableProducts(0,$c) ] + ); + # Assign hash back to classification array. + push @classifications, \%classification; + } + $vars->{'classification'} = \@classifications; +} + # We use 'component_' because 'component' is a Template Toolkit reserved word. $vars->{'component_'} = \@components; @@ -300,7 +315,9 @@ push @chfields, "[Bug creation]"; # This is what happens when you have variables whose definition depends # on the DB schema, and then the underlying schema changes... foreach my $val (@::log_columns) { - if ($val eq 'product_id') { + if ($val eq 'classification_id') { + $val = 'classification'; + } elsif ($val eq 'product_id') { $val = 'product'; } elsif ($val eq 'component_id') { $val = 'component'; |