[Rt-commit] [rtir] 01/01: don't prepend WebPath in menu as RT::Interface::Web::RenderMenu already does it

? sunnavy sunnavy at bestpractical.com
Wed Oct 14 11:36:56 EDT 2015


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

sunnavy pushed a commit to branch 3.4/menu-path-fix
in repository rtir.

commit b22e1025f2559f1df5b5358514b46703e19d7396
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Oct 14 23:24:53 2015 +0800

    don't prepend WebPath in menu as RT::Interface::Web::RenderMenu already does it
    
    otherwise, we will have duplicated WebPaths in urls like '/rt/rt'
    
    Fixes: I#31255
---
 html/Callbacks/RTIR/Elements/Tabs/Privileged | 118 +++++++++++++--------------
 lib/RT/IR.pm                                 |   9 +-
 2 files changed, 65 insertions(+), 62 deletions(-)

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 69e056e..b67a975 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -48,7 +48,7 @@
 <%INIT>
 
 if ( $m->request_comp->path !~ m{^/RTIR/} ) {
-    Menu()->child( rtir => title => loc('RTIR'), path => RT::IR->HREFTo('') );
+    Menu()->child( rtir => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
     return;
 }
 
@@ -90,58 +90,58 @@ $orig_menu->delete('preferences');
 
 my $root = Menu();
 
-my $search = $root->child( search => title => loc('RTIR'), path => RT::IR->HREFTo('') );
-$search->child( new => title => loc('New Search'), path => RT::IR->HREFTo('Search/?NewQuery=1') );
+my $search = $root->child( search => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
+$search->child( new => title => loc('New Search'), path => RT::IR->HREFTo('Search/?NewQuery=1', IncludeWebPath => 0) );
 
 {
 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 => RT::IR->HREFTo('Search/') );
+    $search->child( build => title => loc('Edit Search'), path => RT::IR->HREFTo('Search/', IncludeWebPath => 0) );
     $search->child( results => title => loc('Show Results'),
-                    path =>RT::IR->HREFTo('Search/Results.html?').
+                    path =>RT::IR->HREFTo('Search/Results.html?', IncludeWebPath => 0).
                     $query_string->( $args->{'Query'} ? $search_arguments->() : %$current_search ) );
 }
 }
 
 $root->child(
     incidents => title => loc('Incidents'),
-    path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident)
+    path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_incident),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
 );
 $root->child(
     reports => title => loc('Reports'),
-    path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report)
+    path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('Create.html?Lifecycle='. RT::IR->lifecycle_report),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0),
 );
 $root->child(
     investigations => title => loc('Investigations'),
-    path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation)
+    path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0)
 )->child(
     launch => title => loc('Launch'),
-    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
 );
 unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
     $root->child(
         blocks => title => loc('Blocks'),
-        path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure)
+        path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
     )->child(
         create => title => loc('Create'),
-        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure),
+        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
     );
 }
 
-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 $tools = $root->child( tools => title => loc('Tools'), path => RT::IR->HREFTo('Tools/', IncludeWebPath => 0) );
+$tools->child( lookup => title => loc('Lookup'), path => RT::IR->HREFTo('Tools/Lookup.html', IncludeWebPath => 0));
+$tools->child( reporting => title => loc('Reporting'), path => RT::IR->HREFTo('Reporting/', IncludeWebPath => 0) );
 my $scripted_actions = $tools->child( scripted_actions => title => loc('Scripted Action') );
-$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') );
+$scripted_actions->child( email => title => loc('By Email address'), path => RT::IR->HREFTo('Tools/ScriptedAction.html', IncludeWebPath => 0) );
+$scripted_actions->child( ip => title => loc('By IP address'), path => RT::IR->HREFTo('Tools/ScriptedAction.html?loop=IP', IncludeWebPath => 0) );
 
 my $request_path = $HTML::Mason::Commands::r->path_info;
 $request_path =~ s!/{2,}!/!g;
@@ -168,7 +168,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     my $actions_tab = PageMenu()->child( actions => title => loc('Actions'), sort_order  => 95 );
 
