From c7abecd84384177998bfcf79e03f075630f51223 Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" Date: Tue, 15 Feb 2005 21:51:12 +0000 Subject: [PATCH] Bug 99567 : Allow Milestone to be set on creation of bug as an option Patch by Todd Stansell r=kiko,justdave a=justdave git-svn-id: svn://10.0.0.236/trunk@169221 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/defparams.pl | 9 +++++++++ mozilla/webtools/bugzilla/enter_bug.cgi | 14 ++++++++++++++ .../en/default/bug/create/create.html.tmpl | 8 ++++++++ 3 files changed, 31 insertions(+) diff --git a/mozilla/webtools/bugzilla/defparams.pl b/mozilla/webtools/bugzilla/defparams.pl index 2aa0331f307..3f91aabe254 100644 --- a/mozilla/webtools/bugzilla/defparams.pl +++ b/mozilla/webtools/bugzilla/defparams.pl @@ -887,6 +887,15 @@ You will get this message once a day until you\'ve dealt with these bugs! default => 0 }, + { + name => 'letsubmitterchoosemilestone', + desc => 'If this is on, then people submitting bugs can choose the ' . + 'Target Milestone for that bug. If off, then all bugs initially ' . + 'have the default milestone for the product being filed in.', + type => 'b', + default => 1 + }, + { name => 'musthavemilestoneonaccept', desc => 'If you are using Target Milestone, do you want to require that ' . diff --git a/mozilla/webtools/bugzilla/enter_bug.cgi b/mozilla/webtools/bugzilla/enter_bug.cgi index 8be88476824..8644870188d 100755 --- a/mozilla/webtools/bugzilla/enter_bug.cgi +++ b/mozilla/webtools/bugzilla/enter_bug.cgi @@ -53,6 +53,7 @@ use vars qw( @legal_keywords $userid %versions + %target_milestone $proddesc $classdesc ); @@ -437,6 +438,19 @@ if ( ($cloned_bug_id) && $default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}]; } +# Get list of milestones. +if ( Param('usetargetmilestone') ) { + $vars->{'target_milestone'} = $::target_milestone{$product}; + if (formvalue('target_milestone')) { + $default{'target_milestone'} = formvalue('target_milestone'); + } else { + SendSQL("SELECT defaultmilestone FROM products WHERE " . + "name = " . SqlQuote($product)); + $default{'target_milestone'} = FetchOneColumn(); + } +} + + # List of status values for drop-down. my @status; diff --git a/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl index 013a05f24ca..44b6eac4a0b 100644 --- a/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl @@ -159,6 +159,14 @@ function set_assign_to() { [% INCLUDE select %] + [% IF Param('usetargetmilestone') && Param('letsubmitterchoosemilestone') %] + + [% sel = { description => 'Target Milestone', name => 'target_milestone' } %] + [% INCLUDE select %] + + + [% END %] +