summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-08-20 06:17:18 +0200
committergerv%gerv.net <>2002-08-20 06:17:18 +0200
commit9c0a26d3a5a35788694f5f284c69b995a3298c86 (patch)
tree15cc4cfb1e5e9fb7bcc3898530776f44c7b52492 /globals.pl
parente6fff23fcd99b09511b62c4db4eca658fe5257c4 (diff)
downloadbugzilla-9c0a26d3a5a35788694f5f284c69b995a3298c86.tar.gz
bugzilla-9c0a26d3a5a35788694f5f284c69b995a3298c86.tar.xz
Bug 143286 - Add support for Insiders, Private comments, Private Attachments. Patch by bugreport@peshkin.net; r=gerv.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl27
1 files changed, 17 insertions, 10 deletions
diff --git a/globals.pl b/globals.pl
index 9f15976b2..b437d343f 100644
--- a/globals.pl
+++ b/globals.pl
@@ -323,7 +323,7 @@ sub FetchOneColumn {
"status", "resolution", "summary");
sub AppendComment {
- my ($bugid,$who,$comment) = (@_);
+ my ($bugid,$who,$comment,$isprivate) = (@_);
$comment =~ s/\r\n/\n/g; # Get rid of windows-style line endings.
$comment =~ s/\r/\n/g; # Get rid of mac-style line endings.
if ($comment =~ /^\s*$/) { # Nothin' but whitespace.
@@ -331,9 +331,10 @@ sub AppendComment {
}
my $whoid = DBNameToIdAndCheck($who);
-
- SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext) " .
- "VALUES($bugid, $whoid, now(), " . SqlQuote($comment) . ")");
+ my $privacyval = $isprivate ? 1 : 0 ;
+ SendSQL("INSERT INTO longdescs (bug_id, who, bug_when, thetext, isprivate) " .
+ "VALUES($bugid, $whoid, now(), " . SqlQuote($comment) . ", " .
+ $privacyval . ")");
SendSQL("UPDATE bugs SET delta_ts = now() WHERE bug_id = $bugid");
}
@@ -1137,8 +1138,9 @@ sub GetLongDescriptionAsText {
my ($id, $start, $end) = (@_);
my $result = "";
my $count = 0;
+ my $anyprivate = 0;
my ($query) = ("SELECT profiles.login_name, longdescs.bug_when, " .
- " longdescs.thetext " .
+ " longdescs.thetext, longdescs.isprivate " .
"FROM longdescs, profiles " .
"WHERE profiles.userid = longdescs.who " .
"AND longdescs.bug_id = $id ");
@@ -1156,25 +1158,29 @@ sub GetLongDescriptionAsText {
$query .= "ORDER BY longdescs.bug_when";
SendSQL($query);
while (MoreSQLData()) {
- my ($who, $when, $text) = (FetchSQLData());
+ my ($who, $when, $text, $isprivate) = (FetchSQLData());
if ($count) {
$result .= "\n\n------- Additional Comments From $who".Param('emailsuffix')." ".
time2str("%Y-%m-%d %H:%M", str2time($when)) . " -------\n";
}
+ if (($isprivate > 0) && Param("insidergroup")) {
+ $anyprivate = 1;
+ }
$result .= $text;
$count++;
}
- return $result;
+ return ($result, $anyprivate);
}
sub GetComments {
my ($id) = (@_);
my @comments;
-
SendSQL("SELECT profiles.realname, profiles.login_name,
date_format(longdescs.bug_when,'%Y-%m-%d %H:%i'),
- longdescs.thetext
+ longdescs.thetext,
+ isprivate,
+ date_format(longdescs.bug_when,'%Y%m%d%H%i%s')
FROM longdescs, profiles
WHERE profiles.userid = longdescs.who
AND longdescs.bug_id = $id
@@ -1182,7 +1188,8 @@ sub GetComments {
while (MoreSQLData()) {
my %comment;
- ($comment{'name'}, $comment{'email'}, $comment{'time'}, $comment{'body'}) = FetchSQLData();
+ ($comment{'name'}, $comment{'email'}, $comment{'time'}, $comment{'body'},
+ $comment{'isprivate'}, $comment{'when'}) = FetchSQLData();
$comment{'email'} .= Param('emailsuffix');
$comment{'name'} = $comment{'name'} || $comment{'email'};