[Rt-commit] [rtir] 03/03: First pass at switching all RTIR URLs to run through a helper
Jesse Vincent
jesse at bestpractical.com
Thu Mar 5 04:19:28 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 3e6687735a42f7dcea2d936f3b2746c6186122db
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Thu Mar 5 01:17:57 2015 -0800
First pass at switching all RTIR URLs to run through a helper
This helper function will let us inject the constituency virtual path into the URL
with a dhandler
---
html/Callbacks/RTIR/Elements/Header/Head | 2 +-
html/Callbacks/RTIR/Elements/MakeClicky/Default | 42 ++++---
.../RTIR/Elements/RT__Ticket/ColumnMap/Once | 12 +-
html/Callbacks/RTIR/Elements/Tabs/Privileged | 130 +++++++++++----------
.../TicketHistory/ExtraShowHistoryArguments | 8 +-
html/Callbacks/RTIR/Search/Results.html/Initial | 4 +-
html/Callbacks/RTIR/autohandler/SuccessfulLogin | 2 +-
html/RTIR/Advanced.html | 4 +-
html/RTIR/Create.html | 4 +-
html/RTIR/Display.html | 20 ++--
html/RTIR/Edit.html | 7 +-
html/RTIR/EditUsername | 2 +-
html/RTIR/Elements/DueIncidents | 2 +-
html/RTIR/Elements/MergeWith | 2 +-
html/RTIR/Elements/NewReports | 4 +-
html/RTIR/Elements/ShowArticles | 2 +-
html/RTIR/Elements/ShowIncidents | 9 +-
html/RTIR/Incident/BulkAbandon.html | 4 +-
html/RTIR/Incident/Children/index.html | 2 +-
html/RTIR/Incident/Create.html | 2 +-
html/RTIR/Incident/Display.html | 18 +--
html/RTIR/Incident/Elements/ShowChildren | 8 +-
html/RTIR/Incident/Reply/index.html | 6 +-
html/RTIR/Link/FromIncident/index.html | 6 +-
html/RTIR/Link/ToIncident/Refine.html | 2 +-
html/RTIR/Link/ToIncident/index.html | 4 +-
html/RTIR/Merge/index.html | 4 +-
html/RTIR/Report/BulkReject.html | 8 +-
html/RTIR/Search/Elements/ProcessQuery | 2 +-
html/RTIR/Search/Elements/RefinePage | 2 +-
html/RTIR/Search/Elements/ShowResults | 2 +-
html/RTIR/Search/Reporting.html | 2 +-
html/RTIR/Search/Results.html | 2 +-
html/RTIR/Search/index.html | 2 +-
html/RTIR/ShowUser | 2 +-
html/RTIR/Split.html | 4 +-
html/RTIR/Tools/Elements/LookupSummary | 20 ++--
html/RTIR/Tools/Elements/ToolResultsWhois | 2 +-
lib/RT/IR.pm | 26 +++++
39 files changed, 212 insertions(+), 174 deletions(-)
diff --git a/html/Callbacks/RTIR/Elements/Header/Head b/html/Callbacks/RTIR/Elements/Header/Head
index af47c2d..28c68d0 100644
--- a/html/Callbacks/RTIR/Elements/Header/Head
+++ b/html/Callbacks/RTIR/Elements/Header/Head
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<%init>
return unless $m->request_comp->path =~ m{^/RTIR/};
-$ARGSRef->{URL} //= RT->Config->Get('WebPath') ."/RTIR/index.html";
+$ARGSRef->{URL} //= RT::IR->HREFTo("index.html");
$ARGSRef->{Name} //= loc("RTIR for [_1]", RT->Config->Get('rtirname'));
$ARGSRef->{LogoURL} //= RT->Config->Get('WebPath')."/static/images/RTIR/logo.png";
</%init>
diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index 6f23050..2ce1154 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -55,8 +55,6 @@ my $escaper = sub {
return $content;
};
-my $web_path = RT->Config->Get('WebPath');
-
my %super = %{$ARGS{actions}};
my %actions;
@@ -66,7 +64,7 @@ my %actions;
$args{value} = $escaper->($args{value});
# don't execute on non-rtir tickets
return $args{value} unless defined $args{type};
- return qq{<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}q=$args{value}">$args{value}</a>};
+ return qq{<a href="}. RT::IR->HREFTo("Tools/Lookup.html?".$args{lookup_params}."q=".$args{value}).qq{">$args{value}</a>};
},
url => sub {
my %args = @_;
@@ -78,7 +76,7 @@ my %actions;
# don't execute on non-rtir tickets
return $super unless defined $args{type};
- my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=host&q=$escaped_host">}
+ my $result = qq{[<a href="}. RT::IR->HREFTo("Tools/Lookup.html?".$args{lookup_params}."type=host&q=".$escaped_host).qq{">}
.loc('lookup "[_1]"', $host) .qq{</a>]};
return $super . qq{ <span class="clickylink">$result</span>};
},
@@ -92,7 +90,7 @@ my %actions;
# don't execute on non-rtir tickets
return $super unless defined $args{type};
- my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=host&q=$escaped_host">}
+ my $result = qq{[<a href="}. RT::IR->HREFTo("Tools/Lookup.html?".$args{lookup_params}."type=host&q=".$escaped_host).qq{">}
.loc('lookup "[_1]"', $host) .qq{</a>]};
return $super . qq{ <span class="clickylink">$result</span>};
},
@@ -104,17 +102,21 @@ my %actions;
$args{host} ||= $args{value};
my $escaped_host = $escaper->($args{host});
- my $result .= qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=ip&q=$escaped_host">}
+ my $result .= qq{[<a href="}. RT::IR->HREFTo("Tools/Lookup.html?".$args{lookup_params}."type=ip&q=".$escaped_host).qq{">}
.loc('lookup IP') .q{</a>]};
if ( $args{incident} && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
- $result .= qq{[<a href="$web_path/RTIR/Create.html?Incident=$args{incident}&Lifecycle=}.RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host">block</a>]};
+ $result .= qq{[<a href="} .
+ RT::IR->HREFTo("Create.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
+ .qq{">block</a>]};
}
if ( $args{'object'} && $args{'object'}->id ) {
my $cf = RT::IR::GetCustomField('IP');
my $tid = $args{'object'}->id;
- $result .= qq{[<a href="$web_path/RTIR/Edit.html?id=$tid}
+ $result .= qq{[<a href="}.
+ RT::IR->HREFTo("Edit.html?id=".$tid
.qq{&Object-RT::Ticket-$tid-CustomField-}. $cf->id .qq{-AddValue=$escaped_host}
- .q{&SaveChanges=1">}. loc('Add IP') .q{</a>]};
+ .q{&SaveChanges=1})
+ .qq{">}. loc('Add IP') .q{</a>]};
}
return $escaper->($args{value}) . qq{ <span class="clickylink">$result</span>};
},
@@ -146,21 +148,25 @@ my %actions;
my $email = $args{'value'}; $email =~ s/^<|>$//g;
my $escaped_email = $escaper->($email);
- my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{'lookup_params'}type=email&q=$escaped_email">}
- .loc('lookup email') .q{</a>]};
+ my $result = qq{[<a href="}.
+ RT::IR->HREFTo(qq{Tools/Lookup.html?$args{'lookup_params'}type=email&q=$escaped_email}). qq{">}
+ .loc('lookup email') .q{</a>]};
if ( $args{'incident'} ) {
if ( $r->uri =~ /Lookup.html$/ ) {
$result .= qq{<input type="checkbox" name="Requestorbox-$escaped_email" unchecked />};
}
- $result .= qq{[<a href="$web_path/RTIR/Create.html}
- . qq{?Incident=$args{'incident'}&Lifecycle=}.RT::IR->lifecycle_investigation
- . qq{&Requestors=$escaped_email">}
+ $result .= qq{[<a href="}.
+ RT::IR->HREFTo( "Create.html"
+ . qq{?Incident=$args{'incident'}}
+ . qq{&Lifecycle=}.RT::IR->lifecycle_investigation
+ . "&Requestors=$escaped_email")
+ . qq{">}
. loc('Investigate to') .qq{</a>]};
}
my $domain = (split /@/, $email, 2)[1];
my $escaped_domain = $escaper->($domain);
- $result .= qq{ [<a href="$web_path/RTIR/Tools/Lookup.html?$args{'lookup_params'}type=host&q=$escaped_domain">}
- .loc('lookup "[_1]"', $domain) .qq{</a>]};
+ $result .= ' [<a href="'. RT::IR->HREFTo(qq{Tools/Lookup.html?$args{'lookup_params'}type=host&q=$escaped_domain}). '">'
+ .loc('lookup "[_1]"', $domain) .'</a>]';
return $escaper->($args{'value'}) . qq{ <span class="clickylink">$result</span>};
},
noc => sub {
@@ -170,7 +176,7 @@ my %actions;
return $escaper->($args{value}) unless defined $args{type};
$args{value} = $escaper->($args{value});
- my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=handle&q=$args{value}">}
+ my $result = qq{[<a href="}. RT::IR->HREFTo(qq{Tools/Lookup.html?$args{lookup_params}type=handle&q=$args{value}}).qq{">}
.loc('lookup') .qq{</a>]};
return $args{value} . qq{ <span class="clickylink">$result</span>};
},
@@ -181,7 +187,7 @@ my %actions;
return $escaper->($args{value}) unless defined $args{type};
$args{value} = $escaper->($args{value});
- my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?$args{lookup_params}type=host&q=$args{value}">}
+ my $result = qq{[<a href="}. RT::IR->HREFTo(qq{Tools/Lookup.html?$args{lookup_params}type=host&q=$args{value}}). qq{">}
.loc('lookup host') .qq{</a>]};
return $args{value} . qq{ <span class="clickylink">$result</span>};
},
diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 9d470e9..0faa15a 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -96,7 +96,7 @@ $COLUMN_MAP->{'LookupToolChildrenActions'} = {
my @res;
if ( $show{'link'} ) {
push @res, \'<a href="',
- RT->Config->Get('WebPath') .'/RTIR/Display.html?Child='. $t->id .'&id='. $lid,
+ RT::IR->HREFTo('Display.html?Child='. $t->id .'&id='. $lid),
\'">',
'[' . $t->loc("Link") .']',
\'</a>'
@@ -104,7 +104,7 @@ $COLUMN_MAP->{'LookupToolChildrenActions'} = {
}
if ( $lid != $t->id && $show{'merge'} ) {
push @res, \'<a href="',
- RT->Config->Get('WebPath') .'/RTIR/Merge/?SelectedTicket='. $t->id .'&id='. $lid,
+ RT::IR->HREFTo('Merge/?SelectedTicket='. $t->id .'&id='. $lid),
\'">',
'[' . $t->loc("Merge") .']',
\'</a>'
@@ -123,7 +123,7 @@ $COLUMN_MAP->{'LookupToolIncidentActions'} = {
my @res;
if ( $show{'link'} ) {
push @res, \'<a href="',
- RT->Config->Get('WebPath') .'/RTIR/Display.html?Child='. $lid .'&id='. $t->id,
+ RT::IR->HREFTo('Display.html?Child='. $lid .'&id='. $t->id),
\'">',
'[' . $t->loc("Link") .']',
\'</a>'
@@ -131,15 +131,15 @@ $COLUMN_MAP->{'LookupToolIncidentActions'} = {
}
if ( $lid != $t->id && $show{'merge'} ) {
push @res, \'<a href="',
- RT->Config->Get('WebPath') .'/RTIR/Merge/?SelectedTicket='. $lid .'&id='. $t->id,
+ RT::IR->HREFTo('Merge/?SelectedTicket='. $lid .'&id='. $t->id),
\'">',
'[' . $t->loc("Merge") .']',
\'</a>'
;
}
push @res, \'<a href="',
- RT->Config->Get('WebPath') .'/RTIR/Create.html?Lifecycle='.RT::IR->lifecycle_investigation
- .'&Incident='. $t->id,
+ RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation
+ .'&Incident='. $t->id),
\'">',
'[' . $t->loc("Investigate") .']',
\'</a>'
diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 17c6229..6674931 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -70,60 +70,60 @@ my $search_arguments = sub {
return %res;
};
-my $root = Menu->child( rtir => title => loc('RTIR'), path => '/RTIR/' );
+my $root = Menu->child( rtir => title => loc('RTIR'), path => RT::IR->HREFTo('') );
-my $search = $root->child( search => title => loc('Search'), path => '/RTIR/Search/' );
-$search->child( new => title => loc('New Search'), path => '/RTIR/Search/?NewQuery=1' );
+my $search = $root->child( search => title => loc('Search'), path => RT::IR->HREFTo('Search/') );
+$search->child( new => title => loc('New Search'), path => RT::IR->HREFTo('Search/?NewQuery=1') );
{
my $current_search = $session{'CurrentSearchHash'} ? { map { $_ => $session{'CurrentSearchHash'}{$_} } @query_fields } : {};
my $has_query = 1 if ( $args->{'Query'} or $current_search->{'Query'} );
if ( $has_query ) {
- $search->child( build => title => loc('Edit Search'), path => '/RTIR/Search/' );
+ $search->child( build => title => loc('Edit Search'), path => RT::IR->HREFTo('Search/') );
$search->child( results => title => loc('Show Results'),
- path => '/RTIR/Search/Results.html?' .
+ path =>RT::IR->HREFTo('Search/Results.html?').
$query_string->( $args->{'Query'} ? $search_arguments->() : %$current_search ) );
}
}
$root->child(
incidents => title => loc('Incidents'),
- path => '/RTIR/Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident
+ path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident)
)->child(
create => title => loc('Create'),
- path => '/RTIR/Create.html?Lifecycle='.RT::IR->lifecycle_incident,
+ path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_incident),
);
$root->child(
reports => title => loc('Incident Reports'),
- path => '/RTIR/Search/Results.html?Lifecycle='. RT::IR->lifecycle_report
+ path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report)
)->child(
create => title => loc('Create'),
- path => '/RTIR/Create.html?Lifecycle='. RT::IR->lifecycle_report,
+ path => RT::IR->HREFTo('Create.html?Lifecycle='. RT::IR->lifecycle_report),
);
$root->child(
investigations => title => loc('Investigations'),
- path => '/RTIR/Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation
+ path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation)
)->child(
launch => title => loc('Launch'),
- path => '/RTIR/Create.html?Lifecycle='.RT::IR->lifecycle_investigation,
+ path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation),
);
unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
$root->child(
blocks => title => loc('Blocks'),
- path => '/RTIR/Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure
+ path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure)
)->child(
create => title => loc('Create'),
- path => '/RTIR/Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure,
+ path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure),
);
}
-my $tools = $root->child( tools => title => loc('Tools'), path => '/RTIR/Tools/' );
-$tools->child( lookup => title => loc('Lookup'), path => '/RTIR/Tools/Lookup.html' );
-$tools->child( reporting => title => loc('Reporting'), path => '/RTIR/Reporting/' );
+my $tools = $root->child( tools => title => loc('Tools'), path => RT::IR->HREFTo('Tools/') );
+$tools->child( lookup => title => loc('Lookup'), path => RT::IR->HREFTo('Tools/Lookup.html'));
+$tools->child( reporting => title => loc('Reporting'), path => RT::IR->HREFTo('Reporting/') );
my $scripted_actions = $tools->child( scripted_actions => title => loc('Scripted Action') );
-$scripted_actions->child( email => title => loc('By Email address'), path => '/RTIR/Tools/ScriptedAction.html' );
-$scripted_actions->child( ip => title => loc('By IP address'), path => '/RTIR/Tools/ScriptedAction.html?loop=IP' );
+$scripted_actions->child( email => title => loc('By Email address'), path => RT::IR->HREFTo('Tools/ScriptedAction.html') );
+$scripted_actions->child( ip => title => loc('By IP address'), path => RT::IR->HREFTo('Tools/ScriptedAction.html?loop=IP') );
my $request_path = $HTML::Mason::Commands::r->path_info;
$request_path =~ s!/{2,}!/!g;
@@ -131,6 +131,7 @@ return unless $request_path =~ m{^/RTIR/};
my $re_rtir_types = '(?:'. join( '|', map "\Q$_\E", RT::IR->Types ) .')';
+# XXX TODO make this handle the new constituency paths
if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|Advanced)\.html$} ) {
my $id = $args->{'id'};
@@ -147,7 +148,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
my $actions_tab = PageMenu()->child( actions => title => loc('Actions'), sort_order => 95 );
- PageMenu()->child( display => title => loc('Display'), path => "/RTIR/Display.html?id=$id" );
+ PageMenu()->child( display => title => loc('Display'), path =>RT::IR->HREFTo( "Display.html?id=$id") );
# RT4 TODO: something wrong, this doesn't work
if ( $session{'tickets'} ) {
@@ -161,13 +162,13 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
my $top = PageMenu();
if ( my $t = $item_map->{$id}->{'prev'} ) {
$top = $top->child(
- previouse => path => "/RTIR/Display.html?id=$id",
+ previouse => path => RT::IR->HREFTo("Display.html?id=$id"),
title => '< ' . loc('Prev')
);
}
if ( my $t = $item_map->{'first'} ) {
$top->child(
- first => path => "/RTIR/Display.html?id=$t",
+ first => path => RT::IR->HREFTo("Display.html?id=$t"),
title => '<< ' . loc('First')
) if $t != $id;
}
@@ -175,36 +176,36 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
$top = PageMenu();
if ( my $t = $item_map->{$id}->{'next'} ) {
$top = $top->child(
- next => path => "/RTIR/Display.html?id=$t",
+ next => path => RT::IR->HREFTo("Display.html?id=$t"),
title => loc('Next') . ' >'
);
}
if ( my $t = $item_map->{'last'} ) {
$top->child(
- last => path => "/RTIR/Display.html?id=$t",
+ last => path => RT::IR->HREFTo("Display.html?id=$t"),
title => loc('Last') . ' >>'
) if $t != $id;
}
}
if ( $can->('ModifyTicket') ) {
- PageMenu()->child( edit => title => loc('Edit'), path => "/RTIR/Edit.html?id=$id" );
- PageMenu()->child( split => title => loc('Split'), path => "/RTIR/Split.html?Split=$id" );
+ PageMenu()->child( edit => title => loc('Edit'), path => RT::IR->HREFTo("Edit.html?id=$id") );
+ PageMenu()->child( split => title => loc('Split'), path => RT::IR->HREFTo("Split.html?Split=$id") );
# XXX: we're missing query string here
- PageMenu()->child( merge => title => loc('Merge'), path => "/RTIR/Merge/?id=$id" );
- PageMenu()->child( advanced => title => loc('Advanced'), path => "/RTIR/Advanced.html?id=$id" );
+ PageMenu()->child( merge => title => loc('Merge'), path => RT::IR->HREFTo("Merge/?id=$id") );
+ PageMenu()->child( advanced => title => loc('Advanced'), path => RT::IR->HREFTo("Advanced.html?id=$id") );
}
if ( $can->('OwnTicket') ) {
if ( $ticket->Owner == $RT::Nobody->id ) {
$actions_tab->child(
take => title => loc('Take'),
- path => "/RTIR/Display.html?Action=Take&id=$id",
+ path => RT::IR->HREFTo("Display.html?Action=Take&id=$id"),
) if $can->('ModifyTicket') || $can->('TakeTicket');
} elsif ( $ticket->Owner != $session{CurrentUser}->id ) {
$actions_tab->child(
steal => title => loc('Steal'),
- path => "/RTIR/Display.html?Action=Steal&id=$id",
+ path => RT::IR->HREFTo("Display.html?Action=Steal&id=$id"),
) if $can->('ModifyTicket') || $can->('StealTicket');
}
}
@@ -217,22 +218,22 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
if ( $lifecycle eq RT::IR->lifecycle_incident) {
$actions_tab->child(
reply_reporters => title => loc('Reply to Reporters'),
- path => "/RTIR/Incident/Reply/?id=$id&SelectedReportsAll=1",
+ path => RT::IR->HREFTo("Incident/Reply/?id=$id&SelectedReportsAll=1"),
);
$actions_tab->child(
reply_all => title => loc('Reply to All'),
- path => "/RTIR/Incident/Reply/?id=$id&All=1&SelectedReportsAll=1&SelectedInvestigationsAll=1&SelectedBlocksAll=1",
+ path => RT::IR->HREFTo("Incident/Reply/?id=$id&All=1&SelectedReportsAll=1&SelectedInvestigationsAll=1&SelectedBlocksAll=1"),
);
} else {
$actions_tab->child(
reply => title => loc('Reply'),
- path => "/RTIR/Update.html?id=$id&Action=Respond",
+ path => RT::IR->HREFTo("Update.html?id=$id&Action=Respond"),
);
}
}
if ( $can->('ForwardMessage') ) {
- $actions_tab->child( forward => title => loc('Forward'), path => "/RTIR/Forward.html?id=" . $id );
+ $actions_tab->child( forward => title => loc('Forward'), path => RT::IR->HREFTo("Forward.html?id=" . $id) );
}
my $i = 0;
@@ -251,7 +252,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
next unless $can->( $check );
}
- my $path = '/RTIR/';
+ my $path = '';
$path .= 'Incident/' if $lifecycle eq RT::IR->lifecycle_incident;
if ( my $update = $info->{'update'} ) {
$path .= $lifecycle eq RT::IR->lifecycle_incident? 'Reply/' : 'Update.html';
@@ -268,6 +269,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
Status => $next,
);
}
+ $path=RT::IR->HREFTo($path);
$actions_tab->child(
lc($info->{'label'} || $next),
title => loc( $info->{'label'} || ucfirst($next) ),
@@ -278,7 +280,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
if ( $can->('ModifyTicket') || $can->('CommentOnTicket') ) {
$actions_tab->child(
comment => title => loc('Comment'),
- path => "/RTIR/Update.html?Action=Comment&id=$id",
+ path => RT::IR->HREFTo("Update.html?Action=Comment&id=$id"),
);
}
@@ -293,6 +295,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
bookmark => raw_html => $m->scomp( '/Ticket/Elements/Bookmark', id => $id ),
sort_order => 99
);
+ # XXX TODO RTIR consittuency path
} elsif ( $request_path =~ m{^/RTIR/Link/(ToIncident|FromIncident)/} ) {
my $direction = $1;
@@ -310,23 +313,24 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
PageMenu()->child(
link => title => loc('Show Results'),
- path => "/RTIR/Link/$direction/?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Link/$direction/?". $query_string->( %args )),
);
PageMenu()->child(
edit_search => title => loc('Edit Search'),
- path => "/RTIR/Link/$direction/Refine.html?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Link/$direction/Refine.html?". $query_string->( %args )),
);
PageMenu()->child(
new => title => loc("New [_1]", RT::IR::TicketType( Lifecycle => $lifecycle || RT::IR->lifecycle_incident ) ),
path => !$lifecycle
- ? "/RTIR/Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident
- : "/RTIR/Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle )
+ ? RT::IR->HREFTo("Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident)
+ : RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ))
,
);
PageMenu()->child(
back => title => loc('Back to ticket #[_1]', $id),
- path => "/RTIR/Display.html?id=$id",
+ path => RT::IR->HREFTo("Display.html?id=$id"),
);
+ ### XXX RTIR Constituency regex
} elsif ( $request_path =~ m{^/RTIR/Incident/Children/} ) {
my $lifecycle = $args->{'Lifecycle'} || RT::IR->lifecycle_report;
@@ -341,12 +345,13 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
PageMenu()->child(
new => title => loc("New [_1]",RT::IR::TicketType( Lifecycle => $lifecycle ) ),
- path => "/RTIR/Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ),
+ path => RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle )),
);
PageMenu()->child(
back => title => loc('Back to ticket #[_1]', $id),
- path => "/RTIR/Display.html?id=$id",
+ path => RT::IR->HREFTo( "Display.html?id=$id"),
);
+ # XXX RTIR CONSTITUENCY URL
} elsif ( $request_path =~ m{^/RTIR/Merge/} ) {
my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
$ticket->Load( $args->{'id'} );
@@ -359,16 +364,17 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
PageMenu()->child(
link => title => loc('Merge'),
- path => "/RTIR/Merge/?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Merge/?". $query_string->( %args )),
);
PageMenu()->child(
edit_search => title => loc('Edit Search'),
- path => "/RTIR/Merge/Refine.html?". $query_string->( %args, Lifecycle => $ticket->QueueObj->Lifecycle ),
+ path => RT::IR->HREFTo("Merge/Refine.html?". $query_string->( %args, Lifecycle => $ticket->QueueObj->Lifecycle )),
);
PageMenu()->child(
back => title => loc('Back to ticket #[_1]', $id),
- path => "/RTIR/Display.html?id=$id",
+ path => RT::IR->HREFTo("Display.html?id=$id"),
);
+ # XXX RTIR URL
} elsif ( $request_path =~ m{^/RTIR/Incident/Reply/} ) {
my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
$ticket->Load( $args->{'id'} );
@@ -385,16 +391,17 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
PageMenu()->child(
link => title => loc('Reply'),
- path => "/RTIR/Incident/Reply/?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Incident/Reply/?". $query_string->( %args )),
);
PageMenu()->child(
edit_search => title => loc('Edit Search'),
- path => "/RTIR/Incident/Reply/Refine.html?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Incident/Reply/Refine.html?". $query_string->( %args )),
);
PageMenu()->child(
back => title => loc('Back to ticket #[_1]', $id),
- path => "/RTIR/Display.html?id=$id",
+ path => RT::IR->HREFTo("Display.html?id=$id"),
);
+ # XXX TODO RTIR CONSTITUENCY URIL
} elsif ( $request_path =~ m{^/RTIR/(Search/|Incident/BulkAbandon\.html$|Report/BulkReject\.html$)} ) {
my %args = $search_arguments->();
@@ -417,49 +424,50 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
if ( $args{'Query'} ) {
PageMenu()->child(
link => title => loc('Show Results'),
- path => "/RTIR/Search/Results.html?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Search/Results.html?". $query_string->( %args )),
);
}
# Refine.html doesn't let you change the Queue, so don't link there from the
# full RTIR Search UI, only from the Bulk screens.
+ # #XXX TODO CONSTITUENCY
my $bulk_path = 1 if $request_path =~ m{^/RTIR/(Incident/BulkAbandon\.html$|Report/BulkReject\.html$)};
PageMenu()->child(
edit_search => title => loc('Edit Search'),
- path => "/RTIR/Search/" .
+ path => RT::IR->HREFTo("Search/" .
($bulk_path ? "Refine.html?" : "?") .
- $query_string->( %args ),
+ $query_string->( %args )),
);
if ( $args{'Query'} && !$bulk_path ) {
PageMenu()->child(
new_search => title => loc('New Search'),
- path => "/RTIR/Search/?NewQuery=1"
+ path => RT::IR->HREFTo("Search/?NewQuery=1")
);
}
if ( $lifecycle eq RT::IR->lifecycle_incident ) {
PageMenu()->child(
report => title => loc('Report'),
- path => "/RTIR/Reporting/",
+ path => RT::IR->HREFTo("Reporting/"),
);
PageMenu()->child(
abandon => title => loc('Bulk Abandon'),
- path => "/RTIR/Incident/BulkAbandon.html?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Incident/BulkAbandon.html?". $query_string->( %args )),
);
}
elsif ( $lifecycle eq RT::IR->lifecycle_report) {
PageMenu()->child(
reject => title => loc('Bulk Reject'),
- path => "/RTIR/Report/BulkReject.html?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Report/BulkReject.html?". $query_string->( %args )),
);
}
if ( $args{'Query'} ) {
PageMenu()->child(
chart => title => loc('Chart'),
- path => "/RTIR/Search/Reporting.html?". $query_string->( %args ),
+ path => RT::IR->HREFTo("Search/Reporting.html?". $query_string->( %args )),
);
my $more = PageMenu->child( more => title => loc('Feeds') );
@@ -505,28 +513,30 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update|Forward|
);
}
}
+ #XXX TODO RTIR CONSTITUENCY
} elsif ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?Split\.html$} ) {
my $id = $args->{'Split'};
PageMenu()->child(
back => title => loc('Back to ticket #[_1]', $id),
- path => "/RTIR/Display.html?id=$id",
+ path => RT::IR->HREFTo("Display.html?id=$id"),
);
}
if ( $session{'CurrentUser'}->HasRight(Right => 'ModifySelf', Object => $RT::System) ) {
+# XXX TODO RTIR CONSTITUENCY
if ( $request_path =~ m{^/RTIR/(?:index\.html|)$} ) {
- PageMenu()->child( edit => title => loc('Edit'), path => '/RTIR/Prefs/Home.html' )
+ PageMenu()->child( edit => title => loc('Edit'), path => RT::IR->HREFTo('Prefs/Home.html' ))
}
Menu->child('preferences')->child('settings')->child(
rtir_home_page => title => loc('RTIR at a glance'),
- path => '/RTIR/Prefs/Home.html',
+ path => RT::IR->HREFTo('Prefs/Home.html'),
);
}
PageWidgets()->child('simple_search')->raw_html( $m->scomp(
'/Elements/SimpleSearch',
- SendTo => '/RTIR/index.html',
+ SendTo => RT::IR->HREFTo('index.html'),
Placeholder => 'Search Incidents'
) );
diff --git a/html/Callbacks/RTIR/Helpers/TicketHistory/ExtraShowHistoryArguments b/html/Callbacks/RTIR/Helpers/TicketHistory/ExtraShowHistoryArguments
index 28f0362..e77b242 100644
--- a/html/Callbacks/RTIR/Helpers/TicketHistory/ExtraShowHistoryArguments
+++ b/html/Callbacks/RTIR/Helpers/TicketHistory/ExtraShowHistoryArguments
@@ -51,10 +51,10 @@ return unless $type;
my $id = $Ticket->Id;
%$ExtraArgs = (
- DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
- UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
- ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
- EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/Crypt.html",
+ DisplayPath => RT::IR->HREFTo("Display.html?id=$id"),
+ UpdatePath => RT::IR->HREFTo("Update.html"),
+ ForwardPath => RT::IR->HREFTo("Forward.html"),
+ EncryptionPath => RT::IR->HREFTo("Crypt.html"),
(($type eq "Incident") ? () : (WarnUnsigned => 1)),
PathPrefix => RT->Config->Get('WebPath') ."/Ticket/",
);
diff --git a/html/Callbacks/RTIR/Search/Results.html/Initial b/html/Callbacks/RTIR/Search/Results.html/Initial
index 0a5afef..90ab7aa 100644
--- a/html/Callbacks/RTIR/Search/Results.html/Initial
+++ b/html/Callbacks/RTIR/Search/Results.html/Initial
@@ -52,9 +52,7 @@ $ARGSRef => {}
my ($our, @queues) = RT::IR->OurQuery( $ARGSRef->{'Query'} );
return unless $our;
-RT::Interface::Web::Redirect(
- RT->Config->Get('WebURL')
- .'RTIR/Search/Results.html?'
+RT::Interface::Web::Redirect( RT->Config->Get('WebURL') .'RTIR/Search/Results.html?'
. $m->comp(
'/Elements/QueryString',
%$ARGSRef,
diff --git a/html/Callbacks/RTIR/autohandler/SuccessfulLogin b/html/Callbacks/RTIR/autohandler/SuccessfulLogin
index e580476..4b5cbc3 100644
--- a/html/Callbacks/RTIR/autohandler/SuccessfulLogin
+++ b/html/Callbacks/RTIR/autohandler/SuccessfulLogin
@@ -65,7 +65,7 @@ if ($path && $path ne '/NoAuth/Login.html' ) {
return unless RT->Config->Get('RTIR_RedirectOnLogin');
if (RT::IR->IsStaff($session{'CurrentUser'}->Id)) {
- $$RedirectTo = "$webpath/RTIR/";
+ $$RedirectTo = RT::IR->HREFTo('');
}
</%INIT>
<%ARGS>
diff --git a/html/RTIR/Advanced.html b/html/RTIR/Advanced.html
index 8a9d5ea..512ef0c 100644
--- a/html/RTIR/Advanced.html
+++ b/html/RTIR/Advanced.html
@@ -129,8 +129,8 @@ if ( $ARGS{'SaveChanges'} ) {
MaybeRedirectForResults(
Actions => \@results,
Path => RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'})
- ? "/RTIR/Display.html"
- : "/RTIR/Advanced.html"
+ ? RT::IR->HREFTo("Display.html")
+ : RT::IR->HREFTo("Advanced.html")
,
Arguments => { id => $Ticket->id },
);
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index befe0e0..ba6710a 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -60,9 +60,9 @@
% }
% unless ( $Split ) {
-<form action="<% RT->Config->Get('WebPath') %>/RTIR/Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
+<form action="<% RT::IR->HREFTo("Create.html") %>" method="post" enctype="multipart/form-data" name="TicketCreate">
% } else {
-<form action="<% RT->Config->Get('WebPath') %>/RTIR/Split.html" method="post" enctype="multipart/form-data" name="TicketCreate">
+<form action="<%RT::IR->HREFTo("Split.html") %>" method="post" enctype="multipart/form-data" name="TicketCreate">
% }
<input type="hidden" name="id" value="new" />
<input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index baddd6d..4b00b26 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -62,7 +62,7 @@
<&| /Widgets/TitleBox,
title => loc("The Basics"),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$Ticket->Id,
+ title_href => RT::IR->HREFTo("Edit.html?id=".$Ticket->Id),
class => 'ticket-info-basics',
&>
<table>
@@ -101,7 +101,7 @@
<& /Elements/ShowCustomFieldCustomGroupings,
Object => $Ticket,
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html",
+ title_href => RT::IR->HREFTo("Edit.html"),
&>
<& /RTIR/Elements/ShowArticles, Ticket => $Ticket &>
@@ -111,13 +111,13 @@
<&| /Widgets/TitleBox,
title => loc('People'),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id,
+ title_href => RT::IR->HREFTo("Edit.html?id=". $Ticket->Id),
class => 'ticket-info-people',
&>
<& /RTIR/Elements/ShowPeople, Ticket => $Ticket &>
</&>
<&| /Widgets/TitleBox, title => loc("Dates"),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id,
+ title_href => RT::IR->HREFTo("Edit.html?id=". $Ticket->Id),
class => 'ticket-info-dates',
&>
<& /RTIR/Elements/ShowDates, Ticket => $Ticket &>
@@ -132,7 +132,7 @@
Attachments => $attachments &>
</td>
<td class="boxcontainer" valign="top">
- <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket, DisplayPath => '/RTIR/Display.html' &>
+ <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket, DisplayPath => RT::IR->HREFTo("Display.html") &>
</td>
</tr>
</table>
@@ -154,10 +154,10 @@
<& /Elements/ShowHistory,
Object => $Ticket,
ShowHeaders => $ARGS{'ShowHeaders'},
- DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
- UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
- ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
- EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/Crypt.html",
+ DisplayPath => RT::IR->HREFTo("Display.html?id=$id"),
+ UpdatePath => RT::IR->HREFTo("Update.html"),
+ ForwardPath => RT::IR->HREFTo("Forward.html"),
+ EncryptionPath => RT::IR->HREFTo("Crypt.html"),
WarnUnsigned => 1,
PathPrefix => RT->Config->Get('WebPath') ."/Ticket/",
&>
@@ -263,7 +263,7 @@ if ( $ARGS{'MarkAsSeen'} ) {
$ARGS{'id'} = $id = $Ticket->Id;
MaybeRedirectForResults(
- Path => '/RTIR/Display.html',
+ Path => RT::IR->HREFTo("Display.html"),
Actions => \@results,
Arguments => { id => $id },
Anchor => $ARGS{'Anchor'},
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 6d315a9..340d23e 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -168,8 +168,7 @@ 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?"
+ RT::Interface::Web::Redirect(RT->Config->Get('WebURL') . "RTIR/$Type/Edit.html?"
. $m->comp('/Elements/QueryString', %ARGS ));
}
@@ -229,8 +228,8 @@ if ( $SaveChanges && !$checks_failure && !$OnlySearchForPeople ) {
MaybeRedirectForResults(
Actions => \@results,
Path => RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'})
- ? "/RTIR/Display.html"
- : "/RTIR/Edit.html"
+ ? RT::IR->HREFTo("Display.html")
+ : RT::IR->HREFTo("Edit.html")
,
Arguments => { id => $id },
);
diff --git a/html/RTIR/EditUsername b/html/RTIR/EditUsername
index 31e7138..f06f416 100644
--- a/html/RTIR/EditUsername
+++ b/html/RTIR/EditUsername
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<span id="showuser-<%$User->id%>">
-% my $url = $RT::WebPath."/RTIR/ShowUser?page=1&id=".$User->id;
+% my $url = RT::IR->HREFTo("ShowUser?page=1&id=".$User->id);
<form method="get">
<&|/l, $User->EmailAddress &>[_1]'s name</&>:
<input type="text" id="edit-<%$User->id%>" value="<%$User->RealName%>"&>
diff --git a/html/RTIR/Elements/DueIncidents b/html/RTIR/Elements/DueIncidents
index 35d2884..7cbcc73 100644
--- a/html/RTIR/Elements/DueIncidents
+++ b/html/RTIR/Elements/DueIncidents
@@ -49,7 +49,7 @@
Description => loc('Due Incidents')
</%ATTR>
<&| /Widgets/TitleBox,
- title_href => RT->Config->Get('WebPath') ."/RTIR/Search/Results.html?Lifecycle=incidents&$QueryString",
+ title_href => RT::IR->HREFTo("Search/Results.html?Lifecycle=incidents&$QueryString"),
title => $Title,
&>
diff --git a/html/RTIR/Elements/MergeWith b/html/RTIR/Elements/MergeWith
index 1d67765..ee189df 100644
--- a/html/RTIR/Elements/MergeWith
+++ b/html/RTIR/Elements/MergeWith
@@ -56,7 +56,7 @@
Page => $Page,
OrderBy => $OrderBy,
Order => $Order,
- BaseURL => "RTIR/Merge/?id=$id",
+ BaseURL => RT::IR->HREFTo("Merge/?id=$id"),
&>
<%INIT>
diff --git a/html/RTIR/Elements/NewReports b/html/RTIR/Elements/NewReports
index 72e0b0f..73960ba 100644
--- a/html/RTIR/Elements/NewReports
+++ b/html/RTIR/Elements/NewReports
@@ -46,10 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
<&| /Widgets/TitleBox,
- title_href => RT->Config->Get('WebPath') ."/RTIR/Search/Results.html?$QueryString",
+ title_href => RT::IR->HREFTo("Search/Results.html?$QueryString"),
title => $title,
titleright => loc("Bulk Reject"),
- titleright_href => RT->Config->Get('WebPath') ."/RTIR/Report/BulkReject.html?$BulkQS",
+ titleright_href => RT::IR->HREFTo("Report/BulkReject.html?$BulkQS"),
&>
<& /RTIR/Search/Elements/ShowResults,
diff --git a/html/RTIR/Elements/ShowArticles b/html/RTIR/Elements/ShowArticles
index dd69e3a..10cb81e 100644
--- a/html/RTIR/Elements/ShowArticles
+++ b/html/RTIR/Elements/ShowArticles
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<&| /Widgets/TitleBox,
title => loc("Articles"),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id,
+ title_href => RT::IR->HREFTo("Advanced.html?id=".$id),
title_class => 'inverse',
class => 'ticket-info-articles',
hide_empty => 1,
diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index a1d89fa..a50da59 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -55,12 +55,11 @@
EmptyLabel => loc('(no Incidents)'),
&>
-% 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/Incident/Create.html?Child=<% $id %>">[New]</a></b>
+<b><a href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">[Link]</a></b>
+<b><a href="<% RT::IR->HREFTo('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>
+<a href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>">[<% loc( $action ) %>]</a>
% }
<%INIT>
@@ -97,7 +96,7 @@ my $query = RT::IR->RelevantIncidentsQuery( $Ticket );
my $format = RT->Config->Get('RTIRSearchResultFormats')->{'ListIncidents'};
my $dformat = $format;
if ( $show_unlink ) {
- $dformat .= ", '<a href=\"__WebPath__/RTIR/Display.html?id=$id&DeleteLink--MemberOf-__id__=1\">". loc('Unlink') ."</a>/TITLE:'";
+ $dformat .= ", '<a href=\"". RT::IR->HREFTo("Display.html?id=$id&DeleteLink--MemberOf-__id__=1").\">". loc('Unlink') ."</a>/TITLE:'";
}
</%INIT>
diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index e72f222..861dc74 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -50,7 +50,7 @@
<& /Elements/ListActions, actions => \@results &>
-<form action="<%RT->Config->Get('WebPath')%>/RTIR/Incident/BulkAbandon.html" method="post">
+<form action="<%RT::IR->HREFTo("Incident/BulkAbandon.html") %>" method="post">
% foreach my $arg (qw(Query Format Rows Page OrderBy Order) ) {
% next unless defined $ARGS{ $arg } && length $ARGS{ $arg };
<input type="hidden" name="<% $arg %>" value="<% $ARGS{ $arg } %>" />
@@ -59,7 +59,7 @@
<%PERL>
my $found = $m->comp('/RTIR/Search/Elements/ShowResults',
Lifecycle => RT::IR->lifecycle_incident,
- BaseURL => 'RTIR/Incident/BulkAbandon.html',
+BaseURL => RT::IR->HREFTo('Incident/BulkAbandon.html'),
BaseQuery => RT::IR->ActiveQuery( Lifecycle => RT::IR->lifecycle_incident ),
Query => $Query,
DisplayFormat => "__CheckBox__, $Format",
diff --git a/html/RTIR/Incident/Children/index.html b/html/RTIR/Incident/Children/index.html
index 4d870ba..1e653eb 100644
--- a/html/RTIR/Incident/Children/index.html
+++ b/html/RTIR/Incident/Children/index.html
@@ -64,7 +64,7 @@
Ticket => $Incident,
Lifecycle => $Lifecycle,
Statuses => [@Statuses],
- FullList => RT->Config->Get('WebPath')."/RTIR/Incident/Children/?Lifecycle=$Lifecycle&id=$id",
+ FullList => RT::IR->HREFTo("Incident/Children/?Lifecycle=$Lifecycle&id=$id"),
Delete => $delete,
ShowHeader => 1,
ShowStatusesSelector => 1,
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 5aee5a6..099f8e3 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -408,7 +408,7 @@ if ( !$checks_failure && $CreateIncident ) {
MaybeRedirectForResults(
Actions => \@results,
- Path => "/RTIR/Incident/Display.html",
+ Path => RT::IR->HREFTo("Incident/Display.html"),
Arguments => { id => $inc_obj->id },
);
}
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index d9760c0..0be2c38 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -58,7 +58,7 @@
<&| /Widgets/TitleBox,
title => loc('Incident #[_1]', $id),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$id,
+ title_href => RT::IR->HREFTo("Edit.html?id=".$id),
class=> 'ticket-info-basics',
&>
@@ -111,12 +111,12 @@
<& /Elements/ShowCustomFieldCustomGroupings,
Object => $TicketObj,
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html",
+ title_href => RT::IR->HREFTo("Edit.html"),
&>
<&| /Widgets/TitleBox,
title => loc("Dates"),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$id,
+ title_href =>RT::IR->HREFTo("Edit.html?id=".$id),
class => 'ticket-info-dates',
&>
<& /RTIR/Elements/ShowDates, Ticket => $TicketObj &>
@@ -124,7 +124,7 @@
<& /Ticket/Elements/ShowAttachments, Ticket => $TicketObj, Attachments => $attachments &>
-<& /Ticket/Elements/ShowRequestor, Ticket => $TicketObj, DisplayPath => "/RTIR/Display.html" &>
+<& /Ticket/Elements/ShowRequestor, Ticket => $TicketObj, DisplayPath => RT::IR->HREFTo("Display.html") &>
</td><td class="boxcontainer" valign="top">
% $m->callback( %ARGS, Ticket => $TicketObj, CallbackName => 'RightColumnStart' );
@@ -157,10 +157,10 @@
<& /Elements/ShowHistory,
Object => $TicketObj,
ShowHeaders => $ARGS{'ShowHeaders'},
- DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id",
- UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html",
- ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html",
- EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/Crypt.html",
+ DisplayPath => RT::IR->HREFTo("Display.html?id=$id"),
+ UpdatePath => RT::IR->HREFTo("Update.html"),
+ ForwardPath => RT::IR->HREFTo("Forward.html"),
+ EncryptionPath => RT::IR->HREFTo("Crypt.html"),
PathPrefix => RT->Config->Get('WebPath') ."/Ticket/",
&>
% }
@@ -308,7 +308,7 @@ if ( $ARGS{'MarkAsSeen'} ) {
MaybeRedirectForResults(
Actions => \@results,
- Path => "/RTIR/Display.html",
+ Path => RT::IR->HREFTo("Display.html"),
Arguments => { id => $TicketObj->id },
Anchor => $ARGS{'Anchor'},
);
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index a6d4df7..919954b 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}
<&| /Widgets/TitleBox,
title => loc( $FriendlyLifecycle ),
- title_href => RT->Config->Get('WebPath') ."/RTIR/Incident/Children/?Lifecycle=". $Lifecycle ."&id=".$id,
+ title_href => RT::IR->HREFTo("Incident/Children/?Lifecycle=". $Lifecycle ."&id=".$id),
titleright_raw => $box_actions,
title_class => 'inverse',
class => 'tickets-list-'. lc(RT::IR::TicketType( Lifecycle => $Lifecycle )),
@@ -115,19 +115,19 @@ if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
# $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
push @box_actions, {
title => $Lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
- path => "/RTIR/Create.html?Incident=$id&Lifecycle=".$Lifecycle,
+ path => RT::IR->HREFTo("Create.html?Incident=$id&Lifecycle=".$Lifecycle),
};
}
push @box_actions, {
title => loc('Link'),
- path => "/RTIR/Link/FromIncident/?id=$id&Lifecycle=".$Lifecycle,
+ path => RT::IR->HREFTo("Link/FromIncident/?id=$id&Lifecycle=".$Lifecycle),
};
}
if ( $total_count > $Rows ) {
push @box_actions, {
title => loc("More... ([_1] total)", $total_count),
- path => '/RTIR/Incident/Children/?Lifecycle='. $Lifecycle .'&id='. $id
+ path => RT::IR->HREFTo('Incident/Children/?Lifecycle='. $Lifecycle .'&id='. $id)
};
}
my $box_actions = join ' 'x3,
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index 9c1bad5..6177cbd 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -222,7 +222,7 @@ if ( $SubmitTicket && !$checks_failure ) {
);
MaybeRedirectForResults(
Actions => \@results,
- Path => "/RTIR/Incident/Display.html",
+ Path => RT::IR->HREFTo("Incident/Display.html"),
Arguments => { %$pass, id => $id },
);
}
@@ -246,13 +246,13 @@ push @lifecycles, RT::IR->lifecycle_countermeasure unless RT->Config->Get('RTIR_
$Query ||= RT::IR->ActiveQuery( Lifecycle => \@lifecycles );
-my $BaseURL = "RTIR/Incident/Reply/?".
+my $BaseURL = RT::IR->HREFTo("Incident/Reply/?".
$m->comp('/Elements/QueryString',
id => $id,
All => $All,
Status => $Status,
Action => $Action,
- );
+ ));
my $candidates = RT::IR->IncidentChildren( $IncidentObj, Lifecycle => \@lifecycles )->Count;
diff --git a/html/RTIR/Link/FromIncident/index.html b/html/RTIR/Link/FromIncident/index.html
index 810bc23..8669364 100644
--- a/html/RTIR/Link/FromIncident/index.html
+++ b/html/RTIR/Link/FromIncident/index.html
@@ -54,7 +54,7 @@
Order => $Order,
OrderBy => $OrderBy } &>
-<form action="<% RT->Config->Get('WebPath') %>/RTIR/Incident/Display.html" method="post">
+<form action="<% RT::IR->HREFTo("Incident/Display.html")%>" method="post">
<input type="hidden" name="id" value="<% $id %>" />
<input type="hidden" name="BulkLink" value="1" />
@@ -99,7 +99,7 @@ my $BaseQuery = RT::IR->Query(
NotMemberOf => $id,
);
-my $base_url = 'RTIR/Link/FromIncident/?'
- . $m->comp( '/Elements/QueryString', id => $id, Lifecycle => $Lifecycle );
+my $base_url = RT::IR->HREFTo('Link/FromIncident/?'
+ . $m->comp( '/Elements/QueryString', id => $id, Lifecycle => $Lifecycle ));
</%INIT>
diff --git a/html/RTIR/Link/ToIncident/Refine.html b/html/RTIR/Link/ToIncident/Refine.html
index 81df216..22175cf 100644
--- a/html/RTIR/Link/ToIncident/Refine.html
+++ b/html/RTIR/Link/ToIncident/Refine.html
@@ -49,7 +49,7 @@
return $m->comp(
'/RTIR/Search/Elements/RefinePage',
%ARGS,
- ResultPage => 'RTIR/Link/ToIncident/?id='. $ARGS{'id'},
+ ResultPage => RT::IR->HREFTo('Link/ToIncident/?id='. $ARGS{'id'}),
BaseQuery => RT::IR->Query(
Lifecycle => 'incidents',
HasNoMember => $ARGS{'id'},
diff --git a/html/RTIR/Link/ToIncident/index.html b/html/RTIR/Link/ToIncident/index.html
index 98eb2ba..435055a 100644
--- a/html/RTIR/Link/ToIncident/index.html
+++ b/html/RTIR/Link/ToIncident/index.html
@@ -60,7 +60,7 @@
% $m->callback(CallbackName => 'BeforeActionList', ARGSRef => \%ARGS, Ticket => $Ticket);
-<form action="<% RT->Config->Get('WebPath') %>/RTIR/Incident/Display.html" method="post">
+<form action="<% RT::IR->HREFTo("Incident/Display.html") %>" method="post">
<input type="hidden" name="Child" value="<% $id %>" />
<& /RTIR/Search/Elements/ShowResults,
@@ -72,7 +72,7 @@
Page => $Page,
OrderBy => $OrderBy,
Order => $Order,
- BaseURL => "RTIR/Link/ToIncident/?id=$id&Lifecycle=incidents",
+ BaseURL => RT::IR->HREFTo("Link/ToIncident/?id=$id&Lifecycle=incidents"),
ShowNavigation => 1,
&>
diff --git a/html/RTIR/Merge/index.html b/html/RTIR/Merge/index.html
index 37b4527..2d2e667 100644
--- a/html/RTIR/Merge/index.html
+++ b/html/RTIR/Merge/index.html
@@ -52,7 +52,7 @@
<& /Elements/ListActions, actions => \@results &>
-<form action="<% RT->Config->Get('WebPath') %>/RTIR/Merge/" method="post">
+<form action="<% RT::IR->HREFTo("Merge/") %>" method="post">
<input type="hidden" name="id" value="<% $id %>" />
% if ( $siblings_query ) {
@@ -123,7 +123,7 @@ if ( $MergeTicket && !$checks_failure ) {
MaybeRedirectForResults(
Actions => \@results,
- Path => "/RTIR/Display.html",
+ Path => RT::IR->HREFTo("Display.html"),
Arguments => { id => $Ticket->id },
);
}
diff --git a/html/RTIR/Report/BulkReject.html b/html/RTIR/Report/BulkReject.html
index 32ec7dd..d513316 100644
--- a/html/RTIR/Report/BulkReject.html
+++ b/html/RTIR/Report/BulkReject.html
@@ -50,7 +50,7 @@
<& /Elements/ListActions, actions => \@results &>
-<form action="<%RT->Config->Get('WebPath')%>/RTIR/Report/BulkReject.html" method="post">
+<form action="<%RT::IR->HREFTo("Report/BulkReject.html")|n%>" method="post">
<input type="hidden" name="Status" value="<% $Status %>" />
<input type="hidden" name="Query" value="<% $Query %>" />
@@ -147,7 +147,7 @@ if ( $BulkReject ) {
if ( $BulkRejectAndReturn ) {
MaybeRedirectForResults(
Actions => \@results,
- Path => '/RTIR/',
+ Path => RT::IR->HREFTo(''),
Force => 1,
);
}
@@ -162,8 +162,8 @@ if ( $BulkReject ) {
);
}
-my $BaseURL = "RTIR/Report/BulkReject.html?"
- . $m->comp('/Elements/QueryString', Lifecycle => $Lifecycle);
+my $BaseURL = RT::IR->HREFTo("Report/BulkReject.html?"
+ . $m->comp('/Elements/QueryString', Lifecycle => $Lifecycle));
</%INIT>
<%ARGS>
diff --git a/html/RTIR/Search/Elements/ProcessQuery b/html/RTIR/Search/Elements/ProcessQuery
index 27cf447..3488038 100644
--- a/html/RTIR/Search/Elements/ProcessQuery
+++ b/html/RTIR/Search/Elements/ProcessQuery
@@ -259,5 +259,5 @@ $NewQuery => 0
@clauses => ()
$BaseQuery => ''
-$ResultPage => "RTIR/Search/Results.html"
+$ResultPage => RT::IR->HREFTo("Search/Results.html")
</%ARGS>
diff --git a/html/RTIR/Search/Elements/RefinePage b/html/RTIR/Search/Elements/RefinePage
index d53e2ba..b73da14 100644
--- a/html/RTIR/Search/Elements/RefinePage
+++ b/html/RTIR/Search/Elements/RefinePage
@@ -71,7 +71,7 @@ my $QueryString = $m->comp( '/Elements/QueryString', %{ $query_state{'query'} }
</%INIT>
<%ARGS>
$Title => loc("Refine Search")
-$ResultPage => 'RTIR/Search/Results.html',
+$ResultPage => RT::IR->HREFTo('Search/Results.html'),
$BaseQuery => '',
@ExtraQueryParams => ()
</%ARGS>
diff --git a/html/RTIR/Search/Elements/ShowResults b/html/RTIR/Search/Elements/ShowResults
index 5fc5c67..c697e6f 100644
--- a/html/RTIR/Search/Elements/ShowResults
+++ b/html/RTIR/Search/Elements/ShowResults
@@ -104,7 +104,7 @@ $Page => 1
$OrderBy => RT->Config->Get('DefaultSearchResultOrderBy')
$Order => RT->Config->Get('DefaultSearchResultOrder')
-$BaseURL => "RTIR/Search/Results.html?"
+$BaseURL => RT::IR->HREFTo("Search/Results.html?")
$ShowEmpty => 0
$EmptyLabel => ''
diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 744df9f..8b05dbe 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -53,7 +53,7 @@
<& /Search/Elements/Chart, %ARGS &>
% }
-<form method="get" action="<% RT->Config->Get('WebPath') %>/RTIR/Search/Reporting.html">
+<form method="get" action="<% RT::IR->HREFTo("Search/Reporting.html")%>">
% my %hiddens = (Lifecycle => $Lifecycle, Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order);
% while ( my ($key, $val) = each %hiddens ) {
% next unless defined $val;
diff --git a/html/RTIR/Search/Results.html b/html/RTIR/Search/Results.html
index faa62b0..81e3e72 100644
--- a/html/RTIR/Search/Results.html
+++ b/html/RTIR/Search/Results.html
@@ -90,7 +90,7 @@ if ( $Type ) {
}
}
-my $BaseURL = "RTIR/Search/Results.html";
+my $BaseURL = RT::IR->HREFTo("Search/Results.html");
$BaseURL .= '?'. $m->comp( '/Elements/QueryString', Lifecycle => $Lifecycle )
if $Lifecycle;
diff --git a/html/RTIR/Search/index.html b/html/RTIR/Search/index.html
index ce8c497..d14c94d 100644
--- a/html/RTIR/Search/index.html
+++ b/html/RTIR/Search/index.html
@@ -70,7 +70,7 @@ my @results = @{ delete $query_state{'results'} };
<%ARGS>
$title => loc("Build Search")
-$ResultPage => 'RTIR/Search/Results.html'
+$ResultPage => RT::IR->HREFTo('Search/Results.html')
$NewQuery => 0
$BaseQuery => ''
diff --git a/html/RTIR/ShowUser b/html/RTIR/ShowUser
index 4e551d2..89a9001 100644
--- a/html/RTIR/ShowUser
+++ b/html/RTIR/ShowUser
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<span id="showuser-<%$User->id%>">
-% my $url = RT->Config->Get('WebPath') ."/RTIR/EditUsername?page=1&id=". $User->id;
+% my $url = RT::IR->HREFTo("EditUsername?page=1&id=". $User->id);
<& /Elements/ShowUser, User => $User &>
% if ( $can_modify ) {
% my $modify_url = $can_see_admin? RT->Config->Get('WebPath') .'/Admin/Users/Modify.html?id='. $User->id : '#';
diff --git a/html/RTIR/Split.html b/html/RTIR/Split.html
index 259a69e..9df0e44 100644
--- a/html/RTIR/Split.html
+++ b/html/RTIR/Split.html
@@ -78,8 +78,8 @@ $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')
- . "/RTIR/$Type/Split.html?"
- . $m->comp('/Elements/QueryString', %ARGS ));
+ . RT::IR->HREFTo("$Type/Split.html?"
+ . $m->comp('/Elements/QueryString', %ARGS )));
}
</%INIT>
diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index ad42d74..9329771 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -90,39 +90,39 @@ if ( $TicketObj ) {
my @box_actions;
push @box_actions, {
title => loc('Search'),
- path => "/RTIR/Search/Refine.html?". $m->comp('/Elements/QueryString',
+ path => RT::IR->HREFTo("Search/Refine.html?". $m->comp('/Elements/QueryString',
Lifecycle => $Lifecycle,
Query => $Query,
- ),
+ )),
};
if ( $TicketObj && $TicketObj->QueueObj->Lifecycle eq RT::IR->lifecycle_incident
&& $Lifecycle ne RT::IR->lifecycle_incident
) {
push @box_actions, {
title => loc('Link'),
- path => "/RTIR/Link/ToIncident/?". $m->comp('/Elements/QueryString',
+ path => RT::IR->HREFTo("Link/ToIncident/?". $m->comp('/Elements/QueryString',
id => $TicketObj->id,
Lifecycle => $Lifecycle,
Query => $Query,
- ),
+ )),
};
if ($Lifecycle eq RT::IR->lifecycle_investigation && $LookupType eq 'email') {
push @box_actions, {
title => loc('Launch'),
- path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
+ path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
Incident => $TicketObj->id,
Lifecycle => $Lifecycle,
Requestors => $q,
- ),
+ )),
};
} elsif ( $Lifecycle eq RT::IR->lifecycle_countermeasure && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
push @box_actions, {
title => loc('Create'),
- path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
+ path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
Incident => $TicketObj->id,
Lifecycle => $Lifecycle,
'IP-Value' => $q,
- ),
+ )),
};
}
}
@@ -131,10 +131,10 @@ elsif ( $TicketObj && $TicketObj->QueueObj->Lifecycle ne RT::IR->lifecycle_incid
) {
push @box_actions, {
title => loc('Create'),
- path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
+ path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
Child => $TicketObj->id,
Lifecycle => $Lifecycle
- ),
+ )),
};
}
my $box_actions = join ' 'x3,
diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
index f1191ab..0198025 100644
--- a/html/RTIR/Tools/Elements/ToolResultsWhois
+++ b/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -48,7 +48,7 @@
% if ( $q ) {
<h2>WHOIS Results</h2>
% if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
-<form method="post" action="<% RT->Config->Get('WebPath') %>/RTIR/Tools/Lookup.html">
+<form method="post" action="<% RT::IR->HREFTo("Tools/Lookup.html")|n%>">
<input type="hidden" name="incidentid" value="<% $TicketObj->id %>" />
<input type="hidden" name="Subject" value="<% $TicketObj->Subject %>" />
% }
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 9c6b224..2c45c6e 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -743,6 +743,32 @@ require RT::CustomField;
};
}
+
+=head2 HREFTo
+
+XXX TODO this wants a better name.
+
+
+=cut
+
+sub HREFTo {
+ my $self = shift;
+ my $page = shift;
+
+ return RT->Config->Get('WebPath') .'/RTIR/'.$page;
+}
+
+
+
+=head2 URL
+
+XXX TODO
+
+=cut
+
+
+
+
require RT::Search::Simple;
package RT::Search::Simple;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list