#
# 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)
sub Commit {
my $self = shift;
- my $note;
- 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 ($top) = $self->TicketObj->AllDependedOnBy( Type => 'ticket' );
my $links = $self->TicketObj->DependedOnBy;
}
}
- $obj->SetStatus( Status => 'open', Force => 1 );
+ $obj->SetStatus( Status => $obj->FirstActiveStatus, Force => 1 )
+ if $obj->FirstActiveStatus;
}
my $passed = !$top->HasUnresolvedDependencies( Type => 'approval' );
$top->Correspond( MIMEObj => $template->MIMEObj );
if ($passed) {
+ my $new_status = $top->LifecycleObj->DefaultStatus('approved') || 'open';
+ if ( $new_status ne $top->Status ) {
+ $top->SetStatus( $new_status );
+ }
+
$self->RunScripAction('Notify Owner', 'Approval Ready for Owner',
TicketObj => $top);
}
return;
}
+sub GetNotes {
+ my $self = shift;
+ my $t = $self->TicketObj->Transactions;
+ my $note = '';
+
+ while ( my $o = $t->Next ) {
+ next unless $o->Type eq 'Correspond';
+ $note .= $o->Content . "\n" if $o->ContentObj;
+ }
+ return $note;
+
+}
+
+RT::Base->_ImportOverlays();
+
1;