From c64d51111a5ae02d6fc45163a847d0b7e2004548 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Mon, 25 Nov 2002 03:56:17 +0000 Subject: Bug 147275 Rearchitect product groups Patch by joel r=bbaetz,justdave a=justdave --- editgroups.cgi | 57 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 16 deletions(-) (limited to 'editgroups.cgi') diff --git a/editgroups.cgi b/editgroups.cgi index 5dd2395af..031a23c9e 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -27,6 +27,7 @@ use strict; use lib "."; +use Bugzilla::Constants; require "CGI.pl"; ConnectToDatabase(); @@ -117,9 +118,9 @@ unless ($action) { while (MoreSQLData()) { my ($groupid, $name, $desc, $regexp, $isactive, $isbuggroup) = FetchSQLData(); print "\n"; - print "$name\n"; - print "$desc\n"; - print "$regexp \n"; + print "" . html_quote($name) . "\n"; + print "" . html_quote($desc) . "\n"; + print "" . html_quote($regexp) . " \n"; print ""; print "X" if (($isactive != 0) && ($isbuggroup != 0)); print " \n"; @@ -185,22 +186,27 @@ if ($action eq 'changeform') { print ""; print ""; + print " + "; if ($isbuggroup == 1) { print ""; print ""; - print ""; - print ""; + print ""; + print ""; print "\n"; } @@ -290,6 +296,10 @@ if ($action eq 'add') { print "\n"; print "\n"; print "
Group:"; if ($isbuggroup == 0) { - print "$name"; + print html_quote($name); } else { - print " - "; + print " + "; } print "
Description:"; if ($isbuggroup == 0) { - print "$description"; + print html_quote($description); } else { - print " - "; + print " + "; } print "
User Regexp:"; - print " -
Use For Bugs: @@ -252,8 +258,8 @@ if ($action eq 'changeform') { print ""; print "$grpnam$grpdesc" . html_quote($grpnam) . "" . html_quote($grpdesc) . "
\n
\n"; + print "\n"; + print "Insert new group into all existing products.

\n"; print "\n"; print "\n"; print ""; @@ -308,9 +318,13 @@ to this group, although bugs already in the group will remain in the group. Doing so is a much less drastic way to stop a group from growing than deleting the group would be. Note: If you are creating a group, you probably want it to be usable for bugs, in which case you should leave this checked.

"; - print "User RegExp is optional, and if filled in, will automatically -grant membership to this group to anyone creating a new account with an -email address that matches this regular expression.

"; + print "User RegExp is optional, and if filled in, will "; + print "automatically grant membership to this group to anyone with an "; + print "email address that matches this regular expression.

\n"; + print "By default, the new group will be associated with existing "; + print "products. Unchecking the \"Insert new group into all existing "; + print "products\" option will prevent this and make the group become "; + print "visible only when its controls have been added to a product.

\n"; PutTrailer("Back to the group list"); exit; @@ -384,6 +398,16 @@ if ($action eq 'new') { VALUES ($admin, $gid, 0)"); SendSQL("INSERT INTO group_group_map (member_id, grantor_id, isbless) VALUES ($admin, $gid, 1)"); + # Permit all existing products to use the new group if makeproductgroups. + if ($::FORM{insertnew}) { + SendSQL("INSERT INTO group_control_map " . + "(group_id, product_id, entry, membercontrol, " . + "othercontrol, canedit) " . + "SELECT $gid, products.id, 0, " . + CONTROLMAPSHOWN . ", " . + CONTROLMAPNA . ", 0 " . + "FROM products"); + } print "OK, done.

\n"; PutTrailer("Add another group", "Back to the group list"); @@ -543,6 +567,7 @@ if ($action eq 'delete') { SendSQL("DELETE FROM user_group_map WHERE group_id = $gid"); SendSQL("DELETE FROM group_group_map WHERE grantor_id = $gid"); SendSQL("DELETE FROM bug_group_map WHERE group_id = $gid"); + SendSQL("DELETE FROM group_control_map WHERE group_id = $gid"); SendSQL("DELETE FROM groups WHERE id = $gid"); print "Group $gid has been deleted.
"; -- cgit v1.2.3-24-g4f1b