summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-06-29 02:01:44 +0200
committerlpsolit%gmail.com <>2008-06-29 02:01:44 +0200
commit75e92404700746d6fb0a05e6ee098fe88efc7530 (patch)
treeeb19b796bd0e2242dd6c0cd43e19bef40b8d5967 /Bugzilla
parentd97a8e06d0430028f411e15b603b34b717934535 (diff)
downloadbugzilla-75e92404700746d6fb0a05e6ee098fe88efc7530.tar.gz
bugzilla-75e92404700746d6fb0a05e6ee098fe88efc7530.tar.xz
Bug 428440: Move code to set new product and related groups from process_bug.cgi to new function $bug->set_all - Patch by Noura Elhawary <nelhawar@redhat.com> r=LpSolit r=mkanat a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Bug.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 2335d0caa..c32672ce2 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -501,6 +501,33 @@ sub run_create_validators {
return $params;
}
+sub set_all {
+ my ($self, $args) = @_;
+
+ # For security purposes, and because lots of other checks depend on it,
+ # we set the product first before anything else.
+ my $product_change = 0;
+ if ($args->{product}) {
+ my $changed = $self->set_product($args->{product},
+ { component => $args->{component},
+ version => $args->{version},
+ target_milestone => $args->{target_milestone},
+ change_confirmed => $args->{confirm_product_change},
+ other_bugs => $args->{other_bugs},
+ });
+ # that will be used later to check strict isolation
+ $product_change = $changed;
+ }
+
+ # add/remove groups
+ $self->remove_group($_) foreach @{$args->{remove_group}};
+ $self->add_group($_) foreach @{$args->{add_group}};
+
+ # this is temporary until all related code is moved from
+ # process_bug.cgi to set_all
+ return $product_change;
+}
+
sub update {
my $self = shift;