email.html.tmpl 9.45 KB
Newer Older
1 2 3
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
  #
5 6
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
7 8 9
  #%]

[%# INTERFACE:
10
  # watchedusers: string.
11
  #               Comma-separated list of email addresses this user watches.
12 13
  # watchers:     array.
  #               Array of users watching this user's account.
14 15
  # excludeself:  boolean.
  #               True if user is not receiving self-generated mail.
16
  # <rolename>:   Multiple hashes, one for each rolename (e.g. assignee; see
17 18
  #               below), keyed by reasonname (e.g. comments; again, see
  #               below). The value is a boolean - true if the user is
19 20
  #               receiving mail for that reason when in that role.
  #%]
21

22 23 24 25 26 27 28 29 30
[%# If the user's bugmail has been disabled by admins, show a warning. %]
[% IF user.email_disabled %]
  <div class="warningmessages">
    Your [% terms.bug %]mail has been disabled by the [% terms.Bugzilla %]
    administrator.  Please contact [% Param('maintainer') %] to enable
    [%+ terms.bug %]mails.
  </div>
[% END %]

31 32 33 34 35 36 37
[% IF user.authorizer.can_change_email && Param('allowemailchange') %]
  <p>
    If you want to change your e-mail address
    <b>[% user.email FILTER html %]</b> to which [% terms.Bugzilla %] sends
    notifications, click the "Account Information" tab above.
  </p>
[% END %]
38

39 40 41 42 43
<p>
  If you don't like getting a notification for "trivial"
  changes to [% terms.bugs %], you can use the settings below to
  filter some or all notifications.
</p>
44

45 46 47 48 49
<script type="text/javascript">
<!--
function SetCheckboxes(setting) {
  for (var count = 0; count < document.userprefsform.elements.length; count++) {
    var theinput = document.userprefsform.elements[count];
50 51 52 53
    if (theinput.type == "checkbox"
        && !theinput.disabled
        && !theinput.name.match("remove_ignored_bug"))
    {
54
      if (theinput.name.match("neg")) {
55
        theinput.checked = !setting;
56 57 58 59 60 61 62 63 64
      }
      else {
        theinput.checked = setting;
      }
    }
  }
}
// -->
</script>
65

66 67 68
<input type="button" value="Enable All Mail" onclick="SetCheckboxes(true); return false;">
<input type="button" value="Disable All Mail" onclick="SetCheckboxes(false); return false;">

69
<hr>
70

71 72 73 74 75 76 77 78 79 80 81
<h3>Global options</h3>

[% prefname = "email-$constants.REL_ANY-$constants.EVT_FLAG_REQUESTED" %]
<input type="checkbox" name="[% prefname %]" id="[% prefname %]" value="1"
       [%+ 'checked="checked"' IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_FLAG_REQUESTED} %]>
<label for="[% prefname %]">Email me when someone asks me to set a flag</label>
<br>
[% prefname = "email-$constants.REL_ANY-$constants.EVT_REQUESTED_FLAG" %]
<input type="checkbox" name="[% prefname %]" id="[% prefname %]" value="1"
       [%+ 'checked="checked"' IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_REQUESTED_FLAG} %]>
<label for="[% prefname %]">Email me when someone sets a flag I asked for</label>
82

83
[% IF user.is_global_watcher %]
84 85 86 87
  <p>
    You are watching all [% terms.bugs %]. To be removed from this role, contact
    <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a>.
  </p>
88
[% END %]
89

90
<hr>
91 92

<h3>Field/recipient specific options</h3>
93

94 95 96
[% events = [
    { id = constants.EVT_ADDED_REMOVED,
      description = "I'm added to or removed from this capacity" },
97 98
    { id = constants.EVT_BUG_CREATED,
      description = "A new $terms.bug is created" },
99 100
    { id = constants.EVT_OPENED_CLOSED,
      description = "The $terms.bug is resolved or reopened" },
101 102
    { id = constants.EVT_COMPONENT,
      description = "The product or component changes" },
103 104 105 106 107 108 109
    { id = constants.EVT_PROJ_MANAGEMENT,
      description = "The priority, status, severity, or milestone changes" },
    { id = constants.EVT_COMMENT,
      description = "New comments are added" },
    { id = constants.EVT_ATTACHMENT,
      description = "New attachments are added" },
    { id = constants.EVT_ATTACHMENT_DATA,
110
      description = "Attachment details changes" },
111 112 113 114
    { id = constants.EVT_KEYWORD,
      description = "The keywords field changes" },
    { id = constants.EVT_CC,
      description = "The CC field changes" },
115 116
    { id = constants.EVT_DEPEND_BLOCK,
      description = "The dependency tree changes" },
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
    { id = constants.EVT_OTHER,
      description = "Any field not mentioned above changes" },
] %]

[% neg_events = [
    { id = constants.EVT_UNCONFIRMED,
      description = "The $terms.bug is in the UNCONFIRMED state" },
    { id = constants.EVT_CHANGED_BY_ME,
      description = "The change was made by me" },
] %]

[% relationships = [
    { id = constants.REL_ASSIGNEE,
      description = "Assignee" },
    { id = constants.REL_REPORTER,
      description = "Reporter" },
    { id = constants.REL_CC,
      description = "CCed" },
] %]
136

