X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_svc.pm;h=2066a05ac2ffd973cbdca45a0a9d1412118bbab2;hp=6aa254fda66d46511143f31fb4a05cbc50bddacb;hb=a563de5fc2f42abf16fbcfda7cf5bc5f1ce794e7;hpb=20c649e7838f9448e53e0ba1c8e49820f031fc3e diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 6aa254fda..2066a05ac 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, + ) + }; } } }