1 <& /Elements/Header, Title => 'Time to Resolve in Queue' &>
2 <& /RTx/Statistics/Elements/Tabs, Title => 'Time to Resolve, by ticket in Queue:' . $QueueObj->Name() &>
5 <p>This page displays the same information as the Time to Resolve chart, but in a scattergraph format and only for the previous 7 calendar
6 days. It only displays data for tickets which have been resolved. Each division on the Days axis is one day and the granularity of this chart
13 <td COLSPAN=3><& /Elements/SelectQueue, Name=>"queue", Default=>$queue ,ShowNullOption=>0,
14 CheckQueueRight=>'SeeQueue' &></td>
17 <INPUT TYPE="submit" VALUE="Update Page"</INPUT>
21 % my $url = 'Elements/Chart?x_labels=';
23 % $url .= join ",", (map {(int($_/2) == $_/2 && (++$i)%2) ? $_/2 : ""} grep {$counts[$_]} 0..($#counts-1)), "longer";
25 % $url .= "marker_size=1&";
26 % $url .= "data1=".(join ",", map { $_ || () } @counts)."&";
28 <IMG SRC="<% $url %>">
32 %Statistics::DebugInit($m);
41 my @days = qw(Sun Mon Tue Wed Thu Fri Sat);
47 Statistics::DebugClear();
48 Statistics::DebugLog("TimeToResolve/index.html ARGS:\n");
49 for my $key (keys %ARGS) {
50 Statistics::DebugLog("ARG{ $key }=" . $ARGS{$key} . "\n");
53 my $QueueObj = new RT::Queue($session{'CurrentUser'});
54 if (!defined $queue) {
55 $QueueObj->Load($Statistics::TimeToResolveGraphQueue);
56 $queue = $QueueObj->Id();
58 $QueueObj->Load($queue);
62 my $tix = new RT::Tickets($session{'CurrentUser'});
63 $tix->LimitQueue (VALUE => $queue) if $queue;
64 $tix->LimitStatus(VALUE => "resolved");
67 while (my $t = $tix->RT::SearchBuilder::Next) { # BLOODY HACK
68 my $when = $t->ResolvedObj->Unix - $t->CreatedObj->Unix;
69 next unless $when > 0; # Doubly bloody hack
70 my $max = (60*60*24*2) / 1800;
71 my $x = int($when / 1800);
72 $counts[$x > $max ? $max : $x]++;