Fix user searches in task resource additions in the Project Management

asset not displaying right without both first name and last name profile
fields present.
This commit is contained in:
Drake 2006-10-05 00:28:11 +00:00
parent f28d7e8b2d
commit d7a90bd48d
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,7 @@
7.0.10
- fix: mysql and mysqldump were transposed in upgrade.pl --help
- fix: adding Matrix listings committing the current version tag
- fix: user searches in task resource additions in PM not displaying right without both last name and first name present
7.0.9
- Removed the need for DateTime::Cron::Simple, which also added the ability

View file

@ -669,7 +669,14 @@ sub _htmlOfResourceList {
$subvar->{resourceIcon} = 'groups.gif';
} elsif ($resourceKind eq 'user') {
my $user = WebGUI::User->new($self->session, $resourceId);
$subvar->{resourceName} = WebGUI::HTML::format($user->profileField('lastName').', '.$user->profileField('firstName'), 'text');
my ($firstName, $lastName, $username) = ($user->profileField('firstName'), $user->profileField('lastName'), $user->username);
my $displayName = do {
if (length($firstName) && length($lastName)) { "$lastName, $firstName" }
elsif (length($firstName)) { $firstName }
elsif (length($lastName)) { $lastName }
else { $username }
};
$subvar->{resourceName} = WebGUI::HTML::format($displayName, 'text');
$subvar->{resourceIcon} = 'users.gif';
} else {
$self->session->errorHandler->fatal("Unknown kind of resource '$resourceKind'!");