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

? sunnavy sunnavy at bestpractical.com
Wed Jul 7 17:33:07 EDT 2010


The branch, master has been updated
       via  fc026b27b8d70914641e6c487922eb637e0f594e (commit)
      from  9e77616e856847b9e9b9846b4615a79bbc024fe5 (commit)

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

- Log -----------------------------------------------------------------
commit fc026b27b8d70914641e6c487922eb637e0f594e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 8 05:34:16 2010 +0800

    in case TimeLeft|TimeEstimated is not a number

diff --git a/lib/RT/Extension/JSGantt.pm b/lib/RT/Extension/JSGantt.pm
index e934623..9b7d990 100644
--- a/lib/RT/Extension/JSGantt.pm
+++ b/lib/RT/Extension/JSGantt.pm
@@ -95,7 +95,7 @@ sub TicketsInfo {
             my $hours_per_day = RT->Config->Get('JSGanttWorkingHoursPerDay')
               || 8;
             my $total_time =
-              defined $Ticket->TimeLeft
+              defined $Ticket->TimeLeft && $Ticket->TimeLeft =~ /\d/
               ? ( $Ticket->TimeWorked + $Ticket->TimeLeft )
               : $Ticket->TimeEstimated;
             $total_time ||= 0;
@@ -160,10 +160,10 @@ sub TicketsInfo {
 
         if ($show_progress) {
             my $total_time =
-              defined $Ticket->TimeLeft
+              defined $Ticket->TimeLeft && $Ticket->TimeLeft =~ /\d/
               ? ( $Ticket->TimeWorked + $Ticket->TimeLeft )
               : $Ticket->TimeEstimated;
-            if ($total_time) {
+            if ($total_time && $total_time =~ /\d/ ) {
                 if ( $Ticket->TimeWorked ) {
                     $progress = int( 100 * $Ticket->TimeWorked / $total_time );
                 }

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



More information about the Bps-public-commit mailing list