[rt-commit] [svn] r644 - in rt/branches/rt-3.1/html: . Ticket/Elements

leira at fsck.com leira at fsck.com
Wed Mar 31 00:28:18 EST 2004


Author: leira
Date: Wed Mar 31 00:28:17 2004
New Revision: 644

Modified:
   rt/branches/rt-3.1/html/Ticket/Elements/ShowRequestor
   rt/branches/rt-3.1/html/index.html
Log:
New Callbacks, based on code from Masque.


Modified: rt/branches/rt-3.1/html/Ticket/Elements/ShowRequestor
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/ShowRequestor	(original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/ShowRequestor	Wed Mar 31 00:28:17 2004
@@ -36,9 +36,12 @@
 		  ORDER => 'DESC');
 </%PERL>
 
-% unless ($requestor->Privileged) {
+% if ($requestor->Privileged) {
 <& /Elements/TitleBoxStart, 
 	title => "<a class='inverse' href=\"$RT::WebPath/Admin/Users/Modify.html?id=".$requestor->id."\">".loc("More about [_1]", $name)."</a>" &>
+
+%# Additional information about this user.  Empty by default.
+<& /Elements/Callback, _CallbackName => 'AboutThisUser', requestor => $requestor, %ARGS &>
 
 <&|/l&>Comments about this user</&>:<BR>
 <B><% ($requestor->Comments || loc("No comment entered about this user")) %></B><BR>

Modified: rt/branches/rt-3.1/html/index.html
==============================================================================
--- rt/branches/rt-3.1/html/index.html	(original)
+++ rt/branches/rt-3.1/html/index.html	Wed Mar 31 00:28:17 2004
@@ -63,18 +63,20 @@
 if ( $ARGS{'q'} ) {
     my $query = $ARGS{'q'};
 
-    if ( $query =~ m/^\s*(\d+)\s*$/ ) {
-        $m->comp("/Ticket/Display.html" , id=> $1);
+   if ( $query =~ m/^\s*(\d+)\s*$/ ) {
+        $m->comp("/Ticket/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/\@/ ) {
-        $session{'tickets'}->LimitWatcher( VALUE    => $query,
-                                            TYPE => 'Requestor',
-                                             OPERATOR => '=', );
-        $m->comp("/Search/Listing.html");
+        $m->comp("/Search/Results.html", Query => "Requestor = '$query'");
 
         return();
     }
@@ -84,24 +86,15 @@
     # only.
     #
 
-    $session{'tickets'}->LimitStatus( VALUE    => $_,
-                                      OPERATOR => '=', ) for qw(open new);
-
-
+    my $status = "Status = 'new' OR Status = 'open'";
 
     my $queue = RT::Queue->new( $session{'CurrentUser'} );
     if ( $queue->Load($query) && $queue->Id ) {
-        $session{'tickets'}->LimitQueue( VALUE    => $queue->Id,
-                                         OPERATOR => '=', );
-
-
-        $m->comp("/Search/Listing.html");
+        $m->comp("/Search/Results.html", Query => "Queue = '" . $queue->Id . "' AND ($status)");
         return();
     }
-    $session{'tickets'}->LimitSubject( VALUE    =>  $query, 
-                                       OPERATOR => 'LIKE' );
-        $m->comp("/Search/Listing.html");
 
+    $m->comp("/Search/Results.html", Query => "Subject LIKE '$query' AND ($status)");
     return();
 
 }



More information about the Rt-commit mailing list