diff options
author | travis%sedsystems.ca <> | 2005-01-08 04:25:19 +0000 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-01-08 04:25:19 +0000 |
commit | d6e7117d0ff4a6674a186f443219f56c0bb5bab8 (patch) | |
tree | 979b54567debb0f23988067c151700120f9da20e | |
parent | ed09207ecef601b38bff1392ef5e1726e8fc44c5 (diff) | |
download | bugs-d6e7117d0ff4a6674a186f443219f56c0bb5bab8.tar bugs-d6e7117d0ff4a6674a186f443219f56c0bb5bab8.tar.gz bugs-d6e7117d0ff4a6674a186f443219f56c0bb5bab8.tar.bz2 bugs-d6e7117d0ff4a6674a186f443219f56c0bb5bab8.tar.xz bugs-d6e7117d0ff4a6674a186f443219f56c0bb5bab8.zip |
Bug 276446: Initial description cannot be made private on new bug creation
Patch: travis r=joini a=justdave
-rwxr-xr-x | enter_bug.cgi | 2 | ||||
-rwxr-xr-x | post_bug.cgi | 12 | ||||
-rw-r--r-- | template/en/default/bug/create/create.html.tmpl | 17 |
3 files changed, 28 insertions, 3 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi index 4bda17ac4..2cbb455cc 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -339,6 +339,8 @@ $vars->{'keywords'} = formvalue('keywords'); $vars->{'dependson'} = formvalue('dependson'); $vars->{'blocked'} = formvalue('blocked'); +$vars->{'commentprivacy'} = formvalue('commentprivacy'); + # 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 # for the current version.) If no URL or cookie version, the default diff --git a/post_bug.cgi b/post_bug.cgi index 7282f8fa9..27f870e13 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -419,9 +419,15 @@ foreach my $grouptoadd (@groupstoadd) { VALUES ($id, $grouptoadd)"); } -# Add the comment -SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) - VALUES ($id, $::userid, now(), " . SqlQuote($comment) . ")"); +# Add the initial comment, allowing for the fact that it may be private +my $privacy = 0; +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 foreach my $ccid (keys(%ccids)) { diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 54ff22fbd..0bc5c516c 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -18,6 +18,7 @@ # # Contributor(s): Gervase Markham <gerv@gerv.net> # Ville Skyttä <ville.skytta@iki.fi> + # Shane H. W. Travis <travis@sedsystems.ca> #%] [% PROCESS global/variables.none.tmpl %] @@ -247,6 +248,22 @@ function set_assign_to() { </td> </tr> + [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %] + <tr> + <td></td> + <td colspan="3"> + + <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 use_keywords %] <tr> |