<& Header, TabText => 'Top Projects' &>
<style type="text/css">
.TopProject {
  width: 120px;
  height: 72px;  
  margin: 1px;
  padding: 1px;
  float: left;
  border: 1px outset white;
  cursor:hand;
  cursor:pointer;
}
</style>

<&|/l&>Total Projects</&>: <% $TotalProjects || 0 %><br/>
<&|/l&>Total Members</&>:  <% $TotalMembers  || 0 %><br/>
<&|/l&>Total Tickets</&>:  <% $TotalTickets  || 0 %><br/>

% if ($QueueTickets) {
<hr>
<h3><% loc('Top Projects') %></h3>
% }

% for (sort {$QueueTickets->{$b} <=> $QueueTickets->{$a}} keys %$QueueTickets) {
%   $QueueObj->Load($_);

<div class="TopProject" onClick="MM_goToURL('self','project.html?QueueId=<% $_ %>');return document.MM_returnValue">
<h4><% $QueueObj->Name %></h4>
<span><&|/l&>Tickets</&>: <% $QueueTickets->{$_} || 0 %></span><br />
<span><&|/l&>Members</&>: <% $ProjectMembers->{$_} || 0 %></span><br />
</div>

% }
<& Footer &>
<%INIT>
;;; #_#

my ($ProjectAcc, $TotalProjects,$TotalMembers) = $m->comp('ProjectAcc');

my $ProjectMembers = $ProjectAcc->result('queue');

my $TicketAcc      = $m->comp('TicketAcc');
my $QueueTickets   = $TicketAcc->result('Queue');
my $TotalTickets   = eval { $TicketAcc->result('tickets')->{'tickets'} };

my $QueueObj       = RT::Queue->new($session{'CurrentUser'});

</%INIT>

