summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Component.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-07-25 08:22:53 +0200
committerlpsolit%gmail.com <>2006-07-25 08:22:53 +0200
commit2904ac3261ff9bb59e29b74d55d4ada294986ffe (patch)
treec3c5b3a99f23f76502eac1e652044a550ba19371 /Bugzilla/Component.pm
parentbea873a66d06670af744b29d9e8d357ae3b5ceed (diff)
downloadbugzilla-2904ac3261ff9bb59e29b74d55d4ada294986ffe.tar.gz
bugzilla-2904ac3261ff9bb59e29b74d55d4ada294986ffe.tar.xz
Bug 174039: Set flags on bug entry - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap r=myk a=myk
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r--Bugzilla/Component.pm32
1 files changed, 31 insertions, 1 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm
index 827be789d..abd3711f5 100644
--- a/Bugzilla/Component.pm
+++ b/Bugzilla/Component.pm
@@ -13,7 +13,7 @@
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Tiago R. Mello <timello@async.com.br>
-#
+# Frédéric Buclin <LpSolit@gmail.com>
use strict;
@@ -22,6 +22,7 @@ package Bugzilla::Component;
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User;
+use Bugzilla::FlagType;
###############################
#### Initialization ####
@@ -135,6 +136,24 @@ sub default_qa_contact {
return $self->{'default_qa_contact'};
}
+sub flag_types {
+ my $self = shift;
+
+ if (!defined $self->{'flag_types'}) {
+ $self->{'flag_types'} = {};
+ $self->{'flag_types'}->{'bug'} =
+ Bugzilla::FlagType::match({ 'target_type' => 'bug',
+ 'product_id' => $self->product_id,
+ 'component_id' => $self->id });
+
+ $self->{'flag_types'}->{'attachment'} =
+ Bugzilla::FlagType::match({ 'target_type' => 'attachment',
+ 'product_id' => $self->product_id,
+ 'component_id' => $self->id });
+ }
+ return $self->{'flag_types'};
+}
+
###############################
#### Accessors ####
###############################
@@ -193,6 +212,8 @@ Bugzilla::Component - Bugzilla product component class.
my $product_id = $component->product_id;
my $default_assignee = $component->default_assignee;
my $default_qa_contact = $component->default_qa_contact;
+ my $bug_flag_types = $component->flag_types->{'bug'};
+ my $attach_flag_types = $component->flag_types->{'attachment'};
my $component = Bugzilla::Component::check_component($product, 'AcmeComp');
@@ -252,6 +273,15 @@ Component.pm represents a Product Component object.
Returns: A Bugzilla::User object.
+=item C<flag_types()>
+
+ Description: Returns all bug and attachment flagtypes available for
+ the component.
+
+ Params: none.
+
+ Returns: Two references to an array of flagtype objects.
+
=back
=head1 SUBROUTINES