diff options
author | bugreport%peshkin.net <> | 2002-12-10 23:17:02 +0100 |
---|---|---|
committer | bugreport%peshkin.net <> | 2002-12-10 23:17:02 +0100 |
commit | c457b4c49d1ac10b91db246235e65292798f33d6 (patch) | |
tree | 3db43e4e18df802769faa519a5732bf971ff869e /globals.pl | |
parent | e9093fd7f7e7e37d0c057b77f86f8f087c0887b1 (diff) | |
download | bugzilla-c457b4c49d1ac10b91db246235e65292798f33d6.tar.gz bugzilla-c457b4c49d1ac10b91db246235e65292798f33d6.tar.xz |
Bug 184081 Change search interfaces to use Viewable products instead of enterable products
r=bbaetz
a=justdave
Diffstat (limited to 'globals.pl')
-rw-r--r-- | globals.pl | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/globals.pl b/globals.pl index 25a949e38..51d6642fa 100644 --- a/globals.pl +++ b/globals.pl @@ -774,12 +774,17 @@ sub CanEnterProduct { # # This function returns an alphabetical list of product names to which # the user can enter bugs. -sub GetEnterableProducts { +sub GetSelectableProducts { my $query = "SELECT name " . "FROM products " . "LEFT JOIN group_control_map " . - "ON group_control_map.product_id = products.id " . - "AND group_control_map.entry != 0 "; + "ON group_control_map.product_id = products.id "; + if (Param('useentrygroupdefault')) { + $query .= "AND group_control_map.entry != 0 "; + } else { + $query .= "AND group_control_map.membercontrol = " . + CONTROLMAPMANDATORY . " "; + } if ((defined @{$::vars->{user}{groupids}}) && (@{$::vars->{user}{groupids}} > 0)) { $query .= "AND group_id NOT IN(" . @@ -796,19 +801,24 @@ sub GetEnterableProducts { return (@products); } -# GetEnterableProductHash +# GetSelectableProductHash # returns a hash containing # legal_products => an enterable product list # legal_components => the list of components of enterable products # components => a hash of component lists for each enterable product -sub GetEnterableProductHash { +sub GetSelectableProductHash { my $query = "SELECT products.name, components.name " . "FROM products " . "LEFT JOIN components " . "ON components.product_id = products.id " . "LEFT JOIN group_control_map " . - "ON group_control_map.product_id = products.id " . - "AND group_control_map.entry != 0 "; + "ON group_control_map.product_id = products.id "; + if (Param('useentrygroupdefault')) { + $query .= "AND group_control_map.entry != 0 "; + } else { + $query .= "AND group_control_map.membercontrol = " . + CONTROLMAPMANDATORY . " "; + } if ((defined @{$::vars->{user}{groupids}}) && (@{$::vars->{user}{groupids}} > 0)) { $query .= "AND group_id NOT IN(" . |