diff options
author | Dave Lawrence <dkl@redhat.com> | 2010-02-10 18:55:38 +0100 |
---|---|---|
committer | Dave Lawrence <dkl@redhat.com> | 2010-02-10 18:55:38 +0100 |
commit | 80477beb472a83f6fa711358372db9edf6209c39 (patch) | |
tree | c2bfc902d85f18527462ffff83d4060b335aece1 /Bugzilla/Comment.pm | |
parent | c6c99bcc594d33553921ca111f05f374330d5d4d (diff) | |
download | bugzilla-80477beb472a83f6fa711358372db9edf6209c39.tar.gz bugzilla-80477beb472a83f6fa711358372db9edf6209c39.tar.xz |
Bug 310450 - Bugzilla should send an email when a comment becomes private or un-private
r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/Comment.pm')
-rw-r--r-- | Bugzilla/Comment.pm | 22 |
1 files changed, 20 insertions, 2 deletions
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<Bugzilla::User> who created the comment. +=item C<count> + +C<int> The position this comment is located in the full list of comments for a bug starting from 0. + =item C<body_full> =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 |