Bug 338796: Remove get_product_* from globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=justdave

git-svn-id: svn://10.0.0.236/trunk@200219 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
lpsolit%gmail.com
2006-06-17 23:12:36 +00:00
parent 47f7d2f429
commit eba2e330c1
10 changed files with 100 additions and 139 deletions

View File

@@ -33,6 +33,7 @@ use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin);
use Bugzilla::Group;
use Bugzilla::Product;
use Bugzilla::User;
require "globals.pl";
@@ -364,7 +365,7 @@ if ($action eq 'del') {
my $hasbugs = scalar(@$bug_ids) ? 1 : 0;
my $buglist = join(',', @$bug_ids);
my $hasproduct = get_product_id($name) ? 1 : 0;
my $hasproduct = Bugzilla::Product->new({'name' => $name}) ? 1 : 0;
my $hasflags = $dbh->selectrow_array('SELECT 1 FROM flagtypes
WHERE grant_group_id = ?
@@ -436,7 +437,9 @@ if ($action eq 'delete') {
$cantdelete = 1;
}
if (get_product_id($name) && !defined $cgi->param('unbind')) {
if (Bugzilla::Product->new({'name' => $name})
&& !defined $cgi->param('unbind'))
{
$cantdelete = 1;
}