From e087aa6018bab95f403c836d12b30bb5ed39a626 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 10 Dec 2008 18:26:51 +0000 Subject: Bug 399072: Remove the 'supportwatchers' parameter - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- userprefs.cgi | 49 ++++++++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'userprefs.cgi') diff --git a/userprefs.cgi b/userprefs.cgi index 4ce0f5715..1bf2d7f5f 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -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(); -- cgit v1.2.3-65-gdbad