X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Frt_ticket.pm;h=80254fc5fa1734f5f44e4536135bf9bd37f1d8b1;hb=38e34bbc53a4222c7507e95914e1364a5a74623f;hp=534924eb0d25a3d7ea73a8e5ed1d400e061a8d05;hpb=03870c8fda3909d8aeb9d7120bc1debc3935f1c3;p=freeside.git diff --git a/FS/FS/part_export/rt_ticket.pm b/FS/FS/part_export/rt_ticket.pm index 534924eb0..80254fc5f 100644 --- a/FS/FS/part_export/rt_ticket.pm +++ b/FS/FS/part_export/rt_ticket.pm @@ -6,7 +6,6 @@ use FS::part_export; use FS::Record qw(qsearch qsearchs); use FS::Conf; use FS::TicketSystem; -use Data::Dumper 'Dumper'; @ISA = qw(FS::part_export); @@ -22,7 +21,7 @@ my %template_select = ( %templates = (0 => '', map { $_->msgnum, $_->msgname } qsearch({ table => 'msg_template', - hashref => {}, + hashref => { disabled => '' }, order_by => 'ORDER BY msgnum ASC' }) ); @@ -37,6 +36,7 @@ my %queue_select = ( $queues{$_[0]}; }, option_values => sub { + return (0) unless FS::Conf->new->config('ticket_system'); %queues = (0 => '', FS::TicketSystem->queues()); sort {$queues{$a} cmp $queues{$b}} keys %queues; }, @@ -123,19 +123,25 @@ tie my %options, 'Tie::IxHash', ( ); %info = ( - 'svc' => [qw( svc_acct )], #others? + 'svc' => [qw( svc_acct svc_broadband svc_phone svc_domain )], 'desc' => - 'Create an RT ticket', + 'Create an RT ticket', 'options' => \%options, 'nodomain' => '', - 'notes' => <<'END' -Create a ticket in RT. The subject and body of the ticket -will be generated from a message template. -END + 'no_machine' => 1, + 'notes' => ' + Create a ticket in RT. The subject and body of the ticket + will be generated from a message template.' ); sub _export_ticket { my( $self, $action, $svc ) = (shift, shift, shift); + my $conf = new FS::Conf; + die "rt_ticket export - no ticket system configured" + unless $conf->config('ticket_system'); + + FS::TicketSystem->init(); + my $msgnum = $self->option($action.'_template'); return if !$msgnum;