Commit 17425864 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 109339: Be able to set assignee/QA to default for multiple bugs across…

Bug 109339: Be able to set assignee/QA to default for multiple bugs across products - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=myk
parent ffc1b98a
......@@ -850,7 +850,7 @@ foreach my $field ("rep_platform", "priority", "bug_severity",
}
}
my $prod_id; # Remember, can't use this for mass changes
my $prod_id;
if ($cgi->param('product') ne $cgi->param('dontchange')) {
$prod_id = get_product_id($cgi->param('product'));
$prod_id ||
......@@ -866,7 +866,7 @@ if ($cgi->param('product') ne $cgi->param('dontchange')) {
$prod_id = undef if (FetchOneColumn());
}
my $comp_id; # Remember, can't use this for mass changes
my $comp_id;
if ($cgi->param('component') ne $cgi->param('dontchange')) {
if (!defined $prod_id) {
ThrowUserError("no_component_change_for_multiple_products");
......@@ -1093,33 +1093,10 @@ SWITCH: for ($cgi->param('knob')) {
last SWITCH;
};
/^reassignbycomponent$/ && CheckonComment( "reassignbycomponent" ) && do {
if ($cgi->param('product') eq $cgi->param('dontchange')) {
ThrowUserError("need_product");
}
if ($cgi->param('component') eq $cgi->param('dontchange')) {
ThrowUserError("need_component");
}
if ($cgi->param('compconfirm')) {
DoConfirm();
}
ChangeStatus('NEW');
SendSQL("SELECT initialowner FROM components " .
"WHERE components.id = $comp_id");
$assignee = FetchOneColumn();
DoComma();
$::query .= "assigned_to = $assignee";
if (Param("useqacontact")) {
SendSQL("SELECT initialqacontact FROM components " .
"WHERE components.id = $comp_id");
$qacontact = FetchOneColumn();
DoComma();
if ($qacontact) {
$::query .= "qa_contact = $qacontact";
}
else {
$::query .= "qa_contact = NULL";
}
}
last SWITCH;
};
/^reopen$/ && CheckonComment( "reopen" ) && do {
......@@ -1314,7 +1291,33 @@ sub LogDependencyActivity {
# show_bug.cgi).
#
foreach my $id (@idlist) {
my $query = $basequery;
my $bug_obj = new Bugzilla::Bug($id, $whoid);
if ($cgi->param('knob') eq 'reassignbycomponent') {
# We have to check whether the bug is moved to another product
# and/or component before reassigning. If $comp_id is defined,
# use it; else use the product/component the bug is already in.
my $new_comp_id = $comp_id || $bug_obj->{'component_id'};
$assignee = $dbh->selectrow_array('SELECT initialowner
FROM components
WHERE components.id = ?',
undef, $new_comp_id);
$query .= ", assigned_to = $assignee";
if (Param("useqacontact")) {
$qacontact = $dbh->selectrow_array('SELECT initialqacontact
FROM components
WHERE components.id = ?',
undef, $new_comp_id);
if ($qacontact) {
$query .= ", qa_contact = $qacontact";
}
else {
$query .= ", qa_contact = NULL";
}
}
}
my %dependencychanged;
$bug_changed = 0;
my $write = "WRITE"; # Might want to make a param to control
......@@ -1534,7 +1537,7 @@ foreach my $id (@idlist) {
undef, join(', ', @list), $id);
}
}
my $query = "$basequery\nwhere bug_id = $id";
$query .= " where bug_id = $id";
if ($::comma ne "") {
SendSQL($query);
......
......@@ -841,15 +841,6 @@
to add a version to this product.
[% END %]
[% ELSIF error == "need_component" %]
[% title = "Component Required" %]
You must specify a component to help determine the new assignee of these
[% terms.bugs %].
[% ELSIF error == "need_product" %]
[% title = "Product Required" %]
You must specify a product to help determine the new assignee of these [% terms.bugs %].
[% ELSIF error == "need_quip" %]
[% title = "Quip Required" %]
Please enter a quip in the text field.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment