Commit d6e7117d authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Bug 276446: Initial description cannot be made private on new bug creation

Patch: travis r=joini a=justdave
parent ed09207e
...@@ -339,6 +339,8 @@ $vars->{'keywords'} = formvalue('keywords'); ...@@ -339,6 +339,8 @@ $vars->{'keywords'} = formvalue('keywords');
$vars->{'dependson'} = formvalue('dependson'); $vars->{'dependson'} = formvalue('dependson');
$vars->{'blocked'} = formvalue('blocked'); $vars->{'blocked'} = formvalue('blocked');
$vars->{'commentprivacy'} = formvalue('commentprivacy');
# Use the version specified in the URL, if one is supplied. If not, # Use the version specified in the URL, if one is supplied. If not,
# then use the cookie-specified value. (Posting a bug sets a cookie # then use the cookie-specified value. (Posting a bug sets a cookie
# for the current version.) If no URL or cookie version, the default # for the current version.) If no URL or cookie version, the default
......
...@@ -419,9 +419,15 @@ foreach my $grouptoadd (@groupstoadd) { ...@@ -419,9 +419,15 @@ foreach my $grouptoadd (@groupstoadd) {
VALUES ($id, $grouptoadd)"); VALUES ($id, $grouptoadd)");
} }
# Add the comment # Add the initial comment, allowing for the fact that it may be private
SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) my $privacy = 0;
VALUES ($id, $::userid, now(), " . SqlQuote($comment) . ")"); if (Param("insidergroup") && UserInGroup(Param("insidergroup"))) {
$privacy = $::FORM{'commentprivacy'} ? 1 : 0;
}
SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext, isprivate)
VALUES ($id, " . SqlQuote($user->id) . ", " . SqlQuote($timestamp) .
", " . SqlQuote($comment) . ", $privacy)");
# Insert the cclist into the database # Insert the cclist into the database
foreach my $ccid (keys(%ccids)) { foreach my $ccid (keys(%ccids)) {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# #
# Contributor(s): Gervase Markham <gerv@gerv.net> # Contributor(s): Gervase Markham <gerv@gerv.net>
# Ville Skyttä <ville.skytta@iki.fi> # Ville Skyttä <ville.skytta@iki.fi>
# Shane H. W. Travis <travis@sedsystems.ca>
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
...@@ -247,6 +248,22 @@ function set_assign_to() { ...@@ -247,6 +248,22 @@ function set_assign_to() {
</td> </td>
</tr> </tr>
[% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
<tr>
<td></td>
<td colspan="3">
&nbsp;&nbsp;
<input type="checkbox" id="commentprivacy" name="commentprivacy"
[% " checked=\"checked\"" IF commentprivacy %]>
<label for="commentprivacy">
Initial Description is Private
</label>
</td>
</tr>
[% ELSE %]
<input type="hidden" name="commentprivacy" value="0">
[% END %]
[% IF UserInGroup('editbugs') %] [% IF UserInGroup('editbugs') %]
[% IF use_keywords %] [% IF use_keywords %]
<tr> <tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment