[Rt-commit] r13358 - in rt/3.8/branches/3.8.0-releng: . lib/RT/Graph share/html/Ticket/Graphs

jesse at bestpractical.com jesse at bestpractical.com
Tue Jun 17 13:18:10 EDT 2008


Author: jesse
Date: Tue Jun 17 13:18:10 2008
New Revision: 13358

Modified:
   rt/3.8/branches/3.8.0-releng/   (props changed)
   rt/3.8/branches/3.8.0-releng/lib/RT/Graph/Tickets.pm
   rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/Elements/EditGraphProperties
   rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/index.html

Log:
 r32999 at 31b (orig r13347):  ruz | 2008-06-16 22:08:04 -0400
 * add support for graphs direction


Modified: rt/3.8/branches/3.8.0-releng/lib/RT/Graph/Tickets.pm
==============================================================================
--- rt/3.8/branches/3.8.0-releng/lib/RT/Graph/Tickets.pm	(original)
+++ rt/3.8/branches/3.8.0-releng/lib/RT/Graph/Tickets.pm	Tue Jun 17 13:18:10 2008
@@ -267,6 +267,7 @@
         Ticket               => undef,
 
         Graph                => undef,
+        Direction            => 'TB',
         Seen                 => undef,
         SeenEdge             => undef,
 
@@ -283,6 +284,8 @@
         $args{'Graph'} = GraphViz->new(
             name    => 'ticket_links_'. $args{'Ticket'}->id,
             bgcolor => "transparent",
+# TODO: patch GraphViz to support all posible RDs
+            rankdir => ($args{'Direction'} || "TB") eq "LR",
             node => { shape => 'box', style => 'filled,rounded', fillcolor => 'white' },
         );
         %fill_cache = ();

Modified: rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/Elements/EditGraphProperties
==============================================================================
--- rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/Elements/EditGraphProperties	(original)
+++ rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/Elements/EditGraphProperties	Tue Jun 17 13:18:10 2008
@@ -47,6 +47,14 @@
 %# END BPS TAGGED BLOCK }}}
 <&| /Widgets/TitleBox, title => loc('Graph Properties') &>
 
+<% loc('Direction') %> <select name="Direction">
+<option value="TB" <% ($Direction||'TB') eq 'TB'? 'selected="selected"': '' |n %>><% loc('top to bottom') %></option>
+<option value="LR" <% ($Direction||'TB') eq 'LR'? 'selected="selected"': '' |n %>><% loc('left to right') %></option>
+%# XXX: not supported by GraphViz perl module
+%#<option value="BT" <% ($Direction||'TB') eq 'BT'? 'selected="selected"': '' |n %>><% loc('bottom to top') %></option>
+%#<option value="RL" <% ($Direction||'TB') eq 'RL'? 'selected="selected"': '' |n %>><% loc('right to left') %></option>
+</select><br />
+
 <% loc('Main type of links') %> <select name="LeadingLink">
 % foreach ( @link_types ) {
 <option value="<% $_ %>" <% ($LeadingLink||'Members') eq $_? 'selected="selected"': '' |n %>><% loc($_) %></option>
@@ -116,6 +124,7 @@
 
 <%ARGS>
 $id => undef
+$Direction => 'TB'
 $LeadingLink => 'Members'
 @ShowLinks => ('MemberOf', 'DependsOn', 'RefersTo')
 $MaxDepth => 3

Modified: rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/index.html
==============================================================================
--- rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/index.html	(original)
+++ rt/3.8/branches/3.8.0-releng/share/html/Ticket/Graphs/index.html	Tue Jun 17 13:18:10 2008
@@ -78,7 +78,7 @@
 use RT::Graph::Tickets;
 my @results;
 
-my @save_arguments = qw(id LeadingLink ShowLinks MaxDepth FillUsing ShowLinkDescriptions);
+my @save_arguments = qw(id Direction LeadingLink ShowLinks MaxDepth FillUsing ShowLinkDescriptions);
 foreach my $level ( 0 .. 6 ) {
     push @save_arguments, "Level-". $level ."-Properties";
 }


More information about the Rt-commit mailing list