From 14a40afa87f3c590f6c4796e2a892d9ee2a32a6c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 18 Nov 2005 09:44:26 +0000 Subject: [PATCH] update custom priorioty field BS for RT 3.4.4 --- FS/FS/TicketSystem/RT_External.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm index b69af4356..f8f54720b 100644 --- a/FS/FS/TicketSystem/RT_External.pm +++ b/FS/FS/TicketSystem/RT_External.pm @@ -56,7 +56,7 @@ sub customer_tickets { my( $from_sql, @param) = $self->_from_customer( $custnum, $priority ); my $sql = "select tickets.*, queues.name". - ( length($priority) ? ", ticketcustomfieldvalues.content" : '' ). + ( length($priority) ? ", objectcustomfieldvalues.content" : '' ). " $from_sql order by priority desc limit $limit"; my $sth = $dbh->prepare($sql) or die $dbh->errstr. "preparing $sql"; $sth->execute(@param) or die $sth->errstr. "executing $sql"; @@ -91,10 +91,11 @@ sub _from_customer { #"; push @param, $priority; - $join = "join TicketCustomFieldValues - on ( tickets.id = TicketCustomFieldValues.ticket )"; + $join = "join ObjectCustomFieldValues + on ( tickets.id = ObjectCustomFieldValues.ObjectId )"; - $where = "and content = ? + $where = "and ObjectType = 'RT::Ticket' + and content = ? and customfield = ( select id from customfields where name = ? and ( $queue_sql ) @@ -102,8 +103,9 @@ sub _from_customer { "; } else { $where = - "and 0 = ( select count(*) from TicketCustomFieldValues - where ticket = tickets.id + "and 0 = ( select count(*) from ObjectCustomFieldValues + where ObjectId = tickets.id + and ObjectType = 'RT::Ticket' and customfield = ( select id from customfields where name = ? and ( $queue_sql ) -- 2.11.0