From 80477beb472a83f6fa711358372db9edf6209c39 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Wed, 10 Feb 2010 12:55:38 -0500 Subject: Bug 310450 - Bugzilla should send an email when a comment becomes private or un-private r=mkanat, a=mkanat --- Bugzilla/Comment.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Comment.pm') diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index e81819652..300357313 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -188,6 +188,22 @@ sub _check_type { return $type; } +sub count { + my ($self) = @_; + + return $self->{'count'} if defined $self->{'count'}; + + my $dbh = Bugzilla->dbh; + ($self->{'count'}) = $dbh->selectrow_array( + "SELECT COUNT(*) + FROM longdescs + WHERE bug_id = ? + AND bug_when <= ?", + undef, $self->bug_id, $self->creation_ts); + + return --$self->{'count'}; +} + 1; __END__ @@ -243,6 +259,10 @@ C<0> otherwise. L who created the comment. +=item C + +C The position this comment is located in the full list of comments for a bug starting from 0. + =item C =over @@ -273,8 +293,6 @@ A string, the full text of the comment as it would be displayed to an end-user. =back - - =back =cut -- cgit v1.2.3-24-g4f1b