diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-10-05 19:09:33 -0700 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-02-03 17:28:24 -0600 |
commit | 2ed3ae34f224a4a78813afb45b35fe83ae6b1d82 (patch) | |
tree | e62c724fa63655010ebdfa2b898290de701299c0 /FS | |
parent | 660d0fe0876186513fdd4d6a2946816dc4a42db5 (diff) |
ticket_system-appointment-custom_field, RT#34237
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/TicketSystem/RT_Internal.pm | 4 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 24 |
3 files changed, 34 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 3633375f0..903b42e96 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3390,6 +3390,13 @@ and customer address. Include units.', }, { + 'key' => 'ticket_system-appointment-custom_field', + 'section' => 'ticketing', + 'description' => 'Custom field from the ticketing system to use as an appointment classification.', + 'type' => 'text', + }, + + { 'key' => 'ticket_system-escalation', 'section' => 'ticketing', 'description' => 'Enable priority escalation of tickets as part of daily batch processing.', diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm index 6fb2c187d..b70ac5360 100644 --- a/FS/FS/TicketSystem/RT_Internal.pm +++ b/FS/FS/TicketSystem/RT_Internal.pm @@ -111,7 +111,7 @@ properly. # create an RT::Tickets object for a specified custnum or svcnum sub _tickets_search { - my( $self, $type, $number, $limit, $priority, $status ) = @_; + my( $self, $type, $number, $limit, $priority, $status, $queueid ) = @_; $type =~ /^Customer|Service$/ or die "invalid type: $type"; $number =~ /^\d+$/ or die "invalid custnum/svcnum: $number"; @@ -159,6 +159,8 @@ sub _tickets_search { join(' OR ', map { "Status = '$_'" } @statuses). ' ) '; + $rtql .= " AND Queue = $queueid " if $queueid; + warn "$me _customer_tickets_search:\n$rtql\n" if $DEBUG; $Tickets->FromSQL($rtql); diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 3df17bc62..cf9bdb9b6 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -4417,6 +4417,30 @@ sub tickets { (@tickets); } +=item appointments [ STATUS ] + +Returns an array of hashes representing the customer's RT tickets which +are appointments. + +=cut + +sub appointments { + my $self = shift; + my $status = ( @_ && $_[0] ) ? shift : ''; + + return () unless $conf->config('ticket_system'); + + my $queueid = $conf->config('ticket_system-appointment-queueid'); + + @{ FS::TicketSystem->customer_tickets( $self->custnum, + 99, + undef, + $status, + $queueid, + ) + }; +} + # Return services representing svc_accts in customer support packages sub support_services { my $self = shift; |