summaryrefslogtreecommitdiffstats
path: root/template/en/default/search/form.html.tmpl
blob: 46df426c117040c907adb3cb8ae30d1ee734a75f (plain)
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
[%# 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): Chris Lahey <clahey@ximian.com> [javascript fixes]
  #                 Christian Reis <kiko@async.com.br> [javascript rewrite]
  #                 Gervase Markham <gerv@gerv.net>
  #%]

[% PROCESS "global/field-descs.none.tmpl" %]

<script type="text/javascript">

var first_load = true;         [%# is this the first time we load the page? %]
var last_sel = new Array();    [%# caches last selection %]

[% IF Param('useclassification') %]
var useclassification = true;
var prods = new Array();
[% ELSE %]
var useclassification = false;
[% END %]
var cpts = new Array();
var vers = new Array();
[% IF Param('usetargetmilestone') %]
var tms = new Array();
[% END %]

[%# Create an array of products, indexed by the classification #%]

[% nclass = 0 %]
[% FOREACH c = classification %]
  prods[[% nclass FILTER js %]] = [
    [% sep = '' %]
    [%- FOREACH item = user.get_selectable_products(c.id) -%]
      [%- IF item.components.size -%]
        [%- sep FILTER js %]'[% item.name FILTER js %]'
        [%- sep = ',' -%] 
      [%- END -%]
    [%- END -%] ];
  [% nclass = nclass+1 %]
[% END %]

[%# Create three arrays of components, versions and target milestones, indexed
  # numerically according to the product they refer to. #%]

[% n = 0 %]
[% FOREACH p = product %]
  [% NEXT IF NOT p.components.size %]
  [% IF Param('useclassification') %]
  prods['[% p.name FILTER js %]'] = [% n %]
  [% END %]
  cpts[[% n %]] = [
    [%- FOREACH item = p.components %]'[% item.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
  vers[[% n %]] = [
    [%- FOREACH item = p.versions -%]'[%  item.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
  [% IF Param('usetargetmilestone') %]
  tms[[% n %]]  = [
     [%- FOREACH item = p.milestones %]'[% item.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
  [% END %]
  [% n = n+1 %]
[% END %]

/*
 * doOnSelectProduct determines which selection should get updated 
 *
 * - selectmode = 0  - init
 *   selectmode = 1  - classification selected
 *   selectmode = 2  - product selected
 *
 * globals:
 *   queryform - string holding the name of the selection form
 */
function doOnSelectProduct(selectmode) {
    var f = document.forms[queryform];
    var milestone = (typeof(f.target_milestone) == "undefined" ? 
                                               null : f.target_milestone);
    if (selectmode == 0) {
        // If there is no classification selected, give us a chance to fill
        // the select fields with values from the possibly selected product.
        if (useclassification && f.classification.selectedIndex > -1) {
            selectClassification(f.classification, f.product, f.component, f.version, milestone);
        } else {
            selectProduct(f.product, f.component, f.version, milestone, null);
        }
    } else if (selectmode == 1) {
        selectClassification(f.classification, f.product, f.component, f.version, milestone);
    } else {
        selectProduct(f.product, f.component, f.version, milestone, null);
    }
}

</script>

[% query_types = [
  "allwordssubstr",
  "anywordssubstr",
  "substring",
  "casesubstring",
  "allwords",
  "anywords",
  "regexp",
  "notregexp",
] %]

[%# If we resubmit to ourselves, we need to know if we are using a format. %]
[% thisformat = query_format != '' ? query_format : format %]
<input type="hidden" name="query_format" value="[% thisformat FILTER html %]">

[%# *** Summary *** %]

<table>
  <tr>
    <th align="right">
      <label for="short_desc" accesskey="s"><u>S</u>ummary</label>:
    </th>
    <td>
      [% INCLUDE "search/type-select.html.tmpl"
         name = "short_desc_type",
         types = query_types, selected = default.short_desc_type.0 %]
    </td>
    <td>
      <input name="short_desc" id="short_desc" size="40"
             value="[% default.short_desc.0 FILTER html %]">
      <script type="text/javascript"> <!--
          document.forms[queryform].short_desc.focus(); 
      // -->
      </script>
    </td>
    <td>
      [% IF button_name %]
        <input type="submit" id="[% button_name FILTER css_class_quote %]_top"
               value="[% button_name FILTER html %]">
      [% END %]
    </td>
  </tr>

[%# *** Classification Product Component Version Target *** %]
  <tr>
    <td colspan="4">
      <table>
        <tr>
        [% IF Param('useclassification') %]
          <td valign="top">
            <table>
              <tr valign="bottom">
                <th align="left">
                  <label for="classification">Classification</label>:
                </th>
              </tr>
              <tr valign="top">
                <td align="left">
                  <select name="classification" multiple="multiple" size="5" id="classification"
                          onchange="doOnSelectProduct(1);">
                    [% FOREACH cat = classification %]
                      <option value="[% cat.name FILTER html %]"
                        [% " selected" IF lsearch(default.classification, cat.name) != -1 %]>
                        [% cat.name FILTER html %]
                      </option>
                    [% END %]
                  </select>
                </td>
              </tr>
            </table>
          </td>
        [% END %]
          <td valign="top">
            <table>
              <tr valign="bottom">
                <th align="left">
                  <label for="product" accesskey="p"><u>P</u>roduct</label>:
                </th>
              </tr>
              <tr valign="top">
                [%# Can't use the select block here because of the onChange %]
                <td align="left">
                  <select name="product" multiple="multiple" size="5" id="product"
                          onchange="doOnSelectProduct(2);">
                    [% FOREACH p = product %]
                      [% IF p.components.size %]
                      <option value="[% p.name FILTER html %]"
                        [% " selected" IF lsearch(default.product, p.name) != -1 %]>
                        [% p.name FILTER html %]</option>
                      [% END %]
                    [% END %]
                  </select>
                </td>
              </tr>
            </table>
          </td>
          <td valign="top">
            <table>
              <tr valign="bottom">
                <th align="left">
                  <label for="component" accesskey="m"><a href="describecomponents.cgi">Co<u>m</u>ponent</a></label>:
                </th>
              </tr>
              <tr valign="top">
                [%# Can't use the select block here because 'component' is a toolkit
                    reserved word - we use 'component_' instead. %]
                <td align="left">
                  <select name="component" id="component"
                          multiple="multiple" size="5">
                    [% FOREACH c = component_ %]
                      <option value="[% c FILTER html %]"
                        [% " selected" IF lsearch(default.component, c) != -1 %]>
                        [% c FILTER html %]</option>
                    [% END %]
                  </select>
                </td>
              </tr>
            </table>
          </td>
          <td valign="top">
            <table>
              <tr valign="bottom">
                <th align="left">
                  <label for="version">Version</label>:
                </th>
              </tr>
              <tr valign="top">
                [% PROCESS select sel = { name => 'version',
                                          size => 5 } %]
              </tr>
            </table>
          </td>
        [% IF Param('usetargetmilestone') %]
          <td valign="top">
            <table>
              <tr valign="bottom">
                <th align="left">
                  <label for="target_milestone">Target</label>:
                </th>
              </tr>
              <tr valign="top">
                [% PROCESS select sel = { name => 'target_milestone',
                                          size => 5 } %]
              </tr>
            </table>
          </td>
        [% END %]
        </tr>
      </table>
    </td>
  </tr>

[%# *** Comment URL Whiteboard Keywords *** %]

  [% FOREACH field = [
    { name => "longdesc", description => "A&nbsp;<u>C</u>omment",
      accesskey => 'c' },
    { name => "bug_file_loc", description => "The&nbsp;<u>U</u>RL",
      accesskey => 'u' },
    { name => "status_whiteboard", description => "<u>W</u>hiteboard",
      accesskey => 'w' } ] %]

    [% UNLESS field.name == 'status_whiteboard' AND NOT Param('usestatuswhiteboard') %]
    <tr>
      <th align="right">
        <label for="[% field.name %]" accesskey="[% field.accesskey %]">[% field.description %]</label>:
      </th>
      <td>
        [% INCLUDE "search/type-select.html.tmpl"
           name = field.name _ "_type",
           types = query_types, selected = default.$type.0 %]
      </td>
      <td><input name="[% field.name %]" id="[% field.name %]" size="40"
                 value="[% default.${field.name}.0 FILTER html %]">
      </td>
      <td></td>
    </tr>
    [% END %]
  [% END %]

  [% IF have_keywords %]
    <tr>
      <th align="right">
        <label for="keywords" accesskey="k"><a href="describekeywords.cgi"><u>K</u>eywords</a></label>:
      </th>
      <td>
        [% INCLUDE "search/type-select.html.tmpl"
           name = "keywords_type",
           types = ['allwords', 'anywords', 'nowords'], 
           selected = default.keywords_type.0 %]
      </td>
      <td>
        <input name="keywords" id="keywords" size="40"
               value="[% default.keywords.0 FILTER html %]">
      </td>
    </tr>
  [% END %]

  [%# Deadline %]
  [% IF user.in_group(Param("timetrackinggroup")) %]
    <tr>
      <th align="right">
        <label for="deadlinefrom" accesskey="l">Dead<u>l</u>ine</label>:
      </th>
      <td>
        from <input name="deadlinefrom" id="deadlinefrom" size="10" maxlength="10"
                    value="[% default.deadlinefrom.0 FILTER html %]">
        to <input name="deadlineto" size="10" maxlength="10"
                  value="[% default.deadlineto.0 FILTER html %]">
      </td>
      <td>
        <small>(YYYY-MM-DD)</small>
      </td>
    </tr>
  [% END %]
  
</table>

<hr>

[%# *** Status Resolution Severity Priority Hardware OS *** %]

<table>
  <tr>
    <td>
      <table>
        <tr>
          <th align="left">
            <label for="bug_status" accesskey="a">St<u>a</u>tus</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'bug_status',
                                    size => 7 } %]
        </tr>
      </table>
    </td>
    <td>
      <table>
        <tr>
          <th align="left">
            <label for="resolution" accesskey="r"><u>R</u>esolution</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'resolution',
                                    size => 7 } %]
        </tr>
      </table>
    </td>
    <td>
      <table>
        <tr>
          <th align="left">
            <label for="bug_severity">Severity</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'bug_severity',
                                    size => 7 }%]
        </tr>
      </table>
    </td>
    <td>
      <table>
        <tr>
          <th align="left">
            <label for="priority" accesskey="i">Pr<u>i</u>ority</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'priority',
                                    size => 7 } %]
        </tr>
      </table>
    </td>
    <td>
      <table>
        <tr>
          <th align="left">
            <label for="rep_platform" accesskey="h"><u>H</u>ardware</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'rep_platform',
                                    size => 7 } %]
        </tr>
      </table>
    </td>
    <td>
      <table>
        <tr>
          <th align="left">
            <label for="op_sys" accesskey="o"><u>O</u>S</label>:
          </th>
        </tr>
        <tr valign="top">
          [% PROCESS select sel = { name => 'op_sys',
                                    size => 7 } %]
        </tr>
      </table>
    </td>
  </tr>
</table>

[%# *** Email Numbering Votes *** %]

<table>
  <tr>
    <td>
      <fieldset>
        <legend>
          <strong>
            [% IF Param('usevotes') %]
              Email Addresses, [% terms.Bug %] Numbers, and Votes
            [% ELSE %]
              Email Addresses and [% terms.Bug %] Numbers
            [% END %]
          </strong>
        </legend>


<table>
  <tr>
  [% FOREACH n = [1, 2] %]
    <td>


<table cellspacing="0" cellpadding="0">
  <tr>
    <td>
      Any of:
    </td>
  </tr>
  <tr>
    <td>
      <input type="checkbox" name="emailassigned_to[% n %]"
             id="emailassigned_to[% n %]" value="1"
             [% " checked" IF default.emailassigned_to.$n %]>
      <label for="emailassigned_to[% n %]">
        the [% terms.bug %] assignee
      </label>
    </td>
  </tr>
  <tr>
    <td>
      <input type="checkbox" name="emailreporter[% n %]"
             id="emailreporter[% n %]" value="1"
             [% " checked" IF default.emailreporter.$n %]>
      <label for="emailreporter[% n %]">
        the reporter
      </label>
    </td>
  </tr>
  [% IF Param('useqacontact') %]
  <tr>
    <td>
      <input type="checkbox" name="emailqa_contact[% n %]"
             id="emailqa_contact[% n %]" value="1"
             [% " checked" IF default.emailqa_contact.$n %]>
      <label for="emailqa_contact[% n %]">
        the QA contact
      </label>
    </td>
  </tr>
  [% END %]
  <tr>
    <td>
      <input type="checkbox" name="emailcc[% n %]"
             id="emailcc[% n %]" value="1"
             [% " checked" IF default.emailcc.$n %]>
      <label for="emailcc[% n %]">
        a CC list member
      </label>
    </td>
  </tr>
  <tr>
    <td>
        <input type="checkbox" name="emaillongdesc[% n %]"
               id="emaillongdesc[% n %]" value="1"
               [% " checked" IF default.emaillongdesc.$n %]>
      <label for="emaillongdesc[% n %]">
        a commenter
      </label>
    </td>
  </tr>
  <tr>
    <td>
      <select name="emailtype[% n %]">
      [% FOREACH qv = [
        { name => "substring", description => "contains" },
        { name => "exact", description => "is" },
        { name => "notequals", description => "is not" },
        { name => "regexp", description => "matches regexp" },
        { name => "notregexp", description => "doesn't match regexp" } ] %]

        <option value="[% qv.name %]"
          [% " selected" IF default.emailtype.$n == qv.name %]>[% qv.description %]</option>
      [% END %]
      </select>
    </td>
  </tr>
  <tr>
    <td>
      <input name="email[% n %]" size="25" value="[% default.email.$n FILTER html %]">
    </td>
  </tr>
</table>


    </td>
  [% END %]
  </tr>
</table>
<hr>
<table>
  <tr>
    <td>
      <select name="bugidtype">
        <option value="include"[% " selected" IF default.bugidtype.0 == "include" %]>Only include</option>
        <option value="exclude"[% " selected" IF default.bugidtype.0 == "exclude" %]>Exclude</option>
      </select>
      <label for="bug_id">[% terms.bugs %] numbered</label>:
    </td>
    <td>
      <input type="text" name="bug_id" id="bug_id"
             value="[% default.bug_id.0 FILTER html %]" size="20">
    </td>
  </tr>
  <tr>
    <td></td>
    <td>(comma-separated list)</td>
  </tr>
  [% IF Param('usevotes') %]
    <tr>
      <td align="right">
        <label for="votes">Only [% terms.bugs %] with at least</label>:
      </td>
      <td>
        <input name="votes" id="votes" size="3"
               value="[% default.votes.0 FILTER html %]">
        votes
      </td>
    </tr>
  [% END %]
</table>


      </fieldset>
    </td>
   
[%# *** Bug Changes *** %]

    <td valign="top">
      <fieldset>
        <legend><strong>[% terms.Bug %] Changes</strong></legend>


<dl class="bug_changes">
  <dt>
    <label for="chfieldfrom">Only [% terms.bugs %] changed between</label>:
  </dt>
  <dd>
    <input name="chfieldfrom" id="chfieldfrom"
           size="10" value="[% default.chfieldfrom.0 FILTER html %]">
    and <input name="chfieldto" size="10" value="[% default.chfieldto.0 FILTER html %]">
    <br>(YYYY-MM-DD or relative dates)
  </dd>
  <dt>
    <label for="chfield">where one or more of the following changed</label>:
  </dt>
  <dd>
    [%# Create array, so we can sort it by description #%]
    [% chfields = [] %]
    [% FOREACH field = chfield %]
      [% chfields.push({value => field, desc => (field_descs.$field || field) }) %]
    [% END %]

    <select name="chfield" id="chfield" multiple="multiple" size="4">
    [% FOREACH field = chfields.sort('desc') %]
      <option value="[% field.value FILTER html %]"
        [% " selected" IF lsearch(default.chfield, field.value) != -1 %]>
        [% field.desc FILTER html %]</option>
    [% END %]
    </select>
  </dd>
  <dt>and <label for="chfieldvalue">the new value was</label>:</dt>
  <dd>
    <input name="chfieldvalue" id="chfieldvalue"
           size="20" value="[% default.chfieldvalue.0 FILTER html %]">
  </dd>
</dl>

       </fieldset>
     </td>
  </tr>
</table>

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

[% BLOCK select %]
  <td align="left">
    <select name="[% sel.name %]" id="[% sel.name %]"
            multiple="multiple" size="[% sel.size %]">
      [% FOREACH name = ${sel.name} %]
        <option value="[% name FILTER html %]"
          [% " selected" IF lsearch(default.${sel.name}, name) != -1 %]>
          [% IF sel.name == "bug_status" %]
            [% get_status(name) FILTER html %]
          [% ELSIF sel.name == "resolution" %]
            [% get_resolution(name) FILTER html %]
          [% ELSE %]
            [% name FILTER html %]
          [% END %]
        </option>
      [% END %]
    </select>
  </td>
[% END %]