Bug 383935: Display how many other users have chosen to see your saved search in their footer - Patch by Frédéric Buclin <LpSolit@gmail.com> r=timeless a=LpSolit
git-svn-id: svn://10.0.0.236/trunk@227975 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
879d9a4d4c
commit
6494b9aa1a
@ -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<Bugzilla::Group> that this search is shared with. C<undef> if
|
||||
this search isn't shared.
|
||||
|
||||
=item C<shared_with_users>
|
||||
|
||||
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
|
||||
|
||||
@ -112,6 +112,10 @@
|
||||
>[% group.name FILTER html %]</option>
|
||||
[% END %]
|
||||
</select>
|
||||
[% IF q.shared_with_users %]
|
||||
(shared with [% q.shared_with_users FILTER html %]
|
||||
[%+ q.shared_with_users > 1 ? "users" : "user" %])
|
||||
[% END %]
|
||||
</td>
|
||||
[% END %]
|
||||
</tr>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user