[Rt-commit] r13288 - in rt/branches/3.8-TESTING: etc share/html/Elements
kyoki at bestpractical.com
kyoki at bestpractical.com
Fri Jun 13 15:17:39 EDT 2008
Author: kyoki
Date: Fri Jun 13 15:17:29 2008
New Revision: 13288
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/etc/RT_SiteConfig.pm
rt/branches/3.8-TESTING/share/html/Elements/ShowUser
Log:
r22897 at nyx: kyoki | 2008-06-13 15:16:44 -0400
RT-Ticket: 9650
RT-Status: Resolved
RT-Update: Correspond
Fixed so that ShowUser can deal with an $Address
Modified: rt/branches/3.8-TESTING/etc/RT_SiteConfig.pm
==============================================================================
--- rt/branches/3.8-TESTING/etc/RT_SiteConfig.pm (original)
+++ rt/branches/3.8-TESTING/etc/RT_SiteConfig.pm Fri Jun 13 15:17:29 2008
@@ -16,4 +16,8 @@
Set( $rtname, 'example.com');
#Set(@Plugins,(qw(Extension-QuickDelete)));
-1;
+#1;
+
+use MasonX::Profiler; # available on CPAN
+Set(@MasonParameters, (preamble => 'my $p = MasonX::Profiler->new($m, $r);'));
+
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 15:17:29 2008
@@ -47,18 +47,20 @@
%# 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);
+# $User is an RT::User object
+# $Address is Mail::Address object
+if ( !$User && $Address ) {
+ $User = RT::User->new( $session{'CurrentUser'} );
+ $User->LoadByEmail( $Address->address );
+ unless ( $User->Id ) {
+ $m->comp( '/Elements/ShowUserVerbose', Address => $Address );
+ return;
}
}
-if ($style eq 'concise'){$m->comp('/Elements/ShowUserConcise', User => $User);}
-else {$m->comp('/Elements/ShowUserVerbose', User => $User);}
+if ( $style eq 'concise' ) {
+ $m->comp( '/Elements/ShowUserConcise', User => $User );
+}
+else { $m->comp( '/Elements/ShowUserVerbose', User => $User ); }
</%INIT>
<%ARGS>
$User => undef
More information about the Rt-commit
mailing list