diff options
author | terry%mozilla.org <> | 2000-03-22 01:47:04 +0100 |
---|---|---|
committer | terry%mozilla.org <> | 2000-03-22 01:47:04 +0100 |
commit | 6b2eec91f21d4aa28e68f18435c8636f377a4b2a (patch) | |
tree | 855b795f02d39a7d676949572d872d15bf1e7901 /query.cgi | |
parent | c7ae4f650a612ccf62f68c9894f5a6cd62f464b0 (diff) | |
download | bugzilla-6b2eec91f21d4aa28e68f18435c8636f377a4b2a.tar.gz bugzilla-6b2eec91f21d4aa28e68f18435c8636f377a4b2a.tar.xz |
Patch by "Matt Masson" <matthew@zeroknowledge.com> -- allow definition
of different target milestones by product.
Diffstat (limited to 'query.cgi')
-rwxr-xr-x | query.cgi | 44 |
1 files changed, 43 insertions, 1 deletions
@@ -282,12 +282,14 @@ my $jscript = << 'ENDSCRIPT'; <!-- var cpts = new Array(); var vers = new Array(); +var tms = new Array(); ENDSCRIPT my $p; my $v; my $c; +my $m; my $i = 0; my $j = 0; @@ -299,6 +301,10 @@ foreach $v (@::legal_versions) { $jscript .= "vers['$v'] = new Array();\n"; } +my $tm; +foreach $tm (@::legal_target_milestone) { + $jscript .= "tms['$tm'] = new Array();\n"; +} for $p (@::legal_product) { if ($::components{$p}) { @@ -312,6 +318,12 @@ for $p (@::legal_product) { $jscript .= "vers['$v'][vers['$v'].length] = '$p';\n"; } } + + if ($::target_milestone{$p}) { + foreach $m (@{$::target_milestone{$p}}) { + $jscript .= "tms['$m'][tms['$m'].length] = '$p';\n"; + } + } } $i = 0; @@ -404,8 +416,39 @@ function selectProduct(f) { } } + var tmsel = new Array(); + for (i=0 ; i<f.target_milestone.length ; i++) { + if (f.target_milestone[i].selected) { + tmsel[f.target_milestone[i].value] = 1; + } + } + f.target_milestone.options.length = 0; + for (tm in tms) { + if (typeof(tms[v]) == 'function') continue; + var doit = doall; + for (i=0 ; !doit && i<f.product.length ; i++) { + if (f.product[i].selected) { + var p = f.product[i].value; + for (j in tms[tm]) { + if (typeof(tms[tm][j]) == 'function') continue; + var p2 = tms[tm][j]; + if (p2 == p) { + doit = true; + break; + } + } + } + } + if (doit) { + var l = f.target_milestone.length; + f.target_milestone[l] = new Option(tm, tm); + if (tmsel[tm]) { + f.target_milestone[l].selected = true; + } + } + } } // --> @@ -431,7 +474,6 @@ PutHeader("Bugzilla Query Page", "Query", 0, $jscript); push @::legal_resolution, "---"; # Oy, what a hack. -push @::legal_target_milestone, "---"; # Oy, what a hack. my @logfields = ("[Bug creation]", @::log_columns); |