From 93ed3ae8b3523b9e62597d1cc49de1f715648925 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Tue, 7 Mar 2006 05:42:09 +0000 Subject: Bug 282628: Move OpenStates and IsOpenedState out of globals.pl Patch By Max Kanat-Alexander r=wicked, a=myk --- Bugzilla/Bug.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index f297ec681..43f5a1285 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -54,6 +54,7 @@ use base qw(Exporter); bug_alias_to_id ValidateBugAlias ValidateBugID RemoveVotes CheckIfVotedConfirmed LogActivityEntry + is_open_state ); ##################################################################### @@ -203,7 +204,7 @@ sub initBug { } $self->{'isunconfirmed'} = ($self->{bug_status} eq 'UNCONFIRMED'); - $self->{'isopened'} = &::IsOpenedState($self->{bug_status}); + $self->{'isopened'} = is_open_state($self->{bug_status}); return $self; } @@ -758,6 +759,12 @@ sub EmitDependList { return $list_ref; } +# Tells you whether or not the argument is a valid "open" state. +sub is_open_state { + my ($state) = @_; + return (grep($_ eq $state, BUG_STATE_OPEN) ? 1 : 0); +} + sub ValidateTime { my ($time, $field) = @_; @@ -979,7 +986,7 @@ sub CountOpenDependencies { "FROM bugs, dependencies " . "WHERE blocked IN (" . (join "," , @bug_list) . ") " . "AND bug_id = dependson " . - "AND bug_status IN ('" . (join "','", &::OpenStates()) . "') " . + "AND bug_status IN ('" . (join "','", BUG_STATE_OPEN) . "') " . $dbh->sql_group_by('blocked')); $sth->execute(); -- cgit v1.2.3-24-g4f1b