From 30c7fa92ac2d0c76443fcc47907487a9ff0186b2 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 12 Feb 2008 07:32:51 +0000 Subject: Bug 384009: Global fields (priority, severity, OS, and platform) are required when using WebService instead of using the defaults - Patch by Frédéric Buclin r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Status.pm | 52 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 50 deletions(-) (limited to 'Bugzilla/Status.pm') diff --git a/Bugzilla/Status.pm b/Bugzilla/Status.pm index 5573fa836..f8b77331c 100644 --- a/Bugzilla/Status.pm +++ b/Bugzilla/Status.pm @@ -95,7 +95,8 @@ sub can_change_to { INNER JOIN bug_status ON id = new_status WHERE isactive = 1 - AND old_status $cond", + AND old_status $cond + ORDER BY sortkey", undef, @args); # Allow the bug status to remain unchanged. @@ -106,24 +107,6 @@ sub can_change_to { return $self->{'can_change_to'}; } -sub allow_change_from { - my ($self, $old_status, $product) = @_; - - # Always allow transitions from a status to itself. - return 1 if ($old_status && $old_status->id == $self->id); - - if ($self->name eq 'UNCONFIRMED' && !$product->votes_to_confirm) { - # UNCONFIRMED is an invalid status transition if votes_to_confirm is 0 - # in this product. - return 0; - } - - my ($cond, $values) = $self->_status_condition($old_status); - my ($transition_allowed) = Bugzilla->dbh->selectrow_array( - "SELECT 1 FROM status_workflow WHERE $cond", undef, @$values); - return $transition_allowed ? 1 : 0; -} - sub can_change_from { my $self = shift; my $dbh = Bugzilla->dbh; @@ -259,37 +242,6 @@ below. Returns: A list of Bugzilla::Status objects. -=item C - -=over - -=item B - -Tells you whether or not a change to this status from another status is -allowed. - -=item B - -=over - -=item C<$old_status> - The Bugzilla::Status you're changing from. - -=item C<$product> - A L representing the product of -the bug you're changing. Needed to check product-specific workflow -issues (such as whether or not the C status is enabled -in this product). - -=back - -=item B - -C<1> if you are allowed to change to this status from that status, or -C<0> if you aren't allowed. - -Note that changing from a status to itself is always allowed. - -=back - =item C =over -- cgit v1.2.3-24-g4f1b