diff options
author | bugreport%peshkin.net <> | 2005-08-19 05:09:36 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2005-08-19 05:09:36 +0200 |
commit | 9d4872bef3b679b020b6678445ec84504e1f8a1e (patch) | |
tree | ba83ecbc319e12000d9ee00d2da2f04facded3d6 /process_bug.cgi | |
parent | d11ebe02d5e293f88992090878db4c95523f1809 (diff) | |
download | bugzilla-9d4872bef3b679b020b6678445ec84504e1f8a1e.tar.gz bugzilla-9d4872bef3b679b020b6678445ec84504e1f8a1e.tar.xz |
Bug 304583: Remove all remaining need to rederive inherited groups
Patch by Joel Peshkin <bugreport@peshkin.net>
r=mkanat, a=justdave
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index b0decb861..543c9bf0e 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -73,6 +73,7 @@ use vars qw(@legal_product my $user = Bugzilla->login(LOGIN_REQUIRED); my $whoid = $user->id; +my $grouplist = $user->groups_as_string; my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; @@ -704,10 +705,9 @@ sub ChangeResolution { my @groupAdd = (); my @groupDel = (); -SendSQL("SELECT groups.id, isactive FROM groups INNER JOIN user_group_map " . - "ON groups.id = user_group_map.group_id " . - "WHERE user_group_map.user_id = $whoid " . - "AND isbless = 0 AND isbuggroup = 1"); +SendSQL("SELECT groups.id, isactive FROM groups " . + "WHERE id IN($grouplist) " . + "AND isbuggroup = 1"); while (my ($b, $isactive) = FetchSQLData()) { # The multiple change page may not show all groups a bug is in # (eg product groups when listing more than one product) @@ -1560,7 +1560,7 @@ foreach my $id (@idlist) { # - Is the bug in this group? SendSQL("SELECT DISTINCT groups.id, isactive, " . "oldcontrolmap.membercontrol, newcontrolmap.membercontrol, " . - "user_group_map.user_id IS NOT NULL, " . + "CASE WHEN groups_id IN ($grouplist) THEN 1 ELSE 0 END, " . "bug_group_map.group_id IS NOT NULL " . "FROM groups " . "LEFT JOIN group_control_map AS oldcontrolmap " . @@ -1569,10 +1569,6 @@ foreach my $id (@idlist) { " LEFT JOIN group_control_map AS newcontrolmap " . "ON newcontrolmap.group_id = groups.id " . "AND newcontrolmap.product_id = $newproduct_id " . - "LEFT JOIN user_group_map " . - "ON user_group_map.group_id = groups.id " . - "AND user_group_map.user_id = $whoid " . - "AND user_group_map.isbless = 0 " . "LEFT JOIN bug_group_map " . "ON bug_group_map.group_id = groups.id " . "AND bug_group_map.bug_id = $id " |