]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 337055: Move AnyDefaultGroups() from globals.pl into process_bug.cgi - Patch...
authorlpsolit%gmail.com <>
Fri, 19 May 2006 04:40:54 +0000 (04:40 +0000)
committerlpsolit%gmail.com <>
Fri, 19 May 2006 04:40:54 +0000 (04:40 +0000)
globals.pl
process_bug.cgi

index ad6cfd761ee7cb9451ebe4218d2c9aaa63626e4a..4798c2b49c52f4dec70cd226b18dfb4f0db51807 100644 (file)
@@ -185,25 +185,6 @@ sub GetVersionTable {
     $::VersionTableLoaded = 1;
 }
 
-# This function checks if there are any default groups defined.
-# If so, then groups may have to be changed when bugs move from
-# one bug to another.
-sub AnyDefaultGroups {
-    return $::CachedAnyDefaultGroups if defined($::CachedAnyDefaultGroups);
-    my $dbh = Bugzilla->dbh;
-    PushGlobalSQLState();
-    SendSQL("SELECT 1 FROM group_control_map, groups WHERE " .
-            "groups.id = group_control_map.group_id " .
-            "AND isactive != 0 AND " .
-            "(membercontrol = " . CONTROLMAPDEFAULT .
-            " OR othercontrol = " . CONTROLMAPDEFAULT .
-            ") " . $dbh->sql_limit(1));
-    $::CachedAnyDefaultGroups = MoreSQLData();
-    FetchSQLData();
-    PopGlobalSQLState();
-    return $::CachedAnyDefaultGroups;
-}
-
 sub DBID_to_name {
     my ($id) = (@_);
     return "__UNKNOWN__" if !defined $id;
index 8e93e3f09ed0e10f6041b7e66dae817b67b4def4..e92ec5acfb7a83116a6e66dd73e4f0865d21babb 100755 (executable)
@@ -99,6 +99,23 @@ sub BugInGroupId {
     return $in_group;
 }
 
+# This function checks if there are any default groups defined.
+# If so, then groups may have to be changed when bugs move from
+# one bug to another.
+sub AnyDefaultGroups {
+    my $dbh = Bugzilla->dbh;
+    my $any_default =
+        $dbh->selectrow_array('SELECT 1
+                                 FROM group_control_map
+                           INNER JOIN groups
+                                   ON groups.id = group_control_map.group_id
+                                WHERE isactive != 0
+                                  AND (membercontrol = ? OR othercontrol = ?) ' .
+                                 $dbh->sql_limit(1),
+                                 undef, (CONTROLMAPDEFAULT, CONTROLMAPDEFAULT));
+    return $any_default;
+}
+
 ######################################################################
 # Begin Data/Security Validation
 ######################################################################