X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-html.html;h=8e6546cf83a9db10c6108f2d84644418a1a5aa30;hb=1e5db35fac1efb929a00e7f1e3b17fe4046b54a2;hp=98f9c4476c9b46982d7de2cd0921a026d427e27b;hpb=4317635c55495a4c89413e59bd55f64aa001e38c;p=freeside.git diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html index 98f9c4476..8e6546cf8 100644 --- a/httemplate/search/elements/search-html.html +++ b/httemplate/search/elements/search-html.html @@ -78,7 +78,7 @@ % unless ( $total ) { % unless ( $opt{'disable_nonefound'} ) { - No matching <% $opt{'name'} %> found.
+

No matching <% $opt{'name'} %> found.
% } % } % @@ -190,11 +190,26 @@ % my $h2 = 0; % my $colspan = 0; +% my @fields = @{ $opt{'sort_fields'} || $opt{'fields'} || [] }; +% my $order_by = $cgi->param('order_by'); % foreach my $header ( @{ $opt{header} } ) { +% +% my $field = shift @fields; +% % $colspan-- if $colspan > 0; % next if $colspan; % % my $label = ref($header) ? $header->{label} : $header; +% unless ( ref($field) || !$field ) { +% if ( $order_by eq $field ) { +% $cgi->param('order_by', "$field DESC"); +% } else { +% $cgi->param('order_by', $field); +% } +% $label = qq($label); +% } +% % $colspan = ref($header) ? $header->{colspan} : 0; % my $rowspan = 1; % my $style = '';