summaryrefslogtreecommitdiffstats
path: root/editproducts.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-12-18 00:31:51 +0100
committermkanat%bugzilla.org <>2009-12-18 00:31:51 +0100
commita73890d2ef8851ddae6b4991998824596a0f5644 (patch)
treea154cc5cd26842300bb0dd513ed7949c67682153 /editproducts.cgi
parent3eb0b0d657efa47583d5bea699d8b9a62547fb6c (diff)
downloadbugzilla-a73890d2ef8851ddae6b4991998824596a0f5644.tar.gz
bugzilla-a73890d2ef8851ddae6b4991998824596a0f5644.tar.xz
Bug 162060: Remove the relationship between "votestoconfirm" and whether or not the UNCONFIRMED status is available, by adding a checkbox to enable the UNCONFIRMED status in editproducts.cgi.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'editproducts.cgi')
-rwxr-xr-xeditproducts.cgi36
1 files changed, 22 insertions, 14 deletions
diff --git a/editproducts.cgi b/editproducts.cgi
index a328ca678..8433ed16b 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -176,17 +176,22 @@ if ($action eq 'new') {
check_token_data($token, 'add_product');
- my $product =
- Bugzilla::Product->create({classification => $classification_name,
- name => $product_name,
- description => scalar $cgi->param('description'),
- version => scalar $cgi->param('version'),
- defaultmilestone => scalar $cgi->param('defaultmilestone'),
- isactive => scalar $cgi->param('is_active'),
- votesperuser => scalar $cgi->param('votesperuser'),
- maxvotesperbug => scalar $cgi->param('maxvotesperbug'),
- votestoconfirm => scalar $cgi->param('votestoconfirm'),
- create_series => scalar $cgi->param('createseries')});
+ my %create_params = (
+ classification => $classification_name,
+ name => $product_name,
+ description => scalar $cgi->param('description'),
+ version => scalar $cgi->param('version'),
+ defaultmilestone => scalar $cgi->param('defaultmilestone'),
+ isactive => scalar $cgi->param('is_active'),
+ create_series => scalar $cgi->param('createseries'),
+ allows_unconfirmed => scalar $cgi->param('allows_unconfirmed'),
+ );
+ if (Bugzilla->params->{'usevotes'}) {
+ $create_params{votesperuser} = $cgi->param('votesperuser');
+ $create_params{maxvotesperbug} = $cgi->param('maxvotesperbug');
+ $create_params{votestoconfirm} = $cgi->param('votestoconfirm');
+ }
+ my $product = Bugzilla::Product->create(\%create_params);
delete_token($token);
@@ -294,9 +299,12 @@ if ($action eq 'update') {
$product->set_description(scalar $cgi->param('description'));
$product->set_default_milestone(scalar $cgi->param('defaultmilestone'));
$product->set_is_active(scalar $cgi->param('is_active'));
- $product->set_votes_per_user(scalar $cgi->param('votesperuser'));
- $product->set_votes_per_bug(scalar $cgi->param('maxvotesperbug'));
- $product->set_votes_to_confirm(scalar $cgi->param('votestoconfirm'));
+ if (Bugzilla->params->{'usevotes'}) {
+ $product->set_votes_per_user(scalar $cgi->param('votesperuser'));
+ $product->set_votes_per_bug(scalar $cgi->param('maxvotesperbug'));
+ $product->set_votes_to_confirm(scalar $cgi->param('votestoconfirm'));
+ }
+ $product->set_allows_unconfirmed(scalar $cgi->param('allows_unconfirmed'));
my $changes = $product->update();