summaryrefslogtreecommitdiffstats
path: root/userprefs.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-xuserprefs.cgi178
1 files changed, 36 insertions, 142 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index e2fcbf0db..04f017cc5 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -61,6 +61,7 @@ my @emailFlags = (
);
my $defaultEmailFlagString =
+ 'ExcludeSelf~' . 'on~' .
'emailOwnerRemoveme~' . 'on~' .
'emailOwnerComments~' . 'on~' .
@@ -180,103 +181,28 @@ sub setEmailFlags ($) {
sub ShowEmailOptions () {
- SendSQL("SELECT emailnotification, newemailtech FROM profiles " .
- "WHERE userid = $userid");
- my ($emailnotification, $dbNewEmailTech) = (FetchSQLData());
-
- # Override the database value with the current form value
- # if the disable/enable button has been pressed.
- if ( defined $::FORM{'newEmailTech'} ) {
-
- # If the user has clicked on 'Disable New Email Tech',
- # clear out their email flag preferences.
- if ($dbNewEmailTech == 1) {
- setEmailFlags('');
- }
-
- $showNewEmailTech = $::FORM{'newEmailTech'};
- } else {
- $showNewEmailTech = $dbNewEmailTech;
- }
-
- #print "<BR>database newemailtech = $showNewEmailTech<br>";
-
- my $qacontactpart = "";
- if (Param('useqacontact')) {
- $qacontactpart = ", the current QA Contact";
- }
-
- if ($showNewEmailTech==0) {
- print <<"--endquote--";
-<TABLE>
-<TR><TD COLSPAN="2">
-Bugzilla will send out email notification of changed bugs to
-the current owner, the Reporter of the bug$qacontactpart, and anyone on the
-CC list. However, you can suppress some of those email notifications.
-On which of these bugs would you like email notification of changes?
-</TD></TR>
---endquote--
- my $entry =
- BuildPulldown("emailnotification",
- [["ExcludeSelfChanges",
- "All qualifying bugs except those which I change"],
- ["CConly",
- "Only those bugs which I am listed on the CC line"],
- ["All",
- "All qualifying bugs"]],
- $emailnotification);
- EmitEntry("Notify me of changes to", $entry);
- print "</TABLE>";
- }
-
- if (Param("newemailtech")) {
- print qq{
-<TR><TD COLSPAN="2"><HR></TD></TR>
-<TR><TD COLSPAN="2"><FONT COLOR="red">Updated!</FONT>
-Bugzilla's new standard email notification scheme allows for the use of
-features such as watching other users and selecting which bug changes you get
-mail about. Although it's still possible to use the old notification scheme,
-this isn't recommended, because the old scheme is no longer
-supported and will be going away in an upcoming version of Bugzilla.
-<FONT COLOR="red">Note that after clicking the link below, you must still click
-on the <B>Submit Changes</B> button in order for your email tech change to be saved.</FONT>
-</TD></TR>};
-
- if ($showNewEmailTech == 1) {
- print qq{
- <tr><td colspan=2><center>
- <A HREF="userprefs.cgi?bank=diffs&amp;newEmailTech=0">Disable New Email Tech</A>
- </center></td></tr>};
- } else {
- print qq{<tr><td colspan=2><center><A HREF="userprefs.cgi?bank=diffs&amp;newEmailTech=1">Enable New Email Tech</A></center></td></tr>};
- }
-
- if (Param("supportwatchers") && $showNewEmailTech == 1) {
-
- my $watcheduserSet = new RelationSet;
- $watcheduserSet->mergeFromDB("SELECT watched FROM watch WHERE" .
+ if (Param("supportwatchers")) {
+ my $watcheduserSet = new RelationSet;
+ $watcheduserSet->mergeFromDB("SELECT watched FROM watch WHERE" .
" watcher=$userid");
- my $watchedusers = $watcheduserSet->toString();
+ my $watchedusers = $watcheduserSet->toString();
- print qq{
+ print qq{
<TR><TD COLSPAN="4"><HR></TD></TR>
<TR><TD COLSPAN="4">
-<FONT COLOR="red">New Email Tech Feature: </FONT>If you want to help cover for someone when they're on vacation, or if
+If you want to help cover for someone when they're on vacation, or if
you need to do the QA related to all of their bugs, you can tell bugzilla
to send mail related to their bugs to you also. List the email addresses
of any users you wish to watch here, separated by commas.
</TD></TR>};
- EmitEntry("Users to watch",
+ EmitEntry("Users to watch",
qq{<INPUT SIZE=35 NAME="watchedusers" VALUE="$watchedusers">});
- }
+ }
- print qq{<TR><TD COLSPAN="2"><HR></TD></TR>};
+ print qq{<TR><TD COLSPAN="2"><HR></TD></TR>};
- if ($showNewEmailTech == 1) {
- showAdvancedEmailFilterOptions();
- }
- }
+ showAdvancedEmailFilterOptions();
print qq {
<TABLE CELLSPACING="0" CELLPADDING="10" BORDER=0 WIDTH="100%">
@@ -296,38 +222,25 @@ sub showAdvancedEmailFilterOptions () {
</center>
</TD></TR><tr><td colspan="2">
<p>
- <center><FONT COLOR="red">New Email Tech Feature:</FONT>
- Filter email notifications for <b>modified</b>
- bugs (does not effect new bug email notices).
+ <center>
+ If you don't like getting a notification for "trivial"
+ changes to bugs, you can use the settings below to
+ filter some (or even all) notifications.
</center></td></tr></table>
<hr width=800 align=center>
};
- SendSQL("SELECT emailflags, emailnotification FROM profiles WHERE " .
- "userid = $userid");
+ SendSQL("SELECT emailflags FROM profiles WHERE userid = $userid");
- ($flags, $notify) = FetchSQLData();
+ ($flags) = FetchSQLData();
# if the emailflags haven't been set before, that means that this user
# hasn't been to (the email pane of?) userprefs.cgi since the change to
- # use emailflags. create a default flagset for them, mostly based on
- # static defaults, but setting ExcludeSelf based on the old
- # emailnotification column.
+ # use emailflags. create a default flagset for them, based on
+ # static defaults.
#
if ( !$flags ) {
-
- if ( !$notify ) {
- confess("neither \$flags nor \$notify was set");
- }
-
- my $notifyString;
- if ( $notify eq 'ExcludeSelfChanges' ) {
- $notifyString = "ExcludeSelf~on~";
- } else {
- $notifyString = "ExcludeSelf~~";
- }
-
- $flags = $notifyString . $defaultEmailFlagString;
+ $flags = $defaultEmailFlagString;
setEmailFlags($flags);
}
@@ -440,52 +353,36 @@ sub SaveEmailOptions () {
my $useNewEmailTech = $::FORM{'savedEmailTech'};
my $updateString;
- if ($useNewEmailTech == 0) {
-
- # we force the NEW email filter entry to allow all email
- # (empty string defaults to allowing all email).
- $updateString = '';
-
+ if ( defined $::FORM{'ExcludeSelf'}) {
+ $updateString .= 'ExcludeSelf~on';
} else {
- if ( defined $::FORM{'ExcludeSelf'}) {
- $updateString .= 'ExcludeSelf~on';
- } else {
- $updateString .= 'ExcludeSelf~';
- }
- my @tmpGroups = @emailGroups;
+ $updateString .= 'ExcludeSelf~';
+ }
+ my @tmpGroups = @emailGroups;
- while ((my $groupName,my $groupText) = splice(@tmpGroups,0,2) ) {
+ while ((my $groupName,my $groupText) = splice(@tmpGroups,0,2) ) {
- my @tmpFlags = @emailFlags;
+ my @tmpFlags = @emailFlags;
- while ((my $flagName,my $flagText) = splice(@tmpFlags,0,2) ) {
+ while ((my $flagName,my $flagText) = splice(@tmpFlags,0,2) ) {
- my $entry = 'email' . $groupName . $flagName;
- my $entryValue;
+ my $entry = 'email' . $groupName . $flagName;
+ my $entryValue;
- if (!defined $::FORM{$entry} ) {
- $entryValue = "";
- } else {
- $entryValue = $::FORM{$entry};
- }
-
- $updateString .= '~' . $entry . '~' . $entryValue;
+ if (!defined $::FORM{$entry} ) {
+ $entryValue = "";
+ } else {
+ $entryValue = $::FORM{$entry};
}
- }
- # we force the OLD email tech flag to allow all email
- $::FORM{'emailnotification'} = "All";
+ $updateString .= '~' . $entry . '~' . $entryValue;
+ }
}
#open(FID,">updateString");
#print qq{UPDATE STRING: $updateString <br>};
#close(FID);
- SendSQL("UPDATE profiles SET emailnotification = "
- . SqlQuote($::FORM{'emailnotification'})
- . ", newemailtech = $useNewEmailTech "
- . "WHERE userid = $userid" );
-
SendSQL("UPDATE profiles SET emailflags = " .
SqlQuote($updateString) . " WHERE userid = $userid");
@@ -493,9 +390,6 @@ sub SaveEmailOptions () {
if (exists $::FORM{'watchedusers'}) {
- Error ('You must have "New email tech" set to watch someone')
- if ( $::FORM{'watchedusers'} ne "" && $useNewEmailTech == 0);
-
# Just in case. Note that this much locking is actually overkill:
# we don't really care if anyone reads the watch table. So
# some small amount of contention could be gotten rid of by