From 194c053a60b8839c3cfc6a24efe0b8aeb286f31c Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 9 Nov 2006 02:28:08 +0000 Subject: correct ticket order --- FS/FS/TicketSystem/RT_External.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm index 7dde86228..234363a04 100644 --- a/FS/FS/TicketSystem/RT_External.pm +++ b/FS/FS/TicketSystem/RT_External.pm @@ -55,9 +55,11 @@ sub customer_tickets { $limit ||= 0; my( $from_sql, @param) = $self->_from_customer( $custnum, $priority ); - my $sql = "SELECT tickets.*, queues.name". - ( length($priority) ? ", objectcustomfieldvalues.content" : '' ). - " $from_sql ORDER BY priority, id DESC LIMIT $limit"; + my $sql="SELECT tickets.*, queues.name, ". + "position(tickets.status in 'newopenstalledresolvedrejecteddeleted')". + " AS svalue " . + ( length($priority) ? ", objectcustomfieldvalues.content" : '' ). + " $from_sql ORDER BY priority, svalue, id DESC LIMIT $limit"; my $sth = $dbh->prepare($sql) or die $dbh->errstr. "preparing $sql"; $sth->execute(@param) or die $sth->errstr. "executing $sql"; -- cgit v1.2.1