create.html.tmpl 12.7 KB
Newer Older
1
[%# 1.0@bugzilla.org %]
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[%# 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): Gervase Markham <gerv@gerv.net>
20
  #                 Ville Skyttä <ville.skytta@iki.fi>
21
  #                 Shane H. W. Travis <travis@sedsystems.ca>
22 23
  #%]

24
[% PROCESS global/variables.none.tmpl %]
25
[% PROCESS "global/field-descs.none.tmpl" %]
26

27
[% product_name = product FILTER html %]
28
[% PROCESS global/header.html.tmpl
29
  title = "Enter $terms.Bug: $product_name"
30
  h2 = "This page lets you enter a new $terms.bug into ${terms.Bugzilla}."
31
  onload="set_assign_to();"
32
%]
33
[% USE Bugzilla %]
34

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

38 39
var initialowners = new Array([% component_.size %]);
var last_initialowner;
40
var components = new Array([% component_.size %]);
41 42 43 44
[% IF Param("useqacontact") %]
    var initialqacontacts = new Array([% component_.size %]);
    var last_initialqacontact;
[% END %]
45 46
[% count = 0 %]
[%- FOREACH c = component_ %]
47
    components[[% count %]] = "[% c.name FILTER js %]";
48 49 50 51
    initialowners[[% count %]] = "[% c.initialowner FILTER js %]";
    [% IF Param("useqacontact") %]
        initialqacontacts[[% count %]] = "[% c.initialqacontact FILTER js %]";
    [% END %]
52 53
    [% count = count + 1 %]
[%- END %]
54

55 56
function set_assign_to() {
    // Based on the selected component, fill the "Assign To:" field
57 58
    // with the default component owner, and the the "QA Contact:" field
    // with the default QA Contact.
59
    var form = document.Create;
60
    var assigned_to = form.assigned_to.value;
61 62 63 64 65

[% IF Param("useqacontact") %]
    var qa_contact = form.qa_contact.value;
[% END %]

66 67 68 69 70 71 72 73
    var index = -1;
    if (form.component.type == 'select-one') {
        index = form.component.selectedIndex;
    } else if (form.component.type == 'hidden') {
        // Assume there is only one component in the list
        index = 0;
    }
    if (index != -1) {
74
        var owner = initialowners[index];
75
        var component = components[index];
76
        if (assigned_to == last_initialowner
77
            || assigned_to == owner
78
            || assigned_to == '') {
79
            form.assigned_to.value = owner;
80
            last_initialowner = owner;
81
        }
82 83 84 85 86 87 88 89 90
        [% IF Param("useqacontact") %]
            var contact = initialqacontacts[index];
            if (qa_contact == last_initialqacontact
                || qa_contact == contact
                || qa_contact == '') {
                  form.qa_contact.value = contact;
                  last_initialqacontact = contact;
            }
        [% END %]
91 92 93 94 95 96
    }
}
-->
</script>

<form name="Create" id="Create" method="post" action="post_bug.cgi">
97
<input type="hidden" name="product" value="[% product FILTER html %]">
98 99 100 101 102 103 104 105 106 107

<table cellspacing="2" cellpadding="0" border="0">

  <tr>
    <td><br></td>
  </tr>

  <tr>
    <td></td>
    <td colspan="3">
108 109 110 111
    [%# Migration note: The following file corresponds to the old Param
      # 'entryheaderhtml'
      #%]
    [% INCLUDE 'bug/create/user-message.html.tmpl' %]
112 113
    </td>
  </tr>
114

115 116 117 118 119 120
  <tr>
    <td><br></td>
  </tr>

  <tr>
    <td align="right" valign="top"><strong>Reporter:</strong></td>
121
    <td valign="top">[% Bugzilla.user.login FILTER html %]</td>
122

123 124 125
    <td align="right" valign="top"><strong>Product:</strong></td>
    <td valign="top">[% product FILTER html %]</td>
  </tr>
126

127 128 129 130 131 132 133 134 135 136 137 138 139
  [%# We can't use the select block in these two cases for various reasons. %]
  <tr>
    <td align="right" valign="top">
      <strong>Version:</strong>
    </td>
    <td>
      <select name="version" size="5">
        [%- FOREACH v = version %]
          <option value="[% v FILTER html %]"
            [% " selected=\"selected\"" IF v == default.version %]>[% v FILTER html -%]
          </option>
        [%- END %]
      </select>
140 141
    </td>

142 143
    <td align="right" valign="top">
      <strong>
144
        <a href="describecomponents.cgi?product=[% product FILTER url_quote %]">
145
          Component</a>:
146 147 148
      </strong>
    </td>
    <td>
149
      <select name="component" onchange="set_assign_to();" size="5">
150
        [%- FOREACH c = component_ %]
151 152 153
          <option value="[% c.name FILTER html %]"
            [% " selected=\"selected\"" IF c.name == default.component_ %]>
            [% c.name FILTER html -%]
154 155 156
          </option>
        [%- END %]
      </select>
157
    </td>
158
  </tr>
159

160 161 162 163
  <tr>
    <td>&nbsp;</td>
    <td colspan="3"></td>
  </tr>
164

165 166 167
  <tr>
    [% sel = { description => 'Platform', name => 'rep_platform' } %]
    [% INCLUDE select %]
168

169 170 171
    [% sel = { description => 'OS', name => 'op_sys' } %]
    [% INCLUDE select %]
  </tr>
172 173

  <tr>
174 175 176 177
  [% IF Param('letsubmitterchoosepriority') %]
    [% sel = { description => 'Priority', name => 'priority' } %]
    [% INCLUDE select %]
  [% ELSE %]
178
    <input type="hidden" name="priority"
179
           value="[% default.priority FILTER html %]">
180 181 182
  [% END %]

  [% sel = { description => 'Severity', name => 'bug_severity' } %]
183
  [% INCLUDE select %]
184
  </tr>
185

186 187 188 189 190 191 192 193
  [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %]
    <tr>
    [% sel = { description => 'Target Milestone', name => 'target_milestone' } %]
    [% INCLUDE select %]
    <td colspan="2"></td>
    </tr>
  [% END %]

194 195 196 197 198 199
  <tr>
    <td>&nbsp;</td>
    <td colspan="3"></td>
  </tr>

  <tr>
200 201 202 203
[% IF bug_status.size <= 1 %]
  <input type="hidden" name="bug_status" 
         value="[% default.bug_status FILTER html %]">
    <td align="right" valign="top"><strong>Initial State:</strong></td>
204
    <td valign="top">[% status_descs.${default.bug_status} FILTER html %]</td>
205
[% ELSE %]
206 207
    [% sel = { description => 'Initial State', name => 'bug_status' } %]
    [% INCLUDE select %]
208
[% END %]
209 210 211 212 213 214
    <td colspan="2"></td>
  </tr>

  <tr>
    <td align="right">
      <strong>
215
        <a href="page.cgi?id=fields.html#assigned_to">Assign To</a>:
216 217 218
      </strong>
    </td>
    <td colspan="3">
219 220 221
      [% INCLUDE global/userselect.html.tmpl
         name => "assigned_to"
         value => assigned_to
222
         disabled => assigned_to_disabled
223 224 225
         size => 32
         emptyok => 1
       %]
226
      <noscript>(Leave blank to assign to component's default assignee)</noscript>
227 228 229
    </td>
  </tr>
  
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
[% IF Param("useqacontact") %]
    <tr>
      <td align="right"><strong>QA Contact:</strong></td>
      <td colspan="3">
      [% INCLUDE global/userselect.html.tmpl
         name => "qa_contact"
         value => qa_contact
         disabled => qa_contact_disabled
         size => 32
         emptyok => 1
       %]
        <noscript>(Leave blank to assign to default qa contact)</noscript>
      </td>
    </tr>
[% END %]

246 247 248
  <tr>
    <td align="right"><strong>Cc:</strong></td>
    <td colspan="3">
249 250 251
      [% INCLUDE global/userselect.html.tmpl
         name => "cc"
         value => cc
252
         disabled => cc_disabled
253
         size => 45
254
         multiple => 5
255
       %]
256 257 258 259 260 261 262 263
    </td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td colspan="3"></td>
  </tr>

264 265 266 267
[% IF UserInGroup(Param('timetrackinggroup')) %]
  <tr>
    <td align="right"><strong>Estimated Hours:</strong></td>
    <td colspan="3">
268
      <input name="estimated_time" size="6" maxlength="6" value="0.0">
269 270
    </td>
  </tr>
271 272 273
  <tr>
    <td align="right"><strong>Deadline:</strong></td>
    <td colspan="3">
274
      <input name="deadline" size="10" maxlength="10" value="[% deadline FILTER html %]">
275 276 277
      <small>(YYYY-MM-DD)</small>
    </td>
  </tr>
278 279 280 281 282 283 284

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

285 286 287 288 289 290 291 292 293
[% IF Param("usebugaliases") %]
  <tr>
    <td align="right"><strong>Alias:</strong></td>
    <td colspan="3">
      <input name="alias" size="20">
    </td>
  </tr>
[% END %]

294
  <tr>
295
    <td align="right"><strong>URL:</strong></td>
296
    <td colspan="3">
297
      <input name="bug_file_loc" size="60"
298
             value="[% bug_file_loc FILTER html %]">
299 300
    </td>
  </tr>
301

302 303 304
  <tr>
    <td align="right"><strong>Summary:</strong></td>
    <td colspan="3">
305
      <input name="short_desc" size="60" value="[% short_desc FILTER html %]">
306 307
    </td>
  </tr>
308

309 310
  <tr><td align="right" valign="top"><strong>Description:</strong></td>
    <td colspan="3">
311
      <textarea name="comment" rows="10" cols="80">
312 313 314 315 316
        [% IF cloned_bug_id %]
+++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++


        [% END %]
317
        [% comment FILTER html %]</textarea>
318 319 320
      <br>
    </td>
  </tr>
321

322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
  [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
    <tr>
      <td></td>
      <td colspan="3">
        &nbsp;&nbsp;
        <input type="checkbox" id="commentprivacy" name="commentprivacy"
          [% " checked=\"checked\"" IF commentprivacy %]>
        <label for="commentprivacy">
          Initial Description is Private
        </label>
      </td>
    </tr>
  [% ELSE %]
    <input type="hidden" name="commentprivacy" value="0">
  [% END %]

338
  [% IF UserInGroup('editbugs') %]
339 340 341 342 343 344 345 346
    [% IF use_keywords %]
      <tr>
        <td align="right" valign="top">
          <strong>
            <a href="describekeywords.cgi">Keywords</a>:
          </strong>
        </td>
        <td colspan="3">
347
          <input name="keywords" size="60" value="[% keywords FILTER html %]"> (optional)
348 349 350
        </td>
      </tr>
    [% END %]
351 352 353 354 355
    <tr>
      <td align="right">
        <strong>Depends on:</strong>
      </td>
      <td>
356
        <input name="dependson" accesskey="d" value="[% dependson FILTER html %]">
357 358 359 360 361 362 363
      </td>
    </tr>
    <tr>
      <td align="right">
        <strong>Blocks:</strong>
      </td>
      <td>
364
        <input name="blocked" accesskey="b" value="[% blocked FILTER html %]">
365 366
      </td>
    </tr>
367
  [% END %]
368

369 370 371 372 373 374
  <tr>
    <td></td>
    <td colspan="3">
    [% IF group.size %]
      <br>
        <strong>
375
          Only users in all of the selected groups can view this [% terms.bug %]:
376 377 378
        </strong>
      <br>
      <font size="-1">
379
        (Leave all boxes unchecked to make this a public [% terms.bug %].)
380 381 382 383 384 385 386
      </font>
      <br>
      <br>

      <!-- Checkboxes -->
      [% FOREACH g = group %]
        &nbsp;&nbsp;&nbsp;&nbsp;
387 388 389 390
        <input type="checkbox" id="bit-[% g.bit %]"
          name="bit-[% g.bit %]" value="1"
          [% " checked=\"checked\"" IF g.checked %]>
          <label for="bit-[% g.bit %]">[% g.description %]</label><br>
391 392 393 394 395
      [% END %]
      <br>
    [% END %]
    </td>
  </tr>
396

397 398 399
  [%# Form controls for entering additional data about the bug being created. %]
  [% Hook.process("form") %]

400 401 402
  <tr>
    <td></td>
    <td colspan="3">
403 404 405
      <input type="submit" value="    Commit    "
             onclick="if (this.form.short_desc.value == '')
             { alert('Please enter a summary sentence for this [% terms.bug %].');
406 407
               return false; } return true;">
      &nbsp;&nbsp;&nbsp;&nbsp;
408
      <input type="submit" name="maketemplate"
409
             value="Remember values as bookmarkable template">
410 411 412
    </td>
  </tr>

413
[% UNLESS (Param('defaultplatform') && Param('defaultopsys')) %]
414 415 416 417
  <tr>
    <td></td>
    <td colspan="3">
      <br>
418 419 420 421 422 423 424 425 426
      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, if we got it wrong, email
427
      [%+ Param('maintainer') %].
428 429 430 431 432 433 434 435
    </td>
  </tr>
[% END %]

  </table>
  <input type="hidden" name="form_name" value="enter_bug">
</form>

436 437 438
[%# Links or content with more information about the bug being created. %]
[% Hook.process("end") %]

439
[% PROCESS global/footer.html.tmpl %]
440 441 442 443 444 445 446 447 448

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

[% BLOCK select %]
  [% IF sel.description %]
  <td align="right">
    <strong>
449 450
      <a href="page.cgi?id=fields.html#[% sel.name %]">
        [% sel.description %]</a>:
451 452 453
    </strong>
  </td>
  [% END %]
454

455 456 457 458 459 460 461 462 463 464
  <td>
    <select name="[% sel.name %]">
    [%- FOREACH x = ${sel.name} %]
      <option value="[% x FILTER html %]"
        [% " selected=\"selected\"" IF x == default.${sel.name} %]>[% x FILTER html -%]
      </option>
    [%- END %]
    </select>
  </td>
[% END %]