From f5af4fcceb8a36c3d0885dfa197798a77de64727 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 20 Jun 2007 22:28:28 +0000 Subject: integrate RTx::Statistics package, part of merging spiritone RT changes (#1661) --- rt/html/RTx/Statistics/UserTest/index.html | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 rt/html/RTx/Statistics/UserTest/index.html (limited to 'rt/html/RTx/Statistics/UserTest/index.html') diff --git a/rt/html/RTx/Statistics/UserTest/index.html b/rt/html/RTx/Statistics/UserTest/index.html new file mode 100755 index 000000000..7bc25da70 --- /dev/null +++ b/rt/html/RTx/Statistics/UserTest/index.html @@ -0,0 +1,54 @@ +<& /Elements/Header, Title => 'Time to Resolve in Queue' &> +<& /RTx/Statistics/Elements/Tabs, Title => 'Time to Resolve, by ticket in Queue:' . $QueueObj->Name() &> + + +
+ +See Queue:
+<& /Elements/SelectQueue, Name=>"queue", Default => "$queue" &> +
+ +
+ +
+% my $url = 'Elements/Chart?x_labels='; +% my $i; +% $url .= join ",", (map {(int($_/2) == $_/2 && (++$i)%2) ? $_/2 : ""} grep {$counts[$_]} 0..($#counts-1)), "longer"; +% $url .= '&'; +% $url .= "marker_size=1&"; +% $url .= "data1=".(join ",", map { $_ || () } @counts)."&"; +% chop $url; + + +
+ +<%ARGS> +$queue => $Statistics::TimeToResolveGraphQueue; + + +<%INIT> +use RTx::Statistics; + +my @days = qw(Sun Mon Tue Wed Thu Fri Sat); +my $n = 0; +my @data = ([]); +my @msgs; +my @counts; + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($queue); + +my $tix = new RT::Tickets($session{'CurrentUser'}); +$tix->LimitQueue (VALUE => $queue) if $queue; +$tix->LimitStatus(VALUE => "resolved"); +$tix->UnLimit; +if ($tix->Count) { + while (my $t = $tix->RT::SearchBuilder::Next) { # BLOODY HACK + my $when = $t->ResolvedObj->Unix - $t->CreatedObj->Unix; + next unless $when > 0; # Doubly bloody hack + my $max = (60*60*24*2) / 1800; + my $x = int($when / 1800); + $counts[$x > $max ? $max : $x]++; + } +} + -- cgit v1.2.1