[rt-users] Quicksearch Improvement?
Jeff Hoover
jeff.hoover at infotechfl.com
Thu May 8 12:24:10 EDT 2003
Due to a request by my boss, I made a minor change the the Quicksearch
element to include a line for queue totals. It shows the total number of
tickets that are new and open in all the queues.
Ex:
Queue New Open
Support 5 10
IT 3 5
ALL 8 15
Here is the diff -c if anybody wants it:
*** ../../../share/html/Elements/Quicksearch Wed May 7 09:18:40 2003
--- Quicksearch Thu May 8 12:15:24 2003
***************
*** 32,56 ****
<%PERL>
my $i;
while (my $queue = $Queues->Next) {
$Tickets->ClearRestrictions;
$Tickets->LimitStatus(VALUE => "open");
$Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR =>
'=');
my $open = $Tickets->Count();
$Tickets->ClearRestrictions;
$Tickets->LimitStatus(VALUE => "new");
$Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR =>
'=');
my $new = $Tickets->Count();
</%PERL>
%
$i++;
! <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >
<td><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"
TITLE="<% $queue->Description %>"><%$queue->Name%></a></TD>
<td align="right"><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"><%$new%></a></TD>
<td align="right"><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"><%$open%></a></TD>
</TR>
% }
</TABLE>
<& /Elements/TitleBoxEnd &>
--- 32,65 ----
<%PERL>
my $i;
+ my ($total_open,$total_new);
while (my $queue = $Queues->Next) {
$Tickets->ClearRestrictions;
$Tickets->LimitStatus(VALUE => "open");
$Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR =>
'=');
my $open = $Tickets->Count();
+ $total_open += $open;
$Tickets->ClearRestrictions;
$Tickets->LimitStatus(VALUE => "new");
$Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR =>
'=');
my $new = $Tickets->Count();
+ $total_new += $new;
</%PERL>
% $i++;
! <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >
<td><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"
TITLE="<% $queue->Description %>"><%$queue->Name%></a></TD>
<td align="right"><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"><%$new%></a></TD>
<td align="right"><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"><%$open%></a></TD>
</TR>
% }
+ % $i++;
+ <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" >
+ <td><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&ValueOfStatus=new&StatusOp=%3D&RowsPerPage=50&NewSearch=1"
TITLE="All New & Open Tickets">ALL</a></TD>
+ <td align="right"><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=new&StatusOp=%3D&RowsPerPage=50&NewSearch=1"><%$total_new%></a></TD>
+ <td align="right"><A HREF="<%
$RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&StatusOp=%3D&RowsPerPage=50&NewSearch=1"><%$total_open%></a></TD>
+ </TR>
</TABLE>
<& /Elements/TitleBoxEnd &>
More information about the rt-users
mailing list