summaryrefslogtreecommitdiff
path: root/FS/FS/TicketSystem/RT_External.pm
diff options
context:
space:
mode:
authorivan <ivan>2005-11-18 09:44:26 +0000
committerivan <ivan>2005-11-18 09:44:26 +0000
commit14a40afa87f3c590f6c4796e2a892d9ee2a32a6c (patch)
tree11f1b0d2aabbcedc52e6d46b77adfb8c77b35bd3 /FS/FS/TicketSystem/RT_External.pm
parent4ea07786b15d272d72ccd591f290da0005b7c16f (diff)
update custom priorioty field BS for RT 3.4.4
Diffstat (limited to 'FS/FS/TicketSystem/RT_External.pm')
-rw-r--r--FS/FS/TicketSystem/RT_External.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm
index b69af43..f8f5472 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 )