[Rt-commit] r5535 - in RT-Extension-TimeWorked: . lib/RT/Extension

alexmv at bestpractical.com alexmv at bestpractical.com
Thu Jul 6 13:36:36 EDT 2006


Author: alexmv
Date: Thu Jul  6 13:36:35 2006
New Revision: 5535

Modified:
   RT-Extension-TimeWorked/   (props changed)
   RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html
   RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm

Log:
 r15017 at zoq-fot-pik:  chmrr | 2006-07-06 13:36:28 -0400
  * Version bump
  * Include column of total resolutions for users
  * Include count of comments and correspondence for users


Modified: RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html
==============================================================================
--- RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html	(original)
+++ RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html	Thu Jul  6 13:36:35 2006
@@ -61,21 +61,25 @@
 <th>Resolved within 24h</th>
 <th>Resolved within 24-28h</th>
 <th>Resolved in more than 48h</th>
+<th>Total resolved</th>
 <th>Time worked</th>
 <th>Average time per ticket</th>
 <th>Average resolutions per hour</th>
+<th>Total comments and correspondence</th>
 </tr>
 % for my $user (sort keys %user) {
 % for my $queue (sort {lc $queue{$a}{name} cmp lc $queue{$b}{name}} keys %{$user{$user}}) {
 <tr>
 <th><% $user %></th>
 <th><% $queue{$queue}{name} %></th>
-<td><% $user{$user}{$queue}{24}   || 0 %></td>
-<td><% $user{$user}{$queue}{48}   || 0 %></td>
-<td><% $user{$user}{$queue}{more} || 0 %></td>
+<td><% $user{$user}{$queue}{24}    || 0 %></td>
+<td><% $user{$user}{$queue}{48}    || 0 %></td>
+<td><% $user{$user}{$queue}{more}  || 0 %></td>
+<td><% $user{$user}{$queue}{total} || 0 %></td>
 <td><% sprintf("%.02f",$user{$user}{$queue}{time}/60 || 0) %></td>
 <td><% sprintf("%.02f",$user{$user}{$queue}{time}/($user{$user}{$queue}{tickets} || 1) || 0) %></td>
 <td><% $user{$user}{$queue}{time} ? sprintf("%.02f",$user{$user}{$queue}{resolves}/($user{$user}{$queue}{time}/60) || 0) : "-" %></td>
+<td><% $user{$user}{$queue}{comments} || 0 %></td>
 </tr>
 % }
 % }
@@ -282,12 +286,15 @@
     $user{$_->{name}}{$_->{queue}}{24} = $_->{one_day};
     $user{$_->{name}}{$_->{queue}}{48} = $_->{two_day} - $_->{one_day};
     $user{$_->{name}}{$_->{queue}}{more} = $_->{more} - $_->{two_day};
+    $user{$_->{name}}{$_->{queue}}{total} = $_->{more};
 }
 
 $sth = $RT::Handle->SimpleQuery(<<"EOSQL");
 SELECT Users.Name as name,
        Tickets.Queue as queue,
-       SUM(Transactions.TimeTaken) as worked
+       SUM(Transactions.TimeTaken) as worked,
+       COUNT(Transactions.Type = 'Comment') as comment,
+       COUNT(Transactions.Type = 'Correspond') as correspond
     FROM Tickets
          JOIN Transactions ON $txnjoin
          JOIN Users ON Transactions.Creator = Users.id
@@ -302,6 +309,26 @@
 die $sth->error_message unless $sth;
 $user{$_->{name}}{$_->{queue}}{time} = $_->{worked} while $_ = $sth->fetchrow_hashref;
 
+$sth = $RT::Handle->SimpleQuery(<<"EOSQL");
+SELECT Users.Name as name,
+       Tickets.Queue as queue,
+       COUNT(*) as comments
+    FROM Tickets
+         JOIN Transactions ON $txnjoin
+         JOIN Users ON Transactions.Creator = Users.id
+         JOIN Queues ON Tickets.Queue = Queues.id
+   WHERE Transactions.Created >= '$start'
+     AND Transactions.Created <= '$end'
+     AND (Transactions.Type = 'Comment'
+       OR Transactions.Type = 'Correspond')
+     AND Queues.Disabled = 0
+     $query
+GROUP BY Users.Name, Tickets.Queue;
+EOSQL
+die $sth->error_message unless $sth;
+$user{$_->{name}}{$_->{queue}}{comments} = $_->{comments} while $_ = $sth->fetchrow_hashref;
+
+
 # Set up miniplots
 my %plot;
 for (keys %queue) {

Modified: RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm
==============================================================================
--- RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm	(original)
+++ RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm	Thu Jul  6 13:36:35 2006
@@ -1,3 +1,3 @@
 package RT::Extension::TimeWorked;
 
-our $VERSION = '0.4';
+our $VERSION = '0.5';


More information about the Rt-commit mailing list