[Rt-commit] [rtir] 03/03: RTIR now has the standard Forward

Kevin Falcone falcone at bestpractical.com
Tue Jul 22 12:34:51 EDT 2014


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 3.2/core-forward
in repository rtir.

commit 3778ab174eb9a8604668ff668f7991fabe3bb8ac
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Jul 22 12:28:09 2014 -0400

    RTIR now has the standard Forward
    
    For some reason, RTIR only had "forward transaction" despite RT 3.8
    shipping with both "forward ticket" and "forward transaction".  This
    went unfixed because it was a copy of old code.  Remove the copied code,
    add a top level actions Forward and take advantage of just passing
    through to the core code.
    
    Fixes issues #23511
---
 html/Callbacks/RTIR/Elements/Tabs/Privileged |  4 ++
 html/RTIR/Forward.html                       | 64 +---------------------------
 2 files changed, 5 insertions(+), 63 deletions(-)

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 8f9fa3d..cdf1973 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -230,6 +230,10 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
         }
     }
 
+    if ( $can->('ForwardMessage') ) {
+        $actions_tab->child( forward => title => loc('Forward'), path => "/RTIR/Forward.html?id=" . $id );
+    }
+
     my $i = 0;
     my $status = $ticket->Status;
     my $lifecycle = $queue->LifecycleObj;
diff --git a/html/RTIR/Forward.html b/html/RTIR/Forward.html
index c3be0c1..6e96053 100644
--- a/html/RTIR/Forward.html
+++ b/html/RTIR/Forward.html
@@ -45,66 +45,4 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<& /RTIR/Elements/Header, Title => $Title &>
-<& /Elements/Tabs &>
-<& /Elements/ListActions, actions => \@results &>
-
-<form action="Forward.html" name="ForwardMessage" method="post">
-% $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS );
-<input type="hidden" class="hidden" name="id" value="<% $id %>" /><br />
-<input type="hidden" class="hidden" name="QuoteTransaction" value="<% $ARGS{'QuoteTransaction'} %>" />
-
-<table width="100%">
-
-<tr class="subject">
-  <td class="label"><&|/l&>Subject</&>:</td>
-  <td class="value"><% $TicketObj->Subject %></td>
-</tr>
-
-% foreach my $field (qw(To Cc Bcc)) {
-<tr class="<% lc $field %>">
-  <td class="label"><% loc($field) %>:</td>
-  <td class="value"><& /Elements/EmailInput,
-    Name => $field, Default => $ARGS{ $field }, Size => undef,
-  &></td>
-</tr>
-% }
-
-</table>
-
-<& /Elements/Submit, Label => loc('Forward Message'), Name => 'Forward' &>
-</form>
-<%INIT>
-my $TicketObj = LoadTicket($id);
-$id = $ARGS{'id'} = $TicketObj->id;
-
-Abort( loc("Permission denied") )
-    unless $TicketObj->CurrentUserHasRight('ForwardMessage');
-
-my $Type = RT::IR::TicketType( Ticket => $TicketObj );
-
-my $txn = RT::Transaction->new( $session{'CurrentUser'} );
-$txn->Load( $QuoteTransaction );
-Abort( loc("Couldn't load transaction #[_1]", $QuoteTransaction) )
-    unless $txn->id;
-
-my @results;
-if ( $ARGS{'Forward'} ) {
-    require RT::Interface::Email;
-    my ($status, $msg) = RT::Interface::Email::ForwardTransaction( $txn, %ARGS );
-    push @results, $msg;
-
-    MaybeRedirectForResults(
-        Actions   => \@results,
-        Arguments => { id => $TicketObj->id, QuoteTransaction => $QuoteTransaction },
-    );
-}
-
-my $Title = loc('Forward message');
-
-</%INIT>
-
-<%ARGS>
-$id => undef
-$QuoteTransaction => undef
-</%ARGS>
+<& /Ticket/Forward.html, %ARGS &>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list