diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 37 | ||||
-rw-r--r-- | FS/FS/TicketSystem/RT_Internal.pm | 4 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 24 |
3 files changed, 64 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index e9d0ee690..41d6db691 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3276,12 +3276,14 @@ and customer address. Include units.', } }, }, + { 'key' => 'ticket_system-force_default_queueid', 'section' => 'ticketing', 'description' => 'Disallow queue selection when creating new tickets from customer view.', 'type' => 'checkbox', }, + { 'key' => 'ticket_system-selfservice_queueid', 'section' => 'ticketing', @@ -3360,6 +3362,41 @@ and customer address. Include units.', }, { + 'key' => 'ticket_system-appointment-queueid', + 'section' => 'ticketing', + 'description' => 'Custom field from the ticketing system to use as an appointment classification.', + #false laziness w/above + 'type' => 'select-sub', + 'options_sub' => sub { + my $conf = new FS::Conf; + if ( $conf->config('ticket_system') ) { + eval "use FS::TicketSystem;"; + die $@ if $@; + FS::TicketSystem->queues(); + } else { + (); + } + }, + 'option_sub' => sub { + my $conf = new FS::Conf; + if ( $conf->config('ticket_system') ) { + eval "use FS::TicketSystem;"; + die $@ if $@; + FS::TicketSystem->queue(shift); + } else { + ''; + } + }, + }, + + { + '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; |