1 <&|Elements/Wrapper, %ARGS, title => loc("Activity summary"),
2 path => "Reports/Activity/ActivitySummary.html",
5 <& Elements/MiniPlot, data => \%queues &>
7 <table style="width: 100%">
10 % for my $status (sort keys %status) {
11 <th><% $status %></th>
15 % for my $queue (sort keys %queues) {
16 <th class="label"><% $queue %></th>
17 % for my $status (sort keys %status) {
18 <td><% $queues{$queue}{$status} || 0 %>
20 <td><% $total{$queue} %></td>
23 <tr class="grandtotal">
24 <th class="label" >Grand Total</th>
25 % for my $status (sort keys %status) {
26 <td><% $status{$status} %></td>
33 $start => "2005/01/01"
38 my $tickets = RT::Tickets->new($session{'CurrentUser'});
39 $tickets->FromSQL($query . " AND ( Updated >= '$start' AND Updated <= '$end')");
45 while (my $ticket = $tickets->Next) {
46 my $txns = $ticket->Transactions;
47 $txns->Limit(FIELD => 'Created', OPERATOR => '>=', VALUE => $start);
48 $txns->Limit(FIELD => 'Created', OPERATOR => '<=', VALUE => $end);
49 $txns->Limit(FIELD => 'Type', VALUE => 'Status', ENTRYAGGREGATOR => 'OR');
50 $txns->Limit(FIELD => 'Type', VALUE => 'Create');
52 while (my $txn = $txns->Next) {
53 $queues{$txn->TicketObj->QueueObj->Name}{$txn->NewValue || 'new'}++;
54 $status{$txn->NewValue || 'new'}++;
55 $total{$txn->TicketObj->QueueObj->Name}++;