#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
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,
$rejected->Correspond( MIMEObj => $template->MIMEObj );
$rejected->SetStatus(
- Status => 'rejected',
+ Status => $rejected->LifecycleObj->DefaultStatus('denied') || 'rejected',
Force => 1,
);
}
}
+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;