[Bps-public-commit] rt-extension-jsgantt branch, master, updated. 7feedcf52a03c58fa9f3c9f8ef53f5462e295896

? sunnavy sunnavy at bestpractical.com
Tue Jul 6 04:38:30 EDT 2010


The branch, master has been updated
       via  7feedcf52a03c58fa9f3c9f8ef53f5462e295896 (commit)
      from  d176e130b9094b55e539b774ecdb11d59c892b0e (commit)

Summary of changes:
 lib/RT/Extension/JSGantt.pm |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 7feedcf52a03c58fa9f3c9f8ef53f5462e295896
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jul 6 16:39:54 2010 +0800

    in case endless recursion

diff --git a/lib/RT/Extension/JSGantt.pm b/lib/RT/Extension/JSGantt.pm
index 3645021..4608912 100644
--- a/lib/RT/Extension/JSGantt.pm
+++ b/lib/RT/Extension/JSGantt.pm
@@ -231,6 +231,14 @@ sub _RelatedTickets {
 
 sub _GetDate {
     my $ticket = shift;
+    my $depth;
+    if ( $_[0] =~ /^\d+$/ ) {
+        $depth = shift;
+    } 
+    else {
+        $depth = 0;
+    }
+
     my @fields = @_;
     my ( $date_obj, $date );
     for my $field (@fields) {
@@ -243,14 +251,14 @@ sub _GetDate {
         }
     }
 
-    if ($date) {
+    if ($date || $depth++ > 10 ) {
         return ( $date_obj, $date );
     }
 
     # inherit from parents
     for my $member_of ( @{ $ticket->MemberOf->ItemsArrayRef } ) {
         my $parent = $member_of->TargetObj;
-        return _GetDate( $parent, @fields );
+        return _GetDate( $parent, $depth, @fields );
     }
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list