create.html.tmpl 21.6 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
[% title = BLOCK %]Enter [% terms.Bug %]: [% product.name FILTER html %][% END %]
10
[% use_qa_contact = Param("useqacontact") %]
11

12
[% PROCESS global/header.html.tmpl
13
  title = title
14
  generate_api_token = 1
15
  yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ]
16
  style_urls = ['skins/standard/bug.css']
17
  javascript_urls = [ "js/attachment.js", "js/util.js",
18
                      "js/field.js", "js/TUI.js", "js/bug.js" ]
19
  onload = "set_assign_to($use_qa_contact); hideElementById('attachment_true');
20
            showElementById('attachment_false'); showElementById('btn_no_attachment');"
21 22
%]

23 24 25 26 27 28 29 30 31 32 33 34 35
[% PROCESS etersoft/timersplash.html.tmpl %]

<script type="text/javascript">
  function myform() {
    if (!validateEnterBug(document.Create)) {
      return false;
    }
    mysubmitnew();
    return false;
  }
</script>


36
<script type="text/javascript">
37 38
<!--

39
var initialowners = new Array([% product.components.size %]);
40
var last_initialowner;
41
var initialccs = new Array([% product.components.size %]);
42
var components = new Array([% product.components.size %]);
43
var comp_desc = new Array([% product.components.size %]);
44
var flags = new Array([% product.components.size %]);
45
[% IF Param("useqacontact") %]
46
    var initialqacontacts = new Array([% product.components.size %]);
47 48
    var last_initialqacontact;
[% END %]
49
[% count = 0 %]
50
[%- FOREACH c = product.components %]
51
    [% NEXT IF NOT c.is_active %]
52
    components[[% count %]] = "[% c.name FILTER js %]";
53
    comp_desc[[% count %]] = "[% c.description FILTER html_light FILTER js %]";
54
    initialowners[[% count %]] = "[% c.default_assignee.login FILTER js %]";
55
    [% flag_list = [] %]
56
    [% FOREACH f = c.flag_types.bug %]
57 58
      [% NEXT UNLESS f.is_active %]
      [% flag_list.push(f.id) %]
59 60
    [% END %]
    [% FOREACH f = c.flag_types.attachment %]
61 62
      [% NEXT UNLESS f.is_active %]
      [% flag_list.push(f.id) %]
63
    [% END %]
64
    flags[[% count %]] = [[% flag_list.join(",") FILTER js %]];
65
    [% IF Param("useqacontact") %]
66
        initialqacontacts[[% count %]] = "[% c.default_qa_contact.login FILTER js %]";
67
    [% END %]
68 69 70 71 72 73 74

    [% SET initial_cc_list = [] %]
    [% FOREACH cc_user = c.initial_cc %]
      [% initial_cc_list.push(cc_user.login) %]
    [% END %]
    initialccs[[% count %]] = "[% initial_cc_list.join(', ') FILTER js %]";

75 76
    [% count = count + 1 %]
[%- END %]
77

78 79 80 81 82
var status_comment_required = new Array();
[% FOREACH status = bug_status %]
  status_comment_required['[% status.name FILTER js %]'] = 
    [% status.comment_required_on_change_from() ? 'true' : 'false' %]
[% END %]
83 84 85 86 87

TUI_alternates['expert_fields'] = 'Show Advanced Fields';
// Hide the Advanced Fields by default, unless the user has a cookie
// that specifies otherwise.
TUI_hide_default('expert_fields');
88 89
// Also hide the "Paste text as attachment" textarea by default.
TUI_hide_default('attachment_text_field');
90 91 92
-->
</script>

93
<form name="Create" id="Create" method="post" action="post_bug.cgi"
94
      class="enter_bug_form" enctype="multipart/form-data"
95
      onsubmit="return myform();">
96
<input type="hidden" name="product" value="[% product.name FILTER html %]">
97
<input type="hidden" name="token" value="[% token FILTER html %]">
98

99
<table>
100
<tbody>
101
  <tr>
102
    <td colspan="4">
