]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 399072: Remove the 'supportwatchers' parameter - Patch by Frédéric Buclin ...
authorlpsolit%gmail.com <>
Wed, 10 Dec 2008 18:26:51 +0000 (18:26 +0000)
committerlpsolit%gmail.com <>
Wed, 10 Dec 2008 18:26:51 +0000 (18:26 +0000)
Bugzilla/BugMail.pm
Bugzilla/Config/Admin.pm
docs/en/xml/administration.xml
template/en/default/account/prefs/email.html.tmpl
template/en/default/admin/params/admin.html.tmpl
userprefs.cgi

index 4e91d4be48156f4ef11b88a9283df512ea5d4fc1..9a5e1a4c90a700ce017f95116f9df692e0482966 100644 (file)
@@ -410,23 +410,21 @@ sub Send {
         }
     }
     
-    if (Bugzilla->params->{"supportwatchers"}) {
-        # Find all those user-watching anyone on the current list, who is not 
-        # on it already themselves.
-        my $involved = join(",", keys %recipients);
-
-        my $userwatchers = 
-            $dbh->selectall_arrayref("SELECT watcher, watched FROM watch 
-                                      WHERE watched IN ($involved)");
-
-        # Mark these people as having the role of the person they are watching
-        foreach my $watch (@$userwatchers) {
-            while (my ($role, $bits) = each %{$recipients{$watch->[1]}}) {
-                $recipients{$watch->[0]}->{$role} |= BIT_WATCHING
-                    if $bits & BIT_DIRECT;
-            }
-            push (@{$watching{$watch->[0]}}, $watch->[1]);
+    # Find all those user-watching anyone on the current list, who is not
+    # on it already themselves.
+    my $involved = join(",", keys %recipients);
+
+    my $userwatchers =
+        $dbh->selectall_arrayref("SELECT watcher, watched FROM watch
+                                  WHERE watched IN ($involved)");
+
+    # Mark these people as having the role of the person they are watching
+    foreach my $watch (@$userwatchers) {
+        while (my ($role, $bits) = each %{$recipients{$watch->[1]}}) {
+            $recipients{$watch->[0]}->{$role} |= BIT_WATCHING
+                if $bits & BIT_DIRECT;
         }
+        push(@{$watching{$watch->[0]}}, $watch->[1]);
     }
 
     # Global watcher
index 838e532958f8b906d0c6f4c0bf65f9522f641b11..18818e6b5b461bf6ae62fdec2442c253a340d7e9 100644 (file)
@@ -56,13 +56,7 @@ sub get_param_list {
    name => 'allowuserdeletion',
    type => 'b',
    default => 0
-  },
-
-  {
-   name => 'supportwatchers',
-   type => 'b',
-   default => 0
-  } );
+  });
   return @param_list;
 }
 
index 77f02c0f6108544f994853d438192355454dc1e9..df56715025c0787b28c01be8cc22004994fdae76 100644 (file)
 
         <section id="param-admin-policies">
           <title>Administrative Policies</title>
-        <para>
-        This page contains parameters for basic administrative functions.
-        Options include whether to allow the deletion of bugs and users, whether
-        to allow users to change their email address, and whether to allow
-        user watching (one user receiving all notifications of a selected
-        other user). 
-        </para>
-
-        <variablelist>
-
-          <varlistentry>
-            <term>
-              supportwatchers
-            </term>
-            <listitem>
-              <para>
-                Turning on this option allows users to ask to receive copies 
-                of bug mail sent to another user.  Watching a user with
-                different group permissions is not a way to 'get around' the
-                system; copied emails are still subject to the normal groupset
-                permissions of a bug, and <quote>watchers</quote> will only be 
-                copied on emails from bugs they would normally be allowed to view. 
-              </para> 
-            </listitem>
-          </varlistentry>
-
-        </variablelist>
-
+          <para>
+            This page contains parameters for basic administrative functions.
+            Options include whether to allow the deletion of bugs and users,
+            and whether to allow users to change their email address.
+          </para>
         </section>
 
         <section id="param-user-authentication">
