summaryrefslogtreecommitdiffstats
path: root/extensions/ProductDashboard/lib/Util.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-08-10 20:56:20 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-08-10 20:56:20 +0200
commit3524a4610f7355d1e055eb4a0dccb71ccecefc33 (patch)
treead0123e1c296733a7d8048afd8d0a91687906538 /extensions/ProductDashboard/lib/Util.pm
parent12070e973724b68444cb11d37bef8f0cf6e26c52 (diff)
downloadbugzilla-3524a4610f7355d1e055eb4a0dccb71ccecefc33.tar.gz
bugzilla-3524a4610f7355d1e055eb4a0dccb71ccecefc33.tar.xz
small changes to Product Dashboard
Diffstat (limited to 'extensions/ProductDashboard/lib/Util.pm')
-rw-r--r--extensions/ProductDashboard/lib/Util.pm26
1 files changed, 23 insertions, 3 deletions
diff --git a/extensions/ProductDashboard/lib/Util.pm b/extensions/ProductDashboard/lib/Util.pm
index ad46ef8f6..d83ddf187 100644
--- a/extensions/ProductDashboard/lib/Util.pm
+++ b/extensions/ProductDashboard/lib/Util.pm
@@ -13,8 +13,10 @@ use base qw(Exporter);
bug_link_all
bug_link_open
bug_link_closed
- open_states
+ open_states
closed_states
+ quoted_open_states
+ quoted_closed_states
filter_bugs
bug_milestone_link_total
bug_milestone_link_open
@@ -24,14 +26,32 @@ use base qw(Exporter);
use Bugzilla::Status;
use Bugzilla::Util;
+use Bugzilla::Status;
+
+our $_open_states;
sub open_states {
+ $_open_states ||= Bugzilla::Status->match({ is_open => 1, isactive => 1 });
+ return wantarray ? @$_open_states : $_open_states;
+}
+
+our $_quoted_open_states;
+sub quoted_open_states {
my $dbh = Bugzilla->dbh;
- return join(",", map { $dbh->quote($_) } BUG_STATE_OPEN);
+ $_quoted_open_states ||= [ map { $dbh->quote($_->name) } open_states() ];
+ return wantarray ? @$_quoted_open_states : $_quoted_open_states;
}
+our $_closed_states;
sub closed_states {
+ $_closed_states ||= Bugzilla::Status->match({ is_open => 0, isactive => 1 });
+ return wantarray ? @$_closed_states : $_closed_states;
+}
+
+our $_quoted_closed_states;
+sub quoted_closed_states {
my $dbh = Bugzilla->dbh;
- return join(",", map { $dbh->quote($_->name) } closed_bug_statuses());
+ $_quoted_closed_states ||= [ map { $dbh->quote($_->name) } closed_states() ];
+ return wantarray ? @$_quoted_closed_states : $_quoted_closed_states;
}
sub bug_link_all {