diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-06-07 16:36:04 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-06-07 16:36:04 -0700 |
commit | 655f6f9502b46848565af4dcd86da79386afe139 (patch) | |
tree | da0b0fd9a6443693ef608829e53f7b46066065b4 | |
parent | 5711fd77e33646e11340c5fc8997cdc15fe76f25 (diff) |
fix CSV/XLS links
-rwxr-xr-x | rt/share/html/Elements/Tabs | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/rt/share/html/Elements/Tabs b/rt/share/html/Elements/Tabs index ef17f6fef..75b8160da 100755 --- a/rt/share/html/Elements/Tabs +++ b/rt/share/html/Elements/Tabs @@ -246,7 +246,7 @@ my $build_admin_menu = sub { my $section; if ( $request_path =~ m|^/Admin/$type/?(?:index.html)?$| || ( $request_path =~ m|^/Admin/$type/(?:Modify.html)$| - && $m->request_args->{'Create'} ) + && $DECODED_ARGS->{'Create'} ) ) { $section = $tabs; @@ -261,11 +261,11 @@ my $build_admin_menu = sub { } if ( $request_path =~ m{^/Admin/Queues} ) { - if ( $m->request_args->{'id'} && $m->request_args->{'id'} =~ /^\d+$/ + if ( $DECODED_ARGS->{'id'} && $DECODED_ARGS->{'id'} =~ /^\d+$/ || - $m->request_args->{'Queue'} && $m->request_args->{'Queue'} =~ /^\d+$/ + $DECODED_ARGS->{'Queue'} && $DECODED_ARGS->{'Queue'} =~ /^\d+$/ ) { - my $id = $m->request_args->{'Queue'} || $m->request_args->{'id'}; + my $id = $DECODED_ARGS->{'Queue'} || $DECODED_ARGS->{'id'}; my $queue_obj = RT::Queue->new( $session{'CurrentUser'} ); $queue_obj->Load($id); @@ -295,8 +295,8 @@ my $build_admin_menu = sub { } } if ( $request_path =~ m{^/Admin/Users} ) { - if ( $m->request_args->{'id'} && $m->request_args->{'id'} =~ /^\d+$/ ) { - my $id = $m->request_args->{'id'}; + if ( $DECODED_ARGS->{'id'} && $DECODED_ARGS->{'id'} =~ /^\d+$/ ) { + my $id = $DECODED_ARGS->{'id'}; my $obj = RT::User->new( $session{'CurrentUser'} ); $obj->Load($id); @@ -313,8 +313,8 @@ my $build_admin_menu = sub { } if ( $request_path =~ m{^/Admin/Groups} ) { - if ( $m->request_args->{'id'} && $m->request_args->{'id'} =~ /^\d+$/ ) { - my $id = $m->request_args->{'id'}; + if ( $DECODED_ARGS->{'id'} && $DECODED_ARGS->{'id'} =~ /^\d+$/ ) { + my $id = $DECODED_ARGS->{'id'}; my $obj = RT::Group->new( $session{'CurrentUser'} ); $obj->Load($id); @@ -328,8 +328,8 @@ my $build_admin_menu = sub { } if ( $request_path =~ m{^/Admin/CustomFields/} ) { - if ( $m->request_args->{'id'} && $m->request_args->{'id'} =~ /^\d+$/ ) { - my $id = $m->request_args->{'id'}; + if ( $DECODED_ARGS->{'id'} && $DECODED_ARGS->{'id'} =~ /^\d+$/ ) { + my $id = $DECODED_ARGS->{'id'}; my $obj = RT::CustomField->new( $session{'CurrentUser'} ); $obj->Load($id); @@ -354,7 +354,7 @@ my $build_admin_menu = sub { if ( $request_path =~ m{^/Admin/Articles/Classes/} ) { my $tabs = PageMenu(); - if ( my $id = $m->request_args->{'id'} ) { + if ( my $id = $DECODED_ARGS->{'id'} ) { my $obj = RT::CustomField->new( $session{'CurrentUser'} ); $obj->Load($id); @@ -491,7 +491,7 @@ my $build_main_nav = sub { $about_me->child( logout => title => loc('Logout'), path => '/NoAuth/Logout.html' ); } if ( $request_path =~ m{^/Dashboards/(\d+)?}) { - if ( my $id = ( $1 || $m->request_args->{'id'} ) ) { + if ( my $id = ( $1 || $DECODED_ARGS->{'id'} ) ) { my $obj = RT::Dashboard->new( $session{'CurrentUser'} ); $obj->LoadById($id); if ( $obj and $obj->id ) { @@ -507,7 +507,7 @@ my $build_main_nav = sub { if ( $request_path =~ m{^/Ticket/} ) { - if ( ( $m->request_args->{'id'} || '' ) =~ /^(\d+)$/ ) { + if ( ( $DECODED_ARGS->{'id'} || '' ) =~ /^(\d+)$/ ) { my $id = $1; my $obj = RT::Ticket->new( $session{'CurrentUser'} ); $obj->Load($id); @@ -658,17 +658,17 @@ my $build_main_nav = sub { && $request_path !~ m{^/Search/Simple\.html} ) || ( $request_path =~ m{^/Search/Simple\.html} - && $m->request_args->{'q'} ) + && $DECODED_ARGS->{'q'} ) ) { my $search = Menu()->child('search'); my $args = ''; my $has_query = ''; my $current_search = $session{"CurrentSearchHash"} || {}; - my $search_id = $m->request_args->{'SavedSearchLoad'} || $m->request_args->{'SavedSearchId'} || $current_search->{'SearchId'} || ''; - my $chart_id = $m->request_args->{'SavedChartSearchId'} || $current_search->{SavedChartSearchId}; + my $search_id = $DECODED_ARGS->{'SavedSearchLoad'} || $DECODED_ARGS->{'SavedSearchId'} || $current_search->{'SearchId'} || ''; + my $chart_id = $DECODED_ARGS->{'SavedChartSearchId'} || $current_search->{SavedChartSearchId}; - $has_query = 1 if ( $m->request_args->{'Query'} or $current_search->{'Query'} ); + $has_query = 1 if ( $DECODED_ARGS->{'Query'} or $current_search->{'Query'} ); my %query_args; my %fallback_query_args = ( @@ -677,12 +677,12 @@ my $build_main_nav = sub { ( map { my $p = $_; - $p => $m->request_args->{$p} || $current_search->{$p} + $p => $DECODED_ARGS->{$p} || $current_search->{$p} } qw(Query Format OrderBy Order Page) ), RowsPerPage => ( - defined $m->request_args->{'RowsPerPage'} - ? $m->request_args->{'RowsPerPage'} + defined $DECODED_ARGS->{'RowsPerPage'} + ? $DECODED_ARGS->{'RowsPerPage'} : $current_search->{'RowsPerPage'} ), ); @@ -736,7 +736,9 @@ my $build_main_nav = sub { my $more = $current_search_menu->child( more => title => loc('Feeds') ); - $more->child( spreadsheet => title => loc('Spreadsheet'), path => "/Search/Results.tsv$args" ); + $more->child( tsv => title => loc('TSV'), path => "/Search/Results.tsv$args" ); + $more->child( csv => title => loc('CSV'), path => "/Search/Results.csv$args" ); + $more->child( spreadsheet => title => loc('Spreadsheet'), path => "/Search/Results.xls$args" ); my %rss_data = map { $_ => $QueryArgs->{$_} || $fallback_query_args{$_} || '' } @@ -777,8 +779,8 @@ my $build_main_nav = sub { } if ( $request_path =~ m{^/Article/} ) { - if ( $m->request_args->{'id'} && $m->request_args->{'id'} =~ /^\d+$/ ) { - my $id = $m->request_args->{'id'}; + if ( $DECODED_ARGS->{'id'} && $DECODED_ARGS->{'id'} =~ /^\d+$/ ) { + my $id = $DECODED_ARGS->{'id'}; my $tabs = PageMenu(); $tabs->child( display => title => loc('Display'), path => "/Articles/Article/Display.html?id=".$id ); @@ -792,7 +794,7 @@ my $build_main_nav = sub { my $tabs = PageMenu(); $tabs->child( search => title => loc("Search"), path => "/Articles/Article/Search.html" ); $tabs->child( create => title => loc("New Article" ), path => "/Articles/Article/PreCreate.html" ); - if ( ( $m->request_args->{'id'} || '' ) =~ /^(\d+)$/ ) { + if ( $request_path =~ m{^/Articles/Article/} and ( $DECODED_ARGS->{'id'} || '' ) =~ /^(\d+)$/ ) { my $id = $1; my $obj = RT::Article->new( $session{'CurrentUser'} ); $obj->Load($id); @@ -825,7 +827,7 @@ my $build_selfservice_nav = sub { $queues->UnLimit; my $queue_count = 0; - my $queue_id = 1; + my $queue_id; while ( my $queue = $queues->Next ) { next unless $queue->CurrentUserHasRight('CreateTicket'); @@ -835,14 +837,14 @@ my $build_selfservice_nav = sub { } + if ( $queue_count > 1 ) { + Menu->child( new => title => loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' ); + } elsif ( $queue_id ) { + Menu->child( new => title => loc('New ticket'), path => '/SelfService/Create.html?Queue=' . $queue_id ); + } my $tickets = Menu->child( tickets => title => loc('Tickets')); $tickets->child( open => title => loc('Open tickets'), path => '/SelfService/' ); $tickets->child( closed => title => loc('Closed tickets'), path => '/SelfService/Closed.html' ); - if ( $queue_count > 1 ) { - $tickets->child( new => title => loc('New ticket'), path => '/SelfService/CreateTicketInQueue.html' ); - } else { - $tickets->child( new => title => loc('New ticket'), path => '/SelfService/Create.html?Queue=' . $queue_id ); - } my $username = '<span class="current-user">' |