summaryrefslogtreecommitdiff
path: root/FS/FS/cust_svc.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-07-02 11:53:40 -0700
committerIvan Kohler <ivan@freeside.biz>2013-07-02 11:53:40 -0700
commita563de5fc2f42abf16fbcfda7cf5bc5f1ce794e7 (patch)
tree21ed995983a9ef1f51055c8e4c6c6300863c5c66 /FS/FS/cust_svc.pm
parent93f2d729dcc5c1bbf424a61ee49b985a4e3ed1d6 (diff)
selfservice, TNG, RT#22193
Diffstat (limited to 'FS/FS/cust_svc.pm')
-rw-r--r--FS/FS/cust_svc.pm21
1 files changed, 15 insertions, 6 deletions
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index 6aa254f..2066a05 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -805,14 +805,17 @@ sub get_session_history {
}
-=item tickets
+=item tickets [ STATUS ]
Returns an array of hashes representing the tickets linked to this service.
+An optional status (or arrayref or hashref of statuses) may be specified.
+
=cut
sub tickets {
my $self = shift;
+ my $status = ( @_ && $_[0] ) ? shift : '';
my $conf = FS::Conf->new;
my $num = $conf->config('cust_main-max_tickets') || 10;
@@ -821,7 +824,12 @@ sub tickets {
if ( $conf->config('ticket_system') ) {
unless ( $conf->config('ticket_system-custom_priority_field') ) {
- @tickets = @{ FS::TicketSystem->service_tickets($self->svcnum, $num) };
+ @tickets = @{ FS::TicketSystem->service_tickets( $self->svcnum,
+ $num,
+ undef,
+ $status,
+ )
+ };
} else {
@@ -831,10 +839,11 @@ sub tickets {
last if scalar(@tickets) >= $num;
push @tickets,
@{ FS::TicketSystem->service_tickets( $self->svcnum,
- $num - scalar(@tickets),
- $priority,
- )
- };
+ $num - scalar(@tickets),
+ $priority,
+ $status,
+ )
+ };
}
}
}