[Rt-commit] r5333 - in rtir/branches/1.9-EXPERIMENTAL: html/RTIR/Elements

ruz at bestpractical.com ruz at bestpractical.com
Sat Jun 3 21:16:27 EDT 2006


Author: ruz
Date: Sat Jun  3 21:16:27 2006
New Revision: 5333

Added:
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueSummary
Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)

Log:
 r1457 at cubic-pc:  cubic | 2006-06-04 05:25:32 +0400
 * forgot to add comp


Added: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueSummary
==============================================================================
--- (empty file)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/QueueSummary	Sat Jun  3 21:16:27 2006
@@ -0,0 +1,53 @@
+<%ATTR>
+Description => loc('RTIR queues summary')
+</%ATTR>
+<&| /Widgets/TitleBox,
+	title_class => 'inverse',
+    title => loc('RTIR queues summary'),
+    bodyclass=> '',
+&>
+
+<table border="0" cellspacing="0" cellpadding="1" width="100%">
+<tr>
+       <th class="collection-as-table"><&|/l&>Queue</&></th>
+% foreach my $s( @states ) {
+       <th class="collection-as-table"><% $s %></th>
+% }
+</tr>
+% my $i;
+% for my $queue (@queues) {
+%   $i++;
+%   my $queue_cond = "Queue = '$queue'";
+%   my $all_q = "$queue_cond AND (". join ' OR ', map "CF.{_RTIR_State} = '$_'", @{ $states{ $queue } } .')';
+<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
+<td><a href="<% RT->Config->Get('WebPath')%>/Search/Results.html?Query=<% $all_q %>""><% $queue %></a></td>
+%   foreach my $s ( @states ) {
+<td align="right">
+%   if ( grep $_ eq $s, @{ $states{ $queue } } ) {
+%       my $query =  "$queue_cond AND CF.{_RTIR_State} = '$s'";
+%       $Tickets->FromSQL( $query );
+%       my $qs = $m->comp('/Elements/QueryString', Queue => $queue, Query => $query );
+<a href="<% RT->Config->Get('WebPath') %>/RTIR/Search/Results.html?<% $qs |n %>"><% $Tickets->Count %></a></td>
+%   } else {
+-
+%   }
+</td>
+%   }
+</tr>
+% }
+</table>
+
+</&>
+<%ONCE>
+my @queues = ('Incidents', 'Incident Reports', 'Investigations');
+push @queues, 'Blocks' unless RT->Config->Get('DisableBlocksQueue');
+my %states;
+$states{$_} = [ $m->comp( '/RTIR/Elements/States', Queue => $_ ) ] foreach @queues;
+my %seen;
+my @states = sort grep !$seen{$_}++, map @$_, values %states;
+</%ONCE>
+<%INIT>
+my $Tickets = RT::Tickets->new($session{'CurrentUser'});
+</%INIT>
+<%ARGS>
+</%ARGS>


More information about the Rt-commit mailing list