[Rt-commit] [rtir] 05/06: Further porting to the new 'HREFTo' functionality
Jesse Vincent
jesse at bestpractical.com
Fri Mar 13 01:53:30 EDT 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 d74d940c7ad62777d5b295823e8a144ee9c4781e
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Thu Mar 12 22:49:57 2015 -0700
Further porting to the new 'HREFTo' functionality
---
html/Callbacks/RTIR/Ticket/Create.html/Default | 8 ++++----
html/Callbacks/RTIR/Ticket/Display.html/Initial | 6 ++++--
html/RTIR/Display.html | 9 ++++++---
html/RTIR/Edit.html | 7 ++++---
html/RTIR/Reporting/index.html | 6 +++---
html/RTIR/Search/Elements/ProcessQuery | 2 +-
html/RTIR/Split.html | 3 +--
html/RTIR/Tools/Lookup.html | 8 ++++----
html/RTIR/index.html | 6 +++---
9 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/html/Callbacks/RTIR/Ticket/Create.html/Default b/html/Callbacks/RTIR/Ticket/Create.html/Default
index 429807d..1c6a348 100644
--- a/html/Callbacks/RTIR/Ticket/Create.html/Default
+++ b/html/Callbacks/RTIR/Ticket/Create.html/Default
@@ -54,10 +54,10 @@ if ( grep !/^(id|results|Queue)$/, keys %$ARGSRef ) {
$m->abort;
}
-my $url = RT->Config->Get('WebURL') .'RTIR/Create.html?'
- . $m->comp('/Elements/QueryString', %$ARGSRef, Queue => $QueueObj->Name )
-;
-RT::Interface::Web::Redirect( $url );
+RT::Interface::Web::Redirect( RT::IR->HREFTo('Create.html?'
+ . $m->comp('/Elements/QueryString',
+ %$ARGSRef,
+ Queue => $QueueObj->Name )) );
</%INIT>
<%ARGS>
$QueueObj => undef
diff --git a/html/Callbacks/RTIR/Ticket/Display.html/Initial b/html/Callbacks/RTIR/Ticket/Display.html/Initial
index 5cca1d8..c23032f 100644
--- a/html/Callbacks/RTIR/Ticket/Display.html/Initial
+++ b/html/Callbacks/RTIR/Ticket/Display.html/Initial
@@ -70,9 +70,11 @@ if ( grep !/^(id|results)$/, keys %$ARGSRef ) {
}
# we should use redirect so tabs displayed correctly according to request_comp
-my $url = RT->Config->Get('WebURL') ."RTIR/Display.html?id=". $ARGSRef->{'id'};
-$url .= '&results='. $m->interp->apply_escapes( $ARGSRef->{'results'}, 'u' )
+my $url = RT::IR->HREFTo("Display.html?id=". $ARGSRef->{'id'});
+$url .= '&results='.
+ $m->interp->apply_escapes( $ARGSRef->{'results'}, 'u' )
if $ARGSRef->{'results'};
+
RT::Interface::Web::Redirect( $url );
</%INIT>
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 93c3852..0992c42 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -180,8 +180,11 @@ 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
-RT::Interface::Web::Redirect(RT->Config->Get('WebURL').'Ticket/Display.html?'. $m->comp('/Elements/QueryString', %ARGS )) unless $Type;
+# If it's not an RTIR ticket type, just show the regular
+# RT ticket display page
+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 +192,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") ) {
-RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."RTIR/$Type/Display.html?".$m->comp('/Elements/QueryString', %ARGS ));
+RT::Interface::Web::Redirect(RT::IR->HREFTo("$Type/Display.html?".$m->comp('/Elements/QueryString', %ARGS )));
}
my @results;
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index c82e21a..c3d33c1 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -168,7 +168,8 @@ $id = $ARGS{'id'} = $Ticket->Id;
$m->callback(CallbackName => 'Initial', %ARGS, Ticket => $Ticket);
my $Type = RT::IR::TicketType( Lifecycle => $Ticket->QueueObj->Lifecycle );
-# If it's not an RTIR ticket type, just show the regular RT ticket display page
+# If it's not an RTIR ticket type, just show the
+# regular RT ticket display page
RT::Interface::Web::Redirect(RT->Config->Get('WebURL').'Ticket/Display.html?'.
$m->comp('/Elements/QueryString', %ARGS )) unless $Type;
@@ -179,8 +180,8 @@ if ($Ticket->QueueObj->Lifecycle eq RT::IR->lifecycle_countermeasure
# If there's an RTIR specific display page for this kind of ticket, show that
if ( $m->comp_exists("/RTIR/$Type/Edit.html") ) {
- RT::Interface::Web::Redirect(RT->Config->Get('WebURL') . "RTIR/$Type/Edit.html?"
- . $m->comp('/Elements/QueryString', %ARGS ));
+RT::Interface::Web::Redirect(RT::IR->HREFTo("$Type/Edit.html?"
+ . $m->comp('/Elements/QueryString', %ARGS )));
}
my @results;
diff --git a/html/RTIR/Reporting/index.html b/html/RTIR/Reporting/index.html
index 7e5be01..07ece40 100644
--- a/html/RTIR/Reporting/index.html
+++ b/html/RTIR/Reporting/index.html
@@ -90,9 +90,9 @@ if ( $ARGS{'HTMLReport'} || $ARGS{'TextReport'} || $ARGS{'SpreadsheetReport'} )
my $ext = 'html';
$ext = 'txt' if $ARGS{'TextReport'};
$ext = 'tsv' if $ARGS{'SpreadsheetReport'};
- my $url = RT->Config->Get('WebURL') .'RTIR/Reporting/Report.'. $ext;
- $url .= "?". $m->comp( '/Elements/QueryString', %ARGS );
- return RT::Interface::Web::Redirect($url);
+
+ return RT::Interface::Web::Redirect(RT::IR->HREFTo('RTIR/Reporting/Report.'. $ext
+ . "?". $m->comp( '/Elements/QueryString', %ARGS )));
}
my $now = RT::Date->new(RT->SystemUser);
diff --git a/html/RTIR/Search/Elements/ProcessQuery b/html/RTIR/Search/Elements/ProcessQuery
index 3488038..2fb36dc 100644
--- a/html/RTIR/Search/Elements/ProcessQuery
+++ b/html/RTIR/Search/Elements/ProcessQuery
@@ -238,7 +238,7 @@ $session{'CurrentSearchHash'} = {
if ( $ARGS{"DoSearch"} ) {
$ResultPage .= $ResultPage =~ /\?/? '&': '?';
$ResultPage .= $m->comp('/Elements/QueryString', %query );
- return RT::Interface::Web::Redirect( RT->Config->Get('WebURL') . $ResultPage );
+ return RT::Interface::Web::Redirect( $ResultPage );
}
# }}}
diff --git a/html/RTIR/Split.html b/html/RTIR/Split.html
index 9df0e44..0fcc59c 100644
--- a/html/RTIR/Split.html
+++ b/html/RTIR/Split.html
@@ -77,8 +77,7 @@ $m->callback(CallbackName => 'Initial', %ARGS, Ticket => $TicketObj);
my $Type = RT::IR::TicketType( Ticket => $TicketObj );
if ( $m->comp_exists("/RTIR/$Type/Split.html") ) {
- RT::Interface::Web::Redirect(RT->Config->Get('WebURL')
- . RT::IR->HREFTo("$Type/Split.html?"
+ RT::Interface::Web::Redirect(RT::IR->HREFTo("$Type/Split.html?"
. $m->comp('/Elements/QueryString', %ARGS )));
}
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index a5d7aa9..2a6e8bb 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -74,18 +74,18 @@
if ( $ARGS{'InvestigateTo'} ) {
my $requestors = join ', ', map /^Requestorbox-(.*)/, keys %ARGS;
return RT::Interface::Web::Redirect(
- RT->Config->Get('WebURL')."RTIR/Create.html?"
+ RT::IR->HREFTo("Create.html?"
. $m->comp('/Elements/QueryString',
Lifecycle => RT::IR->lifecycle_investigation,
Requestors => $requestors,
Incident => $ARGS{'incidentid'},
- )
+ ))
);
} elsif ( $ARGS{'InvestigateWithScriptedActions'} ) {
return RT::Interface::Web::Redirect(
- RT->Config->Get('WebURL')."RTIR/Tools/ScriptedAction.html?"
+ RT::IR->HREFTo("Tools/ScriptedAction.html?"
. $m->comp('/Elements/QueryString', %ARGS )
- );
+ ));
}
my $title = $q ? loc("Lookup '[_1]'", $q) : loc("Lookup");
diff --git a/html/RTIR/index.html b/html/RTIR/index.html
index e0d7ba9..1c7d720 100644
--- a/html/RTIR/index.html
+++ b/html/RTIR/index.html
@@ -65,7 +65,7 @@ my $portlets = $session{'my_rtir_portlets'};
if ( defined $q && length $q ) {
if ($q =~ /^#?(\d+)$/) {
- RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."RTIR/Display.html?id=".$1);
+ RT::Interface::Web::Redirect(RT::IR->HREFTo("Display.html?id=".$1));
}
my $query = RT::IR->ParseSimpleSearch(
@@ -74,9 +74,9 @@ if ( defined $q && length $q ) {
);
return RT::Interface::Web::Redirect(
- RT->Config->Get('WebURL') .'RTIR/Search/Results.html?Query='
+ RT::IR->HREFTo('Search/Results.html?Query='
. $m->interp->apply_escapes( $query, 'u' )
- );
+ ));
}
my @results;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list