1
[%# 1.0@bugzilla.org %]
2
[%# The contents of this file are subject to the Mozilla Public
3
# License Version 1.1 (the "License"); you may not use this file
4
# except in compliance with the License. You may obtain a copy of
5
# the License at http://www.mozilla.org/MPL/
7
# Software distributed under the License is distributed on an "AS
8
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
# implied. See the License for the specific language governing
10
# rights and limitations under the License.
12
# The Original Code is the Bugzilla Bug Tracking System.
14
# The Initial Developer of the Original Code is Netscape Communications
15
# Corporation. Portions created by Netscape are
16
# Copyright (C) 1998 Netscape Communications Corporation. All
19
# Contributor(s): Gervase Markham <gerv@gerv.net>
20
# Ville Skyttä <ville.skytta@iki.fi>
21
# Shane H. W. Travis <travis@sedsystems.ca>
22
# Marc Schumann <wurblzap@gmail.com>
23
# Akamai Technologies <bugzilla-dev@akamai.com>
24
# Max Kanat-Alexander <mkanat@bugzilla.org>
27
[% PROCESS "global/field-descs.none.tmpl" %]
29
[% title = BLOCK %]Enter [% terms.Bug %]: [% product.name FILTER html %][% END %]
31
[% PROCESS global/header.html.tmpl
33
style_urls = [ 'skins/standard/create_attachment.css' ]
34
javascript_urls = [ "js/attachment.js" ]
37
<script type="text/javascript">
40
var initialowners = new Array([% product.components.size %]);
41
var last_initialowner;
42
var initialccs = new Array([% product.components.size %]);
43
var components = 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
var last_initialqacontact;
50
[%- FOREACH c = product.components %]
51
components[[% count %]] = "[% c.name FILTER js %]";
52
initialowners[[% count %]] = "[% c.default_assignee.login FILTER js %]";
54
[% FOREACH f = c.flag_types.bug %]
55
[% NEXT UNLESS f.is_active %]
56
[% flag_list.push(f.id) %]
58
[% FOREACH f = c.flag_types.attachment %]
59
[% NEXT UNLESS f.is_active %]
60
[% flag_list.push(f.id) %]
62
flags[[% count %]] = [[% flag_list.join(",") FILTER js %]];
63
[% IF Param("useqacontact") %]
64
initialqacontacts[[% count %]] = "[% c.default_qa_contact.login FILTER js %]";
67
[% SET initial_cc_list = [] %]
68
[% FOREACH cc_user = c.initial_cc %]
69
[% initial_cc_list.push(cc_user.login) %]
71
initialccs[[% count %]] = "[% initial_cc_list.join(', ') FILTER js %]";
73
[% count = count + 1 %]
76
function set_assign_to() {
77
// Based on the selected component, fill the "Assign To:" field
78
// with the default component owner, and the "QA Contact:" field
79
// with the default QA Contact. It also selectively enables flags.
80
var form = document.Create;
81
var assigned_to = form.assigned_to.value;
83
[% IF Param("useqacontact") %]
84
var qa_contact = form.qa_contact.value;
88
if (form.component.type == 'select-one') {
89
index = form.component.selectedIndex;
90
} else if (form.component.type == 'hidden') {
91
// Assume there is only one component in the list
95
var owner = initialowners[index];
96
var component = components[index];
97
if (assigned_to == last_initialowner
98
|| assigned_to == owner
99
|| assigned_to == '') {
100
form.assigned_to.value = owner;
101
last_initialowner = owner;
104
document.getElementById('initial_cc').innerHTML = initialccs[index];
106
[% IF Param("useqacontact") %]
107
var contact = initialqacontacts[index];
108
if (qa_contact == last_initialqacontact
109
|| qa_contact == contact
110
|| qa_contact == '') {
111
form.qa_contact.value = contact;
112
last_initialqacontact = contact;
116
// First, we disable all flags. Then we re-enable those
117
// which are available for the selected component.
118
var inputElements = document.getElementsByTagName("select");
119
var inputElement, flagField;
120
for ( var i=0 ; i<inputElements.length ; i++ ) {
121
inputElement = inputElements.item(i);
122
if (inputElement.name.search(/^flag_type-(\d+)$/) != -1) {
123
var id = inputElement.name.replace(/^flag_type-(\d+)$/, "$1");
124
inputElement.disabled = true;
125
// Also disable the requestee field, if it exists.
126
inputElement = document.getElementById("requestee_type-" + id);
127
if (inputElement) inputElement.disabled = true;
130
// Now enable flags available for the selected component.
131
for (var i = 0; i < flags[index].length; i++) {
132
flagField = document.getElementById("flag_type-" + flags[index][i]);
133
// Do not enable flags the user cannot set nor request.
134
if (flagField && flagField.options.length > 1) {
135
flagField.disabled = false;
136
// Re-enabling the requestee field depends on the status
138
toggleRequesteeField(flagField, 1);
144
function handleWantsAttachment(wants_attachment) {
145
if (wants_attachment) {
146
document.getElementById('attachment_false').style.display = 'none';
147
document.getElementById('attachment_true').style.display = 'block';
150
document.getElementById('attachment_false').style.display = 'block';
151
document.getElementById('attachment_true').style.display = 'none';
152
clearAttachmentFields();
159
<form name="Create" id="Create" method="post" action="post_bug.cgi"
160
enctype="multipart/form-data">
161
<input type="hidden" name="product" value="[% product.name FILTER html %]">
162
<input type="hidden" name="token" value="[% token FILTER html %]">
164
<table cellspacing="2" cellpadding="0" border="0">
169
[%# Migration note: The following file corresponds to the old Param
172
[% INCLUDE 'bug/create/user-message.html.tmpl' %]
178
<td colspan="3"> </td>
182
<td align="right" valign="top"><strong>Reporter:</strong></td>
183
<td valign="top">[% user.login FILTER html %]</td>
185
<td align="right" valign="top"><strong>Product:</strong></td>
186
<td valign="top">[% product.name FILTER html %]</td>
189
[%# We can't use the select block in these two cases for various reasons. %]
191
<td align="right" valign="top">
192
<strong>Version:</strong>
195
<select name="version" size="5">
196
[%- FOREACH v = version %]
197
<option value="[% v FILTER html %]"
198
[% " selected=\"selected\"" IF v == default.version %]>[% v FILTER html -%]
204
<td align="right" valign="top">
206
<a href="describecomponents.cgi?product=[% product.name FILTER url_quote %]">
211
<select name="component" onchange="set_assign_to();" size="5">
212
[%- FOREACH c = product.components %]
213
<option value="[% c.name FILTER html %]"
214
[% " selected=\"selected\"" IF c.name == default.component_ %]>
215
[% c.name FILTER html -%]
224
<td colspan="3"> </td>
228
[% sel = { description => 'Severity', name => 'bug_severity' } %]
231
[% sel = { description => 'Platform', name => 'rep_platform' } %]
236
[% IF Param('letsubmitterchoosepriority') %]
237
[% sel = { description => 'Priority', name => 'priority' } %]
241
<input type="hidden" name="priority" value="[% default.priority FILTER html %]">
245
[% sel = { description => 'OS', name => 'op_sys' } %]
249
[% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %]
251
[% sel = { description => 'Target Milestone', name => 'target_milestone' } %]
253
<td colspan="2"> </td>
259
<td colspan="3"> </td>
263
[% IF bug_status.size <= 1 %]
264
<input type="hidden" name="bug_status"
265
value="[% default.bug_status FILTER html %]">
266
<td align="right" valign="top"><strong>Initial State:</strong></td>
267
<td valign="top">[% status_descs.${default.bug_status} FILTER html %]</td>
269
[% sel = { description => 'Initial State', name => 'bug_status' } %]
273
[%# Calculate the number of rows we can use for flags %]
274
[% num_rows = 6 + (Param("useqacontact") ? 1 : 0) +
275
(user.in_group(Param('timetrackinggroup')) ? 3 : 0) +
276
(Param("usebugaliases") ? 1 : 0)
278
<td rowspan="[% num_rows FILTER html %]" valign="top">
279
[% IF product.flag_types.bug.size > 0 %]
280
[% display_flag_headers = 0 %]
281
[% any_flags_requesteeble = 0 %]
283
[% FOREACH flag_type = product.flag_types.bug %]
284
[% NEXT UNLESS flag_type.is_active %]
285
[% display_flag_headers = 1 %]
286
[% SET any_flags_requesteeble = 1 IF flag_type.is_requestable && flag_type.is_requesteeble %]
289
[% IF display_flag_headers %]
290
[% PROCESS "flag/list.html.tmpl" flag_types = product.flag_types.bug
291
any_flags_requesteeble = any_flags_requesteeble
292
flag_table_id = "bug_flags"
302
<a href="page.cgi?id=fields.html#assigned_to">Assign To</a>:
306
[% INCLUDE global/userselect.html.tmpl
307
name => "assigned_to"
309
disabled => assigned_to_disabled
313
<noscript>(Leave blank to assign to component's default assignee)</noscript>
317
[% IF Param("useqacontact") %]
319
<td align="right"><strong>QA Contact:</strong></td>
321
[% INCLUDE global/userselect.html.tmpl
324
disabled => qa_contact_disabled
328
<noscript>(Leave blank to assign to default qa contact)</noscript>
334
<td align="right"><strong>Cc:</strong></td>
336
[% INCLUDE global/userselect.html.tmpl
339
disabled => cc_disabled
347
<th align="right">Default CC:</th>
349
<div id="initial_cc">
350
<!-- This has to happen after everything above renders,
351
and onload doesn't work. So this is as good a place
352
as any to put it. -->
353
<script type="text/javascript">set_assign_to();</script>
360
<td colspan="2"></td>
363
[% IF user.in_group(Param('timetrackinggroup')) %]
365
<td align="right"><strong>Estimated Hours:</strong></td>
367
<input name="estimated_time" size="6" maxlength="6" value="0.0">
371
<td align="right"><strong>Deadline:</strong></td>
373
<input name="deadline" size="10" maxlength="10" value="[% deadline FILTER html %]">
374
<small>(YYYY-MM-DD)</small>
380
<td colspan="2"></td>
384
[% IF Param("usebugaliases") %]
386
<td align="right"><strong>Alias:</strong></td>
388
<input name="alias" size="20">
394
<td align="right"><strong>URL:</strong></td>
396
<input name="bug_file_loc" size="60"
397
value="[% bug_file_loc FILTER html %]">
402
[% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1,
404
[% SET value = ${field.name} IF ${field.name}.defined %]
406
[% PROCESS bug/field.html.tmpl editable=1 value_span=2 %]
411
<td align="right"><strong>Summary:</strong></td>
413
<input name="short_desc" size="60" value="[% short_desc FILTER html %]"
418
<tr><td align="right" valign="top"><strong>Description:</strong></td>
420
[% defaultcontent = BLOCK %]
421
[% IF cloned_bug_id %]
422
+++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++
426
[%-# We are within a BLOCK. The comment will be correctly HTML-escaped
427
# by global/textarea.html.tmpl. So we must not escape the comment here. %]
428
[% comment FILTER none %]
430
[% INCLUDE global/textarea.html.tmpl
435
cols = constants.COMMENT_COLS
436
defaultcontent = defaultcontent
442
[% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %]
447
<input type="checkbox" id="commentprivacy" name="commentprivacy"
448
[% " checked=\"checked\"" IF commentprivacy %]>
449
<label for="commentprivacy">
450
Initial Description is Private
457
<th align="right" valign="top">Attachment:</th>
459
<script type="text/javascript">
461
document.write( '<div id="attachment_false">'
462
+ '<input type="button" value="Add an attachment" '
463
+ 'onClick="handleWantsAttachment(true)"> '
464
+ '<em style="display: none">This button has no '
465
+ 'functionality for you because your browser does '
466
+ 'not support CSS or does not use it.<\/em>'
468
+ '<div id="attachment_true" style="display: none">'
469
+ '<input type="button" '
470
+ 'value="Don\'t add an attachment " '
471
+ 'onClick="handleWantsAttachment(false)">');
475
<legend>Add an attachment</legend>
476
<table class="attachment_entry">
477
[% PROCESS attachment/createformcontents.html.tmpl
478
flag_types = product.flag_types.attachment
479
any_flags_requesteeble = 1
480
flag_table_id ="attachment_flags" %]
483
<script type="text/javascript">
485
document.write('<\/div>');
491
[% IF user.in_group('editbugs', product.id) %]
492
[% IF use_keywords %]
494
<td align="right" valign="top">
496
<a href="describekeywords.cgi">Keywords</a>:
500
<input name="keywords" size="60" value="[% keywords FILTER html %]"> (optional)
506
<strong>Depends on:</strong>
509
<input name="dependson" accesskey="d" value="[% dependson FILTER html %]">
514
<strong>Blocks:</strong>
517
<input name="blocked" accesskey="b" value="[% blocked FILTER html %]">
528
Only users in all of the selected groups can view this [% terms.bug %]:
532
(Leave all boxes unchecked to make this a public [% terms.bug %].)
538
[% FOREACH g = group %]
539
540
<input type="checkbox" id="bit-[% g.bit %]"
541
name="bit-[% g.bit %]" value="1"
542
[% " checked=\"checked\"" IF g.checked %]>
543
<label for="bit-[% g.bit %]">[% g.description FILTER html_light %]</label><br>
550
[%# Form controls for entering additional data about the bug being created. %]
551
[% Hook.process("form") %]
556
<input type="submit" id="commit" value=" Commit "
557
onclick="if (this.form.short_desc.value == '')
558
{ alert('Please enter a summary sentence for this [% terms.bug %].');
559
return false; } return true;">
560
561
<input type="submit" name="maketemplate" id="maketemplate"
562
value="Remember values as bookmarkable template">
566
[% UNLESS (Param('defaultplatform') && Param('defaultopsys')) %]
571
We've made a guess at your
572
[% IF Param('defaultplatform') %]
573
operating system. Please check it
574
[% ELSIF Param('defaultopsys') %]
575
platform. Please check it
577
operating system and platform. Please check them
579
and, if we got it wrong, email
580
[%+ Param('maintainer') %].
586
<input type="hidden" name="form_name" value="enter_bug">
589
[%# Links or content with more information about the bug being created. %]
590
[% Hook.process("end") %]
592
[% PROCESS global/footer.html.tmpl %]
594
[%############################################################################%]
595
[%# Block for SELECT fields #%]
596
[%############################################################################%]
599
[% IF sel.description %]
602
<a href="page.cgi?id=fields.html#[% sel.name %]">
603
[% sel.description %]</a>:
609
<select name="[% sel.name %]">
610
[%- FOREACH x = ${sel.name} %]
611
<option value="[% x FILTER html %]"
612
[% " selected=\"selected\"" IF x == default.${sel.name} %]>
613
[% IF sel.name == "bug_status" %]
614
[% status_descs.$x FILTER html %]