X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftable-tickets.html;h=f89f984225aa5733571d6a692b676ef710855ca8;hb=afe30fc7315196cc4ae6da7606995cb8388d1a32;hp=6d1a45a0d9eac899ef46961e9de05b5692250549;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/httemplate/elements/table-tickets.html b/httemplate/elements/table-tickets.html index 6d1a45a0d..f89f98422 100644 --- a/httemplate/elements/table-tickets.html +++ b/httemplate/elements/table-tickets.html @@ -94,12 +94,12 @@ View <%init> -use Date::Parse qw(str2time); -use Date::Format qw(time2str); my %opt = @_; my $conf = new FS::Conf; +return '' unless $conf->config('ticket_system'); + my $object = $opt{'object'}; $object = $object->cust_svc if $object->isa('FS::svc_Common'); my( @tickets ) = $object->tickets; @@ -116,8 +116,10 @@ if ( $object->isa('FS::cust_main') ) { $object->custnum, { 'statuses' => [ 'resolved' ] } ); -} -elsif ( $object->isa('FS::cust_svc') ) { +} elsif ( $object->isa('FS::cust_svc') ) { + + return '' unless $object->pkgnum; + $thing = 'service'; $open_link = FS::TicketSystem->href_service_tickets($object->svcnum); @@ -151,7 +153,7 @@ if ( $ss_priority ) { my $format = $conf->config('date_format') || '%Y-%m-%d'; my $date_formatter = sub { - my $time = str2time($_[0], 'GMT'); + my $time = parse_datetime($_[0], 'GMT'); # exclude times within 24 hours of zero ($time > 86400) ? time2str($format, $time) : ''; };