From: travis%sedsystems.ca <> Date: Sat, 8 Jan 2005 04:31:42 +0000 (+0000) Subject: Bug 276446: Initial description cannot be made private on new bug creation X-Git-Tag: bugzilla-2.18~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=401059b4166750b1bd613588f9b74531dd73bdea;p=thirdparty%2Fbugzilla.git Bug 276446: Initial description cannot be made private on new bug creation Patch: travis r=joini a=justdave --- diff --git a/enter_bug.cgi b/enter_bug.cgi index f51351599b..0b30f65e69 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -288,6 +288,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 f5f6f340d9..60807afb38 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -424,9 +424,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 d8954a2a39..6745cd6f19 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 # Ville Skyttä + # Shane H. W. Travis #%] [% PROCESS global/variables.none.tmpl %] @@ -237,6 +238,22 @@ function set_assign_to() { + [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %] + + + +    + + + + + [% ELSE %] + + [% END %] + [% IF UserInGroup('editbugs') %] [% IF use_keywords %]