diff options
author | mkanat%bugzilla.org <> | 2007-11-13 06:15:06 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2007-11-13 06:15:06 +0100 |
commit | 8db452b3d757978ff7166dc229bdb4ebfbd1bdc7 (patch) | |
tree | e57810082f11412d1a2d13118bb9c87e2a39804b /process_bug.cgi | |
parent | d5adbc109d44481c9c4b7ba6429cbbc35487486e (diff) | |
download | bugzilla-8db452b3d757978ff7166dc229bdb4ebfbd1bdc7.tar.gz bugzilla-8db452b3d757978ff7166dc229bdb4ebfbd1bdc7.tar.xz |
Bug 401957: Move comment "isprivate" updating from process_bug to Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 027965f05..99ee5ed57 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -451,28 +451,14 @@ if (defined $cgi->param('id')) { $bug->set_reporter_accessible($cgi->param('reporter_accessible')) if $bug->check_can_change_field('reporter_accessible', 0, 1); } -} - -if ( defined $cgi->param('id') && - (Bugzilla->params->{"insidergroup"} - && Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) ) -{ - - my $sth = $dbh->prepare('UPDATE longdescs SET isprivate = ? - WHERE bug_id = ? AND bug_when = ?'); - - foreach my $field ($cgi->param()) { - if ($field =~ /when-([0-9]+)/) { - my $sequence = $1; - my $private = $cgi->param("isprivate-$sequence") ? 1 : 0 ; - if ($private != $cgi->param("oisprivate-$sequence")) { - my $field_data = $cgi->param("$field"); - # Make sure a valid date is given. - $field_data = format_time($field_data, '%Y-%m-%d %T'); - $sth->execute($private, $cgi->param('id'), $field_data); - } - } - + + # You can only mark/unmark comments as private on single bugs. If + # you're not in the insider group, this code won't do anything. + foreach my $field (grep(/^defined_isprivate/, $cgi->param())) { + $field =~ /(\d+)$/; + my $comment_id = $1; + $bug->set_comment_is_private($comment_id, + $cgi->param("isprivate_$comment_id")); } } |