diff options
Diffstat (limited to 'template/en/default/bug/create/create.html.tmpl')
-rw-r--r-- | template/en/default/bug/create/create.html.tmpl | 359 |
1 files changed, 197 insertions, 162 deletions
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 4b17457..c18e1c5 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -30,11 +30,13 @@ [% PROCESS global/header.html.tmpl title = title - style_urls = [ 'skins/standard/create_attachment.css', - 'skins/standard/yui/calendar.css' ] - javascript_urls = [ "js/attachment.js", "js/util.js", "js/yui/calendar.js", - "js/field.js", "js/TUI.js" ] - onload = 'set_assign_to();' + yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ] + style_urls = [ 'skins/standard/attachment.css', + 'skins/standard/enter_bug.css' ] + javascript_urls = [ "js/attachment.js", "js/util.js", + "js/field.js", "js/TUI.js", "js/bug.js" ] + onload = "set_assign_to(); hideElementById('attachment_true'); + showElementById('attachment_false'); showElementById('btn_no_attachment');" %] <script type="text/javascript"> @@ -128,9 +130,10 @@ function set_assign_to() { if (inputElement.name.search(/^flag_type-(\d+)$/) != -1) { var id = inputElement.name.replace(/^flag_type-(\d+)$/, "$1"); inputElement.disabled = true; - // Also disable the requestee field, if it exists. + // Also hide the requestee field, if it exists. inputElement = document.getElementById("requestee_type-" + id); - if (inputElement) inputElement.disabled = true; + if (inputElement) + YAHOO.util.Dom.addClass(inputElement.parentNode, 'bz_default_hidden'); } } // Now enable flags available for the selected component. @@ -147,18 +150,11 @@ function set_assign_to() { } } -function handleWantsAttachment(wants_attachment) { - if (wants_attachment) { - document.getElementById('attachment_false').style.display = 'none'; - document.getElementById('attachment_true').style.display = 'block'; - } - else { - document.getElementById('attachment_false').style.display = 'block'; - document.getElementById('attachment_true').style.display = 'none'; - clearAttachmentFields(); - } -} - +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 %] TUI_alternates['expert_fields'] = 'Show Advanced Fields'; // Hide the Advanced Fields by default, unless the user has a cookie @@ -168,20 +164,13 @@ TUI_hide_default('expert_fields'); --> </script> -[% USE Bugzilla %] -[% SET select_fields = {} %] -[% FOREACH field = Bugzilla.get_fields( - { type => constants.FIELD_TYPE_SINGLE_SELECT, custom => 0 }) -%] - [% select_fields.${field.name} = field %] -[% END %] - <form name="Create" id="Create" method="post" action="post_bug.cgi" - enctype="multipart/form-data"> + class="enter_bug_form" enctype="multipart/form-data" + onsubmit="return validateEnterBug(this)"> <input type="hidden" name="product" value="[% product.name FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> -<table cellspacing="4" cellpadding="2" border="0"> +<table> <tbody> <tr> <td colspan="4"> @@ -210,22 +199,26 @@ TUI_hide_default('expert_fields'); </tr> <tr> - <th>Product:</th> - <td width="10%">[% product.name FILTER html %]</td> - - <th>Reporter:</th> - <td width="100%">[% user.login FILTER html %]</td> + [% 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 %] </tr> [%# We can't use the select block in these two cases for various reasons. %] <tr> - <th class="required"> - <a href="describecomponents.cgi?product=[% product.name FILTER url_quote %]"> - Component</a>: - </th> - <td> - <select name="component" onchange="set_assign_to();" size="7" - aria-required="true" class="required"> + [% component_desc_url = BLOCK -%] + describecomponents.cgi?product=[% product.name FILTER url_quote %] + [% END %] + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.component editable = 1 + desc_url = component_desc_url + %] + <td id="field_container_component"> + <select name="component" id="component" onchange="set_assign_to();" + size="7" aria-required="true" class="required"> [%# Build the lists of assignees and QA contacts if "usemenuforusers" is enabled. %] [% IF Param("usemenuforusers") %] [% assignees_list = user.get_userlist.clone %] @@ -234,7 +227,13 @@ TUI_hide_default('expert_fields'); [%- FOREACH c = product.components %] <option value="[% c.name FILTER html %]" - [% " selected=\"selected\"" IF c.name == default.component_ %]> + id="v[% c.id FILTER html %]_component" + [% IF c.name == default.component_ %] + [%# This is for bug/field.html.tmpl, for visibility-related + # controls. %] + [% default.component_id = c.id %] + selected="selected" + [% END %]> [% c.name FILTER html -%] </option> [% IF Param("usemenuforusers") %] @@ -245,9 +244,16 @@ TUI_hide_default('expert_fields'); [% END %] [%- END %] </select> + + <script type="text/javascript"> + <!-- + [%+ INCLUDE "bug/field-events.js.tmpl" + field = bug_fields.component %] + //--> + </script> </td> - <td colspan="2"> + <td colspan="2" id="comp_desc_container"> [%# Enclose the fieldset in a nested table so that its width changes based # on the length on the component description. %] <table> @@ -264,9 +270,11 @@ TUI_hide_default('expert_fields'); </tr> <tr> - <th rowspan="3">Version:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.version editable = 1 rowspan = 3 + %] <td rowspan="3"> - <select name="version" size="5"> + <select name="version" id="version" size="5"> [%- FOREACH v = version %] <option value="[% v FILTER html %]" [% ' selected="selected"' IF v == default.version %]>[% v FILTER html -%] @@ -276,35 +284,50 @@ TUI_hide_default('expert_fields'); </td> [% INCLUDE bug/field.html.tmpl - bug = default, field = select_fields.bug_severity, editable = 1, + bug = default, field = bug_fields.bug_severity, editable = 1, value = default.bug_severity %] </tr> <tr> [% INCLUDE bug/field.html.tmpl - bug = default, field = select_fields.rep_platform, editable = 1, + bug = default, field = bug_fields.rep_platform, editable = 1, value = default.rep_platform %] </tr> <tr> [% INCLUDE bug/field.html.tmpl - bug = default, field = select_fields.op_sys, editable = 1, + bug = default, field = bug_fields.op_sys, editable = 1, value = default.op_sys %] </tr> + [% IF !Param('defaultplatform') || !Param('defaultopsys') %] + <tr> + <th colspan="3"> </th> + <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 %] </tbody> <tbody class="expert_fields"> <tr> [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %] - [% sel = { description => 'Target Milestone', name => 'target_milestone' } %] - [% INCLUDE select %] + [% INCLUDE select field = bug_fields.target_milestone %] [% ELSE %] <td colspan="2"> </td> [% END %] [% IF Param('letsubmitterchoosepriority') %] [% INCLUDE bug/field.html.tmpl - bug = default, field = select_fields.priority, editable = 1, + bug = default, field = bug_fields.priority, editable = 1, value = default.priority %] [% ELSE %] <td colspan="2"> </td> @@ -312,40 +335,16 @@ TUI_hide_default('expert_fields'); </tr> </tbody> -[% IF !Param('defaultplatform') || !Param('defaultopsys') %] - <tbody> - <tr> - <th> </th> - <td colspan="3" class="comment"> - 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. - </td> - </tr> - </tbody> -[% END %] - <tbody class="expert_fields"> <tr> <td colspan="4"> </td> </tr> <tr> -[% IF bug_status.size <= 1 %] - <input type="hidden" name="bug_status" - value="[% default.bug_status FILTER html %]"> - <th>Initial State:</th> - <td>[% display_value("bug_status", default.bug_status) FILTER html %]</td> -[% ELSE %] - [% sel = { description => 'Initial State', name => 'bug_status' } %] - [% INCLUDE select %] -[% END %] + [% 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 %] <td> </td> [%# Calculate the number of rows we can use for flags %] @@ -376,9 +375,12 @@ TUI_hide_default('expert_fields'); </tr> <tr> - <th><a href="page.cgi?id=fields.html#assigned_to">Assign To</a>:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.assigned_to editable = 1 + %] <td colspan="2"> [% INCLUDE global/userselect.html.tmpl + id => "assigned_to" name => "assigned_to" value => assigned_to disabled => assigned_to_disabled @@ -392,9 +394,12 @@ TUI_hide_default('expert_fields'); [% IF Param("useqacontact") %] <tr> - <th>QA Contact:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.qa_contact editable = 1 + %] <td colspan="2"> [% INCLUDE global/userselect.html.tmpl + id => "qa_contact" name => "qa_contact" value => qa_contact disabled => qa_contact_disabled @@ -408,9 +413,12 @@ TUI_hide_default('expert_fields'); [% END %] <tr> - <th>CC:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.cc editable = 1 + %] <td colspan="2"> [% INCLUDE global/userselect.html.tmpl + id => "cc" name => "cc" value => cc disabled => cc_disabled @@ -421,7 +429,7 @@ TUI_hide_default('expert_fields'); </tr> <tr> - <th>Default CC:</th> + <th>Default [% field_descs.cc FILTER html %]:</th> <td colspan="2"> <div id="initial_cc"> </div> @@ -434,17 +442,17 @@ TUI_hide_default('expert_fields'); [% IF user.is_timetracker %] <tr> - <th>Estimated Hours:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.estimated_time editable = 1 + %] <td colspan="2"> <input name="estimated_time" size="6" maxlength="6" value="[% estimated_time FILTER html %]"> </td> </tr> <tr> - <th>Deadline:</th> - <td colspan="2"> - <input name="deadline" size="10" maxlength="10" value="[% deadline FILTER html %]"> - <small>(YYYY-MM-DD)</small> - </td> + [% INCLUDE bug/field.html.tmpl + bug = default, field = bug_fields.deadline, value = deadline, + editable = 1, value_span = 2 %] </tr> <tr> @@ -454,7 +462,9 @@ TUI_hide_default('expert_fields'); [% IF Param("usebugaliases") %] <tr> - <th>Alias:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.alias editable = 1 + %] <td colspan="2"> <input name="alias" size="20" value="[% alias FILTER html %]"> </td> @@ -462,21 +472,23 @@ TUI_hide_default('expert_fields'); [% END %] <tr> - <th>URL:</th> - <td colspan="2"> - <input name="bug_file_loc" size="40" - value="[% bug_file_loc FILTER html %]"> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.bug_file_loc editable = 1 + %] + <td colspan="2" class="field_value"> + <input name="bug_file_loc" id="bug_file_loc" class="text_input" + size="40" value="[% bug_file_loc FILTER html %]"> </td> </tr> </tbody> -<tbody class="expert_fields"> +<tbody> [% USE Bugzilla %] [% FOREACH field = Bugzilla.active_custom_fields %] [% NEXT UNLESS field.enter_bug %] [% SET value = ${field.name}.defined ? ${field.name} : "" %] - <tr> + <tr [% 'class="expert_fields"' IF !field.is_mandatory %]> [% INCLUDE bug/field.html.tmpl bug = default, field = field, value = value, editable = 1, value_span = 3 %] @@ -487,17 +499,55 @@ TUI_hide_default('expert_fields'); <tbody> <tr> - <th class="required">Summary:</th> - <td colspan="3"> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.short_desc editable = 1 + %] + <td colspan="3" class="field_value"> <input name="short_desc" size="70" value="[% short_desc FILTER html %]" maxlength="255" spellcheck="true" aria-required="true" - class="required"> + class="required text_input" id="short_desc"> </td> </tr> + [% IF feature_enabled('jsonrpc') AND !cloned_bug_id %] + <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", + label: "[% field_descs.short_desc FILTER js %]", + formatter: "text" }, + { 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' + } + }); + </script> + </td> + </tr> + [% END %] + <tr> <th>Description:</th> <td colspan="3"> + [% defaultcontent = BLOCK %] [% IF cloned_bug_id %] +++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++ @@ -525,34 +575,28 @@ TUI_hide_default('expert_fields'); <th> </th> <td colspan="3"> - <input type="checkbox" id="commentprivacy" name="commentprivacy" - [% " checked=\"checked\"" IF commentprivacy %]> - <label for="commentprivacy"> - Make description private (visible only to members of the - <strong>[% Param('insidergroup') FILTER html %]</strong> group) + <input type="checkbox" id="comment_is_private" name="comment_is_private" + [% ' checked="checked"' IF comment_is_private %] + onClick="updateCommentTagControl(this, 'comment')"> + <label for="comment_is_private"> + Make description and any new attachment private (visible only to members + of the <strong>[% Param('insidergroup') FILTER html %]</strong> group) </label> </td> </tr> [% END %] + [% IF Param("maxattachmentsize") %] <tr> <th>Attachment:</th> <td colspan="3"> - <script type="text/javascript"> - <!-- - document.write( '<div id="attachment_false">' - + '<input type="button" value="Add an attachment" ' - + 'onClick="handleWantsAttachment(true)"> ' - + '<em style="display: none">This button has no ' - + 'functionality for you because your browser does ' - + 'not support CSS or does not use it.<\/em>' - + '<\/div>' - + '<div id="attachment_true" style="display: none">' - + '<input type="button" ' - + 'value="Don\'t add an attachment " ' - + 'onClick="handleWantsAttachment(false)">'); - //--> - </script> + <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)"> <fieldset> <legend>Add an attachment</legend> <table class="attachment_entry"> @@ -562,35 +606,36 @@ TUI_hide_default('expert_fields'); flag_table_id ="attachment_flags" %] </table> </fieldset> - <script type="text/javascript"> - <!-- - document.write('<\/div>'); - //--> - </script> + </div> </td> </tr> + [% END %] </tbody> <tbody class="expert_fields"> [% IF user.in_group('editbugs', product.id) %] [% IF use_keywords %] <tr> - <th><a href="describekeywords.cgi">Keywords</a>:</th> - <td colspan="3"> - <input id="keywords" name="keywords" size="40" - value="[% keywords FILTER html %]"> (optional) - </td> + [% INCLUDE bug/field.html.tmpl + bug = default, field = bug_fields.keywords, editable = 1, + value = keywords, desc_url = "describekeywords.cgi", + value_span = 2 + %] </tr> [% END %] <tr> - <th>Depends on:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.dependson editable = 1 + %] <td colspan="3"> <input name="dependson" accesskey="d" value="[% dependson FILTER html %]"> </td> </tr> <tr> - <th>Blocks:</th> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.blocked editable = 1 + %] <td colspan="3"> <input name="blocked" accesskey="b" value="[% blocked FILTER html %]"> </td> @@ -599,13 +644,14 @@ TUI_hide_default('expert_fields'); </tbody> <tbody class="expert_fields"> - [% IF group.size %] + [% IF product.groups_available.size %] <tr> <th> </th> <td colspan="3"> <br> <strong> - Only users in all of the selected groups can view this [% terms.bug %]: + Only users in all of the selected groups can view this + [%+ terms.bug %]: </strong> <br> <font size="-1"> @@ -615,12 +661,14 @@ TUI_hide_default('expert_fields'); <br> <!-- Checkboxes --> - [% FOREACH g = group %] - - <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 FILTER html_light %]</label><br> + <input type="hidden" name="defined_groups" value="1"> + [% FOREACH group = product.groups_available %] + <input type="checkbox" id="group_[% group.id FILTER html %]" + name="groups" value="[% group.name FILTER html %]" + [% ' checked="checked"' IF default.groups.contains(group.name) + OR group.is_default %]> + <label for="group_[% group.id FILTER html %]"> + [%- group.description FILTER html_light %]</label><br> [% END %] </td> </tr> @@ -634,14 +682,11 @@ TUI_hide_default('expert_fields'); <tr> <th> </th> <td colspan="3"> - <input type="submit" id="commit" value="Submit [% terms.Bug %]" - onclick="if (this.form.short_desc.value == '') - { alert('Please enter a summary sentence for this [% terms.bug %].'); - return false; } return true;"> + <input type="submit" id="commit" value="Submit [% terms.Bug %]"> <input type="submit" name="maketemplate" id="maketemplate" value="Remember values as bookmarkable template" - class="expert_fields"> + onclick="bz_no_validate_enter_bug=true" class="expert_fields"> </td> </tr> </tbody> @@ -659,30 +704,20 @@ TUI_hide_default('expert_fields'); [%############################################################################%] [% BLOCK select %] - [% IF sel.description %] - <th> - <a href="page.cgi?id=fields.html#[% sel.name %]">[% sel.description %]</a>: - </th> - [% END %] + [% INCLUDE "bug/field-label.html.tmpl" + field = field editable = 1 + %] <td> - <select name="[% sel.name %]" id="[% sel.name %]"> - [%- FOREACH x = ${sel.name} %] + <select name="[% field.name FILTER html %]" + id="[% field.name FILTER html %]"> + [%- FOREACH x = ${field.name} %] <option value="[% x FILTER html %]" - [% " selected=\"selected\"" IF x == default.${sel.name} %]> - [% display_value(sel.name, x) FILTER html %] + [% " selected=\"selected\"" IF x == default.${field.name} %]> + [% display_value(field.name, x) FILTER html %] </option> [% END %] </select> - - [% IF sel.name == "bug_status" %] - <script type="text/javascript"> - <!-- - [%+ INCLUDE "bug/field-events.js.tmpl" - field = select_fields.bug_status %] - //--> - </script> - [% END %] </td> [% END %] |