summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-10-09 17:34:41 +0200
committerlpsolit%gmail.com <>2007-10-09 17:34:41 +0200
commit1b8e4cadbdab2e8a335c9f1186a301e493a9a8b3 (patch)
treefa2b295246b059f0a3524c74972566c14b59ce1f /Bugzilla
parent73553366455cb23a6df1847d67bde74386c87742 (diff)
downloadbugzilla-1b8e4cadbdab2e8a335c9f1186a301e493a9a8b3.tar.gz
bugzilla-1b8e4cadbdab2e8a335c9f1186a301e493a9a8b3.tar.xz
Bug 387672: Move BUG_STATE_OPEN and is_open_state() into Status.pm - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'Bugzilla')
-rwxr-xr-xBugzilla/Bug.pm13
-rw-r--r--Bugzilla/BugMail.pm3
-rw-r--r--Bugzilla/Config/BugChange.pm2
-rw-r--r--Bugzilla/Config/Common.pm2
-rw-r--r--Bugzilla/Search.pm2
-rw-r--r--Bugzilla/Search/Quicksearch.pm2
-rw-r--r--Bugzilla/Status.pm17
-rw-r--r--Bugzilla/Template.pm4
8 files changed, 23 insertions, 22 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index e1b4a6e55..c394ea8a8 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -53,7 +53,6 @@ use base qw(Bugzilla::Object Exporter);
bug_alias_to_id ValidateBugID
RemoveVotes CheckIfVotedConfirmed
LogActivityEntry
- BUG_STATE_OPEN is_open_state
editable_bug_fields
SPECIAL_STATUS_WORKFLOW_ACTIONS
);
@@ -223,12 +222,6 @@ use constant SPECIAL_STATUS_WORKFLOW_ACTIONS => qw(
clearresolution
);
-sub BUG_STATE_OPEN {
- # XXX - We should cache this list.
- my $dbh = Bugzilla->dbh;
- return @{$dbh->selectcol_arrayref('SELECT value FROM bug_status WHERE is_open = 1')};
-}
-
#####################################################################
sub new {
@@ -2428,12 +2421,6 @@ 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) = @_;
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index d29ffaf1e..e771a9876 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -40,6 +40,7 @@ use Bugzilla::Bug;
use Bugzilla::Classification;
use Bugzilla::Product;
use Bugzilla::Component;
+use Bugzilla::Status;
use Bugzilla::Mailer;
use Date::Parse;
@@ -308,7 +309,7 @@ sub Send {
}
$thisdiff .= FormatTriple($fielddescription{$what}, $old, $new);
if ($what eq 'bug_status'
- && Bugzilla::Bug::is_open_state($old) ne Bugzilla::Bug::is_open_state($new))
+ && is_open_state($old) ne is_open_state($new))
{
$interestingchange = 1;
}
diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm
index 65b2aec96..aec6e2428 100644
--- a/Bugzilla/Config/BugChange.pm
+++ b/Bugzilla/Config/BugChange.pm
@@ -48,7 +48,7 @@ sub get_param_list {
# and bug_status.is_open is not yet defined (hence the eval), so we use
# the bug statuses above as they are still hardcoded.
eval {
- my @current_closed_states = map {$_->name} Bugzilla::Status::closed_bug_statuses();
+ my @current_closed_states = map {$_->name} closed_bug_statuses();
# If no closed state was found, use the default list above.
@closed_bug_statuses = @current_closed_states if scalar(@current_closed_states);
};
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 2e5e7d15d..03e97d6a1 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -170,7 +170,7 @@ sub check_opsys {
sub check_bug_status {
my $bug_status = shift;
- my @closed_bug_statuses = map {$_->name} Bugzilla::Status::closed_bug_statuses();
+ my @closed_bug_statuses = map {$_->name} closed_bug_statuses();
if (lsearch(\@closed_bug_statuses, $bug_status) < 0) {
return "Must be a valid closed status: one of " . join(', ', @closed_bug_statuses);
}
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 33ccc9d9e..bb6d9af34 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -40,7 +40,7 @@ use Bugzilla::Constants;
use Bugzilla::Group;
use Bugzilla::User;
use Bugzilla::Field;
-use Bugzilla::Bug;
+use Bugzilla::Status;
use Bugzilla::Keyword;
use Date::Format;
diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm
index 884479e50..b9bd4a6ae 100644
--- a/Bugzilla/Search/Quicksearch.pm
+++ b/Bugzilla/Search/Quicksearch.pm
@@ -26,7 +26,7 @@ use strict;
use Bugzilla::Error;
use Bugzilla::Constants;
use Bugzilla::Keyword;
-use Bugzilla::Bug;
+use Bugzilla::Status;
use Bugzilla::Field;
use Bugzilla::Util;
diff --git a/Bugzilla/Status.pm b/Bugzilla/Status.pm
index 9af0f043c..65baf04b8 100644
--- a/Bugzilla/Status.pm
+++ b/Bugzilla/Status.pm
@@ -22,7 +22,8 @@ use strict;
package Bugzilla::Status;
-use base qw(Bugzilla::Object);
+use base qw(Bugzilla::Object Exporter);
+@Bugzilla::Status::EXPORT = qw(BUG_STATE_OPEN is_open_state closed_bug_statuses);
################################
##### Initialization #####
@@ -54,6 +55,18 @@ sub is_open { return $_[0]->{'is_open'}; }
##### Methods ####
###############################
+sub BUG_STATE_OPEN {
+ # XXX - We should cache this list.
+ my $dbh = Bugzilla->dbh;
+ return @{$dbh->selectcol_arrayref('SELECT value FROM bug_status WHERE is_open = 1')};
+}
+
+# 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 closed_bug_statuses {
my @bug_statuses = Bugzilla::Status->get_all;
@bug_statuses = grep { !$_->is_open } @bug_statuses;
@@ -154,7 +167,7 @@ Bugzilla::Status - Bug status class.
my $bug_status = new Bugzilla::Status({name => 'ASSIGNED'});
my $bug_status = new Bugzilla::Status(4);
- my @closed_bug_statuses = Bugzilla::Status::closed_bug_statuses();
+ my @closed_bug_statuses = closed_bug_statuses();
Bugzilla::Status::add_missing_bug_status_transitions($bug_status);
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index d8e23c939..0f08662e0 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -40,9 +40,9 @@ use Bugzilla::Install::Util qw(template_include_path);
use Bugzilla::Util;
use Bugzilla::User;
use Bugzilla::Error;
-use MIME::Base64;
-use Bugzilla::Bug;
+use Bugzilla::Status;
+use MIME::Base64;
# for time2str - replace by TT Date plugin??
use Date::Format ();
use File::Find;