Closed
Bug 30187
Opened 25 years ago
Closed 25 years ago
Allow group members to set group when creating a bug
Categories
(Bugzilla :: Bugzilla-General, enhancement, P3)
Bugzilla
Bugzilla-General
Tracking
()
VERIFIED
FIXED
Bugzilla old
People
(Reporter: justdave, Assigned: terry)
Details
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
Members of a group should be able to restrict the viewing of a bug to one or more
of the groups they are members of, when posting the bug. Currently you have to
view the bug report after you submit it before you can do this.
Reporter | ||
Comment 1•25 years ago
|
||
implemented this one myself. Here's the diff:
Index: enter_bug.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v
retrieving revision 1.30
diff -r1.30 enter_bug.cgi
321a322,342
> <td></td><td colspan=5>
> ";
>
> if ($::usergroupset ne '0') {
> SendSQL("select bit, description, (bit & $::usergroupset != 0) from groups where bit & $::usergroupset != 0 and isbuggroup != 0 order by bit");
> while (MoreSQLData()) {
> my ($bit, $description, $ison) = (FetchSQLData());
> my $check0 = " SELECTED";
> my $check1 = "";
> print "<select name=bit-$bit><option value=0$check0>\n";
> print "People not in the \"$description\" group can see this bug\n";
> print "<option value=1$check1>\n";
> print "Only people in the \"$description\" group can see this bug\n";
> print "</select><br>\n";
> }
> }
>
> print "
> </td>
> </tr>
> <tr>
Reporter | ||
Comment 2•25 years ago
|
||
And Netscape would double-space it on me. :|
OK, let's try again, so you can just copy & paste it. (finger's crossed that it
works this time :)
Index: enter_bug.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v
retrieving revision 1.30
diff -r1.30 enter_bug.cgi
20a21
> # Dave Miller <dave@intrec.com>
319a321,341
> </tr>
> <tr>
> <td></td><td colspan=5>
> ";
>
> if ($::usergroupset ne '0') {
> SendSQL("select bit, description, (bit & $::usergroupset != 0) from groups
where bit & $::usergroupset != 0 and isbuggroup != 0 order by bit");
> while (MoreSQLData()) {
> my ($bit, $description, $ison) = (FetchSQLData());
> my $check0 = " SELECTED";
> my $check1 = "";
> print "<select name=bit-$bit><option value=0$check0>\n";
> print "People not in the \"$description\" group can see this bug\n";
> print "<option value=1$check1>\n";
> print "Only people in the \"$description\" group can see this bug\n";
> print "</select><br>\n";
> }
> }
>
> print "
> </td>
Assignee | ||
Comment 3•25 years ago
|
||
Could you paste that patch in one more time, but this time add the "-c" flag to
diff? The file has changed since you made the patch, and it's hard to tell
exactly where you were hoping to add your new code.
Also, don't you need to patch post_bug.cgi too?
Reporter | ||
Comment 4•25 years ago
|
||
ah, yep. :) Forgot about post_bug.cgi, but I did indeed have to patch that also.
Here we go with a diff -c: (fingers crossed that it doesn't double-space it)
Index: enter_bug.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/enter_bug.cgi,v
retrieving revision 1.31
diff -c -r1.31 enter_bug.cgi
*** enter_bug.cgi 2000/03/07 18:52:27 1.31
--- enter_bug.cgi 2000/03/07 19:41:49
***************
*** 18,23 ****
--- 18,24 ----
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
+ # Dave Miller <dave@intrec.com>
########################################################################
***************
*** 320,325 ****
--- 321,347 ----
<td colspan=5><TEXTAREA WRAP=HARD NAME=comment ROWS=10 COLS=80>" .
value_quote(formvalue('comment')) .
"</TEXTAREA><BR></td>
+ </tr>
+ <tr>
+ <td></td><td colspan=5>
+ ";
+
+ if ($::usergroupset ne '0') {
+ SendSQL("select bit, description, (bit & $::usergroupset != 0) from groups
where bit & $::usergroupset != 0 and isbuggroup != 0 order by bit");
+ while (MoreSQLData()) {
+ my ($bit, $description, $ison) = (FetchSQLData());
+ my $check0 = " SELECTED";
+ my $check1 = "";
+ print "<select name=bit-$bit><option value=0$check0>\n";
+ print "People not in the \"$description\" group can see this bug\n";
+ print "<option value=1$check1>\n";
+ print "Only people in the \"$description\" group can see this bug\n";
+ print "</select><br>\n";
+ }
+ }
+
+ print "
+ </td>
</tr>
<tr>
<td></td>
Index: post_bug.cgi
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v
retrieving revision 1.18
diff -c -r1.18 post_bug.cgi
*** post_bug.cgi 2000/02/25 19:32:27 1.18
--- post_bug.cgi 2000/03/07 19:41:50
***************
*** 155,160 ****
--- 155,174 ----
values (
";
+ my $foundbit = 0;
+ foreach my $b (grep(/^bit-\d*$/, keys %::FORM)) {
+ if (!$foundbit) {
+ $foundbit = 1;
+ DoComma();
+ $::query .= "groupset = 0";
+ }
+ if ($::FORM{$b}) {
+ my $v = substr($b, 4);
+ $::query .= "+ $v"; # Carefully written so that the math is
+ # done by MySQL, which can handle 64-bit math,
+ # and not by Perl, which I *think* can not.
+ }
+ }
foreach my $field (@used_fields) {
$query .= SqlQuote($::FORM{$field}) . ",\n";
Reporter | ||
Comment 5•25 years ago
|
||
dangit, it double-spaced it. We really need to get the line-wraps enforced
server-side so we can get rid of the WRAP=HARD attribute in the TEXTAREA tags...
but that's another bug report. The description on this bug is getting long
enough already for me to try again (and it might mess it up again). I'll upload
it as an attachment. :)
Reporter | ||
Comment 6•25 years ago
|
||
Assignee | ||
Comment 7•25 years ago
|
||
OK, I've checked it in. I had to hack on it quite a bit; did you actually try
this?
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 8•25 years ago
|
||
Part of it I had. Part of it I hadn't... The enter_bug part was well tested. I
forgot the post_bug part until you mentioned it... I looked through post_bug
when I originally did it and my first glance at the code I thought it was just
grabbing every key passed from the form and if it matched a column in the table,
stuffed it into the INSERT command. I didn't stop and think "wait, the bits have
to be added together first, it can't just grab them". Let alone, they were
defined earlier in that file anyway. We hadn't got enough use out of it yet to
notice that things weren't really being hidden when we set them that way (been a
whole two days since I put it in, and we're at the end of a release cycle at the
moment, so there hasn't been a lot of reporting going on).
When you mentioned the post_bug thing this morning, I copied and pasted code from
process_bug.cgi, took a few looks through it to make sure it wasn't using
undeclared variables and that the form keys it used matched, then diffed it and
uploaded it. This is what I get for rushing to deliver while I'm at work instead
of waiting till I'm home when I have time to do it right. :) Sorry about that.
Comment 9•25 years ago
|
||
Need confirmation before I'll verify here as I'm not (yet) in a privacy group.
Reporter, are you now running standard Bugzilla code?
Terry, have you tested this on bugzilla.mozilla.org? Has anyone from
Netscape?
QA Contact: matty
Assignee | ||
Comment 10•25 years ago
|
||
I have not.
Reporter | ||
Comment 11•25 years ago
|
||
Yeah, I did a cvs update last night and grabbed what Terry checked in. Since I
was home, I actually had time to test it last night :) It does appear to work as
advertised now (what Terry fixed anyway, my original code was toasted :). The
only changes I have in the code on my site (http://www.intrec.com/bugs/) compared
to the cvs repository now are all cosmetic.
Reporter | ||
Comment 12•24 years ago
|
||
per Terry, auto-verifying any resolved bug that hasn't been touched since before
2.10 was released.
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 13•23 years ago
|
||
Moving to Bugzilla product
Component: Bugzilla → Bugzilla-General
Product: Webtools → Bugzilla
Target Milestone: --- → Bugzilla old
Version: other → unspecified
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•