-    PageMenu()->child( display => title => loc('Display'), path =>RT::IR->HREFTo( "Display.html?id=$id") );
+    PageMenu()->child( display => title => loc('Display'), path =>RT::IR->HREFTo( "Display.html?id=$id", IncludeWebPath => 0) );
 
     # RT4 TODO: something wrong, this doesn't work
     if ( $session{'tickets'} ) {
@@ -182,13 +182,13 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
         my $top = PageMenu();
         if ( my $t = $item_map->{$id}->{'prev'} ) {
             $top = $top->child(
-                previouse => path => RT::IR->HREFTo("Display.html?id=$id"),
+                previouse => path => RT::IR->HREFTo("Display.html?id=$id", IncludeWebPath => 0),
                 title => '< ' . loc('Prev')
             );
         }
         if ( my $t = $item_map->{'first'} ) {
             $top->child(
-                first => path  => RT::IR->HREFTo("Display.html?id=$t"),
+                first => path  => RT::IR->HREFTo("Display.html?id=$t", IncludeWebPath => 0),
                 title => '<< ' . loc('First')
             ) if $t != $id;
         }
@@ -196,36 +196,36 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
         $top = PageMenu();
         if ( my $t = $item_map->{$id}->{'next'} ) {
             $top = $top->child(
-                next => path  => RT::IR->HREFTo("Display.html?id=$t"),
+                next => path  => RT::IR->HREFTo("Display.html?id=$t", IncludeWebPath => 0),
                 title => loc('Next') . ' >'
             );
         }
         if ( my $t = $item_map->{'last'} ) {
             $top->child(
-                last => path  => RT::IR->HREFTo("Display.html?id=$t"),
+                last => path  => RT::IR->HREFTo("Display.html?id=$t", IncludeWebPath => 0),
                 title => loc('Last') . ' >>'
             ) if $t != $id;
         }
     }
 
     if ( $can->('ModifyTicket') ) {
-        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") );
+        PageMenu()->child( edit => title => loc('Edit'), path => RT::IR->HREFTo("Edit.html?id=$id", IncludeWebPath => 0) );
+        PageMenu()->child( split => title => loc('Split'), path => RT::IR->HREFTo("Split.html?Split=$id", IncludeWebPath => 0) );
         # XXX: we're missing query string here
-        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") );
+        PageMenu()->child( merge => title => loc('Merge'), path => RT::IR->HREFTo("Merge/?id=$id", IncludeWebPath => 0) );
+        PageMenu()->child( advanced => title => loc('Advanced'), path => RT::IR->HREFTo("Advanced.html?id=$id", IncludeWebPath => 0) );
     }
 
     if ( $can->('OwnTicket') ) {
         if ( $ticket->Owner == $RT::Nobody->id ) {
             $actions_tab->child(
                 take => title => loc('Take'),
-                path  => RT::IR->HREFTo("Display.html?Action=Take&id=$id"),
+                path  => RT::IR->HREFTo("Display.html?Action=Take&id=$id", IncludeWebPath => 0),
             ) if $can->('ModifyTicket') || $can->('TakeTicket');
         } elsif ( $ticket->Owner != $session{CurrentUser}->id ) {
             $actions_tab->child(
                 steal => title => loc('Steal'),
-                path  => RT::IR->HREFTo("Display.html?Action=Steal&id=$id"),
+                path  => RT::IR->HREFTo("Display.html?Action=Steal&id=$id", IncludeWebPath => 0),
             ) if $can->('ModifyTicket') || $can->('StealTicket');
         }
     }
@@ -238,22 +238,22 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
         if ( RT::IR->IsIncidentQueue($ticket->QueueObj)) {
             $actions_tab->child(
                 reply_reporters => title => loc('Reply to Reporters'),
-                path  => RT::IR->HREFTo("Incident/Reply/?id=$id&SelectedReportsAll=1"),
+                path  => RT::IR->HREFTo("Incident/Reply/?id=$id&SelectedReportsAll=1", IncludeWebPath => 0),
             );
             $actions_tab->child(
                 reply_all => title => loc('Reply to All'),
-                path  => RT::IR->HREFTo("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", IncludeWebPath => 0),
             );
         } else {
             $actions_tab->child(
                 reply => title => loc('Reply'),
-                path  => RT::IR->HREFTo("Update.html?id=$id&Action=Respond"),
+                path  => RT::IR->HREFTo("Update.html?id=$id&Action=Respond", IncludeWebPath => 0),
             );
         }
     }
 
     if ( $can->('ForwardMessage') ) {
-        $actions_tab->child( forward => title => loc('Forward'), path => RT::IR->HREFTo("Forward.html?id=" . $id) );
+        $actions_tab->child( forward => title => loc('Forward'), path => RT::IR->HREFTo("Forward.html?id=" . $id, IncludeWebPath => 0) );
     }
 
     my $i = 0;
@@ -289,7 +289,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
                 Status => $next,
             );
         }
