[Bps-public-commit] r11671 - RT-Extension-Reports/html/Reports/Types

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Apr 10 03:02:31 EDT 2008


Author: sunnavy
Date: Thu Apr 10 03:02:30 2008
New Revision: 11671

Modified:
   RT-Extension-Reports/html/Reports/Types/ActiveOrInactive
   RT-Extension-Reports/html/Reports/Types/CreatedOrResolved
   RT-Extension-Reports/html/Reports/Types/General
   RT-Extension-Reports/html/Reports/Types/TicketsMoved
   RT-Extension-Reports/html/Reports/Types/TimeWorked

Log:
intialize data to show 0s in reports

Modified: RT-Extension-Reports/html/Reports/Types/ActiveOrInactive
==============================================================================
--- RT-Extension-Reports/html/Reports/Types/ActiveOrInactive	(original)
+++ RT-Extension-Reports/html/Reports/Types/ActiveOrInactive	Thu Apr 10 03:02:30 2008
@@ -119,6 +119,13 @@
 
 
     $end_date->AddDay; # we want the date range to be inclusive
+
+# initial %data;
+    require RT::Extension::Reports::Util;
+    RT::Extension::Reports::Util::initialize_data( Data => \%data, Keys =>
+            [@headers[2, $#headers]], StartDate => $start_date, EndDate => $end_date );
+
+
     my $tickets = RT::Tickets->new( $session{CurrentUser} );
 
     $tickets->UnLimit;

Modified: RT-Extension-Reports/html/Reports/Types/CreatedOrResolved
==============================================================================
--- RT-Extension-Reports/html/Reports/Types/CreatedOrResolved	(original)
+++ RT-Extension-Reports/html/Reports/Types/CreatedOrResolved	Thu Apr 10 03:02:30 2008
@@ -124,6 +124,13 @@
 
 
     $end_date->AddDay; # we want the date ranage to be inclusive
+
+
+# initial %data;
+    require RT::Extension::Reports::Util;
+    RT::Extension::Reports::Util::initialize_data( Data => \%data, Keys =>
+            [@headers[2, $#headers]], StartDate => $start_date, EndDate => $end_date );
+
     my $tickets = RT::Tickets->new( $session{CurrentUser} );
 
     $tickets->UnLimit;

Modified: RT-Extension-Reports/html/Reports/Types/General
==============================================================================
--- RT-Extension-Reports/html/Reports/Types/General	(original)
+++ RT-Extension-Reports/html/Reports/Types/General	Thu Apr 10 03:02:30 2008
@@ -104,6 +104,12 @@
 
     $end_date->AddDay; # we want the date ranage to be inclusive
 
+# initial %data;
+    require RT::Extension::Reports::Util;
+    RT::Extension::Reports::Util::initialize_data( Data => \%data, Keys =>
+            [@headers[2, $#headers]], StartDate => $start_date, EndDate => $end_date );
+
+
     my $tickets = RT::Tickets->new( $session{CurrentUser} );
     $tickets->UnLimit;
 
@@ -111,7 +117,7 @@
     TICKET:
     while ( my $ticket = $tickets->Next ) {
         if ( $Filter ) {
-            next unless RT::Extension::Reports::Filter::filter_ticket( Filter => $Filter, Ticket => $ticket );
+            next TICKET unless RT::Extension::Reports::Filter::filter_ticket( Filter => $Filter, Ticket => $ticket );
         }
 
         my $tmp_date = RT::Date->new( $session{CurrentUser} );

Modified: RT-Extension-Reports/html/Reports/Types/TicketsMoved
==============================================================================
--- RT-Extension-Reports/html/Reports/Types/TicketsMoved	(original)
+++ RT-Extension-Reports/html/Reports/Types/TicketsMoved	Thu Apr 10 03:02:30 2008
@@ -119,6 +119,12 @@
 
 
     $end_date->AddDay; # we want the date range to be inclusive
+
+# initial %data;
+    require RT::Extension::Reports::Util;
+    RT::Extension::Reports::Util::initialize_data( Data => \%data, Keys =>
+            [@headers[2, $#headers]], StartDate => $start_date, EndDate => $end_date );
+
     my $tickets = RT::Tickets->new( $session{CurrentUser} );
 
     $tickets->UnLimit;

Modified: RT-Extension-Reports/html/Reports/Types/TimeWorked
==============================================================================
--- RT-Extension-Reports/html/Reports/Types/TimeWorked	(original)
+++ RT-Extension-Reports/html/Reports/Types/TimeWorked	Thu Apr 10 03:02:30 2008
@@ -108,6 +108,10 @@
     $start_date->Set( Format => 'iso', Value => $StartDate . ' 00:00:00' );
     $end_date->Set( Format => 'iso', Value => $EndDate . ' 00:00:00' );
 
+# initial %data;
+    require RT::Extension::Reports::Util;
+    RT::Extension::Reports::Util::initialize_data( Data => \%data, Keys =>
+            [@headers[2, $#headers]], StartDate => $start_date, EndDate => $end_date );
 
     $end_date->AddDay; # we want the date range to be inclusive
     my $tickets = RT::Tickets->new( $session{CurrentUser} );
@@ -173,8 +177,10 @@
 
     for my $date ( keys %data ) {
         for my $queue ( keys %{$data{$date}} ) {
-            $data{$date}{$queue}{MeanTimeWorked} = int
+            if ( $data{$date}{$queue}{Number} ) {
+                $data{$date}{$queue}{MeanTimeWorked} = int
 $data{$date}{$queue}{TimeWorked}/$data{$date}{$queue}{Number};
+            }
         }
     }
 



More information about the Bps-public-commit mailing list