]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 598014: Document how to mark the initial comment as private when using Bug.create()
authorFrédéric Buclin <LpSolit@gmail.com>
Wed, 20 Oct 2010 23:49:37 +0000 (01:49 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 20 Oct 2010 23:49:37 +0000 (01:49 +0200)
r/a=mkanat

Bugzilla/Bug.pm
Bugzilla/WebService/Bug.pm
enter_bug.cgi
post_bug.cgi
process_bug.cgi
template/en/default/bug/create/create.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/bug/process/midair.html.tmpl
template/en/default/list/edit-multiple.html.tmpl

index 4219664f24f60184b79c6a22b4333dd2bf76c0d5..87c53f0d28175b69247540c6f0a4be40d13b523d 100644 (file)
@@ -125,7 +125,7 @@ sub VALIDATORS {
         bug_status     => \&_check_bug_status,
         cc             => \&_check_cc,
         comment        => \&_check_comment,
-        commentprivacy => \&_check_commentprivacy,
+        comment_is_private => \&_check_comment_is_private,
         component      => \&_check_component,
         deadline       => \&_check_deadline,
         dup_id         => \&_check_dup_id,
@@ -268,6 +268,7 @@ use constant FIELD_MAP => {
     blocks           => 'blocked',
     is_confirmed     => 'everconfirmed',
     cc_accessible    => 'cclist_accessible',
+    commentprivacy   => 'comment_is_private',
     creation_time    => 'creation_ts',
     creator          => 'reporter',
     description      => 'comment',
@@ -610,9 +611,9 @@ sub create {
     my $depends_on = delete $params->{dependson};
     my $blocked    = delete $params->{blocked};
     my $keywords   = delete $params->{keywords};
-    my ($comment, $privacy) = ($params->{comment}, $params->{commentprivacy});
+    my ($comment, $privacy) = ($params->{comment}, $params->{comment_is_private});
     delete $params->{comment};
-    delete $params->{commentprivacy};
+    delete $params->{comment_is_private};
 
     # We don't want the bug to appear in the system until it's correctly
     # protected by groups.
@@ -1404,7 +1405,7 @@ sub _check_comment {
     return $comment;
 }
 
-sub _check_commentprivacy {
+sub _check_comment_is_private {
     my ($invocant, $comment_privacy) = @_;
     if ($comment_privacy && !Bugzilla->user->is_insider) {
         ThrowUserError('user_not_insider');
@@ -2620,7 +2621,7 @@ sub add_comment {
     }
     if (exists $params->{isprivate}) {
         $params->{isprivate} = 
-            $self->_check_commentprivacy($params->{isprivate});
+            $self->_check_comment_is_private($params->{isprivate});
     }
     # XXX We really should check extra_data, too.
 
index 4e24636f4a0a155dcf4ffa4bb1e3715d09e17028..5206f7705da6202e01b4c9d07c20317b8d1e9936 100644 (file)
@@ -2250,6 +2250,9 @@ don't want it to be assigned to the component owner.
 
 =item C<cc> (array) - An array of usernames to CC on this bug.
 
+=item C<comment_is_private> (boolean) - If set to true, the description
+is private, otherwise it is assumed to be public.
+
 =item C<groups> (array) - An array of group names to put this
 bug into. You can see valid group names on the Permissions
 tab of the Preferences screen, or, if you are an administrator,
@@ -2328,6 +2331,10 @@ B<Required>, due to a bug in Bugzilla.
 Bugzilla 4.0, bugs were only added into Mandatory groups by this
 method.
 
+=item The C<comment_is_private> argument was added in Bugzilla B<4.0>.
+Before Bugzilla 4.0, you had to use the undocumented C<commentprivacy>
+argument.
+
 =back
 
 =back
index 6cc174c315d4e2157a70651a457ad45be5416a69..61fc06162e6b66187155a4d67dad730c55cc8053 100755 (executable)
@@ -452,14 +452,14 @@ if ($cloned_bug_id) {
     my $bug_desc = $cloned_bug->comments({ order => 'oldest_to_newest' })->[0];
     my $isprivate = $bug_desc->is_private;
 
-    $vars->{'comment'}        = "";
-    $vars->{'commentprivacy'} = 0;
+    $vars->{'comment'} = "";
+    $vars->{'comment_is_private'} = 0;
 
     if (!$isprivate || Bugzilla->user->is_insider) {
         # We use "body" to avoid any format_comment text, which would be
         # pointless to clone.
-        $vars->{'comment'}        = $bug_desc->body;
-        $vars->{'commentprivacy'} = $isprivate;
+        $vars->{'comment'} = $bug_desc->body;
+        $vars->{'comment_is_private'} = $isprivate;
     }
 
 } # end of cloned bug entry form
@@ -484,7 +484,7 @@ else {
     $vars->{'cc'}             = join(', ', $cgi->param('cc'));
 
     $vars->{'comment'}        = formvalue('comment');
-    $vars->{'commentprivacy'} = formvalue('commentprivacy');
+    $vars->{'comment_is_private'} = formvalue('comment_is_private');
 
 } # end of normal/bookmarked entry form
 
index c097a96ce259cbd5ed5c8a218ca6890e16dd861e..a0cfaf29d877e24f08b10c51b79b9e94bab05b74 100755 (executable)
@@ -129,7 +129,7 @@ push(@bug_fields, qw(
 
     alias
     blocked
-    commentprivacy
+    comment_is_private
     bug_file_loc
     bug_severity
     bug_status
@@ -184,7 +184,7 @@ if (defined $cgi->param('version')) {
 
 # Add an attachment if requested.
 if (defined($cgi->upload('data')) || $cgi->param('attachurl')) {
-    $cgi->param('isprivate', $cgi->param('commentprivacy'));
+    $cgi->param('isprivate', $cgi->param('comment_is_private'));
 
     # Must be called before create() as it may alter $cgi->param('ispatch').
     my $content_type = Bugzilla::Attachment::get_content_type();
index 4f89215596d25af3bd633fc2baaa4b9b13a32324..0d57bfcfea6870490f4314ec8ed49978348bf6a5 100755 (executable)
@@ -265,7 +265,7 @@ if (should_set('keywords')) {
 if (should_set('comment')) {
     $set_all_fields{comment} = {
         body       => scalar $cgi->param('comment'),
-        is_private => scalar $cgi->param('commentprivacy'),
+        is_private => scalar $cgi->param('comment_is_private'),
     };
 }
 if (should_set('see_also')) {
index 411a0a64d3394ce97e567ed7064f2a0b4dc62faf..618727fee7465533e1f786100f667212c740f3a4 100644 (file)
@@ -585,9 +585,9 @@ TUI_hide_default('expert_fields');
       <th>&nbsp;</th>
       <td colspan="3">
         &nbsp;&nbsp;
-        <input type="checkbox" id="commentprivacy" name="commentprivacy"
-          [% " checked=\"checked\"" IF commentprivacy %]>
-        <label for="commentprivacy">
+        <input type="checkbox" id="comment_is_private" name="comment_is_private"
+          [% ' checked="checked"' IF comment_is_private %]>
+        <label for="comment_is_private">
           Make description private (visible only to members of the 
           <strong>[% Param('insidergroup') FILTER html %]</strong> group)
         </label>
index 2a5cd02004a0a4b90a5c776b448b3b59ac858514..badd5dfb8c3d33f9975dc462d2aaf9c8708e05b1 100644 (file)
         <u>C</u>omments</b></label>:
 
       [% IF user.is_insider %]
-        <input type="checkbox" name="commentprivacy" value="1"
+        <input type="checkbox" name="comment_is_private" value="1"
                id="newcommentprivacy"
                onClick="updateCommentTagControl(this, form)">
         <label for="newcommentprivacy">
index f5c3407f453826bf375641893466a34fdc448832..8a49f7cdc1643342ef1c558d1306671d09c02046 100644 (file)
@@ -94,7 +94,8 @@ You have the following choices:
         <input type="hidden" name="id" value="[% cgi.param("id") FILTER html %]">
         <input type="hidden" name="delta_ts" value="[% bug.delta_ts FILTER html %]">
         <input type="hidden" name="comment" value="[% cgi.param("comment") FILTER html %]">
-        <input type="hidden" name="commentprivacy" value="[% cgi.param("commentprivacy") FILTER html %]">
+        <input type="hidden" name="comment_is_private"
+               value="[% cgi.param("comment_is_private") FILTER html %]">
         <input type="hidden" name="longdesclength" value="[% bug.comments.size %]">
         <input type="hidden" name="token" value="[% cgi.param("token") FILTER html %]">
         <input type="submit" id="process_comment" value="Submit only my new comment">
index 1f22624d648b7792e9ecbd2c1a37a5fad59cad59..92e578e8f77c0512c06752e095b6a449d3c85085 100644 (file)
 
 <b><label for="comment">Additional Comments:</label></b>
 [% IF user.is_insider %]
-  <input type="checkbox" name="commentprivacy" value="1"
+  <input type="checkbox" name="comment_is_private" value="1"
          id="newcommentprivacy"
          onClick="updateCommentTagControl(this, form)"/>
    <label for="newcommentprivacy">