Change user.name property to be equal to login_name, add separate accessor for realname

hinted-selects
Vitaliy Filippov 2014-08-27 16:50:36 +04:00
parent de967fa5c8
commit 93961db741
4 changed files with 14 additions and 13 deletions

View File

@ -264,7 +264,7 @@ sub set_login {
delete $self->{nick};
}
sub set_name {
sub set_realname {
my ($self, $name) = @_;
$self->set('realname', $name);
delete $self->{identity};
@ -287,9 +287,10 @@ sub update_last_seen_date {
################################################################################
# Accessors for user attributes
sub name { $_[0]->{realname}; }
sub login { $_[0]->{login_name}; }
sub email { $_[0]->login . Bugzilla->params->{'emailsuffix'}; }
sub name { $_[0]->{login_name} }
sub login { $_[0]->{login_name} }
sub email { $_[0]->login . Bugzilla->params->{emailsuffix}; }
sub realname { $_[0]->{realname} }
sub disabledtext { $_[0]->{disabledtext}; }
sub is_enabled { $_[0]->{is_enabled} }
sub showmybugslink { $_[0]->{mybugslink}; }

View File

@ -212,7 +212,7 @@ if ($action eq 'search') {
my $new_user = Bugzilla::User->create({
login_name => scalar $cgi->param('login'),
cryptpassword => $password,
realname => scalar $cgi->param('name'),
realname => scalar $cgi->param('realname'),
disabledtext => scalar $cgi->param('disabledtext'),
disable_mail => scalar $cgi->param('disable_mail')});
@ -252,7 +252,7 @@ if ($action eq 'search') {
my $changes = {};
if ($editusers) {
$otherUser->set_login($cgi->param('login'));
$otherUser->set_name($cgi->param('name'));
$otherUser->set_realname($cgi->param('realname'));
$otherUser->set_password($cgi->param('password'))
if $cgi->param('password');
$otherUser->set_disabledtext($cgi->param('disabledtext'));

View File

@ -39,14 +39,14 @@
</td>
</tr>
<tr>
<th><label for="name">Real name:</label></th>
<th><label for="realname">Real name:</label></th>
<td>
[% IF editusers %]
<input size="64" maxlength="255" name="name"
<input size="64" maxlength="255" name="realname"
autocomplete="off"
id="name" value="[% otheruser.name FILTER html %]" />
id="realname" value="[% otheruser.realname FILTER html %]" />
[% ELSE %]
[% otheruser.name FILTER html %]
[% otheruser.realname FILTER html %]
[% END %]
</td>
</tr>

View File

@ -14,7 +14,7 @@
# Portions created by the Initial Developer are Copyright (C) 2007
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Contributor(s):
# Daniel Brooks <db48x@db48x.net>
# Max Kanat-Alexander <mkanat@bugzilla.org>
#%]
@ -29,8 +29,8 @@
<a class="email" href="[% Param("user_mailto") %][% who.email FILTER html %]"
title="[% who.identity FILTER html %]">
[%- END -%]
[% IF who.name %]
<span class="fn">[% who.name FILTER html %]</span>
[% IF who.realname %]
<span class="fn">[% who.realname FILTER html %]</span>
[% ELSE %]
[% who.login FILTER email FILTER html %]
[% END %]