X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FApproval%2FRule%2FRejected.pm;h=0a025684f0009743c47e8e2b8d8effd2edb8ca6a;hb=679854b8bbc65d112071111bbd7f34a6a481fb30;hp=b10f5f0ea676be2897c180dc9b7b1957d4443d5f;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/lib/RT/Approval/Rule/Rejected.pm b/rt/lib/RT/Approval/Rule/Rejected.pm index b10f5f0ea..0a025684f 100644 --- a/rt/lib/RT/Approval/Rule/Rejected.pm +++ b/rt/lib/RT/Approval/Rule/Rejected.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -65,14 +65,7 @@ sub Commit { # XXX: from custom prepare code my $self = shift; if ( my ($rejected) = $self->TicketObj->AllDependedOnBy( Type => 'ticket' ) ) { - my $note = ''; - if ( RT->Config->Get('ApprovalRejectionNotes') ) { - my $t = $self->TicketObj->Transactions; - while ( my $o = $t->Next ) { - next unless $o->Type eq 'Correspond'; - $note .= $o->Content . "\n" if $o->ContentObj; - } - } + my $note = $self->GetNotes; my $template = $self->GetTemplate('Approval Rejected', TicketObj => $rejected, @@ -82,7 +75,7 @@ sub Commit { # XXX: from custom prepare code $rejected->Correspond( MIMEObj => $template->MIMEObj ); $rejected->SetStatus( - Status => 'rejected', + Status => $rejected->QueueObj->Lifecycle->DefaultStatus('denied') || 'rejected', Force => 1, ); } @@ -112,4 +105,20 @@ sub Commit { # XXX: from custom prepare code } +sub GetNotes { + my $self = shift; + my $note = ''; + + if ( RT->Config->Get('ApprovalRejectionNotes') ) { + my $t = $self->TicketObj->Transactions; + while ( my $o = $t->Next ) { + next unless $o->Type eq 'Correspond'; + $note .= $o->Content . "\n" if $o->ContentObj; + } + } + return $note; +} + +RT::Base->_ImportOverlays(); + 1;