103 104 105
    [%# Migration note: The following file corresponds to the old Param
      # 'entryheaderhtml'
      #%]
106
    [% PROCESS 'bug/create/user-message.html.tmpl' %]
107 108
    </td>
  </tr>
109

110
  <tr>
111 112 113
    <td colspan="2">
      <a id="expert_fields_controller" class="controller bz_default_hidden"
         href="javascript:TUI_toggle_class('expert_fields')">Hide
114 115 116
        Advanced Fields</a>
      [%# Show the link if the browser supports JS %]
      <script type="text/javascript">
117 118
        YAHOO.util.Dom.removeClass('expert_fields_controller', 
                                   'bz_default_hidden');
119 120
      </script>
    </td>
121 122 123 124
    <td colspan="2">
      (<span class="required_star">*</span> =
      <span class="required_explanation">Required Field</span>)
   </td>
125 126 127
  </tr>

  <tr>
128 129 130 131 132 133
    [% INCLUDE bug/field.html.tmpl
      bug = default, field = bug_fields.product, editable = 0,
      value = product.name %]
    [% INCLUDE bug/field.html.tmpl
      bug = default, field = bug_fields.reporter, editable = 0,
      value = user.login %]
134
  </tr>
135

136 137
  [%# We can't use the select block in these two cases for various reasons. %]
  <tr>
138
    [% component_desc_url = BLOCK -%]
139
      describecomponents.cgi?product=[% product.name FILTER uri %]
140 141
    [% END %]
    [% INCLUDE "bug/field-label.html.tmpl"
142
      field = bug_fields.component editable = 1
143 144
      desc_url = component_desc_url
    %]      
145
    <td id="field_container_component">
146
      <select name="component" id="component" onchange="set_assign_to([% Param("useqacontact") %]);"
147
              size="7" aria-required="true" class="required">
148 149 150 151 152 153
        [%# Build the lists of assignees and QA contacts if "usemenuforusers" is enabled. %]
        [% IF Param("usemenuforusers") %]
          [% assignees_list = user.get_userlist.clone %]
          [% qa_contacts_list = user.get_userlist.clone %]
        [% END %]

154
        [%- FOREACH c = product.components %]
155
          [% NEXT IF NOT c.is_active %]
156
          <option value="[% c.name FILTER html %]"
157
                  id="v[% c.id FILTER html %]_component"
158
            [% IF c.name.lower == default.component_.lower %]
159 160 161 162 163
              [%# This is for bug/field.html.tmpl, for visibility-related
                # controls. %]
              [% default.component_id = c.id %]
              selected="selected"
            [% END %]>
164
            [% c.name FILTER html -%]
165
          </option>
166 167 168 169 170 171
          [% IF Param("usemenuforusers") %]
            [% INCLUDE build_userlist default_user = c.default_assignee,
                                      userlist = assignees_list %]
            [% INCLUDE build_userlist default_user = c.default_qa_contact,
                                      userlist = qa_contacts_list %]
          [% END %]
172 173
        [%- END %]
      </select>
174 175 176 177

      <script type="text/javascript">
       <!--
         [%+ INCLUDE "bug/field-events.js.tmpl" 
178
                     field = bug_fields.component, product = product %]
179 180
       //-->
       </script>
181 182
    </td>

183
    <td colspan="2" id="comp_desc_container">
184 185 186 187 188 189 190 191 192 193 194 195 196
      [%# Enclose the fieldset in a nested table so that its width changes based
        # on the length on the component description. %]
      <table>
        <tr>
          <td>
            <fieldset>
              <legend>Component Description</legend>
              <div id="comp_desc" class="comment">Select a component to read its description.</div>
            </fieldset>
          </td>
        </tr>
      </table>
    </td>
197
  </tr>
198

199
  <tr>
200
    [% INCLUDE "bug/field-label.html.tmpl"
201
      field = bug_fields.version editable = 1 rowspan = 4
202
    %]
203
    <td rowspan="4">
204 205
      <select name="version" id="version" size="5" aria-required="true"
              class="required">
206
        [%- FOREACH v = version %]
207 208 209
          [% NEXT IF NOT v.is_active %]
          <option value="[% v.name FILTER html %]"
            [% ' selected="selected"' IF v.name == default.version %]>[% v.name FILTER html -%]
210 211 212 213 214
          </option>
        [%- END %]
      </select>
    </td>

215
    [% INCLUDE bug/field.html.tmpl
216
      bug = default, field = bug_fields.bug_severity, editable = 1, 
217
      value = default.bug_severity %]
218
  </tr>
219

220 221 222 223 224 225 226 227 228 229
  <tr class="expert_fields">
    [% IF Param('letsubmitterchoosepriority') %]
      [% INCLUDE bug/field.html.tmpl
        bug = default, field = bug_fields.priority, editable = 1, 
        value = default.priority %]
    [% ELSE %]
      <td colspan="2">&nbsp;</td>
    [% END %]
  </tr>

230
  <tr>
231
    [% INCLUDE bug/field.html.tmpl
232
      bug = default, field = bug_fields.rep_platform, editable = 1,
233
      value = default.rep_platform %]
234
  </tr>
235 236

  <tr>
237
    [% INCLUDE bug/field.html.tmpl 
238
       bug = default, field = bug_fields.op_sys, editable = 1, 
239
       value = default.op_sys %]
240
  </tr>
241
  [% IF (!Param('defaultplatform') || !Param('defaultopsys')) && !cloned_bug_id %]
242
    <tr>
243 244
      <td colspan="2" class="expert_fields">&nbsp;</td>
      <td>&nbsp;</td>
245 246 247 248 249 250 251 252 253 254 255 256 257
      <td id="os_guess_note" class="comment">
        <div>We've made a guess at your
        [% IF Param('defaultplatform') %]
          operating system. Please check it
        [% ELSIF Param('defaultopsys') %]
          platform. Please check it
        [% ELSE %]
          operating system and platform. Please check them
        [% END %]
        and make any corrections if necessary.</div>
      </td>
    </tr>
  [% END %]
258 259 260 261 262
</tbody>

<tbody class="expert_fields">
  <tr>
    [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %]
263
      [% INCLUDE select field = bug_fields.target_milestone %]
264 265 266 267
    [% ELSE %]
      <td colspan="2">&nbsp;</td>
    [% END %]

268
    <td colspan="2">&nbsp;</td>
269 270 271 272 273 274 275
    [% IF Param('letsubmitterchoosepriority') && user.in_group('Etersoft') %]
      [% INCLUDE bug/field.html.tmpl
        bug = default, field = bug_fields.priority, editable = 1, 
        value = default.priority %]
    [% ELSE %]
      <td colspan="2">&nbsp;</td>
    [% END %]
276
  </tr>
277
</tbody>
278

279
<tbody class="expert_fields">
280
  <tr>
281
    <td colspan="4">&nbsp;</td>
282 283 284
  </tr>

  <tr>
285 286 287 288
    [% INCLUDE bug/field.html.tmpl
      bug = default, field = bug_fields.bug_status,
      editable = (bug_status.size > 1), value = default.bug_status
      override_legal_values = bug_status %]
289

290 291
    <td>&nbsp;</td>
    [%# Calculate the number of rows we can use for flags %]
292
    [% num_rows = 6 + (Param("useqacontact") ? 1 : 0) +
293
                      (user.is_timetracker ? 3 : 0)
294
    %]
295 296

    <td rowspan="[% num_rows FILTER html %]">
297
      [% IF product.flag_types.bug.size > 0 %]
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
        [% display_flag_headers = 0 %]
        [% any_flags_requesteeble = 0 %]

        [% FOREACH flag_type = product.flag_types.bug %]
          [% NEXT UNLESS flag_type.is_active %]
          [% display_flag_headers = 1 %]
          [% SET any_flags_requesteeble = 1 IF flag_type.is_requestable && flag_type.is_requesteeble %]
        [% END %]

        [% IF display_flag_headers %]
          [% PROCESS "flag/list.html.tmpl" flag_types = product.flag_types.bug
                                           any_flags_requesteeble = any_flags_requesteeble
                                           flag_table_id = "bug_flags"
          %]
        [% END %]
313 314
      [% END %]
    </td>
315 316 317
  </tr>

  <tr>
318 319 320
    [% INCLUDE "bug/field-label.html.tmpl"
      field = bug_fields.assigned_to editable = 1
    %]
321
    <td colspan="2">
322
      [% INCLUDE global/userselect.html.tmpl
323
         id => "assigned_to"
324 325
         name => "assigned_to"
         value => assigned_to
326
         disabled => assigned_to_disabled
327
         size => 30
328
         emptyok => 1
329
         custom_userlist => assignees_list
330
       %]
331
      <noscript>(Leave blank to assign to component's default assignee)</noscript>
332 333 334
    </td>
  </tr>
  
335 336
[% IF Param("useqacontact") %]
    <tr>
337 338 339
      [% INCLUDE "bug/field-label.html.tmpl"
        field = bug_fields.qa_contact editable = 1
      %]
340
      <td colspan="2">
341
      [% INCLUDE global/userselect.html.tmpl
342
         id => "qa_contact"
343 344 345
         name => "qa_contact"
         value => qa_contact
         disabled => qa_contact_disabled
346
         size => 30
347
         emptyok => 1
348
         custom_userlist => qa_contacts_list
349 350 351 352 353 354
       %]
        <noscript>(Leave blank to assign to default qa contact)</noscript>
      </td>
    </tr>
[% END %]

355
  <tr>
356 357 358
    [% INCLUDE "bug/field-label.html.tmpl"
      field = bug_fields.cc editable = 1 
    %]
359
    <td colspan="2">
360
      [% INCLUDE global/userselect.html.tmpl
361
         id => "cc"
362 363
         name => "cc"
         value => cc
364
         disabled => cc_disabled
365
         size => 30
366
         multiple => 5
367
       %]
368 369
    </td>
  </tr>
370 371

  <tr>
372
    <th>Default [% field_descs.cc FILTER html %]:</th>
373 374 375 376 377
    <td colspan="2">
      <div id="initial_cc">
      </div>
   </td>
  </tr>
378 379
  
  <tr>
380
    <td colspan="3">&nbsp;</td>
381 382
  </tr>

383
[% IF user.is_timetracker %]
384
  <tr>
385 386 387
    [% INCLUDE "bug/field-label.html.tmpl"
      field = bug_fields.estimated_time editable = 1
    %]
388
    <td colspan="2">
389
      <input name="estimated_time" size="6" maxlength="6" value="[% estimated_time FILTER html %]">
390
      <input name="work_time" id="work_time" value="0" hidden>
391 392
    </td>
  </tr>
393
  <tr>
394 395 396
    [% INCLUDE bug/field.html.tmpl
      bug = default, field = bug_fields.deadline, value = deadline,
      editable = 1, value_span = 2 %] 
397
  </tr>
398 399

  <tr>
400
    <td colspan="3">&nbsp;</td>
401 402 403
  </tr>
[% END %]

404
  <tr>
405 406 407
    [% INCLUDE "bug/field-label.html.tmpl"
      field = bug_fields.alias editable = 1
    %]
408
    <td colspan="2">
409
      <input name="alias" size="20" value="[% alias FILTER html %]">
410 411 412
    </td>
  </tr>

413
  <tr>
414 415 416
    [% INCLUDE "bug/field-label.html.tmpl"
      field = bug_fields.bug_file_loc editable = 1
    %]
417
    <td colspan="3" class="field_value">
418 419
      <input name="bug_file_loc" id="bug_file_loc" class="text_input"
             size="40" value="[% bug_file_loc FILTER html %]">
420 421
    </td>
  </tr>
422
</tbody>
423

424
<tbody>
425
  [% USE Bugzilla %]
426

427 428
  [% FOREACH field = Bugzilla.active_custom_fields %]
    [% NEXT UNLESS field.enter_bug %]
429
    [% SET value = ${field.name}.defined ? ${field.name} : "" %]
430
    <tr [% 'class="expert_fields"' IF !field.is_mandatory %]>
431 432 433
      [% INCLUDE bug/field.html.tmpl 
        bug = default, field = field, value = value, editable = 1, 
        value_span = 3 %]
434 435
    </tr>
  [% END %]
436 437 438
</tbody>

<tbody>
439

440
  <tr>
441
    [% INCLUDE "bug/field-label.html.tmpl"
442
      field = bug_fields.short_desc editable = 1
443
    %]
444
    <td colspan="3" class="field_value">
445
      <input name="short_desc" size="70" value="[% short_desc FILTER html %]"
446
             maxlength="255" spellcheck="true" aria-required="true"
447
             class="required text_input" id="short_desc">
448 449
    </td>
  </tr>
450

451
  [% IF feature_enabled('jsonrpc') AND !cloned_bug_id
452
        AND user.settings.possible_duplicates.value == 'on' %]
453 454 455 456 457 458 459 460 461
    <tr id="possible_duplicates_container" class="bz_default_hidden">
      <th>Possible<br>Duplicates:</th>
      <td colspan="3">
        <div id="possible_duplicates"></div>
        <script type="text/javascript">
          var dt_columns = [ 
              { key: "id", label: "[% field_descs.bug_id FILTER js %]",
                formatter: YAHOO.bugzilla.dupTable.formatBugLink },
              { key: "summary", 
462 463
                label: "[% field_descs.short_desc FILTER js %]",
                formatter: "text" },
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
              { key: "status",
                label: "[% field_descs.bug_status FILTER js %]",
                formatter: YAHOO.bugzilla.dupTable.formatStatus },
              { key: "update_token", label: '',
                formatter: YAHOO.bugzilla.dupTable.formatCcButton }
          ];
          YAHOO.bugzilla.dupTable.addCcMessage = "Add Me to the CC List";
          YAHOO.bugzilla.dupTable.init({
            container: 'possible_duplicates',
            columns: dt_columns,
            product_name: '[% product.name FILTER js %]',
            summary_field: 'short_desc',
            options: {
              MSG_LOADING: 'Searching for possible duplicates...',
              MSG_EMPTY:   'No possible duplicates found.',
              SUMMARY:     'Possible Duplicates'
480
            }
481 482 483 484 485 486
          });
        </script>
      </td>
    </tr>
  [% END %]

487 488
  <tr>
    <th>Description:</th>
489
    <td colspan="3">
490

491
      [% defaultcontent = BLOCK %]
492 493 494 495 496
        [% IF cloned_bug_id %]
+++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++


        [% END %]
497 498 499
        [%-# We are within a BLOCK. The comment will be correctly HTML-escaped
          # by global/textarea.html.tmpl. So we must not escape the comment here. %]
        [% comment FILTER none %]
500
      [%- END %]
501
      [% INCLUDE bug/comment.html.tmpl
502 503
         minrows        = 10
         maxrows        = 25
504
         cols           = constants.COMMENT_COLS
505 506
         defaultcontent = defaultcontent
       %]
507 508 509
      <br>
    </td>
  </tr>
510

511
  [% IF user.is_insider %]
512
    <tr class="expert_fields">
513
      <th>&nbsp;</th>
514 515
      <td colspan="3">
        &nbsp;&nbsp;
516
        <input type="checkbox" id="comment_is_private" name="comment_is_private"
517 518
          [% ' checked="checked"' IF comment_is_private %]
               onClick="updateCommentTagControl(this, 'comment')">
519
        <label for="comment_is_private">
520 521
          Make description and any new attachment private (visible only to members 
          of the <strong>[% Param('insidergroup') FILTER html %]</strong> group)
522 523 524
        </label>
      </td>
    </tr>
525 526 527
    <script>
      updateCommentTagControl(document.getElementById('comment_is_private'), 'comment');
    </script>
528 529
  [% END %]

530
  [% IF Param("maxattachmentsize") || Param("maxlocalattachment") %]
531
  <tr>
532
    <th>Attachment:</th>
533
    <td colspan="3">
534 535 536 537 538 539 540
      <div id="attachment_false" class="bz_default_hidden">
        <input type="button" value="Add an attachment" onClick="handleWantsAttachment(true)">
      </div>

      <div id="attachment_true">
        <input type="button" id="btn_no_attachment" value="Don't add an attachment"
               class="bz_default_hidden"  onClick="handleWantsAttachment(false)">
541 542 543
        <fieldset>
          <legend>Add an attachment</legend>
          <table class="attachment_entry">
544
            [% PROCESS attachment/createformcontents.html.tmpl
545
                       flag_types = product.flag_types.attachment
546
                       any_flags_requesteeble = 1
547
                       flag_table_id ="attachment_flags" %]
548 549
          </table>
        </fieldset>
550
      </div>
551 552
    </td>
  </tr>
553
  [% END %]
554
</tbody>
555

556
<tbody class="expert_fields">
557 558 559 560 561
  [% IF use_keywords %]
    <tr>
      [% INCLUDE bug/field.html.tmpl
        bug = default, field = bug_fields.keywords, editable = 1,
        value = keywords, possible_values = all_keywords,
562
        desc_url = "describekeywords.cgi", value_span = 3
563 564 565 566
      %]
    </tr>
  [% END %]
  
567
  [% IF user.in_group('editbugs', product.id) %]
568
    <tr>
569 570 571
      [% INCLUDE "bug/field-label.html.tmpl"
        field = bug_fields.dependson editable = 1
      %]
572
      <td colspan="3">
573
        <input name="dependson" accesskey="d" value="[% dependson FILTER html %]">
574 575 576
      </td>
    </tr>
    <tr>
577 578 579
      [% INCLUDE "bug/field-label.html.tmpl"
        field = bug_fields.blocked editable = 1
      %]
580
      <td colspan="3">
581
        <input name="blocked" accesskey="b" value="[% blocked FILTER html %]">
582 583
      </td>
    </tr>
584
  [% END %]
585

586 587 588 589 590 591 592 593 594 595
  [% IF Param('use_see_also') %]
    <tr>
      [% INCLUDE bug/field.html.tmpl
         bug            = default
         field          = bug_fields.see_also
         editable       = 1
         value          = see_also
      %]
    </tr>
  [% END %]
596
</tbody>
597

598
<tbody class="expert_fields">
599
  [% IF product.groups_available.size %]
600
  <tr>
601
    <th>&nbsp;</th>
602 603 604
    <td colspan="3">
      <br>
        <strong>
605
          Only users in [%+ IF Param('or_groups') %]at least one[% ELSE %]all[% END %] of the selected groups can view this 
606
          [%+ terms.bug %]:
607 608
        </strong>
      <br>
609
      <span class="bz_info">
610
        (Leave all boxes unchecked to make this a public [% terms.bug %].)
611
      </span>
612 613 614 615
      <br>
      <br>

      <!-- Checkboxes -->
616
      <input type="hidden" name="defined_groups" value="1">
617
      [% FOREACH group = product.groups_available %]
618
        <input type="checkbox" id="group_[% group.id FILTER html %]"
619 620 621
               name="groups" value="[% group.name FILTER html %]"
               [% ' checked="checked"' IF default.groups.contains(group.name)
                                          OR group.is_default %]>
622
        <label for="group_[% group.id FILTER html %]">
623
          [%- group.description FILTER html_light %]</label><br>
624 625 626
      [% END %]
    </td>
  </tr>
627
  [% END %]
628
</tbody>
629

630
<tbody>
631 632 633
  [%# Form controls for entering additional data about the bug being created. %]
  [% Hook.process("form") %]

634
  <tr>
635
    <th>&nbsp;</th>
636
    <td colspan="3">
637
      <input type="submit" id="commit" value="Submit [% terms.Bug %]">
638
      &nbsp;&nbsp;&nbsp;&nbsp;
639
      <input type="submit" name="maketemplate" id="maketemplate"
640
             value="Remember values as bookmarkable template"
641
             onclick="bz_no_validate_enter_bug=true" class="expert_fields">
642 643
    </td>
  </tr>
644
</tbody>
645 646 647 648
  </table>
  <input type="hidden" name="form_name" value="enter_bug">
</form>

649 650 651
[%# Links or content with more information about the bug being created. %]
[% Hook.process("end") %]

652
[% PROCESS global/footer.html.tmpl %]
653 654 655 656 657 658

[%############################################################################%]
[%# Block for SELECT fields                                                  #%]
[%############################################################################%]

[% BLOCK select %]
659

660 661 662
  [% INCLUDE "bug/field-label.html.tmpl"
    field = field editable = 1
  %]
663
  <td>
664 665 666
    <select name="[% field.name FILTER html %]" 
            id="[% field.name FILTER html %]">
    [%- FOREACH x = ${field.name} %]
667 668 669 670
      [% NEXT IF NOT x.is_active %]
      <option value="[% x.name FILTER html %]"
        [% " selected=\"selected\"" IF x.name == default.${field.name} %]>
        [% display_value(field.name, x.name) FILTER html %]
671
      </option>
672
    [% END %]
673 674 675
    </select>
  </td>
[% END %]
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693

[% BLOCK build_userlist %]
  [% user_found = 0 %]
  [% default_login = default_user.login %]
  [% RETURN UNLESS default_login %]

  [% FOREACH user = userlist %]
    [% IF user.login == default_login %]
      [% user_found = 1 %]
      [% LAST %]
    [% END %]
  [% END %]

  [% userlist.push({login    => default_login,
                    identity => default_user.identity,
                    visible  => 1})
     UNLESS user_found %]
[% END %]