X-Git-Url: http://git.home-dn.net/?p=manu%2FRT-Extension-SearchResults-XLS.git;a=blobdiff_plain;f=html%2FCallbacks%2FResults-XLS%2FSearch%2FResults.html%2FSearchActions;h=b3bca550e75068dc749d1a2b51d0fac6cdf283e2;hp=9d83c3319173f13ad6ee5b643534f709bb163e4d;hb=eccf2d3c39297b0bc145041e65f8245b1bef49ea;hpb=62c1f305415dd098a43e3ea4b9f84cb87ff80c67 diff --git a/html/Callbacks/Results-XLS/Search/Results.html/SearchActions b/html/Callbacks/Results-XLS/Search/Results.html/SearchActions index 9d83c33..b3bca55 100644 --- a/html/Callbacks/Results-XLS/Search/Results.html/SearchActions +++ b/html/Callbacks/Results-XLS/Search/Results.html/SearchActions @@ -1,4 +1,27 @@ +% # Don't display this callback if our RT Version contains the new ResultsView +% # AfterTools Callback +% if ( $must_display ) { XLS +% } +<%INIT> +my $must_display = 0; + +# cmp_version is present only since 3.8.0 +sub cmp_version($$) { + my ($a, $b) = (@_); + my @a = split /[^0-9]+/, $a; + my @b = split /[^0-9]+/, $b; + for ( my $i = 0; $i < @a; $i++ ) { + return 1 unless defined $b[$i]; + return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i]; + } + return 0 if @a == @b; + return -1; +} + +$must_display = ( cmp_version( '3.8.1', $RT::VERSION ) > 0 ); + + <%ARGS> $QueryString => undef