confirm-user-match.html.tmpl 6.15 KB
Newer Older
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
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
<!-- 1.0@bugzilla.org -->
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Myk Melez <myk@mozilla.org>
  #                 Erik Stambaugh <not_erik@dasbistro.com>
  #%]

[%# INTERFACE:
  # form: hash; the form values submitted to the script
  # mform: hash; the form multi-values submitted to the script
26 27 28
  # 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
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
29 30 31
  # matches: hash; Hierarchical.  The levels go like this:
  #     field_name {
  #         pattern_text {
32 33 34
  #             'users'  = @user_list           (user objects)
  #             'status' = success|fail|trunc   (result of search.
  #                             'trunc' (truncated) means max was reached)
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
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
  #         }
  #     }
  # script: string; The name of the calling script, used to create a
  #     self-referential URL
  #%]

[% # use the global field descs %]
[% PROCESS "global/field-descs.html.tmpl" %]

[% IF matchsuccess == 1 %]
  [% PROCESS global/header.html.tmpl title="Confirm Match" %]

  <form method="post" 
  [% IF script -%]
    action="[% script %]"
  [%- END -%]
  >

  <p>
    One or more of the names/email addresses you entered into fields on the
    previous page produced results which require confirmation.  Please
    carefully examine the matches below, selecting users from the lists if
    necessary, or go back to the previous page to revise the names you
    entered.
  </p>
[% ELSE %]
  [% PROCESS global/header.html.tmpl title="Match Failed" %]
  <p>
    One or more of the names/email addresses you entered into fields on the
    previous page were unable to make a valid match.  Go back to the previous
    page and try other names/email addresses.
  </p>
[% END %]

<p>
70
  <table border="0">
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
71
    <tr>
72 73
      <td colspan="2">
        <hr width="100%" size="1">
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
74 75 76 77 78 79 80
      </td>
    </tr>

  [% # this is messy to allow later expansion %]

  [% FOREACH field = matches %]
    <tr>
81
      <td align="left" valign="top">
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
82 83
        [% PROCESS field_names field_name=field.key %]:
      </td>
84
      <td align="left" valign="top">
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
85 86 87 88 89 90 91 92 93 94
          [% FOREACH query = field.value %]
              <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.
95
                  [% ELSIF fields.${field.key}.type == 'single' %]
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
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
                    matched:<br>
                    <select name="[% field.key FILTER html %]"
                     id="[% field.key FILTER html %]">
                      [% FOREACH match = query.value.users %]
                        <option value="[% match.email FILTER html %]">
                         [%- match.identity FILTER html -%]
                        </option>
                      [% END %]
                    </select>
                  [% 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 query.value.users.size > 5 %]
                       multiple="multiple" size="5">
                      [% ELSE %]
                       multiple="multiple" size="[% query.value.users.size %]">
                      [% END %]
                      [% FOREACH match = query.value.users %]
                        <option value="[% match.email FILTER html %]">
                         [%- match.identity FILTER html -%]
                        </option>
                      [% END %]
                    </select>
                  [% END %]
                [% ELSE %]
                  matched
                  <b>[% query.value.users.0.identity FILTER html %]</b>
                  <br>
                [% END %]
            [% ELSE %]
                [% IF (query.key.length < 3) && !(Param('emailsuffix'))
                    && (Param('usermatchmode') == 'search') %]
                  <font color="#FF0000">was too short for substring match
                  (minimum 3 characters)</font>
                [% ELSE %]
                  <font color="#FF0000">did not match anything</font>
                [% END %]
            [% END %]
            <p>
        [% END %]
      </td>
    </tr>
    <tr>
146 147
      <td colspan="2">
        <hr width="100%" size="1">
bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
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
      </td>
    </tr>
  [% END %]

  </table>

</p>

[% IF matchsuccess == 1 %]

  [% PROCESS "global/hidden-fields.html.tmpl" exclude="^(Bugzilla|LDAP)_(login|password)$" %]

  <p>
    <input type="submit" 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 for things that don't belong in the field_descs hash here -%]

178 179 180
  [% ELSIF field_name.match("^requestee") %]
    [% fields.${field_name}.flag_type.name %] requestee

bugreport%peshkin.net's avatar
bugreport%peshkin.net committed
181 182 183 184 185
  [% ELSE %]
    [% field_name FILTER html %]
  [% END %]

[% END %]