From: Andrew Chilton Date: Sat, 21 Jun 2008 11:17:13 +0000 (+1200) Subject: Make sure each comment knows who it's parent is. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=37a2611bacecbb705ec2c1b6a3831532750e20ea;p=cil.git Make sure each comment knows who it's parent is. --- diff --git a/bin/cil b/bin/cil index e0926fb..9ee4a0b 100755 --- a/bin/cil +++ b/bin/cil @@ -255,6 +255,9 @@ sub comment { # we've got the comment, so let's name it my $unique_str = $comment->Inserted . $issue->Description; $comment->set_name( substr(md5_hex($unique_str), 0, 8) ); + + # finally, tell it who it's parent is and then save + $comment->Issue( $issue->name ); $comment->save($cil); # add the comment to the issue, update it's timestamp and save it out @@ -325,7 +328,18 @@ sub display_issue { sub display_issue_full { my ($cil, $issue) = @_; - display_issue( $cil, $issue ); + separator(); + title( 'Issue ' . $issue->name() ); + field( 'Summary', $issue->Summary() ); + field( 'Status', $issue->Status() ); + field( 'CreatedBy', $issue->CreatedBy() ); + field( 'AssignedTo', $issue->AssignedTo() ); + field( 'Label', $_ ) + foreach sort @{$issue->Label()}; + field( 'Inserted', $issue->Inserted() ); + field( 'Updated', $issue->Inserted() ); + text('Description', $issue->Description()); + separator(); my $comments = $cil->get_comments_for( $issue ); foreach my $comment ( @$comments ) { diff --git a/issues/c_feb65ae7.cil b/issues/c_feb65ae7.cil index dcdfaf2..d4e89f3 100644 --- a/issues/c_feb65ae7.cil +++ b/issues/c_feb65ae7.cil @@ -1,4 +1,4 @@ -Issue: +Issue: 5c88cb30 CreatedBy: Andrew Chilton Inserted: 2008-06-21T10:57:47 Updated: 2008-06-21T10:57:47 diff --git a/lib/CIL/Comment.pm b/lib/CIL/Comment.pm index c046569..355466b 100644 --- a/lib/CIL/Comment.pm +++ b/lib/CIL/Comment.pm @@ -27,6 +27,7 @@ use Carp; use Config::IniFiles; use base qw(CIL::Base); +__PACKAGE__->mk_accessors(qw(Issue)); my @FIELDS = ( qw(Issue CreatedBy Inserted Updated Description) ); my $cfg = {