[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rt-users
Subject:    RE: [rt-users] Accessing requestors' names
From:       "Schincke, Keith D. (JSC-IT)[MEI]" <Keith.D.Schincke () nasa ! gov>
Date:       2007-08-28 14:42:43
Message-ID: 5D0B651C5306D64AA429824F50D2C0AC43A764 () NDJSEVS23B ! ndc ! nasa ! gov
[Download RAW message or body]

Hey Tim,

The inspiration for this answer came from the RT code
(html/Ticket/Elements/ShowRequestor).
It should march through all of the requestors of the ticket and add
their RealName or email address to user list array. This array will then
be joined into a scaler. You could either work with each user as they
are looked up at line 6, do something with the array after the while at
line 9 or the list as a string on line 10.

1: my @names ;
2: my $people = $Ticket->Requestors->UserMembersObj;
3: while (my $requestor=$people->Next) 
4: {
5:   next if $requestor->Privileged;
6:   my $name=$requestor->RealName || $requestor->EmailAddress;
7:   push( @names, name ) ;
8: }
9: 
10: $name_list = join( ',' @names ) ;


I have not tested this yet this morning but it looks like Perl to me.

Good luck,

Keith

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Tim
Wilson
Sent: Monday, August 27, 2007 10:43 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Accessing requestors' names

Hey all,

Is it possible to print the full name of a ticket's requestor in a
template? Bonus points for gracefully handling multiple requestors. :-)

-Tim

--
Tim Wilson, Director of Technology
Buffalo-Hanover-Montrose Schools
214 1st Ave NE   Buffalo, MN  55313
ph: 763.682.8740  fax: 763.682.8743  http://www.buffalo.k12.mn.us




_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic