summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorjustdave%syndicomm.com <>2004-03-18 14:55:41 +0100
committerjustdave%syndicomm.com <>2004-03-18 14:55:41 +0100
commit39a329b9ac46424a4552e8c68e44467173a8238c (patch)
tree57da556be3e1e1e7106e314738b4a9cf1e378703 /globals.pl
parent3d59b2bd807ec35c511fd76df11b2cbb61289242 (diff)
downloadbugzilla-39a329b9ac46424a4552e8c68e44467173a8238c.tar.gz
bugzilla-39a329b9ac46424a4552e8c68e44467173a8238c.tar.xz
Bug 24496: Adds a parameter "noresolveonopenblockers" which when enabled, prevents bugs from being closed if there are any bugs blocking it which are still open.
Patch by Andreas Höfler <andreas.hoefler@bearingpoint.com> r= justdave, a= myk
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/globals.pl b/globals.pl
index 399482caa..019d6d972 100644
--- a/globals.pl
+++ b/globals.pl
@@ -1069,6 +1069,38 @@ sub GetBugLink {
}
}
+# CountOpenDependencies counts the number of open dependent bugs for a
+# list of bugs and returns a list of bug_id's and their dependency count
+# It takes one parameter:
+# - A list of bug numbers whose dependencies are to be checked
+
+sub CountOpenDependencies {
+ my (@bug_list) = @_;
+ my @dependencies;
+
+ # Make sure any unfetched data from a currently running query
+ # is saved off rather than overwritten
+ PushGlobalSQLState();
+
+ SendSQL("SELECT blocked, count(bug_status) " .
+ "FROM bugs, dependencies " .
+ "WHERE blocked IN (" . (join "," , @bug_list) . ") " .
+ "AND bug_id = dependson " .
+ "AND bug_status IN ('" . (join "','", OpenStates()) . "') " .
+ "GROUP BY blocked ");
+
+ while (MoreSQLData()) {
+ my ($bug_id, $dependencies) = FetchSQLData();
+ push(@dependencies, { bug_id => $bug_id,
+ dependencies => $dependencies });
+ }
+
+ # All done with this sidetrip
+ PopGlobalSQLState();
+
+ return @dependencies;
+}
+
sub GetLongDescriptionAsText {
my ($id, $start, $end) = (@_);
my $result = "";