Change username format of autocomplete list

Hi,

I’ve just started testing RT 4.0.2 for a future upgrade from the
3.8-series. Enabled autocomplete based on work phone number in
addition to name for requestor. However doing that I would like to
change the username format of the suggestions in the drop down to
include name, email and work phone.

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.

Best regards,

Peter

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

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