summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-02-19 02:52:01 -0600
committerJonathan Prykop <jonathan@freeside.biz>2016-02-19 02:52:01 -0600
commitdd72ad399c69875b14703e9086f8cedb88acb518 (patch)
tree8da035ae74cd995cfd4529be71b811ca937c28f2 /FS
parentbc977024d700876278824d2556c8d6201ad71334 (diff)
parentefb3f4ff4890d19c2877600cf3a27ad77a45ee70 (diff)
Merge branch 'FREESIDE_3_BRANCH_34237' into FREESIDE_3_BRANCH
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm37
-rw-r--r--FS/FS/TicketSystem/RT_Internal.pm4
-rw-r--r--FS/FS/cust_main.pm24
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;