-            $path=RT::IR->HREFTo($path);
+            $path=RT::IR->HREFTo($path, IncludeWebPath => 0);
         $actions_tab->child(
             lc($info->{'label'} || $next),
             title => loc( $info->{'label'} || ucfirst($next) ),
@@ -300,7 +300,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
     if ( $can->('ModifyTicket') || $can->('CommentOnTicket') ) {
         $actions_tab->child(
             comment => title => loc('Comment'),
-            path  => RT::IR->HREFTo("Update.html?Action=Comment&id=$id"),
+            path  => RT::IR->HREFTo("Update.html?Action=Comment&id=$id", IncludeWebPath => 0),
         );
     }
 
@@ -332,22 +332,22 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         link => title => loc('Show Results'),
-        path => RT::IR->HREFTo("Link/$direction/?". $query_string->( %args )),
+        path => RT::IR->HREFTo("Link/$direction/?". $query_string->( %args ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         edit_search => title => loc('Edit Search'),
-        path => RT::IR->HREFTo("Link/$direction/Refine.html?". $query_string->( %args )),
+        path => RT::IR->HREFTo("Link/$direction/Refine.html?". $query_string->( %args ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         new => title => loc("New [_1]", RT::IR::TicketType( Lifecycle => $lifecycle || RT::IR->lifecycle_incident ) ),
         path => !$lifecycle
-            ? RT::IR->HREFTo("Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident)
-            : RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ))
+            ? RT::IR->HREFTo("Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
+            : RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
         ,
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]',lc RT::IR::TicketType(Lifecycle => $ticket->QueueObj->Lifecycle), $id),
-        path => RT::IR->HREFTo("Display.html?id=$id"),
+        path => RT::IR->HREFTo("Display.html?id=$id", IncludeWebPath => 0),
     );
 } elsif ( $request_path =~ m{(?:$re_rtir_path)Incident/Children} ) {
     my $lifecycle = $args->{'Lifecycle'} ||  RT::IR->lifecycle_report;
@@ -363,11 +363,11 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         new => title => loc("New [_1]",RT::IR::TicketType( Lifecycle => $lifecycle ) ),
-        path => RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle )),
+        path => RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]', lc RT::IR::TicketType( Lifecycle => $ticket->QueueObj->Lifecycle), $id),
-        path => RT::IR->HREFTo( "Display.html?id=$id"),
+        path => RT::IR->HREFTo( "Display.html?id=$id", IncludeWebPath => 0),
     );
 } elsif ( $request_path =~ m{^(?:$re_rtir_path)Merge} ) {
     my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
@@ -381,15 +381,15 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         link => title => loc('Merge'),
-        path => RT::IR->HREFTo("Merge/?". $query_string->( %args )),
+        path => RT::IR->HREFTo("Merge/?". $query_string->( %args ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         edit_search => title => loc('Edit Search'),
-        path => RT::IR->HREFTo("Merge/Refine.html?". $query_string->( %args, Lifecycle => $ticket->QueueObj->Lifecycle )),
+        path => RT::IR->HREFTo("Merge/Refine.html?". $query_string->( %args, Lifecycle => $ticket->QueueObj->Lifecycle ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]', lc RT::IR::TicketType( Lifecycle => $ticket->QueueObj->Lifecycle), $id),
-        path => RT::IR->HREFTo("Display.html?id=$id"),
+        path => RT::IR->HREFTo("Display.html?id=$id", IncludeWebPath => 0),
     );
 } elsif ( $request_path =~ m{(?:$re_rtir_path)Incident/Reply} ) {
     my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
@@ -407,15 +407,15 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         link => title => loc('Reply'),
-        path => RT::IR->HREFTo("Incident/Reply/?". $query_string->( %args )),
+        path => RT::IR->HREFTo("Incident/Reply/?". $query_string->( %args ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         edit_search => title => loc('Edit Search'),
-        path => RT::IR->HREFTo("Incident/Reply/Refine.html?". $query_string->( %args )),
+        path => RT::IR->HREFTo("Incident/Reply/Refine.html?". $query_string->( %args ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]', lc RT::IR::TicketType(Lifecycle => $ticket->QueueObj->Lifecycle), $id),
-        path => RT::IR->HREFTo("Display.html?id=$id"),
+        path => RT::IR->HREFTo("Display.html?id=$id", IncludeWebPath => 0),
     );
 } elsif ( $request_path =~ m{(?:$re_rtir_path)(Search/?|Incident/BulkAbandon\.html$|Report/BulkReject\.html$)} ) {
     my %args = $search_arguments->();
@@ -439,7 +439,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
     if ( $args{'Query'} ) {
         PageMenu()->child(
             link => title => loc('Show Results'),
-            path => RT::IR->HREFTo("Search/Results.html?". $query_string->( %args )),
+            path => RT::IR->HREFTo("Search/Results.html?". $query_string->( %args ), IncludeWebPath => 0),
         );
     }
 
@@ -451,37 +451,37 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
         edit_search => title => loc('Edit Search'),
         path => RT::IR->HREFTo("Search/" .
                     ($bulk_path ? "Refine.html?" : "?") .
-                    $query_string->( %args )),
+                    $query_string->( %args ), IncludeWebPath => 0),
     );
     if ( $args{'Query'} && !$bulk_path ) {
         PageMenu()->child(
             new_search => title => loc('New Search'),
-            path => RT::IR->HREFTo("Search/?NewQuery=1")
+            path => RT::IR->HREFTo("Search/?NewQuery=1", IncludeWebPath => 0)
         );
     }
 
     if ( $lifecycle eq RT::IR->lifecycle_incident ) {
         PageMenu()->child(
             report => title => loc('Report'),
-            path => RT::IR->HREFTo("Reporting/"),
+            path => RT::IR->HREFTo("Reporting/", IncludeWebPath => 0),
         );
 
         PageMenu()->child(
             abandon => title => loc('Bulk Abandon'),
-            path => RT::IR->HREFTo("Incident/BulkAbandon.html?". $query_string->( %args )),
+            path => RT::IR->HREFTo("Incident/BulkAbandon.html?". $query_string->( %args ), IncludeWebPath => 0),
         );
     }
     elsif ( $lifecycle eq RT::IR->lifecycle_report) {
         PageMenu()->child(
             reject => title => loc('Bulk Reject'),
-            path => RT::IR->HREFTo("Report/BulkReject.html?". $query_string->( %args )),
+            path => RT::IR->HREFTo("Report/BulkReject.html?". $query_string->( %args ), IncludeWebPath => 0),
         );
     }
 
     if ( $args{'Query'} ) {
         PageMenu()->child(
             chart => title => loc('Chart'),
-            path => RT::IR->HREFTo("Search/Reporting.html?". $query_string->( %args )),
+            path => RT::IR->HREFTo("Search/Reporting.html?". $query_string->( %args ), IncludeWebPath => 0),
         );
 
         my $more = PageMenu->child( more => title => loc('Feeds') );
@@ -534,23 +534,23 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
     $ticket->Load($id);
     PageMenu()->child(
         back => title => loc('Back to  [_1] #[_2]',lc RT::IR::TicketType(Lifecycle => $ticket->QueueObj->Lifecycle), $id),
-        path => RT::IR->HREFTo("Display.html?id=$id"),
+        path => RT::IR->HREFTo("Display.html?id=$id", IncludeWebPath => 0),
     );
 }
 
 if ( $session{'CurrentUser'}->HasRight(Right => 'ModifySelf', Object => $RT::System) ) {
     if ( $request_path =~ m{(?:$re_rtir_path)(?:index\.html|)$} ) {
-        PageMenu()->child( edit => title => loc('Edit'), path => RT::IR->HREFTo('Prefs/Home.html' ))
+        PageMenu()->child( edit => title => loc('Edit'), path => RT::IR->HREFTo('Prefs/Home.html', IncludeWebPath => 0 ))
     }
     Menu->child('preferences')->child('settings')->child(
         rtir_home_page => title => loc('RTIR at a glance'),
-        path => RT::IR->HREFTo('Prefs/Home.html'),
+        path => RT::IR->HREFTo('Prefs/Home.html', IncludeWebPath => 0),
     );
 }
 
 PageWidgets()->child('simple_search')->raw_html( $m->scomp(
     '/Elements/SimpleSearch',
-    SendTo => RT::IR->HREFTo('index.html'),
+    SendTo => RT::IR->HREFTo('index.html', IncludeWebPath => 0),
     Placeholder => 'Search Incidents'
 ) );
 PageWidgets()->child( create_ticket => raw_html => $m->scomp('/RTIR/Elements/CreateTicketInQueue') );
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 795a384..565de18 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -824,8 +824,11 @@ XXX TODO this wants a better name.
 sub HREFTo {
     my $self = shift;
     my $page = shift;
-    my %args = ( Constituency => $HTML::Mason::Commands::m->{'RTIR_ConstituencyFilter'},
-                 @_); 
+    my %args = (
+        IncludeWebPath => 1,
+        Constituency   => $HTML::Mason::Commands::m->{'RTIR_ConstituencyFilter'},
+        @_
+    );
     # XXX TODO - this code has a dependency on the implementation
     # of the mason UI. It might want to be either in a web handler
     # related namespace or to have a better abstraction
@@ -833,7 +836,7 @@ sub HREFTo {
     if ($args{'Constituency'}) {  
         $c = 'c/'.$args{'Constituency'}."/";
     }
-    return RT->Config->Get('WebPath') .'/RTIR/'.$c.$page;
+    return ($args{IncludeWebPath} ? RT->Config->Get('WebPath') : '') .'/RTIR/'.$c.$page;
 }
 
 

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


More information about the rt-commit mailing list