[rt-users] getting username from id

Ruslan Zakirov ruslan.zakirov at gmail.com
Fri Mar 30 10:59:36 EDT 2007


On 3/29/07, Stephen Turner <sturner at mit.edu> wrote:
> At Thursday 3/29/2007 04:28 AM, Mathew Snyder wrote:
> >         while (my $user = $users->Next) {
> >             if ($user = $transaction->Creator) {
> >                 $timeworked{$user} += $transaction->TimeTaken;
> >             }
> >             $environment{$environment}{$user->Name} = $timeworked{$user};
> >         }
>
> In the if statement, you are setting $user to $transaction->Creator,
> which is an integer. So $user is no longer a User object and hence no
> Name method.
However, there is $transaction->CreatorObj method that returns user's object.

>
> Also, a comment - in looking at the code I did get confused by the
> dual use of "environment" to represent a scalar variable and a hash -
> might be better for code maintenance to choose different names.
>
> Steve
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>


-- 
Best regards, Ruslan.



More information about the rt-users mailing list