[rt-devel] [PATCH] Add meta status searching for Active and Closed

Tammy Dugan tdugan at progeny.com
Fri Feb 27 15:18:12 EST 2004


This patch adds 'Active' and 'Closed' statuses to the status dropdown on
the search page. An RT user can see all tickets that are open or new by
selecting 'Active' and see all tickets that are resolved, deleted, or
rejected by selecting 'Closed'.

-------------- next part --------------
Index: html/Search/Elements/PickRestriction
===================================================================
--- html/Search/Elements/PickRestriction	(revision 14854)
+++ html/Search/Elements/PickRestriction	(revision 14855)
@@ -78,9 +78,17 @@
 			    TrueVal=> '=', 
 			    FalseVal => '!=' 
 &>  
-<& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &>
+<SELECT NAME ="ValueOfStatus">
+<OPTION VALUE="">-</OPTION>
+<OPTION VALUE="Active">Active (new and open)</OPTION>
+<OPTION VALUE="Closed">Closed (resolved, rejected, deleted)</OPTION>
+%my $queue = RT::Queue->new($session{'CurrentUser'});
+%my @status = $queue->StatusArray();
+%foreach my $status (@status) {
+<OPTION VALUE="<%$status%>"><%loc($status)%></OPTION>
+% }
+</SELECT>
 
-
 % while ( my $CustomField = $CustomFields->Next ) {
 
 <li><% $CustomField->Name %> 
Index: html/Search/Listing.html
===================================================================
--- html/Search/Listing.html	(revision 14854)
+++ html/Search/Listing.html	(revision 14855)
@@ -98,6 +98,14 @@
 	    $session{'tickets'}->ClearRestrictions;
 	}	
 }
+   if($ARGS{'ValueOfStatus'} eq 'Active'){
+	my @active_statuses = ('open', 'new');
+	$ARGS{'ValueOfStatus'} = \@active_statuses;
+   }
+   if($ARGS{'ValueOfStatus'} eq 'Closed'){
+   	my @closed_statuses = ('rejected', 'deleted', 'resolved');
+	$ARGS{'ValueOfStatus'} = \@closed_statuses;
+   }
    ProcessSearchQuery(ARGS=>\%ARGS);
    $session{'tickets'}->RedoSearch();
    if ( $session{'tickets'}->DescribeRestrictions()) {


More information about the Rt-devel mailing list