This I hope should be a relatively easy and straightforward feature request. It would be nice if the team notification used the drupal username function so that it integrated with the Real Name module (see Real Name project). "Bob Smith" is an easier team member to pick out than some usernames like bbs1265.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cfennell’s picture

Since RealName simply overrides theme_username($object), all we'd need to do is invoke this function when setting usernames so that instead of doing a straight $user->name;, we'd do theme('username', $user);. Right?

The attached files make this very small change in a few places where I noticed usernames were being set, and I have verified that RealName is invoked in the notifications form in my test intstance- "foobbs1265" becomes "Fred Foo." I did not test the autosuggest form, FWIW.

cfennell’s picture

Status: Active » Needs review

forgot to change the status...

David Goode’s picture

Hey, thanks for the patch, sorry for the belated response--it was finals period :-( This looks like a solid idea and I'll review and post it shortly.

Thanks!
David

David Goode’s picture

Status: Needs review » Needs work

The main issue is the autocompletion form. I've never used RealName--would it be standard to use that as the autocompletion (instead of the username), in which case we'd have to find a DB query that would support that. Someone should look into the RealName module to see if there is a standard implementation of the autocomplete forms that is compatible with RealNames when they exist and standard usernames when they don't, and that doesn't involve user_load'ing every possible user to see if it matches the query string. The other thing is that we don't really want the standard username themeing that involves a link, because we don't want it clickable. If these issues are resolved I'd be happy to commit this.

Thanks and good luck to anyone who'd be willing to help clean this up!
David

obrienmd’s picture

I think this would be well covered by http://drupal.org/node/718216 - more flexible, to boot. I don't want to be presumptuous and mark this as duplicate, but it seems frivolous to work on this from multiple angles when views integration similar to userref and noderef would solve this problem.

David Goode’s picture

Status: Needs work » Closed (duplicate)

Hey, that's a good idea obrienmd, and given as this doesn't look easily implementable for the theming and autocompletion reasons, I think we should concentrate our efforts there. Hopefully real name has good views support...?

David

obrienmd’s picture

Sure, if you wanted to use real name it would be required to have good views support, but why not just throw two fields in the profile, first and last name, then use views and display those two for the autocomplete? I don't really know, I've never used real name...

Dragoonius’s picture

Status: Closed (duplicate) » Needs review
FileSize
6.34 KB

It actually does have pretty good views support. I took cfennell's idea and ran with it. The problem with using the adding in themeing at those locations is it turns the names into links. Well if you take that patch and replace the "theme('username', $u);" with $u->realname_realname and the "$matches[$prefix . $user->name] = $prefix . theme('username', $user);" with $user->realname_realname. You then create a view similar to the attached one where you add in realnames as a field. Once you do that, you go into Administer->Messages and Notifications->Team UI and set the default view as the one you just created. That should bring forth the realnames without the links.