[Rt-commit] r6778 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Thu Jan 18 10:57:45 EST 2007


Author: ruz
Date: Thu Jan 18 10:57:43 2007
New Revision: 6778

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests

Log:
 r4398 at cubic-pc:  cubic | 2007-01-18 17:21:02 +0300
 * refactoring
 * use id of a user instead of address in searches


Modified: rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/SelfService/Elements/MyRequests	Thu Jan 18 10:57:43 2007
@@ -54,19 +54,14 @@
 </&>
 
 <%INIT>
-$title ||= loc("My [_1] tickets", $friendly_status);
-my $EmailAddress = $session{'CurrentUser'}->EmailAddress;
-my $Role = shift @roles;
-my $Query = "( ";
-$Query .= $Role . " = '" . $EmailAddress . "'";
-foreach $Role (@roles) {
-   $Query .= " OR " . $Role . " = '" . $EmailAddress . "'";
-}
-$Query .= " )";
-if (@status) {
-   $Query .= " AND ( Status = '";
-   $Query .= join "' OR Status = '", @status; 
-   $Query .= "' )";
+my $id = $session{'CurrentUser'}->id;
+my $Query = "( "
+    . join( ' OR ', map "$_.id = $id", @roles )
+    . ")";
+if ( @status ) {
+    $Query .= " AND ( "
+        . join( ' OR ', map "Status = '$_'", @status )
+        . " )";
 }
 my $Order = "ASC";
 my $OrderBy = "Created";
@@ -78,8 +73,8 @@
    OwnerName};
 </%INIT>
 <%ARGS>
-$title => undef
 $friendly_status => loc('open')
+$title => loc("My [_1] tickets", $friendly_status)
 @roles => ('Requestor', 'Cc', 'AdminCc')
 @status => ('open', 'new', 'stalled')
 $BaseURL => undef


More information about the Rt-commit mailing list