зеркало из https://github.com/mozilla/pjs.git
Bug 280517 : Let me know who is watching my account
Patch by Frederic Buclin <LpSolit@gmail.com> r=myk a=myk
This commit is contained in:
Родитель
acdcda36e6
Коммит
e63adf2aad
|
@ -24,6 +24,8 @@
|
|||
[%# INTERFACE:
|
||||
# watchedusers: string.
|
||||
# Comma-separated list of email addresses this user watches.
|
||||
# watchers: array.
|
||||
# Array of users watching this user's account.
|
||||
# excludeself: boolean.
|
||||
# True if user is not receiving self-generated mail.
|
||||
# <rolename>: Multiple hashes, one for each rolename (e.g. owner; see
|
||||
|
@ -63,6 +65,19 @@
|
|||
value="[% watchedusers FILTER html %]">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th align="right" valign="baseline">Users watching you:</th>
|
||||
<td>
|
||||
[% IF watchers.size %]
|
||||
[% FOREACH watcher = watchers %]
|
||||
[% watcher FILTER html %] <br>
|
||||
[% END %]
|
||||
[% ELSE %]
|
||||
Nobody is currently watching your account.
|
||||
[% END %]
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
|
||||
<tr>
|
||||
|
|
|
@ -182,6 +182,19 @@ sub DoEmail {
|
|||
. " WHERE watcher = ? AND watch.watched = profiles.userid",
|
||||
undef, $userid);
|
||||
$vars->{'watchedusers'} = join(',', @$watched_ref);
|
||||
|
||||
my $watcher_ids = $dbh->selectcol_arrayref(
|
||||
"SELECT watcher FROM watch WHERE watched = ?",
|
||||
undef, $userid);
|
||||
|
||||
my @watchers;
|
||||
foreach my $watcher_id (@$watcher_ids) {
|
||||
my $watcher = new Bugzilla::User($watcher_id);
|
||||
push (@watchers, Bugzilla::User::identity($watcher));
|
||||
}
|
||||
|
||||
@watchers = sort { lc($a) cmp lc($b) } @watchers;
|
||||
$vars->{'watchers'} = \@watchers;
|
||||
}
|
||||
|
||||
SendSQL("SELECT emailflags FROM profiles WHERE userid = $userid");
|
||||
|
|
Загрузка…
Ссылка в новой задаче