[Rt-commit] [svn] r1370 - in rtir/branches/1.1/html/RTIR: . Elements

leira at pallas.eruditorum.org leira at pallas.eruditorum.org
Fri Aug 27 04:39:42 EDT 2004


Author: leira
Date: Fri Aug 27 04:39:42 2004
New Revision: 1370

Modified:
   rtir/branches/1.1/html/RTIR/Elements/SimpleSearch
   rtir/branches/1.1/html/RTIR/index.html
Log:
Make SimpleSearch work with the new search system.


Modified: rtir/branches/1.1/html/RTIR/Elements/SimpleSearch
==============================================================================
--- rtir/branches/1.1/html/RTIR/Elements/SimpleSearch	(original)
+++ rtir/branches/1.1/html/RTIR/Elements/SimpleSearch	Fri Aug 27 04:39:42 2004
@@ -21,7 +21,7 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<form action="<% $RT::WebPath %>/RTIR/Listing.html">
+<form action="<% $RT::WebPath %>/RTIR/index.html">
 <input type="hidden" name="NewSearch" value="1">
 <input type="hidden" name="Queue" value="Incidents">
 <input size="12" name="q" accesskey="0">

Modified: rtir/branches/1.1/html/RTIR/index.html
==============================================================================
--- rtir/branches/1.1/html/RTIR/index.html	(original)
+++ rtir/branches/1.1/html/RTIR/index.html	Fri Aug 27 04:39:42 2004
@@ -51,6 +51,39 @@
 </TABLE>
 
 <%init>
+if ( $ARGS{'q'} ) {
+    my $query = $ARGS{'q'};
+
+   if ( $query =~ m/^\s*(\d+)\s*$/ ) {
+        $m->comp("/RTIR/Display.html" , id=> $1);
+        return();
+    }
+
+    if ($m->comp('/Elements/Callback', _CallbackName => 'SearchPreFilter', 
+		 query => $query, %ARGS)) {
+	return();
+    }
+
+    $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
+
+    if ( $query =~ m/\@/ ) {
+        $m->comp("/RTIR/Search/Results.html", Queue => 'Incidents', Query => "Requestor = '$query'");
+
+        return();
+    }
+
+    #
+    # Any search on queue name or subject will be for new/open tickets
+    # only.
+    #
+
+    my $status = "'CF.Incidents.{_RTIR_State}' = 'new' OR 'CF.Incidents.{_RTIR_State}' = 'open'";
+
+    $m->comp("/RTIR/Search/Results.html", Queue => 'Incidents', Query => "Subject LIKE '$query' AND ($status)");
+    return();
+
+}
+
 if ($ARGS{'HomeRefreshInterval'}) {
 	$session{'home_refresh_interval'} = $ARGS{'HomeRefreshInterval'};
 }


More information about the Rt-commit mailing list