]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 234855: Show only products enterable by current user in edit-multiple
authorbugreport%peshkin.net <>
Sat, 10 Jul 2004 14:44:12 +0000 (14:44 +0000)
committerbugreport%peshkin.net <>
Sat, 10 Jul 2004 14:44:12 +0000 (14:44 +0000)
patch by kiko
r=joel,justdave
a=justdave

buglist.cgi
globals.pl

index caf0943128eb242dbc14bcc857868752e85eb5d4..28993cbec2b5d987e97684a29fc2de1ce3e90d95 100755 (executable)
@@ -875,7 +875,8 @@ if ($dotweak) {
     $vars->{'dotweak'} = 1;
     $vars->{'use_keywords'} = 1 if @::legal_keywords;
 
-    $vars->{'products'} = \@::legal_product;
+    my @enterable_products = GetEnterableProducts();
+    $vars->{'products'} = \@enterable_products;
     $vars->{'platforms'} = \@::legal_platform;
     $vars->{'priorities'} = \@::legal_priority;
     $vars->{'severities'} = \@::legal_severity;
index a2172a998e027dff53fc1461b3baef105bf5f141..6632833abd2abbc6a5d564d8d2f8cc61da31415d 100644 (file)
@@ -516,6 +516,17 @@ sub CanEnterProduct {
     return ($ret);
 }
 
+sub GetEnterableProducts {
+    my @products;
+    # XXX rewrite into pure SQL instead of relying on legal_products?
+    foreach my $p (@::legal_product) {
+        if (CanEnterProduct($p)) {
+            push @products, $p;
+        }
+    }
+    return (@products);
+}
+
 #
 # This function returns an alphabetical list of product names to which
 # the user can enter bugs.  If the $by_id parameter is true, also retrieves IDs