summaryrefslogtreecommitdiff
path: root/lib/CIL
diff options
context:
space:
mode:
authorAndrew Chilton <andychilton@gmail.com>2008-07-04 16:17:34 +1200
committerAndrew Chilton <andychilton@gmail.com>2008-07-04 16:21:29 +1200
commit2979e8914aa542a20cbf07e8f7812e293ad0699d (patch)
treed2032a7117a0efc566ff0e50408b2068cd006af2 /lib/CIL
parent41ec963c1aace994072b6d62b20cdce5370e0e8e (diff)
parentf6649a52ff5610af925818cddd720fa5945bd6b3 (diff)
Merge branch 'upstream'
Diffstat (limited to 'lib/CIL')
-rw-r--r--lib/CIL/Issue.pm46
1 files changed, 40 insertions, 6 deletions
diff --git a/lib/CIL/Issue.pm b/lib/CIL/Issue.pm
index d44626e..eff317f 100644
--- a/lib/CIL/Issue.pm
+++ b/lib/CIL/Issue.pm
@@ -31,14 +31,16 @@ use CIL::Utils;
use base qw(CIL::Base);
# fields specific to Issue
-__PACKAGE__->mk_accessors(qw(Summary Status AssignedTo Label Comment Attachment Description));
+__PACKAGE__->mk_accessors(qw(Summary Status AssignedTo DependsOn Precedes Label Comment Attachment Description));
-my @FIELDS = ( qw(Summary Status CreatedBy AssignedTo Label Comment Attachment Inserted Updated Description) );
+my @FIELDS = ( qw(Summary Status CreatedBy AssignedTo DependsOn Precedes Label Comment Attachment Inserted Updated Description) );
my $cfg = {
array => {
Label => 1,
Comment => 1,
Attachment => 1,
+ DependsOn => 1,
+ Precedes => 1,
},
};
@@ -65,6 +67,8 @@ sub new {
Label => [],
Comment => [],
Attachment => [],
+ DependsOn => [],
+ Precedes => [],
Description => '',
};
$self->{Changed} = 0;
@@ -109,7 +113,7 @@ sub is_valid {
# see if we only allow certain Labels
if ( $cil->LabelStrict ) {
- my @labels = @{$self->Labels};
+ my @labels = @{$self->LabelList};
foreach my $label ( @labels ) {
unless ( exists $cil->LabelAllowed()->{$label} ) {
push @errors, "LabelStrict is turned on but this issue has an invalid label '$label'";
@@ -155,21 +159,51 @@ sub add_attachment {
$self->flag_as_updated();
}
-sub Labels {
+sub add_depends_on {
+ my ($self, $depends) = @_;
+
+ croak 'provide an issue name when adding a depends'
+ unless defined $depends;
+
+ push @{$self->{data}{DependsOn}}, $depends;
+ $self->flag_as_updated();
+}
+
+sub add_precedes {
+ my ($self, $precedes) = @_;
+
+ croak 'provide an issue name when adding a precedes'
+ unless defined $precedes;
+
+ push @{$self->{data}{Precedes}}, $precedes;
+ $self->flag_as_updated();
+}
+
+sub LabelList {
my ($self) = @_;
return $self->{data}{Label};
}
-sub Comments {
+sub CommentList {
my ($self) = @_;
return $self->{data}{Comment};
}
-sub Attachments {
+sub AttachmentList {
my ($self) = @_;
return $self->{data}{Attachment};
}
+sub DependsOnList {
+ my ($self) = @_;
+ return $self->{data}{DependsOn};
+}
+
+sub PrecedesList {
+ my ($self) = @_;
+ return $self->{data}{Precedes};
+}
+
sub is_open {
my ($self, $cil) = @_;