summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authormkanat%kerio.com <>2006-03-07 06:42:09 +0100
committermkanat%kerio.com <>2006-03-07 06:42:09 +0100
commit93ed3ae8b3523b9e62597d1cc49de1f715648925 (patch)
tree691aa59ef033d8f23b920842558c68c52bae43f3 /Bugzilla/Bug.pm
parenteb411e0d6a8848ff925ca13f42a04da1a7591284 (diff)
downloadbugzilla-93ed3ae8b3523b9e62597d1cc49de1f715648925.tar.gz
bugzilla-93ed3ae8b3523b9e62597d1cc49de1f715648925.tar.xz
Bug 282628: Move OpenStates and IsOpenedState out of globals.pl
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=wicked, a=myk
Diffstat (limited to 'Bugzilla/Bug.pm')
-rwxr-xr-xBugzilla/Bug.pm11
1 files changed, 9 insertions, 2 deletions
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();