137 138 139 140 141 142 143 144 145 146 147 148 149
[% IF Param('useqacontact') %]
  [% relationships.push({ id = constants.REL_QA, 
                          description = "QA Contact" }) %]
[% END %]


[%# This is up here so that the "relationships" hook can modify it. %]
[% no_added_removed = [constants.REL_REPORTER] %]

[% Hook.process('relationships') %]

[% num_columns = relationships.size %]

150
<table id="email_prefs">
151 152 153 154 155
  <tr class="column_header">
    <th colspan="[% num_columns FILTER html %]">
      When my relationship to this [% terms.bug %] is:
    </th>
    <th>I want to receive mail when:</th>
156 157 158
  </tr>

  <tr>
159
    [% FOREACH relationship = relationships %]
160
      <th class="role_header">[% relationship.description FILTER html %]</th>
161
    [% END %]
162
  </tr>
163

164
  [% FOREACH event = events %]  
165 166
    [% count = loop.count() %]
    <tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]">
167
      [% FOREACH relationship = relationships %]
168 169 170 171 172 173 174 175 176 177
        <td class="center">
          <input type="checkbox" value="1"
                 name="email-[% relationship.id %]-[% event.id %]"
                 [%# The combinations don't always make sense; disable a couple %]
                 [% IF event.id == constants.EVT_ADDED_REMOVED
                       AND no_added_removed.contains(relationship.id) %]
                   disabled="disabled"
                 [% ELSIF user.mail_settings.${relationship.id}.${event.id} %]
                   checked="checked"
                 [% END %]>
178 179 180 181
        </td>
      [% END %]
      <td>
        [% event.description FILTER html %]
182
      </td>
183 184
    </tr>
  [% END %]
185 186 187 188

  <tr class="column_header">
    <th colspan="[% num_columns FILTER html %]">&nbsp;</th>
    <th>but not when (overrides above):</th>
189 190
  </tr>

191
  [% FOREACH event = neg_events %]  
192 193
    [% count = loop.count() %]
    <tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]">
194
      [% FOREACH relationship = relationships %]
195 196 197 198
        <td class="center">
          <input type="checkbox" value="1"
                 name="neg-email-[% relationship.id %]-[% event.id %]"
                 [%+ 'checked="checked"' IF NOT user.mail_settings.${relationship.id}.${event.id} %]>
199 200
        </td>
      [% END %]
201
      <td>[% event.description FILTER html %]</td>
202 203
    </tr>
  [% END %]
204
</table>
205

206
<hr>
207 208

<h3>User Watching</h3>
209 210 211

<p>
If you watch a user, it is as if you are standing in their shoes for the 
212 213
purposes of getting email. Email is sent or not according to <em>your</em>
preferences for <em>their</em> relationship to the [% terms.bug %]
214
(e.g. Assignee).
215
</p>
216

217
[% IF watchedusers.size %]
218
  <p>You are watching everyone in the following list:</p>
219 220 221 222 223
  <p>
    <select id="watched_by_you" name="watched_by_you" multiple="multiple" size="5">
        [% FOREACH w = watchedusers %]
           <option value="[% w FILTER html %]">[% w FILTER html %]</option>
        [% END %]
224 225
    </select>
    <br>
226 227
    <input type="checkbox" id="remove_watched_users" name="remove_watched_users">
    <label for="remove_watched_users">Remove selected users from my watch list</label>
228
  </p>
229
[% ELSE %]
230
  <p>You are currently not watching any users.</p>
231
[% END %]
232

233

234
<p id="new_watched_by_you">Add users to my watch list (comma separated list):
235 236 237 238 239 240 241
  [% INCLUDE global/userselect.html.tmpl
     id => "new_watchedusers"
     name => "new_watchedusers"
     value => ""
     size => 60
     multiple => 5
  %]
242
</p>
243

244
<p id="watching_you">Users watching you:<br>
245 246 247 248 249
  [% IF watchers.size %]
    [% FOREACH watcher = watchers %]
      [% watcher FILTER html %] <br>
    [% END %]
  [% ELSE %]
250
    <i>No one</i>
251 252 253
  [% END %]
</p>

254 255 256
<hr>

<h3>Ignore [% terms.Bugs %]</h3>
257

258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
<p>
  You can specify a list of [% terms.bugs %] from which you never want to get
  any email notification of any kind by adding their ID(s) as a comma-separated
  list. Removing [% terms.abug %] by selecting it from the current ignored list 
  will re-enable email notifications for the [% terms.bug %].
</p>
[% IF user.bugs_ignored.size %]
  <p>
    You are currently ignoring:
    <table>
    [% FOREACH bug = user.bugs_ignored %]
      <tr>
        <td>
          <input type="checkbox" name="remove_ignored_bug_[% bug.id FILTER html %]" value="1">
        </td>
        <td><a href="[% urlbase FILTER html %]show_bug.cgi?id=[% bug.id FILTER uri %]">
          [% bug.id FILTER html %]</a>
        </td>
        <td>[% bug.status FILTER html %]</td>
        <td>
          [% IF user.can_see_bug(bug.id) %]
            - [% bug.summary FILTER html %]
          [% ELSE %]
            (private)
          [% END %]
        </td>
      </tr>
    [% END %]
    </table>
  </p>
[% END %]

290 291
<p>
  Add [% terms.bugs %]:<br>
292
  <input type="text" id="add_ignored_bugs" 
293 294
         name="add_ignored_bugs" size="60">
</p>