]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 365302 email userprefs doesn't tell you if you are a globalwatcher
authortimeless%mozdev.org <>
Sun, 22 Jul 2007 20:08:09 +0000 (20:08 +0000)
committertimeless%mozdev.org <>
Sun, 22 Jul 2007 20:08:09 +0000 (20:08 +0000)
r=lpsolit a=lpsolit

Bugzilla/User.pm
template/en/default/account/prefs/email.html.tmpl

index f13b94fbfac6ad72d571520318c8c79e66271aae..1a9729ee9dda3e6d11becf35b004de1d3f3ce01c 100644 (file)
@@ -1513,6 +1513,16 @@ sub is_insider {
     return $self->{'is_insider'};
 }
 
+sub is_global_watcher {
+    my $self = shift;
+
+    if (!defined $self->{'is_global_watcher'}) {
+        my @watchers = split(/[,\s]+/, Bugzilla->params->{'globalwatchers'});
+        $self->{'is_global_watcher'} = grep { $_ eq $self->login } @watchers;
+    }
+    return  $self->{'is_global_watcher'};
+}
+
 sub get_userlist {
     my $self = shift;
 
@@ -2055,6 +2065,11 @@ moving is enabled.
 Returns true if the user can access private comments and attachments,
 i.e. if the 'insidergroup' parameter is set and the user belongs to this group.
 
+=item C<is_global_watcher>
+
+Returns true if the user is a global watcher,
+i.e. if the 'globalwatchers' parameter contains the user.
+
 =back
 
 =head1 CLASS FUNCTIONS
index 1aa4dae76e5a7e4092e5e97f89b3991c093503a4..617bec8c6436319f861cbf79d33efdcd67ea1e22 100644 (file)
@@ -100,6 +100,16 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
       <br>
     </td>
   </tr>
+[% IF user.is_global_watcher %]
+  <tr>
+    <td width="150"></td>
+    <td>
+      You are watching all [% terms.bugs %]. To be removed from this role,
+      contact
+      <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a>.
+    </td>
+  </tr>
+[% END %]
 </table>
 
 <hr>