From eced5d2c4b2d154a5a6ec8c27e8ac10973dc4e0c Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 30 Aug 2016 21:19:08 -0400 Subject: Backout Bug 1299280 and Bug 1294478 --- template/en/default/bug/create/create.html.tmpl | 40 ++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'template/en/default/bug') diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 4103c16dc..ba5d08273 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -63,17 +63,43 @@ function initCrashSignatureField() { 'cf_crash_signature_action', 'cf_crash_signature'); [% END %] } -var data = JSON.parse('[% data FILTER js %]'); -var initialowners = data["initialowners"]; + +var initialowners = new Array([% product.components.size %]); var last_initialowner; -var initialccs = data["initialccs"]; -var components = data["components"]; -var comp_desc = data["comp_desc"]; -var flags = data["flags"]; +var initialccs = new Array([% product.components.size %]); +var components = new Array([% product.components.size %]); +var comp_desc = new Array([% product.components.size %]); +var flags = new Array([% product.components.size %]); [% IF Param("useqacontact") %] - var initialqacontacts = data["initialqacontacts"]; + var initialqacontacts = new Array([% product.components.size %]); var last_initialqacontact; [% END %] +[% count = 0 %] +[%- FOREACH c = product.components %] + [% NEXT IF NOT c.is_active %] + components[[% count %]] = "[% c.name FILTER js %]"; + comp_desc[[% count %]] = "[% c.description FILTER html_light FILTER js %]"; + initialowners[[% count %]] = "[% c.default_assignee.login FILTER js %]"; + [% flag_list = [] %] + [% FOREACH f = c.flag_types.bug %] + [% flag_list.push(f.id) %] + [% END %] + [% FOREACH f = c.flag_types.attachment %] + [% 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 -- cgit v1.2.3-24-g4f1b