From 2904ac3261ff9bb59e29b74d55d4ada294986ffe Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 25 Jul 2006 06:22:53 +0000 Subject: Bug 174039: Set flags on bug entry - Patch by Frédéric Buclin r=wurblzap r=myk a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/en/default/bug/create/create.html.tmpl | 116 +++++++++++++++++------- 1 file changed, 82 insertions(+), 34 deletions(-) (limited to 'template/en/default/bug/create/create.html.tmpl') diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 8b2bcb997..bb4936861 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -37,6 +37,7 @@ var initialowners = new Array([% product.components.size %]); var last_initialowner; 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; @@ -45,6 +46,17 @@ var components = new Array([% product.components.size %]); [%- FOREACH c = product.components %] components[[% count %]] = "[% c.name FILTER js %]"; initialowners[[% count %]] = "[% c.default_assignee.login FILTER js %]"; + var flag_list = new Array([% c.flag_types.bug.size + c.flag_types.attachment.size %]); + [% flag_count = 0 %] + [% FOREACH f = c.flag_types.bug %] + flag_list[[% flag_count %]] = "[% f.id %]"; + [% flag_count = flag_count + 1 %] + [% END %] + [% FOREACH f = c.flag_types.attachment %] + flag_list[[% flag_count %]] = "[% f.id %]"; + [% flag_count = flag_count + 1 %] + [% END %] + flags[[% count %]] = flag_list; [% IF Param("useqacontact") %] initialqacontacts[[% count %]] = "[% c.default_qa_contact.login FILTER js %]"; [% END %] @@ -53,8 +65,8 @@ var components = new Array([% product.components.size %]); function set_assign_to() { // Based on the selected component, fill the "Assign To:" field - // with the default component owner, and the the "QA Contact:" field - // with the default QA Contact. + // 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; @@ -87,6 +99,31 @@ function set_assign_to() { 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 -
- - - - +   [%# Migration note: The following file corresponds to the old Param # 'entryheaderhtml' @@ -127,7 +160,8 @@ function handleWantsAttachment(wants_attachment) { -
+   +   @@ -173,7 +207,7 @@ function handleWantsAttachment(wants_attachment) {   - +   @@ -185,29 +219,30 @@ function handleWantsAttachment(wants_attachment) { - [% IF Param('letsubmitterchoosepriority') %] - [% sel = { description => 'Priority', name => 'priority' } %] - [% INCLUDE select %] - [% ELSE %] - - [% END %] + [% IF Param('letsubmitterchoosepriority') %] + [% sel = { description => 'Priority', name => 'priority' } %] + [% INCLUDE select %] + [% ELSE %] + + + + [% END %] - [% sel = { description => 'Severity', name => 'bug_severity' } %] - [% INCLUDE select %] + [% sel = { description => 'Severity', name => 'bug_severity' } %] + [% INCLUDE select %] [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %] - [% sel = { description => 'Target Milestone', name => 'target_milestone' } %] - [% INCLUDE select %] - + [% sel = { description => 'Target Milestone', name => 'target_milestone' } %] + [% INCLUDE select %] +   [% END %]   - +   @@ -220,7 +255,19 @@ function handleWantsAttachment(wants_attachment) { [% sel = { description => 'Initial State', name => 'bug_status' } %] [% INCLUDE select %] [% END %] - +   + [%# Calculate the number of rows we can use for flags %] + [% num_rows = 6 + (Param("useqacontact") ? 1 : 0) + + (UserInGroup(Param('timetrackinggroup')) ? 3 : 0) + + (Param("usebugaliases") ? 1 : 0) + %] + + [% IF product.flag_types.bug.size > 0 %] + [% PROCESS "flag/list.html.tmpl" flag_types = product.flag_types.bug + any_flags_requesteeble = 1 + %] + [% END %] + @@ -229,7 +276,7 @@ function handleWantsAttachment(wants_attachment) { Assign To: - + [% INCLUDE global/userselect.html.tmpl name => "assigned_to" value => assigned_to @@ -244,7 +291,7 @@ function handleWantsAttachment(wants_attachment) { [% IF Param("useqacontact") %] QA Contact: - + [% INCLUDE global/userselect.html.tmpl name => "qa_contact" value => qa_contact @@ -259,7 +306,7 @@ function handleWantsAttachment(wants_attachment) { Cc: - + [% INCLUDE global/userselect.html.tmpl name => "cc" value => cc @@ -272,19 +319,19 @@ function handleWantsAttachment(wants_attachment) {   - + [% IF UserInGroup(Param('timetrackinggroup')) %] Estimated Hours: - + Deadline: - + (YYYY-MM-DD) @@ -292,14 +339,14 @@ function handleWantsAttachment(wants_attachment) {   - + [% END %] [% IF Param("usebugaliases") %] Alias: - + @@ -307,7 +354,7 @@ function handleWantsAttachment(wants_attachment) { URL: - + @@ -324,7 +371,7 @@ function handleWantsAttachment(wants_attachment) { Summary: - + @@ -389,7 +436,8 @@ function handleWantsAttachment(wants_attachment) {
Add an attachment - [% PROCESS attachment/createformcontents.html.tmpl %] + [% PROCESS attachment/createformcontents.html.tmpl + flag_types = product.flag_types.attachment %]