X-Git-Url: http://git.home-dn.net/?p=manu%2FRT-Extension-SearchResults-ODS.git;a=blobdiff_plain;f=html%2FCallbacks%2FResults-ODS%2FElements%2FTabs%2FPrivileged;h=ec849a6c1e95437604a38772bc71b12c7d835378;hp=e144564d696e0a2784eab97d4676a06f33e778b8;hb=8c7186545d13b38783caf887a92871536aa01d18;hpb=d4074b22b5c51361a938461b25bbc68acb6d31f2 diff --git a/html/Callbacks/Results-ODS/Elements/Tabs/Privileged b/html/Callbacks/Results-ODS/Elements/Tabs/Privileged index e144564..ec849a6 100644 --- a/html/Callbacks/Results-ODS/Elements/Tabs/Privileged +++ b/html/Callbacks/Results-ODS/Elements/Tabs/Privileged @@ -55,12 +55,29 @@ my $query_string = sub { return $u->query; }; -if ( $request_path =~ qr{^/Search/Results\.html} ) { - my $tabs = PageMenu; - $tabs->child( - 'ods' => title => loc('ODS'), - path => '/Search/Results.ods?' . $query_string->( %{ $m->request_args } ) - ); + +if ( + ( + $request_path =~ m{^/(?:Ticket|Search)/} + && $request_path !~ m{^/Search/Simple\.html} + ) + || ( $request_path =~ m{^/Search/Simple\.html} + && $DECODED_ARGS->{'q'} ) + ) { + + my $has_query = ''; + my $current_search = $session{"CurrentSearchHash"} || {}; + $has_query = 1 if ( $DECODED_ARGS->{'Query'} or $current_search->{'Query'} ); + + if ( $has_query ) { + my $tabs = PageMenu; + my $feeds = $tabs->child('more'); + + $feeds->child( + 'ods' => title => loc('ODS'), + path => '/Search/Results.ods?' . $query_string->( %{ $m->request_args } ) + ); + } }