X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_svc.pm;h=7e34f7dabd80717c054a976867ec63763880f73e;hb=050d6ba1479c273fc68c0ec2d3fedbb0ff6e8464;hp=ce61786e3b2c77aa6030a291a34fbb8e9c3fc2c1;hpb=6dff12f555fe81ed44b517eb48e1d708636709f6;p=freeside.git diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index ce61786e3..7e34f7dab 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -857,14 +857,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; @@ -873,7 +876,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 { @@ -883,10 +891,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, + ) + }; } } }