diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2011-01-07 21:07:48 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-09-15 20:44:39 +0100 |
commit | 35b43461c439f87dece54c5939d5ead0bc6603e7 (patch) | |
tree | cdef31f12a222d3ee6237858d719e2aa1cb4ae13 /template | |
parent | 80fc05854135e575e7811b55f521e8bb9855a2ee (diff) | |
download | bugzilla-35b43461c439f87dece54c5939d5ead0bc6603e7.tar bugzilla-35b43461c439f87dece54c5939d5ead0bc6603e7.tar.gz bugzilla-35b43461c439f87dece54c5939d5ead0bc6603e7.tar.bz2 bugzilla-35b43461c439f87dece54c5939d5ead0bc6603e7.tar.xz bugzilla-35b43461c439f87dece54c5939d5ead0bc6603e7.zip |
Add templates for bug creation
Diffstat (limited to 'template')
-rw-r--r-- | template/en/default/bug/create/create-guided.html.tmpl | 541 |
1 files changed, 275 insertions, 266 deletions
diff --git a/template/en/default/bug/create/create-guided.html.tmpl b/template/en/default/bug/create/create-guided.html.tmpl index 9f2a21b..8b04e66 100644 --- a/template/en/default/bug/create/create-guided.html.tmpl +++ b/template/en/default/bug/create/create-guided.html.tmpl @@ -34,22 +34,11 @@ style = "#somebugs { width: 100%; height: 500px }" %] -<p> - <font color="red"> - This is a template used on mozilla.org. This template, and the - comment-guided.txt.tmpl template that formats the data submitted via - the form in this template, are included as a demo of what it's - possible to do with custom templates in general, and custom [% terms.bug %] - entry templates in particular. As much of the text will not apply, - you should alter it - if you want to use this form on your [% terms.Bugzilla %] installation. - </font> -</p> - -[% tablecolour = "#FFFFCC" %] +[% tablecolour = "#efefef" %] [%# This script displays the descriptions for selected components. %] <script type="text/javascript"> +<!-- var descriptions = [ [% FOREACH c = product.components %] '[% c.description FILTER js %]', @@ -65,116 +54,224 @@ function PutDescription() { } } } -</script> -<a name="step1"></a> -<h3>Step 1 of 3 - has your [% terms.bug %] already been reported?</h3> +var initialowners = new Array([% product.components.size %]); +var last_initialowner; +var initialccs = new Array([% product.components.size %]); +var components = new Array([% product.components.size %]); +var flags = new Array([% product.components.size %]); +[% IF Param("useqacontact") %] + var initialqacontacts = new Array([% product.components.size %]); + var last_initialqacontact; +[% END %] +[% count = 0 %] +[%- FOREACH c = product.components %] + components[[% count %]] = "[% c.name FILTER js %]"; + initialowners[[% count %]] = "[% c.default_assignee.login FILTER js %]"; + [% flag_list = [] %] + [% FOREACH f = c.flag_types.bug %] + [% NEXT UNLESS f.is_active %] + [% flag_list.push(f.id) %] + [% END %] + [% FOREACH f = c.flag_types.attachment %] + [% NEXT UNLESS f.is_active %] + [% flag_list.push(f.id) %] + [% END %] + flags[[% count %]] = [[% flag_list.join(",") FILTER js %]]; + [% IF Param("useqacontact") %] + initialqacontacts[[% count %]] = "[% c.default_qa_contact.login FILTER js %]"; + [% END %] -<p> - <font color="red">Please don't skip this step - half of all - [% terms.bugs %] filed are - reported already.</font> - Check the two lists of frequently-reported [% terms.bugs %]: -</p> + [% SET initial_cc_list = [] %] + [% FOREACH cc_user = c.initial_cc %] + [% initial_cc_list.push(cc_user.login) %] + [% END %] + initialccs[[% count %]] = "[% initial_cc_list.join(', ') FILTER js %]"; + + [% count = count + 1 %] +[%- END %] -[%# Include other products if sensible %] -[% IF product.name == "Firefox" %] - [% productstring = "product=Mozilla%20Application%20Suite&product=Firefox" %] -[% ELSIF product.name == "Thunderbird" %] - [% productstring = "product=Mozilla%20Application%20Suite&product=Thunderbird" %] -[% ELSE %] - [% productstring = BLOCK %]product=[% product.name FILTER url_quote %][% END %] +function set_assign_to() { + // Based on the selected component, fill the "Assign To:" field + // with the default component owner, and the "QA Contact:" field + // with the default QA Contact. It also selectively enables flags. + var form = document.Create; + var assigned_to = form.assigned_to.value; + +[% IF Param("useqacontact") %] + var qa_contact = form.qa_contact.value; [% END %] -<p> - <a href="duplicates.cgi?[% productstring %]&format=simple" target="somebugs">All-time Top 100</a> (loaded initially) | - <a href="duplicates.cgi?[% productstring %]&format=simple&sortby=delta&reverse=1&maxrows=100&changedsince=14" target="somebugs">Hot in the last two weeks</a> -</p> + 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) { + var owner = initialowners[index]; + var component = components[index]; + if (assigned_to == last_initialowner + || assigned_to == owner + || assigned_to == '') { + form.assigned_to.value = owner; + last_initialowner = owner; + } -<iframe name="somebugs" id="somebugs" - style="border: 2px black solid" - src="duplicates.cgi?[% productstring %]&format=simple"> -</iframe> + document.getElementById('initial_cc').innerHTML = initialccs[index]; + + [% 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 %] + + // First, we disable all flags. Then we re-enable those + // which are available for the selected component. + var inputElements = document.getElementsByTagName("select"); + var inputElement, flagField; + for ( var i=0 ; i<inputElements.length ; i++ ) { + inputElement = inputElements.item(i); + 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. + inputElement = document.getElementById("requestee_type-" + id); + if (inputElement) inputElement.disabled = true; + } + } + // Now enable flags available for the selected component. + for (var i = 0; i < flags[index].length; i++) { + flagField = document.getElementById("flag_type-" + flags[index][i]); + // Do not enable flags the user cannot set nor request. + if (flagField && flagField.options.length > 1) { + flagField.disabled = false; + // Re-enabling the requestee field depends on the status + // of the flag. + toggleRequesteeField(flagField, 1); + } + } + } + PutDescription(); +} -<p> - If your [% terms.bug %] isn't there, search [% terms.Bugzilla %] by entering - a few key words having to do with your [% terms.bug %] in this box. - For example: <tt><b>pop3 mail</b></tt> or <tt><b>copy paste</b></tt>. - The results will appear above. - </p> - -[%# All bugs opened inside the past six months %] - <form action="buglist.cgi" method="get" target="somebugs"> - <input type="hidden" name="format" value="simple"> - <input type="hidden" name="order" value="relevance desc"> - <input type="hidden" name="bug_status" value="__all__"> - <input type="hidden" name="product" value="[% product.name FILTER html %]"> - [% IF product.name == "Firefox" OR - product.name == "Thunderbird" OR - product.name == "Mozilla Application Suite" OR - product.name == "Camino" %] - <input type="hidden" name="product" value="Core"> - <input type="hidden" name="product" value="Toolkit"> - <input type="hidden" name="product" value="PSM"> - <input type="hidden" name="product" value="NSPR"> - <input type="hidden" name="product" value="NSS"> - [% END %] - <input type="hidden" name="chfieldfrom" value="-6m"> - <input type="hidden" name="chfieldto" value="Now"> - <input type="hidden" name="chfield" value="[Bug creation]"> - <input type="text" name="content" size="40"> - <input type="submit" id="search" value="Search"> - </form> +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(); + } +} -<p> - Look through the search results. If you get the - <tt><b>[% terms.zeroSearchResults %]</b></tt> message, [% terms.Bugzilla %] - found no [% terms.bugs %] that - match. Check for typing mistakes, or try fewer or different keywords. - If you find [% terms.abug %] that looks the same as yours, please add - any useful extra information you have to it, rather than opening a new one. -</p> +// this is courtesy of John Keller + +var LOOKUP_ADDR = "/lookup.php?pkg="; +var ASSIGNEE_OBJ_NAME = "assigned_to"; +var NOT_FOUND = "NOT_FOUND"; + +var http_connection = null; + +// init XMLHttpRequest object, based on browser type +function initHttpConnection() { + http_connection = null; + + try { + // Firefox, Opera 8.0+, Safari + http_connection = new XMLHttpRequest(); + } catch (e) { + // Internet Explorer + try { + http_connection = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + http_connection = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) { + // browser does not support AJAX + } + } + } + + if (http_connection != null) { + http_connection.onreadystatechange = onLoadMaintainer; + } +} +// handler for data received +// text field to set should be similar to +// <input name="assigned_to" id="assigned_to" /> +function onLoadMaintainer() { + var field_obj; + + if ((http_connection.readyState == 4) && (http_connection.status == 200)) { + if ((http_connection.responseText != null) && (http_connection.responseText != NOT_FOUND)) { + if ((field_obj = document.getElementById(ASSIGNEE_OBJ_NAME)) != null) { + field_obj.value = http_connection.responseText; + } + } + } else { + // by default, we'll leave form value alone and don't do anything else + // this is a good place to set a default or show an error, though + } +} -<a name="step2"></a> -<h3>Step 2 of 3 - give information</h3> +// handler for when user enters a package +// text field to set should be similar to +// <input name="cf_rpmpkg" onchange="onChangePackage(this)" /> +function onChangePackage(input_obj) { + initHttpConnection(); + + if ((http_connection != null) && (input_obj.value != "")) { + http_connection.open("GET", LOOKUP_ADDR + encodeURIComponent(input_obj.value)); + http_connection.send(null); + } +}; + + +--> +</script> + +<p> Submit a bug using the <a href="enter_bug.cgi?product=[% product.name FILTER html %]">expert bug form</a>.</p> -<p> - If you've tried a few searches and your [% terms.bug %] really isn't in - there, tell us all about it. -</p> <form method="post" action="post_bug.cgi"> <input type="hidden" name="format" value="guided"> <input type="hidden" name="assigned_to" value=""> <input type="hidden" name="priority" value="[% default.priority FILTER html %]"> - <input type="hidden" name="version" - value="[% default.version FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> + <input type="hidden" name="op_sys" value="Linux"> <table valign="top" cellpadding="5" cellspacing="5" border="0"> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Product</b> + <tr> + <td align="right" valign="top" bgcolor="[% tablecolour %]" width="10%"> + <b>Product:</b> </td> <td valign="top"> <input type="hidden" name="product" value="[% product.name FILTER html %]"> - [% product.name FILTER html %] + <b>[% product.name FILTER html %]</b> </td> </tr> <tr> - <td align="right" valign="top"> - <b>Component</b> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>Component:</b> </td> <td valign="top"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <select name="component" id="component" - size="5" onchange="PutDescription()"> + size="5" onchange="PutDescription();"> [% IF NOT default.component_ %] [%# Various b.m.o. products have a "General" component, which is a useful default. %] @@ -201,6 +298,8 @@ function PutDescription() { </td> </tr> </table> + <p style="font-size: 85%;">Core packages are those packages found in the main and contrib repositories, and Other + packages are those found in non-free and commercial repositories; if you're unsure, choose Core.</p> <p> The area where the problem occurs. @@ -213,82 +312,74 @@ function PutDescription() { </td> </tr> - [%# We override rep_platform and op_sys for simplicity. The values chosen - are based on which are most common in the b.m.o database %] - [% rep_platform = [ "PC", "Macintosh", "All", "Other" ] %] - - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Hardware Platform</b> + <tr> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>Version:</b> </td> <td valign="top"> - [% PROCESS select sel = 'rep_platform' %] + <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> </td> </tr> - [% op_sys = [ "Windows 2000", "Windows XP", "Windows Vista", "Windows 7", - "Mac OS X", "Linux", "All", "Other" ] %] + [%# We override rep_platform and op_sys for simplicity. The values chosen + are based on which are most common in the b.m.o database %] + [% rep_platform = [ "All", "i586", "x86_64" ] %] - <tr> - <td align="right" valign="top"> - <b>Operating System</b> + <tr> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>Hardware Platform:</b> </td> <td valign="top"> - [% PROCESS select sel = 'op_sys' %] + [% PROCESS select sel = 'rep_platform' %] </td> </tr> - [% IF product.name.match("Firefox|Camino|Mozilla Application Suite") %] - [% matches = cgi.user_agent('Gecko/(\d+)') %] - [% buildid = cgi.user_agent() IF matches %] - [% END %] - - [%# Accept URL parameter build ID for non-browser products %] - [% IF cgi.param("buildid") %] - [% buildid = cgi.param("buildid") %] - [% END %] - - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Build Identifier</b> + <tr> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>Source RPM:</b> </td> <td valign="top"> - <input type="text" size="80" name="buildid" value="[% buildid FILTER html %]"> - <p> - This should identify the exact version of the product you were using. - If the above field is blank or you know it is incorrect, copy the - version text from the product's Help | - About menu (for browsers this will begin with "Mozilla/5.0..."). - If the product won't start, instead paste the complete URL you downloaded - it from. + <input type="text" size="80" name="cf_rpmpkg" value="" onchange="onChangePackage(this)"> + <p> + This is where you can identify exactly which RPM package is involved in this bug report. For instance, + if you know the problem you are having is with the program <tt>mysqld</tt>, then execute + <tt>rpm -qif /usr/sbin/mysqld</tt>. This will tell you the name and version of the RPM + package (i.e. MySQL-5.0.27-1mga1) as well as other information. In particular, you are looking for + the "Source RPM" field (i.e. MySQL-5.0.27-1mga1.src.rpm) -- this is the information you should + provide here. Alternatively, you may use <tt>rpm -qf /usr/sbin/mysqld --qf '%{SOURCERPM}\n'</tt> to + obtain the information. If you do not know the location of the program in question, use <tt>rpm -qf `which mysqld`</tt> + to obtain it. Please enter that information above. </p> </td> </tr> <tr> - <td align="right" valign="top"> - <b>URL</b> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>URL:</b> </td> <td valign="top"> <input type="text" size="80" name="bug_file_loc" value="http://"> <p> - URL that demonstrates the problem you are seeing (optional).<br> - <b>IMPORTANT</b>: if the problem is with a broken web page, you need - to report it - <a href="https://bugzilla.mozilla.org/page.cgi?id=broken-website.html">a different way</a>. + URL that demonstrates the problem you are submitting (optional). </p> </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Summary</b> + <tr> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>Summary:</b> </td> <td valign="top"> <input type="text" size="80" name="short_desc" id="short_desc" maxlength="255" spellcheck="true"> <p> - A sentence which summarises the problem. + A sentence that summarizes the problem. Please be descriptive and use lots of keywords. </p> <p> @@ -298,149 +389,64 @@ function PutDescription() { <br> <tt> <font color="#009900">Good example</font>: - crash if I close the mail window while checking for new POP mail + crash in Evolution while checking for new POP mail </tt> </p> </td> </tr> <tr> - <td align="right" valign="top"> - <b>Details</b> + <td align="right" valign="top" bgcolor="[% tablecolour %]"> + <b>Details:</b> </td> <td valign="top"> [% INCLUDE global/textarea.html.tmpl name = 'comment' - minrows = 6 + minrows = 10 + maxrows = 25 cols = constants.COMMENT_COLS + defaultcontent = "Description of problem:\n\n\nVersion-Release number of selected component (if applicable):\n\n\nHow reproducible:\n\n\nSteps to Reproduce:\n1.\n2.\n3.\n" %] + [% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %] + <br /> + <input type="checkbox" id="commentprivacy" name="commentprivacy" + [% " checked=\"checked\"" IF commentprivacy %]> + <label for="commentprivacy"> + Initial Description is Private + </label> + [% END %] + <p> Expand on the Summary. Please be as specific as possible about what is wrong. </p> <p> <tt> - <font color="#990000">Bad example</font>: Mozilla crashed. - You suck! + <font color="#990000">Bad example</font>: I can't seem to login to the system. Please help! </tt> <br> <tt> - <font color="#009900">Good example</font>: After a crash which - happened when I was sorting in the Bookmark Manager,<br> all of my - top-level bookmark folders beginning with the letters Q to Z are - no longer present. + <font color="#009900">Good example</font>:<br /><br /> + Description of problem:<br /><br /> + I'm unable to login to the system via ssh. The /var/log/messages + log indicates there is a problem with the pam module pam_ldap, but the /etc/pam.d/system-auth file doesn't + contain that module and I'm not using LDAP. I looked at /etc/pam.d/sshd and it does contain that module but I'm + not sure how it got there, unless it was due to the super-spiffy super-ldap-mojo package I installed yesterday. <br /><br /> + Version-Release number of selected component (if applicable):<br /><br /> + openldap-2.3.34-5mga1, pam-0.99.7.1-2mga1<br /><br /> + How reproducible:<br /><br /> + Every time I attempt to login.<br /><br /> + Steps to Reproduce:<br /> + 1. ssh user@host<br /> + 2. see the rejection<br /> </tt> </p> </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Reproducibility</b> - </td> - <td valign="top"> - <select name="reproducible"> - <option name="AlwaysReproducible" value="Always"> - Happens every time. - </option> - <option name="Sometimes" value="Sometimes"> - Happens sometimes, but not always. - </option> - <option name="DidntTry" value="Didn't try"> - Haven't tried to reproduce it. - </option> - <option name="NotReproducible" value="Couldn't Reproduce"> - Tried, but couldn't reproduce it. - </option> - </select> - </td> - </tr> - - <tr> - <td align="right" valign="top"> - <b>Steps to Reproduce</b> - </td> - <td valign="top"> - [% INCLUDE global/textarea.html.tmpl - name = 'reproduce_steps' - minrows = 4 - cols = constants.COMMENT_COLS - defaultcontent = "1.\n2.\n3." - %] - <p> - Describe how to reproduce the problem, step by - step. Include any special setup steps. - </p> - </td> - </tr> - - <tr bgcolor="[% tablecolour %]"> - <td valign="top" align="right"> - <b>Actual Results</b> - </td> - <td valign="top"> - [% INCLUDE global/textarea.html.tmpl - name = 'actual_results' - minrows = 4 - cols = constants.COMMENT_COLS - %] - <p> - What happened after you performed the steps above? - </p> - </td> - </tr> - - <tr> - <td valign="top" align="right"> - <b>Expected Results</b> - </td> - <td valign="top"> - [% INCLUDE global/textarea.html.tmpl - name = 'expected_results' - minrows = 4 - cols = constants.COMMENT_COLS - %] - <p> - What should the software have done instead? - </p> - </td> - </tr> - - <tr bgcolor="[% tablecolour %]"> - <td valign="top" align="right"> - <b>Additional Information</b> - </td> - <td valign="top"> - [% INCLUDE global/textarea.html.tmpl - name = 'additional_info' - minrows = 8 - cols = constants.COMMENT_COLS - %] - <p> - Add any additional information you feel may be - relevant to this [% terms.bug %], such as the <b>theme</b> you were - using (does the [% terms.bug %] still occur - with the default theme?), a - <b><a href="http://kb.mozillazine.org/Quality_Feedback_Agent">Talkback crash ID</a></b>, or special - information about <b>your computer's configuration</b>. Any information - longer than a few lines, such as a <b>stack trace</b> or <b>HTML - testcase</b>, should be added - using the "Add an Attachment" link on the [% terms.bug %], after - it is filed. If you believe that it's relevant, please also include - your build configuration, obtained by typing <tt>about:buildconfig</tt> - into your URL bar. - <br> - <br> - If you are reporting a crash, note the module in - which the software crashed (e.g., <tt>Application Violation in - gkhtml.dll</tt>). - </p> - </td> - </tr> - <tr> - <td valign="top" align="right"> - <b>Severity</b> + <td valign="top" align="right" bgcolor="[% tablecolour %]"> + <b>Severity:</b> </td> <td valign="top"> <select name="bug_severity"> @@ -466,20 +472,31 @@ function PutDescription() { </option> </select> <p> - Say how serious the problem is, or if your [% terms.bug %] is a + Indicate how serious the problem is, or if your [% terms.bug %] is a request for a new feature. </p> </td> </tr> + <tr> + <td valign="top" align="right" bgcolor="[% tablecolour %]"> + <b>Assign To:</b> + </td> + <td valign="top"> + [% safe_assigned_to = FILTER js; bug.assigned_to.login; END %] + [% INCLUDE global/userselect.html.tmpl + id => "assigned_to" + name => "assigned_to" + value => bug.assigned_to.login + size => 32 + %] + <p>Leave the above blank to assign to the default component owner.</p> + </td> + </tr> </table> - -<a name="step3"></a> -<h3>Step 3 of 3 - submit the [% terms.bug %] report</h3> - <p> <input type="submit" id="report" value=" Submit [% terms.Bug %] Report " - onclick="if (this.form.comment.value == '') + onclick="if (this.form.comment.value == 'Description of problem:\n\n\nVersion-Release number of selected component (if applicable):\n\n\nHow reproducible:\n\n\nSteps to Reproduce:\n1.\n2.\n3.\n') { alert('Please enter some details about this [% terms.bug %].'); this.form.comment.focus(); return false; } return true;"> @@ -487,17 +504,9 @@ function PutDescription() { <p> That's it! Thanks very much. You'll be notified by email about any - progress that is made on fixing your [% terms.bug %]. - -<p> - Please be warned - that we get a lot of [% terms.bug %] reports filed - it may take quite a - while to get around to yours. You can help the process by making sure your - [%+ terms.bug %] is - complete and easy to understand, and by quickly replying to any questions - which may arrive by email. + progress that is made on fixing your [% terms.bug %]. + Thank you for choosing Mageia! </p> - </form> [% PROCESS global/footer.html.tmpl %] |