From 836b976e508db4efa1775d0beb0704cb56f28695 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 13 Jun 2007 20:28:03 +0000 Subject: =?UTF-8?q?Bug=20383935:=20Display=20how=20many=20other=20users=20?= =?UTF-8?q?have=20chosen=20to=20see=20your=20saved=20search=20in=20their?= =?UTF-8?q?=20footer=20-=20Patch=20by=20Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20B?= =?UTF-8?q?uclin=20=20r=3Dtimeless=20a=3DLpSolit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Search/Saved.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Bugzilla/Search') diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm index 83528405f..3c1ad6651 100644 --- a/Bugzilla/Search/Saved.pm +++ b/Bugzilla/Search/Saved.pm @@ -170,6 +170,23 @@ sub shared_with_group { return $self->{shared_with_group}; } +sub shared_with_users { + my $self = shift; + my $dbh = Bugzilla->dbh; + + if (!exists $self->{shared_with_users}) { + $self->{shared_with_users} = + $dbh->selectrow_array('SELECT COUNT(*) + FROM namedqueries_link_in_footer + INNER JOIN namedqueries + ON namedquery_id = id + WHERE namedquery_id = ? + AND user_id != userid', + undef, $self->id); + } + return $self->{shared_with_users}; +} + #################### # Simple Accessors # #################### @@ -208,6 +225,7 @@ __END__ my $edit_link = $query->edit_link; my $search_url = $query->url; my $owner = $query->user; + my $num_subscribers = $query->shared_with_users; =head1 DESCRIPTION @@ -262,4 +280,9 @@ True if the search contains only a list of Bug IDs. The L that this search is shared with. C if this search isn't shared. +=item C + +Returns how many users (besides the author of the saved search) are +using the saved search, i.e. have it displayed in their footer. + =back -- cgit v1.2.1