1[%# This Source Code Form is subject to the terms of the Mozilla Public
2  # License, v. 2.0. If a copy of the MPL was not distributed with this
3  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4  #
5  # This Source Code Form is "Incompatible With Secondary Licenses", as
6  # 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  # watchers:     array.
13  #               Array of users watching this user's account.
14  # excludeself:  boolean.
15  #               True if user is not receiving self-generated mail.
16  # <rolename>:   Multiple hashes, one for each rolename (e.g. assignee; see
17  #               below), keyed by reasonname (e.g. comments; again, see
18  #               below). The value is a boolean - true if the user is
19  #               receiving mail for that reason when in that role.
20  #%]
21
22[%# If the user's bugmail has been disabled by admins, show a warning. %]
23[% IF user.email_disabled %]
24  <div class="warningmessages">
25    あなた宛の [% terms.bug %] メールは、[% terms.Bugzilla %] 管理者により
26    無効化されています。[% terms.bug %] メールを有効化するには、
27    [% Param('maintainer') %] に連絡してください。
28  </div>
29[% END %]
30
31[% IF user.authorizer.can_change_email && Param('allowemailchange') %]
32<p>
33  [% terms.Bugzilla %] が通知メールを送信するメールアドレス
34  <b>[% user.email FILTER html %]</b> を変更したい場合は、
35  "アカウント情報" タブをクリックしてください。
36</p>
37[% END %]
38
39<p>
40  "重要でない" [% terms.bugs %] への変更についての通知メールを受け取りたくない場合、
41  下の設定からいくつかもしくは全ての通知メールの設定を変更することができます。
42</p>
43
44<script type="text/javascript">
45<!--
46function SetCheckboxes(setting) {
47  for (var count = 0; count < document.userprefsform.elements.length; count++) {
48    var theinput = document.userprefsform.elements[count];
49    if (theinput.type == "checkbox"
50        && !theinput.disabled
51        && !theinput.name.match("remove_ignored_bug"))
52    {
53      if (theinput.name.match("neg")) {
54        theinput.checked = !setting;
55      }
56      else {
57        theinput.checked = setting;
58      }
59    }
60  }
61}
62// -->
63</script>
64
65<input type="button" value="全てのメールを有効" onclick="SetCheckboxes(true); return false;">
66<input type="button" value="全てのメールを無効" onclick="SetCheckboxes(false); return false;">
67
68<hr>
69
70<h3>全体オプション</h3>
71
72[% prefname = "email-$constants.REL_ANY-$constants.EVT_FLAG_REQUESTED" %]
73<input type="checkbox" name="[% prefname %]" id="[% prefname %]" value="1"
74       [%+ 'checked="checked"' IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_FLAG_REQUESTED} %]>
75<label for="[% prefname %]">フラグの要請があったときに通知メールを送る</label>
76<br>
77[% prefname = "email-$constants.REL_ANY-$constants.EVT_REQUESTED_FLAG" %]
78<input type="checkbox" name="[% prefname %]" id="[% prefname %]" value="1"
79       [%+ 'checked="checked"' IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_REQUESTED_FLAG} %]>
80<label for="[% prefname %]">要請したフラグが設定されたときに通知メールを送る</label>
81
82[% IF user.is_global_watcher %]
83  <p>
84      すべての [% terms.bugs %] を監視しています。
85      この権限から外れるには、
86      <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a>
87      に連絡してください。
88  </p>
89[% END %]
90
91<hr>
92<h3>フィールド・条件によるオプション設定</h3>
93
94[% events = [
95    { id = constants.EVT_ADDED_REMOVED,
96      description = "わたしが追加・削除された" },
97    { id = constants.EVT_BUG_CREATED,
98      description = "新規 $terms.bug が登録された" },
99    { id = constants.EVT_OPENED_CLOSED,
100      description = "$terms.bug が解決したか再開された" },
101    { id = constants.EVT_COMPONENT,
102      description = "プロダクトかコンポーネントが変更された" },
103    { id = constants.EVT_PROJ_MANAGEMENT,
104      description = "重要度、ステータス、深刻度、マイルストーンが更新された" },
105    { id = constants.EVT_COMMENT,
106      description = "新しいコメントが追加された" },
107    { id = constants.EVT_ATTACHMENT,
108      description = "新しい添付が追加された" },
109    { id = constants.EVT_ATTACHMENT_DATA,
110      description = "添付が変更された" },
111    { id = constants.EVT_KEYWORD,
112      description = "キーワードが変更された" },
113    { id = constants.EVT_CC,
114      description = "CC が変更された" },
115    { id = constants.EVT_DEPEND_BLOCK,
116      description = "依存関係が変更された" },
117    { id = constants.EVT_OTHER,
118      description = "上記以外の全ての変更" },
119] %]
120
121[% neg_events = [
122    { id = constants.EVT_UNCONFIRMED,
123      description = "$terms.bug が UNCONFIRMED のとき" },
124    { id = constants.EVT_CHANGED_BY_ME,
125      description = "自分が行った変更であるとき" },
126] %]
127
128[% relationships = [
129    { id = constants.REL_ASSIGNEE,
130      description = "担当者" },
131    { id = constants.REL_REPORTER,
132      description = "報告者" },
133    { id = constants.REL_CC,
134      description = "CC" },
135] %]
136
137[% IF Param('useqacontact') %]
138  [% relationships.push({ id = constants.REL_QA,
139                          description = "QA コンタクト" }) %]
140[% END %]
141
142
143[%# This is up here so that the "relationships" hook can modify it. %]
144[% no_added_removed = [constants.REL_REPORTER] %]
145
146[% Hook.process('relationships') %]
147
148[% num_columns = relationships.size %]
149
150<table id="email_prefs">
151  <tr class="column_header">
152    <th colspan="[% num_columns FILTER html %]">
153      この [% terms.bug %] との関連性:
154    </th>
155    <th>メールを受け取りたい条件</th>
156  </tr>
157
158  <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    [% count = loop.count() %]
166    <tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]">
167      [% FOREACH relationship = relationships %]
168        <td class="center">
169          <input type="checkbox" value="1"
170                 name="email-[% relationship.id %]-[% event.id %]"
171                 [%# The combinations don't always make sense; disable a couple %]
172                 [% IF event.id == constants.EVT_ADDED_REMOVED
173                       AND no_added_removed.contains(relationship.id) %]
174                   disabled="disabled"
175                 [% ELSIF user.mail_settings.${relationship.id}.${event.id} %]
176                   checked="checked"
177                 [% END %]>
178        </td>
179      [% END %]
180      <td>
181        [% event.description FILTER html %]
182      </td>
183    </tr>
184  [% END %]
185
186  <tr class="column_header">
187    <th colspan="[% num_columns FILTER html %]">&nbsp;</th>
188    <th>次のとき以外 (上書きします)</th>
189  </tr>
190
191  [% FOREACH event = neg_events %]
192    [% count = loop.count() %]
193    <tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]">
194      [% FOREACH relationship = relationships %]
195        <td class="center">
196          <input type="checkbox" value="1"
197                 name="neg-email-[% relationship.id %]-[% event.id %]"
198                 [%+ 'checked="checked"' IF NOT user.mail_settings.${relationship.id}.${event.id} %]>
199        </td>
200      [% END %]
201      <td>[% event.description FILTER html %]</td>
202    </tr>
203  [% END %]
204</table>
205
206<hr>
207<h3>ユーザの監視</h3>
208
209<p>
210ユーザを監視すると、メールの受信という意味で対象のユーザと同じ状況になることができます。
211メールは、<em>あなたの</em> ではなく、<em>対象の</em> [% terms.bug %]
212との関係により設定と照合されます。(たとえば、担当者など)
213</p>
214
215[% IF watchedusers.size %]
216  <p>あなたは、次のリストの全員を監視しています:</p>
217  <p>
218    <select id="watched_by_you" name="watched_by_you" multiple="multiple" size="5">
219        [% FOREACH w = watchedusers %]
220           <option value="[% w FILTER html %]">[% w FILTER html %]</option>
221        [% END %]
222    </select>
223    <br />
224    <input type="checkbox" id="remove_watched_users" name="remove_watched_users">
225    <label for="remove_watched_users">選択したユーザを監視対象から外す</label>
226  </p>
227[% ELSE %]
228  <p>誰も監視していません。</p>
229[% END %]
230
231<p id="new_watched_by_you">ユーザを監視リストに追加する (カンマ区切りのリスト):
232  [% INCLUDE global/userselect.html.tmpl
233     id => "new_watchedusers"
234     name => "new_watchedusers"
235     value => ""
236     size => 60
237     multiple => 5
238  %]
239</p>
240
241<p id="watching_you">あなたを監視しているユーザ:<br>
242  [% IF watchers.size %]
243    [% FOREACH watcher = watchers %]
244      [% watcher FILTER html %] <br>
245    [% END %]
246  [% ELSE %]
247    <i>No one</i>
248  [% END %]
249</p>
250
251<hr>
252<h3>[% terms.Bugs %] を無視する</h3>
253
254<p>
255  メール通知を一切受け取りたくない [% terms.bugs %] のリストを、カンマ区切りの
256  ID リストを入力することで設定することができます。メール通知を再有効化したい
257  場合、無視する [% terms.abug %] リストから、 [% terms.bug %] を選択してください。
258</p>
259[% IF user.bugs_ignored.size %]
260  <p>
261    あなたの今の無視リスト:
262    <table>
263    [% FOREACH bug = user.bugs_ignored %]
264      <tr>
265        <td>
266          <input type="checkbox" name="remove_ignored_bug_[% bug.id FILTER html %]" value="1">
267        </td>
268        <td><a href="[% urlbase FILTER html %]show_bug.cgi?id=[% bug.id FILTER uri %]">
269          [% bug.id FILTER html %]</a>
270        </td>
271        <td>[% bug.status FILTER html %]</td>
272        <td>
273          [% IF user.can_see_bug(bug.id) %]
274            - [% bug.summary FILTER html %]
275          [% ELSE %]
276            (プライベート)
277          [% END %]
278        </td>
279      </tr>
280    [% END %]
281    </table>
282  </p>
283[% END %]
284
285<p>
286  [% terms.bugs %] を追加:<br>
287  <input type="text" id="add_ignored_bugs"
288         name="add_ignored_bugs" size="60">
289</p>
290