<& Header, TabText => 'Project Statistics' &> % my ($ym,$label,$data); % $ym = $TicketAcc->result('status');

<% loc("Ticket Status Distribution") %>

% if ($SVNAcc) { % for(qw(year-month)) { % $ym = $SVNAcc->result($_); % $label = freeze(sort keys %$ym); % $data = freeze(map{$ym->{$_}}sort keys %$ym);

<% $desc{$_} %>

% } % for(qw(author path)) { % $ym = $SVNAcc->result($_); % $label = freeze(sort keys %$ym); % $data = freeze(map{$ym->{$_}}sort keys %$ym);

<% $desc{$_} %>

% } % } else {

<% loc("(This project doesn't have version control log on openfoundry.org, unable to generate statistics chart.)") %>

% } <& Footer &> <%INIT> use FreezeThaw qw(freeze); use Log::Accounting::SVN; return unless $QueueId; my $base = "$RT::VarPath/Foundry/svn"; my $QueueObj = RT::Queue->new( $session{'CurrentUser'}); $QueueObj->Load($QueueId); my $repopath = $QueueObj->Name; my $repo = "$base/$repopath"; my $SVNAcc = undef; if(-d $repo) { $SVNAcc = Log::Accounting::SVN->new(repository => $repo, quiet => 1)->process; } my $TicketAcc = $m->comp('TicketAcc', QueueId => $QueueId); my %desc = ( 'year-month' => loc("Commits per month"), 'author' => loc("Commits per-author"), 'path' => loc("Commits per-path"), ); <%ARGS> $QueueId