Re: [rt-users] Change username format of autocomplete list

2011-10-24 Thread Thomas Sibley

On 10/22/2011 02:32 PM, Peter Reuterås wrote:

Is there a standard way to add a new username format? If I understand
correctly the format is the one the user select on the Setting -
Options page and the default specified in $UsernameFormat. The current
options are concise and verbose. How to add a superverbose with
name, email and work phone? Couldn't find any suggestions in the wiki.


share/html/Elements/ShowUser is what looks at the system setting or user 
preference and dispatches to the right component for display 
(ShowUserVerbose vs. ShowUserConcise out of the box).


You'll need to add a share/html/Elements/ShowUserSuperverbose (note 
casing since the preference is lower-cased an then the first letter 
upper-cased) and then either Set($UsernameFormat, 'superverbose'); 
globally and/or write some Perl in your config to add superverbose to 
the user preference options.  Something like this might do the trick:


push @{$RT::Config::META{UsernameFormat}-{WidgetArguments}{Values}}, 
'superverbose';
$RT::Config::META{UsernameFormat}-{WidgetArguments}{ValuesLabel}{superverbose} 
= 'Name, email address, and phone number';


That's untested, so give it a shot.

Thomas

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011

Re: [rt-users] Change username format of autocomplete list

2011-10-24 Thread Peter Reuterås
 share/html/Elements/ShowUser is what looks at the system setting or user
 preference and dispatches to the right component for display
 (ShowUserVerbose vs. ShowUserConcise out of the box).

 You'll need to add a share/html/Elements/ShowUserSuperverbose (note casing
 since the preference is lower-cased an then the first letter upper-cased)
 and then either Set($UsernameFormat, 'superverbose'); globally and/or write
 some Perl in your config to add superverbose to the user preference options.
  Something like this might do the trick:

 push @{$RT::Config::META{UsernameFormat}-{WidgetArguments}{Values}},
 'superverbose';
 $RT::Config::META{UsernameFormat}-{WidgetArguments}{ValuesLabel}{superverbose}
 = 'Name, email address, and phone number';

 That's untested, so give it a shot.

Thanks for quick reply! Will look into it as soon as I'm back from a conference.

/Peter

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011