From 232d08fe800c1c36a9bb74953eeac2f4a2d188c3 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 19 May 2006 04:40:54 +0000 Subject: Bug 337055: Move AnyDefaultGroups() from globals.pl into process_bug.cgi - Patch by Frédéric Buclin r=mkanat a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- globals.pl | 19 ------------------- process_bug.cgi | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/globals.pl b/globals.pl index ad6cfd761..4798c2b49 100644 --- a/globals.pl +++ b/globals.pl @@ -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; diff --git a/process_bug.cgi b/process_bug.cgi index 8e93e3f09..e92ec5acf 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -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 ###################################################################### -- cgit v1.2.3-24-g4f1b