blob: b8807835e1881e5cb8d11ea513d5e9d162e75b26 [file] [log] [blame]
[%# 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>
#%]
[% PROCESS global/variables.none.tmpl %]
[%# Define strings that will serve as the title and header of this page %]
[% title = BLOCK %]Create New Attachment for [% terms.Bug %] #[% bugid %][% END %]
[% h1 = BLOCK %]Create New Attachment for
[%+ GetBugLink(bugid, "$terms.Bug $bugid") %][% END %]
[% h2 = BLOCK %][% bugsummary FILTER html %][% END %]
[% PROCESS global/header.html.tmpl
title = title
h1 = h1
h2 = h2
style = "
table.attachment_entry th {
text-align: right;
vertical-align: baseline;
white-space: nowrap;
}
table.attachment_entry td {
text-align: left;
vertical-align: baseline;
padding-bottom: 5px;
}
table#flags th, table#flags td {
text-align: left;
vertical-align: baseline;
font-size: small;
}
"
onload="setContentTypeDisabledState();"
%]
<form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data">
<input type="hidden" name="bugid" value="[% bugid %]">
<input type="hidden" name="action" value="insert">
<table class="attachment_entry">
<tr>
<th><label for="data">File:</label></th>
<td>
<em>Enter the path to the file on your computer.</em><br>
<input type="file" id="data" name="data" size="50">
</td>
</tr>
[% IF Param("maxlocalattachment") %]
<tr>
<th>BigFile:</th>
<td>
<input type="checkbox" id="bigfile"
name="bigfile" value="bigfile">
<label for="bigfile">
Big File - Stored locally and may be purged
</label>
</td>
</tr>
[% END %]
<tr>
<th><label for="description">Description:</label></th>
<td>
<em>Describe the attachment briefly.</em><br>
<input type="text" id="description" name="description" size="60" maxlength="200">
</td>
</tr>
<tr>
<th></th>
<td>
</td>
</tr>
<tr>
<th>Content Type:</th>
<td>
<em>If the attachment is a patch, check the box below.</em><br>
<input type="checkbox" id="ispatch" name="ispatch" value="1"
onchange="setContentTypeDisabledState();">
<label for="ispatch">patch</label><br><br>
<em>Otherwise, choose a method for determining the content type.</em><br>
<input type="radio" id="autodetect"
name="contenttypemethod" value="autodetect">
<label for="autodetect">auto-detect</label><br>
<input type="radio" id="list"
name="contenttypemethod" value="list">
<label for="list">select from list:</label>
<select name="contenttypeselection"
onchange="this.form.contenttypemethod[1].checked = true;">
[% PROCESS "attachment/content-types.html.tmpl" %]
</select><br>
<input type="radio" id="manual"
name="contenttypemethod" value="manual">
<label for="manual">enter manually:</label>
<input type="text" name="contenttypeentry" size="30" maxlength="200"
onchange="if (this.value) this.form.contenttypemethod[2].checked = true;">
</td>
</tr>
[% IF (Param("insidergroup") && UserInGroup(Param("insidergroup"))) %]
<tr>
<th>Privacy:</th>
<td>
<em>If the attachment is private, check the box below.</em><br>
<input type="checkbox" name="isprivate" id="isprivate" value="1">
<label for="isprivate">Private</label>
</td>
</tr>
[% END %]
<tr>
<th>Obsoletes:</th>
<td>
<em>(optional) Check each existing attachment made obsolete by your new attachment.</em><br>
[% IF attachments.size %]
[% FOREACH attachment = attachments %]
[% IF ((attachment.isprivate == 0) || (Param("insidergroup")
&& UserInGroup(Param("insidergroup")))) %]
<input type="checkbox" id="[% attachment.id %]"
name="obsolete" value="[% attachment.id %]">
<a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">[% attachment.id %]: [% attachment.description FILTER html %]</a><br>
[% END %]
[% END %]
[% ELSE %]
[no attachments can be made obsolete]
[% END %]
</td>
</tr>
[% IF (user.id != bugassignee_id) AND user.groups.editbugs %]
<tr>
<th>Reassignment:</th>
<td>
<em>If you want to assign this [% terms.bug %] to yourself,
check the box below.</em><br>
<input type="checkbox" id="takebug" name="takebug" value="1">
<label for="takebug">take [% terms.bug %]</label>
</td>
</tr>
[% END %]
<tr>
<td> </td>
<td>
[% IF flag_types.size > 0 %]
[% PROCESS "flag/list.html.tmpl" bug_id=bugid attach_id=attachid %]<br>
[% END %]
</td>
</tr>
<tr>
<th><label for="comment">Comment:</label></th>
<td>
<em>(optional) Add a comment about this attachment to the [% terms.bug %].</em><br>
<textarea wrap="soft" id="commment" name="comment" rows="6" cols="80"></textarea>
</td>
</tr>
[% IF bug.product == "WebKit" %]
<tr id="legal" style="visibility: collapse;">
<th>Legal:</th>
<td>
<b>WebKit Contribution Terms:</b><br/>
<br/>
Hello and thank you for contributing a patch. Here is our licensing policy and terms for contributing code to the WebKit project.<br/>
<br/>
<ol>
<li>If you are sending in a patch to existing WebKit code, you agree by clicking below that your changes are licensed under the existing license terms of the file you are modifying (i.e., BSD license or GNU Lesser General Public License v.2.1, LGPL v. 2.1). Please also add your copyright (name and year) to the relevant files for changes that are more than 10 lines of code.</li>
<li>If you are sending in a new file for inclusion in WebKit (no code copied from another source), the preferred license is BSD, but LGPL 2.1 is an option as well. Please include your copyright (name and year) and license preference (BSD or LGPL 2.1). By clicking below you agree that your file is licensed under either the BSD license or LGPL 2.1, as indicated in your file.</li>
<li>If you aren't the author of the patch, you agree to include the original copyright notices and licensing terms with it, to the extent that they exist. If there wasn't a copyright notice or license, please make a note of it. Generally we can only take in patches that are BSD- or LGPL-licensed in order to maintain license compatibility within the project.</li>
</ol>
</td>
</tr>
[% END %]
<tr>
<th>&nbsp;</th>
<td><input type="submit" id="submit" value="Submit"></td>
</tr>
</table>
</form>
<script type="text/javascript">
<!--
function setContentTypeDisabledState()
{
var entryform = document.entryform;
var isdisabled = false;
if (entryform.ispatch.checked)
isdisabled = true;
for (var i=0 ; i<entryform.contenttypemethod.length ; i++)
entryform.contenttypemethod[i].disabled = isdisabled;
entryform.contenttypeselection.disabled = isdisabled;
entryform.contenttypeentry.disabled = isdisabled;
if (isdisabled) {
document.getElementById('legal').style.visibility = "visible";
document.getElementById('submit').value = "Agree and Submit";
} else {
document.getElementById('submit').value = "Submit";
document.getElementById('legal').style.visibility = "collapse";
}
}
//-->
</script>
[% PROCESS global/footer.html.tmpl %]