summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-05-06 16:43:45 -0700
committerMark Wells <mark@freeside.biz>2015-05-06 16:57:43 -0700
commit95606bc9db41352511c886773a311f2166cc6cf2 (patch)
tree255095b60370ab663d585c85a750cab85e97a9a8 /httemplate/search
parentc422010521a7c09673a8d4d0068d3fd482dd2dbc (diff)
display N most recent emails in customer view, #30164
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_msg.html2
-rw-r--r--httemplate/search/elements/search.html9
2 files changed, 5 insertions, 6 deletions
diff --git a/httemplate/search/cust_msg.html b/httemplate/search/cust_msg.html
index d5b865c3b..401f52ebb 100644
--- a/httemplate/search/cust_msg.html
+++ b/httemplate/search/cust_msg.html
@@ -47,7 +47,7 @@
],
'html_init' => $html_init,
'really_disable_download' => 1,
- @_ #why?
+ 'order_by' => '_date DESC',
&>
<%init>
#hmm...
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 62a0e4786..64f3a665f 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -386,10 +386,7 @@ unless ( $type =~ /^(csv|xml|\w*.xls)$/) {
}
#order by override
-my $order_by = '';
-#if ( $cgi->param('order_by') =~ /^([\w\, ]+)$/ ) {
-# $order_by = $1;
-#}
+my $order_by = $opt{order_by} || '';
$order_by = $cgi->param('order_by') if $cgi->param('order_by');
# run the query
@@ -415,6 +412,8 @@ if ( ref($opt{query}) ) {
}
}
+ $opt{query}->{'order_by'} .= " $limit";
+
} elsif (ref($opt{query}) eq 'ARRAY') {
@query = @{ $opt{query} };
} else {
@@ -434,7 +433,7 @@ if ( ref($opt{query}) ) {
}
@query
],
- 'order_by' => $opt{order_by}. " ". $limit,
+ #'order_by' => $opt{order_by}. " ". $limit,
)
];
} else {