summaryrefslogtreecommitdiffstats
path: root/importxml.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-07-25 09:23:33 +0200
committerlpsolit%gmail.com <>2006-07-25 09:23:33 +0200
commit5ecf8a501a52ce675d9990ede5d165f789a7e1fc (patch)
treee72489d1b163186595e1ccf0e4ac1c7534184f72 /importxml.pl
parent43dd0fc1e7a1c6f601e30243b363b3e2f358f105 (diff)
downloadbugzilla-5ecf8a501a52ce675d9990ede5d165f789a7e1fc.tar.gz
bugzilla-5ecf8a501a52ce675d9990ede5d165f789a7e1fc.tar.xz
Bug 343810: Remove Bugzilla::FlagType::get() and implement real flagtype objects - Patch by Frédéric Buclin <LpSolit@gmail.com> a=myk
Diffstat (limited to 'importxml.pl')
-rwxr-xr-ximportxml.pl18
1 files changed, 8 insertions, 10 deletions
diff --git a/importxml.pl b/importxml.pl
index 4796f35fd..4ca9c8745 100755
--- a/importxml.pl
+++ b/importxml.pl
@@ -238,24 +238,24 @@ sub flag_handler {
# If this is the case, we will only match the first one.
my $ftype;
foreach my $f ( @{$flag_types} ) {
- if ( $f->{'name'} eq $name) {
+ if ( $f->name eq $name) {
$ftype = $f;
last;
}
}
if ($ftype) { # We found the flag in the list
- my $grant_gid = $ftype->{'grant_gid'};
+ my $grant_group = $ftype->grant_group;
if (( $status eq '+' || $status eq '-' )
- && $grant_gid && !$setter->in_group_id($grant_gid)) {
+ && $grant_group && !$setter->in_group_id($grant_group->id)) {
$err = "Setter $setter_login on $type flag $name ";
$err .= "is not in the Grant Group\n";
$err .= " Dropping flag $name\n";
return $err;
}
- my $request_gid = $ftype->{'request_gid'};
- if ($request_gid
- && $status eq '?' && !$setter->in_group_id($request_gid)) {
+ my $request_group = $ftype->request_group;
+ if ($request_group
+ && $status eq '?' && !$setter->in_group_id($request_group->id)) {
$err = "Setter $setter_login on $type flag $name ";
$err .= "is not in the Request Group\n";
$err .= " Dropping flag $name\n";
@@ -263,9 +263,7 @@ sub flag_handler {
}
# Take the first flag_type that matches
- my $ftypeid = $ftype->{'id'};
- my $is_active = $ftype->{'is_active'};
- unless ($is_active) {
+ unless ($ftype->is_active) {
$err = "Flag $name is not active in this database\n";
$err .= " Dropping flag $name\n";
return $err;
@@ -275,7 +273,7 @@ sub flag_handler {
(type_id, status, bug_id, attach_id, creation_date,
setter_id, requestee_id)
VALUES (?, ?, ?, ?, ?, ?, ?)", undef,
- ($ftypeid, $status, $bugid, $attachid, $timestamp,
+ ($ftype->id, $status, $bugid, $attachid, $timestamp,
$setter_id, $requestee_id));
}
else {