1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
[%# 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/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
#%]
[%# INTERFACE:
# fields: hash/record; the fields being matched, each of which has:
# type: single|multi: whether or not the user can select multiple matches
# flag_type: for flag requestee fields, the type of flag being requested
# matches: hash; Hierarchical. The levels go like this:
# field_name {
# pattern_text {
# 'users' = @user_list (user objects)
# 'status' = success|fail|trunc (result of search.
# 'trunc' (truncated) means max was reached)
# }
# }
# script: string; The name of the calling script, used to create a
# self-referential URL
#%]
[%# This lists fields which use the user auto-completion feature and which
# are not listed in field_descs. %]
[% field_labels = { # Used by editcomponents.cgi
"initialcc" => "Default CC List",
"initialowner" => "Default Assignee",
"initialqacontact" => "Default QA Contact",
# Used by process_bug.cgi
"masscc" => "CC List",
# Used by request.cgi
"requester" => "Requester",
"requestee" => "Requestee",
# Used by userprefs.cgi
"new_watchedusers" => "Watch List",
}
%]
[% IF matchsuccess == 1 %]
[% PROCESS global/header.html.tmpl title="Confirm Match" %]
[% USE Bugzilla %]
<form method="post"
[% IF script -%]
action="[% script %]"
[%- END -%]
[% IF Bugzilla.cgi.param("data") %]
enctype="multipart/form-data"
[% END %]
>
<p>
[% IF matchmultiple %]
[% terms.Bugzilla %] cannot make a conclusive match for one or more
of the names and/or email addresses you entered on the previous page.
<br>Please examine the lists of potential matches below and select the
ones you want,
[% ELSE %]
[% terms.Bugzilla %] is configured to require verification whenever
you enter a name or partial email address.
<br>Below are the names/addresses you entered and the matched accounts.
Please confirm that they are correct,
[% END %]
or go back to the previous page to revise the names you entered.
</p>
[% ELSE %]
[% PROCESS global/header.html.tmpl title="Match Failed" %]
<p>
[% terms.Bugzilla %] was unable to make any match at all for one or more of
the names and/or email addresses you entered on the previous page.
[% IF !user.id %]
<b>Note: You are currently logged out. Only exact matches against e-mail
addresses will be performed.</b>
[% END %]
</p>
<p>Please go back and try other names or email addresses.</p>
[% END %]
<table border="0">
<tr>
<td colspan="2">
<hr width="100%" size="1">
</td>
</tr>
[%# this is messy to allow later expansion %]
[% FOREACH field = matches %]
<tr>
<td align="left" valign="top">
[% PROCESS field_names field_name=field.key %]:
</td>
<td align="left" valign="top">
[% FOREACH query = field.value %]
<div class="user_match">
<b>[% query.key FILTER html %]</b>
[% IF query.value.users.size %]
[% IF query.value.users.size > 1 %]
[% IF query.value.status == 'fail' %]
<font color="#FF0000">
matches multiple users.
</font>
Please go back and try again with a more specific
name/address.
[% ELSE %]
[% IF query.value.status == 'trunc' %]
matched
more than the maximum
of [% query.value.users.size %] users:<br>
[% ELSE %]
matched:<br>
[% END %]
<select name="[% field.key FILTER html %]"
id="[% field.key FILTER html %]"
[% IF fields.${field.key}.type == 'multi' %]
multiple="multiple"
[% IF query.value.users.size > 5 %]
size="5"
[% ELSE %]
size="[% query.value.users.size %]"
[% END %]
[% END %]
>
[% FOREACH match = query.value.users %]
<option value="[% match.login FILTER html %]">
[%- match.identity FILTER html -%]
</option>
[% END %]
</select>
[% END %]
[% ELSE %]
matched
<b>[% query.value.users.0.identity FILTER html %]</b>
[% END %]
[% ELSE %]
[% IF (query.key.length < 3) && !Param('emailsuffix') %]
<font color="#FF0000">was too short for substring match
(minimum 3 characters)</font>
[% ELSE %]
<font color="#FF0000">did not match anything</font>
[% END %]
[% END %]
</div>
[% END %]
</td>
</tr>
<tr>
<td colspan="2">
<hr width="100%" size="1">
</td>
</tr>
[% END %]
</table>
[% IF matchsuccess == 1 %]
[% SET exclude_these = ['Bugzilla_login', 'Bugzilla_password'] %]
[% FOREACH key IN matches.keys %]
[% exclude_these.push(key) IF cgi.param(key) == '' %]
[% END %]
[% SET exclude = '^' _ exclude_these.join('|') _ '$' %]
[% PROCESS "global/hidden-fields.html.tmpl" exclude = exclude %]
<p>
<input type="submit" id="continue" value="Continue">
</p>
</form>
[% END %]
[% PROCESS global/footer.html.tmpl %]
[% BLOCK field_names %]
[% IF field_descs.$field_name %]
[% field_descs.$field_name FILTER html %]
[% ELSIF field_labels.$field_name %]
[% field_labels.$field_name FILTER html %]
[% ELSIF field_name.match("^requestee") %]
[% fields.${field_name}.flag_type.name FILTER html %] requestee
[% ELSE %]
[% field_name FILTER html %]
[% END %]
[% END %]
|