From 2a70cfc7e4700c5a339b833ea197b1b77769604b Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Wed, 20 Oct 2010 23:33:55 +0000 Subject: [PATCH] Bug 598014: Document how to mark the initial comment as private when using Bug.create() r/a=mkanat git-svn-id: svn://10.0.0.236/trunk@261438 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Bug.pm | 6 ++---- mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm | 7 +++++++ mozilla/webtools/bugzilla/enter_bug.cgi | 10 +++++----- mozilla/webtools/bugzilla/post_bug.cgi | 4 ++-- mozilla/webtools/bugzilla/process_bug.cgi | 2 +- .../template/en/default/bug/create/create.html.tmpl | 6 +++--- .../bugzilla/template/en/default/bug/edit.html.tmpl | 2 +- .../template/en/default/bug/process/midair.html.tmpl | 3 ++- .../template/en/default/list/edit-multiple.html.tmpl | 2 +- 10 files changed, 25 insertions(+), 19 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 802a3d3ecba..73617cc0b0f 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7554 \ No newline at end of file +7555 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm index 70f3f607d21..b8178b9cef7 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm @@ -260,6 +260,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', @@ -1405,7 +1406,7 @@ sub _check_comment { } # Load up some data - my $isprivate = $params->{commentprivacy}; + my $isprivate = delete $params->{comment_is_private}; my $timestamp = $params->{creation_ts}; # Create the new comment so we can check it @@ -1420,9 +1421,6 @@ sub _check_comment { $comment->{isprivate} = $isprivate; } - # Don't need this anymore as it is now in the comment hash - delete $params->{commentprivacy}; - # Validate comment. We have to do this special as a comment normally # requires a bug to be already created. For a new bug, the first comment # obviously can't get the bug if the bug is created after this diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm index 14642bca9f3..bfd5d5c0dbb 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm @@ -2244,6 +2244,9 @@ don't want it to be assigned to the component owner. =item C (array) - An array of usernames to CC on this bug. +=item C (boolean) - If set to true, the description +is private, otherwise it is assumed to be public. + =item C (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, @@ -2322,6 +2325,10 @@ B, due to a bug in Bugzilla. Bugzilla 4.0, bugs were only added into Mandatory groups by this method. +=item The C argument was added in Bugzilla B<4.0>. +Before Bugzilla 4.0, you had to use the undocumented C +argument. + =back =back diff --git a/mozilla/webtools/bugzilla/enter_bug.cgi b/mozilla/webtools/bugzilla/enter_bug.cgi index af37caf8954..2b54800cc9e 100755 --- a/mozilla/webtools/bugzilla/enter_bug.cgi +++ b/mozilla/webtools/bugzilla/enter_bug.cgi @@ -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 diff --git a/mozilla/webtools/bugzilla/post_bug.cgi b/mozilla/webtools/bugzilla/post_bug.cgi index 2c8062605f3..734b5978dee 100755 --- a/mozilla/webtools/bugzilla/post_bug.cgi +++ b/mozilla/webtools/bugzilla/post_bug.cgi @@ -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('attach_text')) { - $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(); diff --git a/mozilla/webtools/bugzilla/process_bug.cgi b/mozilla/webtools/bugzilla/process_bug.cgi index 4f89215596d..0d57bfcfea6 100755 --- a/mozilla/webtools/bugzilla/process_bug.cgi +++ b/mozilla/webtools/bugzilla/process_bug.cgi @@ -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')) { diff --git a/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl index 43f11315053..94aafe45d97 100644 --- a/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl @@ -588,9 +588,9 @@ TUI_hide_default('attachment_text_field');      - - : [% IF user.is_insider %] -