X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FTicketSystem%2FRT_Internal.pm;h=0043811411c88accb54cd8d8ab82fb18b63cdb71;hb=e96a3fd1c8ee8c711a7e119c0937da6866bbd4f0;hp=a4ecd6a66612d4babf83b6fac4c9dc325f2544a6;hpb=52a2dbebe522c0866e18f09a169d39a0cbd4d7b8;p=freeside.git diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm index a4ecd6a66..004381141 100644 --- a/FS/FS/TicketSystem/RT_Internal.pm +++ b/FS/FS/TicketSystem/RT_Internal.pm @@ -1,8 +1,54 @@ package FS::TicketSystem::RT_Internal; use strict; +use vars qw( @ISA ); +use FS::UID qw(dbh); +use FS::CGI qw(popurl); +use FS::TicketSystem::RT_Libs; @ISA = qw( FS::TicketSystem::RT_Libs ); +sub sql_num_customer_tickets { + "( select count(*) from tickets + join links on ( tickets.id = links.localbase ) + where ( status = 'new' or status = 'open' or status = 'stalled' ) + and target = 'freeside://freeside/cust_main/' || custnum + )"; +} + +sub num_customer_tickets { + my( $self, $custnum, $priority ) = ( shift, shift, shift ); + $self->SUPER::num_customer_tickets( $custnum, $priority, dbh ); +} + +sub customer_tickets { + my( $self, $custnum, $limit, $priority ) = ( shift, shift, shift, shift ); + $self->SUPER::customer_tickets( $custnum, $limit, $priority, dbh ); +} + +sub href_customer_tickets { + my $self = shift; + # well, 2 is wrong here but will have to do for now + baseurl().'rt/'. $self->_href_customer_tickets(@_); +} + +sub href_new_ticket { + my $self = shift; + # well, 2 is wrong here but will have to do for now + baseurl().'rt/'. $self->_href_new_ticket(@_); +} + +sub href_ticket { + my $self = shift; + # well, 2 is wrong here but will have to do for now + baseurl().'rt/'. $self->_href_ticket(@_); +} + +sub baseurl { + + return popurl(2); + +} + 1;