[Rt-commit] r6794 - rt/branches/3.6-RELEASE/html/SelfService/Elements

ruz at bestpractical.com ruz at bestpractical.com
Tue Jan 23 05:48:09 EST 2007


Author: ruz
Date: Tue Jan 23 05:48:07 2007
New Revision: 6794

Modified:
   rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests

Log:
SelfService/Elements/MyRequests
* backport refactoring from 3.7

Modified: rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests
==============================================================================
--- rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests	(original)
+++ rt/branches/3.6-RELEASE/html/SelfService/Elements/MyRequests	Tue Jan 23 05:48:07 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