1 <&|Elements/Wrapper, %ARGS, title => loc("Activity detail"),
2 path => "Reports/Activity/ActivityDetail.html",
5 <& Elements/MiniPlot, data => \%counts &>
7 <table style="width: 100%">
9 <th>Queue</th><th>Activity</th><th>Date</th><th>Time</th><th>Ticket #</th><th>User</th><th>Short description</th>
11 % for my $item (@items) {
13 <td><% $item->{queue} %></td>
14 <td><% $item->{status} %></td>
15 <td><% $item->{date} %></td>
16 <td><% $item->{time} %></td>
17 <td><% $item->{id} %></td>
18 <td><% $item->{actor} %></td>
19 <td><% $item->{notes} %></td>
27 $start => "2005/01/01"
33 my $summary_tickets = RT::Tickets->new($session{'CurrentUser'});
34 $summary_tickets->FromSQL($query . " AND ( Updated >= '$start' AND Updated <= '$end')");
36 while (my $ticket = $summary_tickets->Next) {
37 my $txns = $ticket->Transactions;
38 $txns->Limit(FIELD => 'Created', OPERATOR => '>=', VALUE => $start);
39 $txns->Limit(FIELD => 'Created', OPERATOR => '<=', VALUE => $end);
40 # I think they really don't just want status changes
41 $txns->Limit(FIELD => 'Type', VALUE => 'Status', ENTRYAGGREGATOR => 'OR');
42 $txns->Limit(FIELD => 'Type', VALUE => 'Create');
44 while (my $txn = $txns->Next){
45 my $date = substr($txn->Created, 0, 10);
46 # we don't have data on the status of a new ticket, default to 'new'
47 $counts{$date}{$txn->NewValue || 'new'}++;
52 my $tickets = RT::Tickets->new($session{'CurrentUser'});
53 $tickets->FromSQL($query);
55 while (my $ticket = $tickets->Next) {
56 my $txns = $ticket->Transactions;
57 $txns->Limit(FIELD => 'Created', OPERATOR => '>=', VALUE => $start);
58 $txns->Limit(FIELD => 'Created', OPERATOR => '<=', VALUE => $end);
59 # I think they really don't just want status changes
60 $txns->Limit(FIELD => 'Type', VALUE => 'Status', ENTRYAGGREGATOR => 'OR');
61 $txns->Limit(FIELD => 'Type', VALUE => 'Create');
63 while (my $txn = $txns->Next) {
64 push @items, { queue => $txn->TicketObj->QueueObj->Name,
65 id => $txn->TicketObj->id,
66 date => (split ' ', $txn->CreatedObj->ISO)[0],
67 time => (split ' ', $txn->CreatedObj->ISO)[1],
68 status => $txn->NewValue || 'new',
69 actor => $txn->CreatorObj->Name,
70 notes => ($txn->Content ne 'This transaction appears to have no content' ? substr($txn->Content, 0, 60) : $txn->BriefDescription)
76 $a->{queue} cmp $b->{'queue'}
77 || $a->{'status'} cmp $b->{'status'}
78 || $a->{'id'} <=> $b->{'id'}
79 || $a->{'actor'} cmp $b->{'actor'}
80 || $a->{'notes'} <=> $b->{'notes'}