[Rt-commit] r13282 - in rt/branches/3.8-TESTING: share/html/Elements

elacour at bestpractical.com elacour at bestpractical.com
Fri Jun 13 11:31:28 EDT 2008


Author: elacour
Date: Fri Jun 13 11:31:27 2008
New Revision: 13282

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/share/html/Elements/ShowUser

Log:
 r9526 at datura:  manu | 2008-06-13 17:31:18 +0200
 Try to load the user if args is an address, not a user object (when called from
 Ticket/Elements/UpdateCc for example)


Modified: rt/branches/3.8-TESTING/share/html/Elements/ShowUser
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Elements/ShowUser	(original)
+++ rt/branches/3.8-TESTING/share/html/Elements/ShowUser	Fri Jun 13 11:31:27 2008
@@ -47,6 +47,16 @@
 %# END BPS TAGGED BLOCK }}}
 %# Released under the terms of version 2 of the GNU Public License
 <%INIT>
+if ( ! $User && $Address ) {
+    $User = new RT::User ($session{'CurrentUser'});
+    # FIXME : sometimes $TicketObj->TransactionAddresses returns a
+    # Mail::Address object whose address is the Name :(
+    if ( $Address->address =~ /\@/ ) {
+        $User->LoadByEmail($Address->address);
+    } else {
+        $User->Load($Address->address);
+    }
+}
 if ($style eq 'concise'){$m->comp('/Elements/ShowUserConcise', User => $User);}
 else {$m->comp('/Elements/ShowUserVerbose', User => $User);}
 </%INIT>


More information about the Rt-commit mailing list