summaryrefslogtreecommitdiffstats
path: root/process_bug.cgi
diff options
context:
space:
mode:
authordkl%redhat.com <>2009-01-04 05:38:35 +0100
committerdkl%redhat.com <>2009-01-04 05:38:35 +0100
commit43f03aa4fb7fce809332f05e6d973430a515f960 (patch)
tree57ab7c995eb739478e53e918cdf6077a23329006 /process_bug.cgi
parentdd52ea1b9baad23990c47a3186933e63b0cc01bb (diff)
downloadbugzilla-43f03aa4fb7fce809332f05e6d973430a515f960.tar.gz
bugzilla-43f03aa4fb7fce809332f05e6d973430a515f960.tar.xz
Bug 99205: Allow mass-editing of dependencies
Patch by Dave Lawrence <dkl@redhat.com> - r/a=mkanat
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-xprocess_bug.cgi22
1 files changed, 18 insertions, 4 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index bea5d1a7b..c64594bd9 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -271,10 +271,24 @@ if ($cgi->param('id') && (defined $cgi->param('dependson')
$first_bug->set_dependencies(scalar $cgi->param('dependson'),
scalar $cgi->param('blocked'));
}
-# Right now, you can't modify dependencies on a mass change.
-else {
- $cgi->delete('dependson');
- $cgi->delete('blocked');
+elsif (should_set('dependson') || should_set('blocked')) {
+ foreach my $bug (@bug_objects) {
+ my %temp_deps;
+ foreach my $type (qw(dependson blocked)) {
+ $temp_deps{$type} = { map { $_ => 1 } @{$bug->$type} };
+ if (should_set($type) && $cgi->param($type . '_action') =~ /^(add|remove)$/) {
+ foreach my $id (split(/[,\s]+/, $cgi->param($type))) {
+ if ($cgi->param($type . '_action') eq 'remove') {
+ delete $temp_deps{$type}{$id};
+ }
+ else {
+ $temp_deps{$type}{$id} = 1;
+ }
+ }
+ }
+ }
+ $bug->set_dependencies([ keys %{$temp_deps{'dependson'}} ], [ keys %{$temp_deps{'blocked'}} ]);
+ }
}
my $any_keyword_changes;