X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FGraph%2FTickets.pm;h=477a5d077b6614989f8a299033db8d9201880385;hp=46345fbdd090fb826d0bd486a24f01244980689a;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/rt/lib/RT/Graph/Tickets.pm b/rt/lib/RT/Graph/Tickets.pm index 46345fbdd..477a5d077 100644 --- a/rt/lib/RT/Graph/Tickets.pm +++ b/rt/lib/RT/Graph/Tickets.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -58,10 +58,6 @@ RT::Graph::Tickets - view relations between tickets as graphs =cut unless ($RT::DisableGraphViz) { - require IPC::Run; - IPC::Run->import; - require IPC::Run::SafeHandles; - IPC::Run::SafeHandles->import; require GraphViz; GraphViz->import; } @@ -104,7 +100,7 @@ EOT sub gv_escape($) { my $value = shift; - $value =~ s{(?=")}{\\}g; + $value =~ s{(?=["\\])}{\\}g; return $value; } @@ -282,6 +278,14 @@ sub TicketLinks { ShowLinkDescriptions => 0, @_ ); + + my %valid_links = map { $_ => 1 } + qw(Members MemberOf RefersTo ReferredToBy DependsOn DependedOnBy); + + # Validate our link types + $args{ShowLinks} = [ grep { $valid_links{$_} } @{$args{ShowLinks}} ]; + $args{LeadingLink} = 'Members' unless $valid_links{ $args{LeadingLink} }; + unless ( $args{'Graph'} ) { $args{'Graph'} = GraphViz->new( name => 'ticket_links_'. $args{'Ticket'}->id, @@ -345,14 +349,6 @@ sub TicketLinks { return $args{'Graph'}; } -eval "require RT::Graph::Tickets_Vendor"; -if ($@ && $@ !~ qr{^Can't locate RT/Graph/Tickets_Vendor.pm}) { - die $@; -}; - -eval "require RT::Graph::Tickets_Local"; -if ($@ && $@ !~ qr{^Can't locate RT/Graph/Tickets_Local.pm}) { - die $@; -}; +RT::Base->_ImportOverlays(); 1;