Index: bug/create/create-guided.html.tmpl =================================================================== --- bug/create/create-guided.html.tmpl (révision 144) +++ bug/create/create-guided.html.tmpl (révision 145) @@ -34,22 +34,11 @@ style = "#somebugs { width: 100%; height: 500px }" %] -
- - 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. - -
+[% tablecolour = "#efefef" %] -[% tablecolour = "#FFFFCC" %] - [%# This script displays the descriptions for selected components. %] - -- Please don't skip this step - half of all - [% terms.bugs %] filed are - reported already. - Check the two lists of frequently-reported [% terms.bugs %]: -
+ [% 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 %]"; -[%# 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 %] + [% count = count + 1 %] +[%- 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 %] -- All-time Top 100 (loaded initially) | - Hot in the last two weeks -
+ 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; + } - + document.getElementById('initial_cc').innerHTML = initialccs[index]; -- 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: pop3 mail or copy paste. - The results will appear above. -
+ [% 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 %] -[%# All bugs opened inside the past six months %] - + // 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- Look through the search results. If you get the - [% terms.zeroSearchResults %] 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. -
+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(); + } +} +// this is courtesy of John Keller - -- If you've tried a few searches and your [% terms.bug %] really isn't in - there, tell us all about it. -
+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 +// +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 + } +} + +// handler for when user enters a package +// text field to set should be similar to +// +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); + } +}; + + +--> + + +Submit a bug using the expert bug form.
+ + [% PROCESS global/footer.html.tmpl %] Index: index.html.tmpl =================================================================== --- index.html.tmpl (révision 145) +++ index.html.tmpl (copie de travail) @@ -126,7 +126,7 @@