diff options
author | ivan <ivan> | 2007-10-09 04:48:25 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-10-09 04:48:25 +0000 |
commit | 3fb622ec06c82c10798ab72ed5ea6e72e0a0b1bf (patch) | |
tree | 24abdbd99dc36f1ae7865bf530656f1718e66afb /FS/FS/TicketSystem | |
parent | a41d7d685dfca9ddcfcc2a4c629c3e1ee22090d9 (diff) |
add ticket_system-priority_reverse config
Diffstat (limited to 'FS/FS/TicketSystem')
-rw-r--r-- | FS/FS/TicketSystem/RT_External.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm index cd6834c..0b9a98e 100644 --- a/FS/FS/TicketSystem/RT_External.pm +++ b/FS/FS/TicketSystem/RT_External.pm @@ -2,6 +2,7 @@ package FS::TicketSystem::RT_External; use strict; use vars qw( $DEBUG $me $conf $dbh $default_queueid $external_url + $priority_reverse $priority_field $priority_field_queue $field ); use URI::Escape; @@ -15,6 +16,7 @@ $DEBUG = 0; FS::UID->install_callback( sub { $conf = new FS::Conf; $default_queueid = $conf->config('ticket_system-default_queueid'); + $priority_reverse = $conf->exists('ticket_system-priority_reverse'); $priority_field = $conf->config('ticket_system-custom_priority_field'); if ( $priority_field ) { @@ -75,7 +77,11 @@ sub customer_tickets { "position(tickets.status in 'newopenstalledresolvedrejecteddeleted')". " AS svalue " . ( length($priority) ? ", objectcustomfieldvalues.content" : '' ). - " $from_sql ORDER BY svalue, priority DESC, id DESC LIMIT $limit"; + " $from_sql ". + " ORDER BY svalue, ". + " priority ". ( $priority_reverse ? 'ASC' : 'DESC' ). ", ". + " id DESC ". + " LIMIT $limit"; warn "$me $sql (@param)" if $DEBUG; my $sth = $dbh->prepare($sql) or die $dbh->errstr. "preparing $sql"; $sth->execute(@param) or die $sth->errstr. "executing $sql"; |