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
11 % my $url = 'Elements/Chart?x_labels=';
13 % $url .= join ",", (map {(int($_/2) == $_/2 && (++$i)%2) ? $_/2 : ""} grep {$counts[$_]} 0..($#counts-1)), "longer";
15 % $url .= "marker_size=1&";
16 % $url .= "data1=".(join ",", map { $_ || () } @counts)."&";
18 <& /RTx/Statistics/Elements/GraphBox, GraphURL => $url &>
20 <& /RTx/Statistics/Elements/ControlsAsTable/ControlBox,
21 Title => "Change Queue",
22 ShowSingleQueue => 1, Queue=>$Queue,
27 %Statistics::DebugInit($m);
36 my @days = qw(Sun Mon Tue Wed Thu Fri Sat);
42 Statistics::DebugClear();
43 Statistics::DebugLog("TimeToResolve/index.html ARGS:\n");
44 for my $key (keys %ARGS) {
45 Statistics::DebugLog("ARG{ $key }=" . $ARGS{$key} . "\n");
48 my $QueueObj = new RT::Queue($session{'CurrentUser'});
49 #if (!defined $queue) {
50 # $QueueObj->Load($Statistics::TimeToResolveGraphQueue);
51 # $queue = $QueueObj->Id();
53 $QueueObj->Load($Queue);
57 my $tix = new RT::Tickets($session{'CurrentUser'});
58 $tix->LimitQueue (VALUE => $Queue) if $Queue;
59 $tix->LimitStatus(VALUE => "resolved");
62 while (my $t = $tix->RT::SearchBuilder::Next) { # BLOODY HACK
63 my $when = $t->ResolvedObj->Unix - $t->CreatedObj->Unix;
64 next unless $when > 0; # Doubly bloody hack
65 my $max = (60*60*24*2) / 1800;
66 my $x = int($when / 1800);
67 $counts[$x > $max ? $max : $x]++;