[Rt-commit] [rtir] 05/10: Start to replace passthrough to object-type specific components with redirects

Jesse Vincent jesse at bestpractical.com
Thu Feb 26 19:25:37 EST 2015


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

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit 5f3125b3c87d036a927a3e3e009bda798e5c6fbd
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Feb 26 15:48:20 2015 -0800

    Start to replace passthrough to object-type specific components with redirects
---
 html/RTIR/Display.html           | 4 ++--
 html/RTIR/Elements/ShowIncidents | 2 +-
 t/searches/simple.t              | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 13dce57..baddd6d 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -181,7 +181,7 @@ unless ( $id eq 'new' ) {
 
 my $Type = RT::IR::TicketType( Lifecycle => $QueueObj->Lifecycle );
 # If it's not an RTIR ticket type, just show the regular RT ticket display page
-return $m->comp( '/Ticket/Display.html', %ARGS ) unless $Type;
+RT::Interface::Web::Redirect(RT->Config->Get('WebURL').'Ticket/Display.html?'. $m->comp('/Elements/QueryString', %ARGS )) unless $Type;
 
 if ($QueueObj->Lifecycle eq RT::IR->lifecycle_countermeasure && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
     Abort(loc("Blocks queue is disabled via config file"));
@@ -189,7 +189,7 @@ if ($QueueObj->Lifecycle eq RT::IR->lifecycle_countermeasure && RT->Config->Get(
 
 # If there's an RTIR specific display page for this kind of ticket, show that
 if ( $m->comp_exists("/RTIR/$Type/Display.html") ) {
-    return $m->comp("/RTIR/$Type/Display.html", %ARGS);
+RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."RTIR/$Type/Display.html?".$m->comp('/Elements/QueryString', %ARGS ));
 }
 
 my @results;
diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index a78127d..a1d89fa 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -58,7 +58,7 @@
 % my $wp = RT->Config->Get('WebPath');
 % unless ( $action ) {
 <b><a href="<% $wp %>/RTIR/Link/ToIncident/?id=<% $id %>">[Link]</a></b>
-<b><a href="<% $wp %>/RTIR/Create.html?Child=<% $id %>&Lifecycle=incidents">[New]</a></b>
+<b><a href="<% $wp %>/RTIR/Incident/Create.html?Child=<% $id %>">[New]</a></b>
 % } elsif ( $action ne 'No' ) {
 <a href="<% $wp %>/RTIR/Display.html?Action=<% $action %>&id=<% $id %>">[<% loc( $action ) %>]</a>
 % }
diff --git a/t/searches/simple.t b/t/searches/simple.t
index 69840b6..512c35b 100644
--- a/t/searches/simple.t
+++ b/t/searches/simple.t
@@ -26,7 +26,7 @@ my $agent = default_agent();
     $agent->content_like(qr{test ir});
 
     $agent->get_ok( "/RTIR/index.html?q=$inc_id" );
-    is($agent->uri,$agent->rt_base_url."RTIR/Display.html?id=$inc_id","Directed to the Incident Page");
+    is($agent->uri,$agent->rt_base_url."RTIR/Incident/Display.html?id=$inc_id","Directed to the Incident Page");
 
     $agent->get_ok( "/RTIR/index.html?q=$ir_id" );
     is($agent->uri,$agent->rt_base_url."RTIR/Display.html?id=$ir_id","Directed to the Report Page");

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


More information about the rt-commit mailing list