]> git.mjollnir.org Git - cil.git/commitdiff
Add an AssignedTo field
authorAndrew Chilton <andychilton@gmail.com>
Mon, 5 May 2008 12:56:31 +0000 (00:56 +1200)
committerAndrew Chilton <andychilton@gmail.com>
Mon, 5 May 2008 12:56:31 +0000 (00:56 +1200)
bin/cil
lib/CIL/Issue.pm

diff --git a/bin/cil b/bin/cil
index 61f1a95ce8aefaaca14e3e9ef5a3be78ea388ffd..596b3e524e9b74db7a318cd99d63ba0e9bc48da1 100755 (executable)
--- a/bin/cil
+++ b/bin/cil
@@ -44,6 +44,7 @@ my $new_issue_text = <<"EOF";
 Summary     =
 Status      =New
 CreatedBy   =$gan <$gae>
+AssignedTo  =$gan <$gae>
 Labels      =
 Description = <<END_OF_DESCRIPTION
 
@@ -218,6 +219,7 @@ sub edit {
     my $summary     = $issue->Summary;
     my $status      = $issue->Status;
     my $created_by  = $issue->CreatedBy;
+    my $assigned_to = $issue->AssignedTo;
     my $labels      = $issue->Labels;
     my $description = $issue->Description;
 
@@ -228,6 +230,7 @@ sub edit {
 Summary     = $summary
 Status      = $status
 CreatedBy   = $created_by
+AssignedTo  = $assigned_to
 Labels      = $labels
 Description = <<END_OF_DESCRIPTION
 $description
@@ -249,7 +252,7 @@ EOF
     }
 
     # for the fields we're interested in, set them
-    foreach my $field ( qw(Summary Status CreatedBy Labels Description) ) {
+    foreach my $field ( qw(Summary Status CreatedBy AssignedTo Labels Description) ) {
         $issue->$field( $issue_edited->$field() );
     }
     if ( $issue->changed ) {
@@ -331,7 +334,7 @@ sub display_issue_summary {
     $msg .= "\t";
     $msg .= $issue->Status;
     $msg .= "\t";
-    $msg .= $issue->CreatedBy;
+    $msg .= $issue->AssignedTo;
     $msg .= "\t";
     $msg .= $issue->Summary;
 
@@ -345,6 +348,7 @@ sub display_issue_short {
     field( 'Summary', $issue->Summary() );
     field( 'Name', $issue->Name() );
     field( 'CreatedBy', $issue->CreatedBy() );
+    field( 'AssignedTo', $issue->AssignedTo() );
     field( 'Inserted', $issue->Inserted() );
     field( 'Status', $issue->Status() );
     field( 'Labels', $issue->Labels() );
@@ -359,6 +363,7 @@ sub display_issue_full {
     field( 'Name', $issue->Name() );
     field( 'Status', $issue->Status() );
     field( 'CreatedBy', $issue->CreatedBy() );
+    field( 'AssignedTo', $issue->AssignedTo() );
     field( 'Inserted', $issue->Inserted() );
     field( 'Updated', $issue->Inserted() );
     field( 'Labels', $issue->Labels() );
index d94e32ed0d2fde838fe45bb10af61dd4d2b41107..84b86ee76aafbe647ce65ce50e6cc71969583d26 100644 (file)
@@ -29,9 +29,9 @@ use Config::IniFiles;
 use YAML qw(LoadFile DumpFile);
 
 use base qw(CIL::Base);
-__PACKAGE__->mk_accessors(qw(Name Summary Status Labels Comments));
+__PACKAGE__->mk_accessors(qw(Name Summary AssignedTo Status Labels Comments));
 
-my @FIELDS = ( qw(Name Summary Description CreatedBy Status Labels Comments) );
+my @FIELDS = ( qw(Name Summary Description CreatedBy AssignedTo Status Labels Comments) );
 
 ## ----------------------------------------------------------------------------
 
@@ -63,7 +63,7 @@ sub new_load_issue {
     my $issue = CIL::Issue->new();
 
     # do the issue
-    foreach my $field ( qw(Summary Name Description CreatedBy Status Labels Inserted Updated) ) {
+    foreach my $field ( qw(Summary Name Description CreatedBy AssignedTo Status Labels Inserted Updated) ) {
         # modify the data directly, otherwise Updated will kick in
         $issue->{data}{$field} = $data->{$field};
     }
@@ -93,7 +93,7 @@ sub new_parse_issue {
     }
 
     my $issue = CIL::Issue->new();
-    foreach my $field ( qw(Summary Name Description CreatedBy Status Labels Inserted Updated) ) {
+    foreach my $field ( qw(Summary Name Description CreatedBy AssignedTo Status Labels Inserted Updated) ) {
         # modify the data directly, otherwise Updated will kick in
         my $value = $cfg->val( 'Issue', $field );
         next unless defined $value;