summaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authordonm%bluemartini.com <>2000-04-27 04:35:43 +0200
committerdonm%bluemartini.com <>2000-04-27 04:35:43 +0200
commite0195342e76673a15cfa2ca2b789d94238b64729 (patch)
treecab55fe5d3e3d04a0f8e1ca90568b0ffbed5238f /enter_bug.cgi
parentdc17dc6d5faf0ec2c15400194da515ec2e4d7d62 (diff)
downloadbugzilla-e0195342e76673a15cfa2ca2b789d94238b64729.tar.gz
bugzilla-e0195342e76673a15cfa2ca2b789d94238b64729.tar.xz
bug 25010 need a way to edit groups
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi76
1 files changed, 35 insertions, 41 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index f89f2f436..086372d23 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -250,15 +250,17 @@ PutHeader ("Enter Bug","Enter Bug","This page lets you enter a new bug into Bugz
# Modified, -JMR, 2/24,00
# If the usebuggroupsentry parameter is set, we need to check and make sure
# that the user has permission to enter a bug against this product.
-if(Param("usebuggroupsentry")) {
- if(!UserInGroup($product)) {
- print "<H1>Permission denied.</H1>\n";
- print "Sorry; you do not have the permissions necessary to enter\n";
- print "a bug against this product.\n";
- print "<P>\n";
- PutFooter();
- exit;
- }
+# Modified, -DDM, 3/11/00
+# added GroupExists check so we don't choke on a groupless product
+if(Param("usebuggroupsentry")
+ && GroupExists($product)
+ && !UserInGroup($product)) {
+ print "<H1>Permission denied.</H1>\n";
+ print "Sorry; you do not have the permissions necessary to enter\n";
+ print "a bug against this product.\n";
+ print "<P>\n";
+ PutFooter();
+ exit;
}
# Modified, -JMR, 2/18/00
@@ -271,14 +273,17 @@ if(Param("usebuggroupsentry")) {
# the database, (2) insert the select box in the giant print statements below,
# and (3) update post_bug.cgi to process the additional input field.
+# Modified, -DDM, 3/11/00
+# Only need the bit here, and not the description. Description is gotten
+# when the select boxes for all the groups this user has access to are read
+# in later on.
# First we get the bit and description for the group.
my $group_bit=0;
-my $group_desc;
if(Param("usebuggroups") && GroupExists($product)) {
- SendSQL("select bit, description from groups ".
+ SendSQL("select bit from groups ".
"where name = ".SqlQuote($product)." ".
"and isbuggroup != 0");
- ($group_bit, $group_desc) = FetchSQLData();
+ ($group_bit) = FetchSQLData();
}
print "
@@ -388,33 +393,6 @@ print "
value_quote(formvalue('comment')) .
"</TEXTAREA><BR></td>
</tr>";
-# In between the Description field and the Submit buttons, we'll put in the
-# select box for the bug group, if necessary.
-# Rather than waste time with another Param check and another database access,
-# $group_bit will only have a non-zero value if we're using bug groups and have
-# one for this product, so I'll check on that instead here. -JMR, 2/18/00
-if($group_bit) {
- # In addition, we need to handle the possibility that we're coming from
- # a bookmark template. We'll simply check if we've got a parameter called
- # groupset passed with a value other than the current bit. If so, then we're
- # coming from a template, and we don't have group_bit set, so turn it off.
- my $check0 = (formvalue("groupset",$group_bit) == $group_bit) ? "" : " SELECTED";
- my $check1 = ($check0 eq "") ? " SELECTED" : "";
- print "
- <tr>
- <td align=right><B>Access:</td>
- <td colspan=5>
- <select name=\"groupset\">
- <option value=0$check0>
- People not in the \"$group_desc\" group can see this bug
- </option>
- <option value=$group_bit$check1>
- Only people in the \"$group_desc\" group can see this bug
- </option>
- </select>
- </td>
- </tr>"
-}
print "
<tr>
@@ -424,15 +402,31 @@ print "
if ($::usergroupset ne '0') {
SendSQL("SELECT bit, description FROM groups " .
"WHERE bit & $::usergroupset != 0 " .
- " AND isbuggroup != 0 ORDER BY bit");
+ " AND isbuggroup != 0 ORDER BY description");
while (MoreSQLData()) {
my ($bit, $description) = (FetchSQLData());
+ # Rather than waste time with another Param check and another database
+ # access, $group_bit will only have a non-zero value if we're using
+ # bug groups and have one for this product, so I'll check on that
+ # instead here. -JMR, 2/18/00
+ # Moved this check to this location to fix conflict with existing
+ # select-box patch. Also, if $group_bit is 0, it won't match the
+ # current group, either, so I'll compare it to the current bit
+ # instead of checking for non-zero. -DDM, 3/11/00
+ my $check = 0; # default selection
+ if($group_bit == $bit) {
+ # In addition, we need to handle the possibility that we're coming
+ # from a bookmark template. We'll simply check if we've got a
+ # parameter called bit-# passed. If so, then we're coming from a
+ # template, and we'll use the template value.
+ $check = formvalue("bit-$bit","1");
+ }
print BuildPulldown("bit-$bit",
[["0",
"People not in the \"$description\" group can see this bug"],
["1",
"Only people in the \"$description\" group can see this bug"]],
- 0);
+ $check);
print "<BR>\n";
}
}