]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 276446: Initial description cannot be made private on new bug creation
authortravis%sedsystems.ca <>
Sat, 8 Jan 2005 04:31:42 +0000 (04:31 +0000)
committertravis%sedsystems.ca <>
Sat, 8 Jan 2005 04:31:42 +0000 (04:31 +0000)
Patch: travis  r=joini  a=justdave

enter_bug.cgi
post_bug.cgi
template/en/default/bug/create/create.html.tmpl

index f51351599bed79ce17b2a352ebf63f5dd1dc8fd7..0b30f65e697d9b67d71d359f1dae23fbf4a78ed1 100755 (executable)
@@ -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
index f5f6f340d9469a208bead7d462189bfdbca8b08a..60807afb38bf7764e0811af97541a0af12300b05 100755 (executable)
@@ -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)) {
index d8954a2a395f6c65cd67910f86a7cf4b641a4658..6745cd6f198f97a6e89f250b10c1c36300db094b 100644 (file)
@@ -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 %]
@@ -237,6 +238,22 @@ function set_assign_to() {
     </td>
   </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 use_keywords %]
       <tr>