[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-977-gcea5aea

Alex Vandiver alexmv at bestpractical.com
Tue Sep 28 16:07:21 EDT 2010


The branch, 3.9-trunk has been updated
       via  cea5aea04139dd2a2af8e36e34340333f7ba1619 (commit)
      from  782dd4cd4fcbfb5735626585dccd15bfaa643a2d (commit)

Summary of changes:
 share/html/Ticket/Elements/PreviewScrips |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit cea5aea04139dd2a2af8e36e34340333f7ba1619
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Sep 28 15:55:47 2010 -0400

    Sort scrips with recipients before those without

diff --git a/share/html/Ticket/Elements/PreviewScrips b/share/html/Ticket/Elements/PreviewScrips
index 7027be0..27ec649 100755
--- a/share/html/Ticket/Elements/PreviewScrips
+++ b/share/html/Ticket/Elements/PreviewScrips
@@ -58,8 +58,13 @@ my %recips;
 </p>
 
 % if ( $Object and $Object->Scrips ) {
-%     for my $scrip (@{$Object->Scrips->Prepared}) {
-%         next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail');
+%     # Sort scrips with recipients before those without
+%     my @scrips = map { $_->[0] }
+%                  sort { ($b->[1]?1:0) <=> ($a->[1]?1:0) }
+%                  map { [$_, $_->ActionObj->Action->To + $_->ActionObj->Action->Cc + $_->ActionObj->Action->Bcc] }
+%                  grep {$_->ActionObj->Action->isa('RT::Action::SendEmail')}
+%                  @{$Object->Scrips->Prepared};
+%     for my $scrip (@scrips) {
           <b><% $scrip->Description || loc('Scrip #[_1]',$scrip->id) %></b><br />
           <&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&>
           <br />

-----------------------------------------------------------------------


More information about the Rt-commit mailing list