A few RT_External fixes.
[freeside.git] / FS / FS / TicketSystem / RT_Internal.pm
1 package FS::TicketSystem::RT_Internal;
2
3 use strict;
4 use vars qw( @ISA );
5 use FS::UID qw(dbh);
6 use FS::CGI qw(popurl);
7 use FS::TicketSystem::RT_Libs;
8
9 @ISA = qw( FS::TicketSystem::RT_Libs );
10
11 sub sql_num_customer_tickets {
12   "( select count(*) from tickets
13                      join links on ( tickets.id = links.localbase )
14      where ( status = 'new' or status = 'open' or status = 'stalled' )
15        and target = 'freeside://freeside/cust_main/' || custnum
16    )";
17 }
18
19 sub num_customer_tickets {
20   my( $self, $custnum, $priority ) = ( shift, shift, shift );
21   $self->SUPER::num_customer_tickets( $custnum, $priority, dbh );
22 }
23
24 sub customer_tickets {
25   my( $self, $custnum, $limit, $priority ) = ( shift, shift, shift, shift );
26   $self->SUPER::customer_tickets( $custnum, $limit, $priority, dbh );
27 }
28
29 sub href_customer_tickets {
30   my $self = shift;
31   # well, 2 is wrong here but will have to do for now
32   baseurl().'rt/'. $self->_href_customer_tickets(@_);
33 }
34
35 sub href_new_ticket {
36   my $self = shift;
37   # well, 2 is wrong here but will have to do for now
38   baseurl().'rt/'. $self->_href_new_ticket(@_);
39 }
40
41 sub href_ticket {
42   my $self = shift;
43   # well, 2 is wrong here but will have to do for now
44   baseurl().'rt/'. $self->_href_ticket(@_);
45 }
46
47 sub baseurl {
48
49   return popurl(2);
50
51 }
52
53 1;
54