diff options
Diffstat (limited to 'template/en/default/bug/create/create-guided.html.tmpl')
-rw-r--r-- | template/en/default/bug/create/create-guided.html.tmpl | 200 |
1 files changed, 59 insertions, 141 deletions
diff --git a/template/en/default/bug/create/create-guided.html.tmpl b/template/en/default/bug/create/create-guided.html.tmpl index 0628a0e..bee5f01 100644 --- a/template/en/default/bug/create/create-guided.html.tmpl +++ b/template/en/default/bug/create/create-guided.html.tmpl @@ -34,6 +34,8 @@ style = "#somebugs { width: 100%; height: 500px }" %] +[% style = "" %] + [% tablecolour = "#efefef" %] [%# This script displays the descriptions for selected components. %] @@ -57,51 +59,20 @@ function PutDescription() { 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 %] - - [% 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 %] 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. + // with the default component owner. var form = document.Create; var assigned_to = form.assigned_to.value; -[% IF Param("useqacontact") %] - var qa_contact = form.qa_contact.value; -[% END %] - var index = -1; if (form.component.type == 'select-one') { index = form.component.selectedIndex; @@ -118,137 +89,83 @@ function set_assign_to() { form.assigned_to.value = owner; last_initialowner = owner; } - - 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(); } -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 -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; - } + 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 - } + 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('assigned_to')) != 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 // <input name="cf_rpmpkg" onchange="onChangePackage(this)" /> function onChangePackage(input_obj) { - initHttpConnection(); + initHttpConnection(); - if ((http_connection != null) && (input_obj.value != "")) { - http_connection.open("GET", LOOKUP_ADDR + encodeURIComponent(input_obj.value)); - http_connection.send(null); - } + if ((http_connection != null) && (input_obj.value != "")) { + http_connection.open("GET", '/lookup.php?pkg=' + 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> Submit [% terms.abug %] using the +<a href="enter_bug.cgi?product=[% product.name FILTER html %]">expert [% terms.bug %] form</a>.</p> -<form method="post" action="post_bug.cgi"> +<form name="Create" id="Create" 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="token" value="[% token FILTER html %]"> - <input type="hidden" name="op_sys" value="Linux"> + <input type="hidden" name="op_sys" value="[% Param('defaultopsys') FILTER html %]"> <table valign="top" cellpadding="5" cellspacing="5" border="0"> @@ -298,6 +215,7 @@ function onChangePackage(input_obj) { </td> </tr> </table> + <p> The area where the problem occurs. To pick the right component, you could use the same one as @@ -344,7 +262,7 @@ function onChangePackage(input_obj) { <td valign="top"> <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, + This is where you can identify exactly which RPM package is involved in this [% terms.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 @@ -404,13 +322,11 @@ function onChangePackage(input_obj) { 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> + [% IF user.is_insider %] + <br> + <input type="checkbox" id="comment_is_private" name="comment_is_private" + [% ' checked="checked"' IF comment_is_private %]> + <label for="comment_is_private">Initial Description is Private</label> [% END %] <p> @@ -475,16 +391,18 @@ function onChangePackage(input_obj) { <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 + id => "assigned_to" + name => "assigned_to" + value => "" + emptyok => 1 + size => 32 %] <p>Leave the above blank to assign to the default component owner.</p> </td> </tr> + + [% Hook.process('form') %] </table> <p> |