Hello,
You will need to modify the following control
~\CMSModules\Messaging\Controls\SelectFromContactList.ascx in order to display the FullName in the user selector in Messaging.
As you can see the control uses a standard UniGrid control. For more information about the UniGrid control please visit Controls documentation:
UniGrid overview.
To display the FullName in the UniGrid, please add a new column definition to the
~\CMSModules\Messaging\Controls\SelectFromContactList.xml:
<column source="ContactListContactUserID" externalsourcename="contactlistcontactuserid" caption="$general.FullName$" wrap="false" />
Then, please find the
gridContactList_OnExternalDataBound method (~\CMSModules\Messaging\Controls\SelectFromContactList.ascx) and add a new case statement for the new column:
case "contactlistcontactuserid":
drv = GetDataRowView((DataControlFieldCell)(sender));
userId = ValidationHelper.GetInteger(drv["ContactListContactUserID"], 0);
if (userId != 0)
{
UserInfo ui = UserInfoProvider.GetUserInfo(userId);
if (ui != null)
{
userName = ValidationHelper.GetString(drv["UserName"], String.Empty);
userName = Functions.GetFormattedUserName(userName, this.IsLiveSite);
return GetItemText(userId, userName, ui);
}
}
return parameter;
The
GetItemText method needs to be modified in the following way:
protected string GetItemText(int userId, object username, object usernickname)
{
string usrName = username.ToString();
string nick = HTMLHelper.HTMLEncode(UserInfoProvider.GetFullUserName(usrName, usernickname.ToString()));
if (usernickname is UserInfo)
{
nick = (usernickname as UserInfo).FullName;
}
return "<a href=\"javascript: window.parent.CloseAndRefresh(" + userId + ", " + ScriptHelper.GetString(HTMLHelper.HTMLEncode(usrName)) + ", " +
ScriptHelper.GetString(QueryHelper.GetText("mid", String.Empty)) +
", " + ScriptHelper.GetString(QueryHelper.GetText("hidid", String.Empty)) +
")\">" + nick + "</a>";
}
Best regards,
Michal Legen