bug 40933

Merge Silent comments (Bug 14372) into Bugzilla 3.2


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@77 6955db30-a419-402b-8a0d-67ecbb4d7f56
custis
vfilippov 2008-12-23 14:19:11 +00:00
parent bb3480b8b4
commit 45dd03f070
4 changed files with 44 additions and 16 deletions

View File

@ -199,7 +199,29 @@ if (defined $cgi->param('delta_ts')
exit;
}
$vars->{'title_tag'} = "bug_processed";
$vars->{title_tag} = "bug_processed";
# Log silent comments
if ($vars->{commentsilent} = $cgi->param('commentsilent'))
{
my $datadir = bz_locations()->{datadir};
my $fd;
if (-w "$datadir/silentlog")
{
my $mesg = "";
my $comment = substr($cgi->param('comment'),0,60);
$comment =~ s/\r*\n+/|/gso;
$mesg .= "Silent comment> " . time2str("%D %H:%M:%S ", time());
$mesg .= " Bug " . $cgi->param('id') . " User: " . Bugzilla->user->login;
$mesg .= " ($ENV{REMOTE_ADDR}) " if $ENV{REMOTE_ADDR};
$mesg .= " // $comment ";
if (open $fd, ">>$datadir/silentlog")
{
print $fd "$mesg\n";
close $fd;
}
}
}
# Set up the vars for navigational <link> elements
my @bug_list;

View File

@ -243,6 +243,9 @@
onClick="updateCommentTagControl(this, form)">
<label for="newcommentprivacy">Private</label>
[% END %]
<input type="checkbox" name="commentsilent" value="1"
id="commentsilent">
<label for="commentsilent">Silent</label>
<br>
[% INCLUDE global/textarea.html.tmpl
name = 'comment'

View File

@ -37,19 +37,22 @@
[% PROCESS global/variables.none.tmpl %]
[% mail = SendBugMail(mailing_bugid, mailrecipients) %]
<dl>
[% PROCESS emails
description = "Email sent to"
names = mail.sent
%]
[% PROCESS emails
description = "Excluding"
names = mail.excluded
%]
</dl>
[% IF NOT(commentsilent) OR commentsilent<=0 %]
[% mail = SendBugMail(mailing_bugid, mailrecipients) %]
<dl>
[% PROCESS emails
description = "Email sent to"
names = mail.sent
%]
[% PROCESS emails
description = "Excluding"
names = mail.excluded
%]
</dl>
[% ELSE %]
[% StopBugMail(mailing_bugid) %]
Your changes marked as Silent. No mail is sent.
[% END %]
[%############################################################################%]
[%# Block for a set of email addresses #%]

View File

@ -18,7 +18,7 @@
[% PROCESS global/variables.none.tmpl %]
[% setting_descs = {
[% setting_descs = {
"comment_sort_order" => "When viewing $terms.abug, show comments in this order",
"csv_colsepchar" => "Field separator character for CSV files",
"display_quips" => "Show a quip at the top of each $terms.bug list",
@ -45,5 +45,5 @@
"simple_reply" => "Reference the comment number only",
"remind_me_about_worktime" => "Remind me about worktime",
"remind_me_about_flags" => "Remind me about flag requests",
}
}
%]