From: Penny Leach Date: Thu, 23 Jul 2009 09:03:02 +0000 (+0200) Subject: Add DefaultNewStatus config option so I don't have to use 'new' X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ecf025a8719903ee82689eb78e2374f32660ab32;p=cil.git Add DefaultNewStatus config option so I don't have to use 'new' --- diff --git a/lib/CIL.pm b/lib/CIL.pm index 327adc6..d6360b5 100644 --- a/lib/CIL.pm +++ b/lib/CIL.pm @@ -41,16 +41,18 @@ __PACKAGE__->mk_accessors(qw( IssueDir StatusStrict StatusAllowed StatusOpen StatusClosed LabelStrict LabelAllowed + DefaultNewStatus VCS vcs hook vcs_revision )); my $defaults = { - IssueDir => 'issues', # the dir to save the issues in - StatusStrict => 0, # whether to complain if a status is invalid - LabelStrict => 0, # whether to complain if a label is invalid - VCS => 'Null', # don't do anything for VCS hooks + IssueDir => 'issues', # the dir to save the issues in + StatusStrict => 0, # whether to complain if a status is invalid + LabelStrict => 0, # whether to complain if a label is invalid + DefaultNewStatus => 'New', # What Status to use for new issues by default + VCS => 'Null', # don't do anything for VCS hooks }; my @config_hashes = qw(StatusAllowed StatusOpen StatusClosed LabelAllowed); @@ -287,6 +289,8 @@ sub read_config_file { $self->LabelStrict( $cfg->{LabelStrict} ); $self->LabelAllowed( $cfg->{LabelAllowed} ); + $self->DefaultNewStatus( $cfg->{DefaultNewStatus} ); + # if we are allowed this VCS, create the hook instance $self->VCS( $cfg->{VCS} || 'Null' ); my $vcs = CIL::VCS::Factory->new( $cfg->{VCS} ); diff --git a/lib/CIL/Command/Add.pm b/lib/CIL/Command/Add.pm index de8a9e2..18ff0bb 100644 --- a/lib/CIL/Command/Add.pm +++ b/lib/CIL/Command/Add.pm @@ -39,7 +39,7 @@ sub run { my $issue = CIL::Issue->new('tmpname'); $issue->Summary( join ' ', @argv ); - $issue->Status('New'); + $issue->Status($cil->DefaultNewStatus); $issue->CreatedBy( $user ); $issue->AssignedTo( $user ) if $args->{mine}; diff --git a/lib/CIL/Command/Am.pm b/lib/CIL/Command/Am.pm index bff0531..4f6d2dd 100644 --- a/lib/CIL/Command/Am.pm +++ b/lib/CIL/Command/Am.pm @@ -115,7 +115,7 @@ sub run { # no issue found so make up the issue first my $issue = CIL::Issue->new('tmpname'); $issue->Summary( $subject ); - $issue->Status( 'New' ); + $issue->Status($cil->DefaultNewStatus); $issue->CreatedBy( $from ); $issue->AssignedTo( CIL::Utils->user($cil) ); $issue->Inserted( $date ); diff --git a/lib/CIL/Command/Init.pm b/lib/CIL/Command/Init.pm index 76ee893..3bc33c1 100644 --- a/lib/CIL/Command/Init.pm +++ b/lib/CIL/Command/Init.pm @@ -84,6 +84,7 @@ StatusAllowedList: Finished StatusOpenList: New StatusOpenList: InProgress StatusClosedList: Finished +DefaultNewStatus: New LabelStrict: 1 LabelAllowedList: Type-Enhancement LabelAllowedList: Type-Defect