index 57c76a93ef95a123f181921a1a864578ed0173b3..a4d22db73297766edc9b6748b058f434093ee3df 100644 (file)
@@ -31,7 +31,6 @@
   #               below), keyed by reasonname (e.g. comments; again, see
   #               below). The value is a boolean - true if the user is
   #               receiving mail for that reason when in that role.
-  # Also references the 'supportwatchers' Param.
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
@@ -264,7 +263,6 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb
   [% END %]
 [% END %]
 
-[% IF Param('supportwatchers') %]
 <hr>
 <b>User Watching</b>
 
@@ -306,8 +304,6 @@ You are currently not watching any users.
   [% END %]
 </p>
 
-[% END %]
-
 <hr>
 
 <br>
index 639ea66a1bda9350900cef66b2540bb75925aae0..dd83ebb2ed03a3731ab5b1a73a8f13ba0e89a274 100644 (file)
@@ -37,9 +37,5 @@
                        "$terms.Bugzilla will issue a warning in case you'd run into inconsistencies " _
                        "when you're about to do so, but such deletions remain kinda scary. " _
                        "So, you have to turn on this option before any such deletions " _
-                       "will ever happen.",
-
-  supportwatchers => "Support one user watching (ie getting copies of all related " _
-                     "email about) another's ${terms.bugs}. Useful for people going on " _
-                     "vacation, and QA folks watching particular developers' ${terms.bugs}." }
+                       "will ever happen." }
 %]
\ No newline at end of file
index 4ce0f57159499df0c5df41cf4147a67d8f3221e9..1bf2d7f5f3ea8cdfb803fd36b8afdc089e43b8e6 100755 (executable)
@@ -205,29 +205,27 @@ sub DoEmail {
     ###########################################################################
     # User watching
     ###########################################################################
-    if (Bugzilla->params->{"supportwatchers"}) {
-        my $watched_ref = $dbh->selectcol_arrayref(
-            "SELECT profiles.login_name FROM watch INNER JOIN profiles" .
-            " ON watch.watched = profiles.userid" .
-            " WHERE watcher = ?" .
-            " ORDER BY profiles.login_name",
-            undef, $user->id);
-        $vars->{'watchedusers'} = $watched_ref;
-
-        my $watcher_ids = $dbh->selectcol_arrayref(
-            "SELECT watcher FROM watch WHERE watched = ?",
-            undef, $user->id);
-
-        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;
+    my $watched_ref = $dbh->selectcol_arrayref(
+        "SELECT profiles.login_name FROM watch INNER JOIN profiles" .
+        " ON watch.watched = profiles.userid" .
+        " WHERE watcher = ?" .
+        " ORDER BY profiles.login_name",
+        undef, $user->id);
+    $vars->{'watchedusers'} = $watched_ref;
+
+    my $watcher_ids = $dbh->selectcol_arrayref(
+        "SELECT watcher FROM watch WHERE watched = ?",
+        undef, $user->id);
+
+    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;
+
     ###########################################################################
     # Role-based preferences
     ###########################################################################
@@ -249,9 +247,7 @@ sub SaveEmail {
     my $cgi = Bugzilla->cgi;
     my $user = Bugzilla->user;
 
-    if (Bugzilla->params->{"supportwatchers"}) {
-        Bugzilla::User::match_field($cgi, { 'new_watchedusers' => {'type' => 'multi'} });
-    }
+    Bugzilla::User::match_field($cgi, { 'new_watchedusers' => {'type' => 'multi'} });
 
     ###########################################################################
     # Role-based preferences
@@ -308,9 +304,8 @@ sub SaveEmail {
     ###########################################################################
     # User watching
     ###########################################################################
-    if (Bugzilla->params->{"supportwatchers"} 
-        && (defined $cgi->param('new_watchedusers')
-            || defined $cgi->param('remove_watched_users'))) 
+    if (defined $cgi->param('new_watchedusers')
+        || defined $cgi->param('remove_watched_users'))
     {
         $dbh->bz_start_transaction();