summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2006-11-09 02:28:08 +0000
committerjeff <jeff>2006-11-09 02:28:08 +0000
commit194c053a60b8839c3cfc6a24efe0b8aeb286f31c (patch)
tree9ee9483f65940a9e4fc39449c99e34934c556598
parent011655eed8c44c354efa49979d39e2c32f678454 (diff)
correct ticket order
-rw-r--r--FS/FS/TicketSystem/RT_External.pm8
1 files 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";