From 0922bcf5c61f8fca804c85a2a6ec8aeebf2f6600 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 4 Dec 2010 23:54:24 +0000 Subject: RTx-Statistics in 2.1 / 3.8 --- .../RTx/Statistics/TimeToResolve/Elements/Chart | 23 ------- rt/html/RTx/Statistics/TimeToResolve/index.html | 75 ---------------------- 2 files changed, 98 deletions(-) delete mode 100755 rt/html/RTx/Statistics/TimeToResolve/Elements/Chart delete mode 100755 rt/html/RTx/Statistics/TimeToResolve/index.html (limited to 'rt/html/RTx/Statistics/TimeToResolve') diff --git a/rt/html/RTx/Statistics/TimeToResolve/Elements/Chart b/rt/html/RTx/Statistics/TimeToResolve/Elements/Chart deleted file mode 100755 index a069a7bfb..000000000 --- a/rt/html/RTx/Statistics/TimeToResolve/Elements/Chart +++ /dev/null @@ -1,23 +0,0 @@ -<%perl> -print $graph->plot(\@data)->$format(); -$m->abort(); - -<%INIT> -use GD::Graph::points; - -my @data; -my $graph = GD::Graph::points->new(400,300); -$graph->set(export_format => "png", - marker_size => $ARGS{marker_size}, - x_label => 'Average time to resolve (Days)', - y_label => 'Number of tickets resolved' ); -#$r->content_type("image/$format"); -my $format = $graph->export_format; -push @data, [split /,/ , $ARGS{x_labels}]; -for (1..((scalar keys %ARGS)-2)) { - push @data, [split /,/ , $ARGS{"data".$_}]; -} - - -<%ARGS> - diff --git a/rt/html/RTx/Statistics/TimeToResolve/index.html b/rt/html/RTx/Statistics/TimeToResolve/index.html deleted file mode 100755 index 2124b538d..000000000 --- a/rt/html/RTx/Statistics/TimeToResolve/index.html +++ /dev/null @@ -1,75 +0,0 @@ -<& /Elements/Header, Title => 'Time to Resolve in Queue' &> -<& /RTx/Statistics/Elements/Tabs, Title => 'Time to Resolve, by ticket in Queue:' . $QueueObj->Name() &> - -

Description

-

This page displays the same information as the Time to Resolve chart, but in a scattergraph format and only for the previous 7 calendar -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 -is 30 minutes.

-
- - - - - - -
Show Queue:<& /Elements/SelectQueue, Name=>"queue", Default=>$queue ,ShowNullOption=>0, - CheckQueueRight=>'SeeQueue' &>
- -
- -
-% 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; - - -
- -%Statistics::DebugInit($m); - -<%ARGS> -$queue => undef - - -<%INIT> -use RTx::Statistics; - -my @days = qw(Sun Mon Tue Wed Thu Fri Sat); -my $n = 0; -my @data = ([]); -my @msgs; -my @counts; - -Statistics::DebugClear(); -Statistics::DebugLog("TimeToResolve/index.html ARGS:\n"); -for my $key (keys %ARGS) { - Statistics::DebugLog("ARG{ $key }=" . $ARGS{$key} . "\n"); -} - -my $QueueObj = new RT::Queue($session{'CurrentUser'}); -if (!defined $queue) { - $QueueObj->Load($Statistics::TimeToResolveGraphQueue); - $queue = $QueueObj->Id(); -} else { - $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