[Rt-commit] rt branch, 4.2/date-time-improvements-in-charts, updated. rt-3.8.10-93-gf2cc00c

Ruslan Zakirov ruz at bestpractical.com
Fri Jun 24 16:16:00 EDT 2011


The branch, 4.2/date-time-improvements-in-charts has been updated
       via  f2cc00c572b7a3fffaeef61dba92954615cb3789 (commit)
       via  a9837d8990a635360c7324531f778d5b5de31e65 (commit)
      from  f2ee0fe0a7150b4d53608dd70e33f1a1db4af936 (commit)

Summary of changes:
 lib/RT/Report/Tickets.pm |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

- Log -----------------------------------------------------------------
commit a9837d8990a635360c7324531f778d5b5de31e65
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sat Jun 25 00:13:47 2011 +0400

    register function generator for Custom Fields

diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index ad811f4..61e836f 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -174,6 +174,7 @@ our %GROUPINGS_META = (
             }
             return @res;
         },
+        Function => 'GenerateCustomFieldFunction',
         Label => sub {
             my $self = shift;
             my %args = (@_);

commit f2cc00c572b7a3fffaeef61dba92954615cb3789
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sat Jun 25 00:14:29 2011 +0400

    "Time" statistic instead of "Simple" for time fields

diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index 61e836f..ca7380a 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -197,20 +197,20 @@ our %GROUPINGS_META = (
 our @STATISTICS = (
     COUNT             => ['Tickets', 'Count', 'id'],
 
-    'SUM(TimeWorked)' => ['Total time worked',   'Simple', 'SUM', 'TimeWorked' ],
-    'AVG(TimeWorked)' => ['Average time worked', 'Simple', 'AVG', 'TimeWorked' ],
-    'MIN(TimeWorked)' => ['Minimum time worked', 'Simple', 'MIN', 'TimeWorked' ],
-    'MAX(TimeWorked)' => ['Maximum time worked', 'Simple', 'MAX', 'TimeWorked' ],
+    'SUM(TimeWorked)' => ['Total time worked',   'Time', 'SUM', 'TimeWorked' ],
+    'AVG(TimeWorked)' => ['Average time worked', 'Time', 'AVG', 'TimeWorked' ],
+    'MIN(TimeWorked)' => ['Minimum time worked', 'Time', 'MIN', 'TimeWorked' ],
+    'MAX(TimeWorked)' => ['Maximum time worked', 'Time', 'MAX', 'TimeWorked' ],
 
-    'SUM(TimeEstimated)' => ['Total time estimated',   'Simple', 'SUM', 'TimeEstimated' ],
-    'AVG(TimeEstimated)' => ['Average time estimated', 'Simple', 'AVG', 'TimeEstimated' ],
-    'MIN(TimeEstimated)' => ['Minimum time estimated', 'Simple', 'MIN', 'TimeEstimated' ],
-    'MAX(TimeEstimated)' => ['Maximum time estimated', 'Simple', 'MAX', 'TimeEstimated' ],
+    'SUM(TimeEstimated)' => ['Total time estimated',   'Time', 'SUM', 'TimeEstimated' ],
+    'AVG(TimeEstimated)' => ['Average time estimated', 'Time', 'AVG', 'TimeEstimated' ],
+    'MIN(TimeEstimated)' => ['Minimum time estimated', 'Time', 'MIN', 'TimeEstimated' ],
+    'MAX(TimeEstimated)' => ['Maximum time estimated', 'Time', 'MAX', 'TimeEstimated' ],
 
-    'SUM(TimeLeft)' => ['Total time left',   'Simple', 'SUM', 'TimeLeft' ],
-    'AVG(TimeLeft)' => ['Average time left', 'Simple', 'AVG', 'TimeLeft' ],
-    'MIN(TimeLeft)' => ['Minimum time left', 'Simple', 'MIN', 'TimeLeft' ],
-    'MAX(TimeLeft)' => ['Maximum time left', 'Simple', 'MAX', 'TimeLeft' ],
+    'SUM(TimeLeft)' => ['Total time left',   'Time', 'SUM', 'TimeLeft' ],
+    'AVG(TimeLeft)' => ['Average time left', 'Time', 'AVG', 'TimeLeft' ],
+    'MIN(TimeLeft)' => ['Minimum time left', 'Time', 'MIN', 'TimeLeft' ],
+    'MAX(TimeLeft)' => ['Maximum time left', 'Time', 'MAX', 'TimeLeft' ],
 
     'SUM(Created-Resolved)'
         => ['Summary of Created-Resolved', 'DateTimeInterval', 'SUM', 'Created', 'Resolved' ],
@@ -255,6 +255,20 @@ our %STATISTICS_META = (
             return (FUNCTION => $function, FIELD => $field);
         },
     },
+    Time => {
+        Function => sub {
+            my $self = shift;
+            my ($function, $field) = @_;
+            return (FUNCTION => $function, FIELD => $field);
+        },
+        Display => sub {
+            my $self = shift;
+            my %args = @_;
+            my $v = $args{'VALUE'};
+            return $self->loc("(no value)") unless defined $v && length $v;
+            return RT::Date->new( $self->CurrentUser )->DurationAsString( $v );
+        },
+    },
     DateTimeInterval => {
         Function => sub {
             my $self = shift;

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


More information about the Rt-commit mailing list