diff options
Diffstat (limited to 'rt/lib/RT/Approval')
-rw-r--r-- | rt/lib/RT/Approval/Rule/Created.pm | 2 | ||||
-rw-r--r-- | rt/lib/RT/Approval/Rule/NewPending.pm | 2 | ||||
-rw-r--r-- | rt/lib/RT/Approval/Rule/Passed.pm | 23 | ||||
-rw-r--r-- | rt/lib/RT/Approval/Rule/Rejected.pm | 25 |
4 files changed, 37 insertions, 15 deletions
diff --git a/rt/lib/RT/Approval/Rule/Created.pm b/rt/lib/RT/Approval/Rule/Created.pm index 324061e88..40382f9ef 100644 --- a/rt/lib/RT/Approval/Rule/Created.pm +++ b/rt/lib/RT/Approval/Rule/Created.pm @@ -68,4 +68,6 @@ sub Commit { $self->RunScripAction('Open Tickets' => 'Blank'); } +RT::Base->_ImportOverlays(); + 1; diff --git a/rt/lib/RT/Approval/Rule/NewPending.pm b/rt/lib/RT/Approval/Rule/NewPending.pm index 6d93d8252..026f7e680 100644 --- a/rt/lib/RT/Approval/Rule/NewPending.pm +++ b/rt/lib/RT/Approval/Rule/NewPending.pm @@ -94,4 +94,6 @@ sub Commit { } +RT::Base->_ImportOverlays(); + 1; diff --git a/rt/lib/RT/Approval/Rule/Passed.pm b/rt/lib/RT/Approval/Rule/Passed.pm index 1618e6e8f..e0560bac1 100644 --- a/rt/lib/RT/Approval/Rule/Passed.pm +++ b/rt/lib/RT/Approval/Rule/Passed.pm @@ -62,13 +62,7 @@ sub Prepare { 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; @@ -108,4 +102,19 @@ sub Commit { 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; diff --git a/rt/lib/RT/Approval/Rule/Rejected.pm b/rt/lib/RT/Approval/Rule/Rejected.pm index b10f5f0ea..a97cf47b2 100644 --- a/rt/lib/RT/Approval/Rule/Rejected.pm +++ b/rt/lib/RT/Approval/Rule/Rejected.pm @@ -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, @@ -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; |