Change occurances of user->profileField to user->get
This commit is contained in:
parent
ae48e7517a
commit
59c03b50e7
41 changed files with 86 additions and 86 deletions
|
|
@ -227,7 +227,7 @@ sub www_editFriends {
|
|||
##We don't use acceptsFriendsRequests here because it's overkill.
|
||||
##No need to check invitations, since friends are managed.
|
||||
##Existing friends are already filtered out.
|
||||
next USERID unless $user->profileField('ableToBeFriend') || $overrideProfile;
|
||||
next USERID unless $user->get('ableToBeFriend') || $overrideProfile;
|
||||
push @usersToAdd, [ $newFriendId, $user->username ];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,11 +66,11 @@ sub canView {
|
|||
my $session = $self->session;
|
||||
my $uid = $self->uid;
|
||||
|
||||
return 1 if (($session->user->userId eq $uid || $uid eq "") && $session->user->profileField('ableToBeFriend'));
|
||||
return 1 if (($session->user->userId eq $uid || $uid eq "") && $session->user->get('ableToBeFriend'));
|
||||
|
||||
my $user = WebGUI::User->new($session,$uid);
|
||||
return 0 if($user->isVisitor); #This should never happen but let's make sure
|
||||
return 0 unless ($user->profileField('ableToBeFriend')); #User doesn't have friends enabled
|
||||
return 0 unless ($user->get('ableToBeFriend')); #User doesn't have friends enabled
|
||||
return WebGUI::User->new($session,$uid)->profileIsViewable($session->user); #User's profile isn't viewable by this user
|
||||
}
|
||||
|
||||
|
|
@ -491,7 +491,7 @@ sub www_view {
|
|||
my $displayView = $uid ne "";
|
||||
$var->{'display_message'} = $msg;
|
||||
|
||||
unless ($user->profileField('ableToBeFriend') && $user->profileIsViewable($session->user)) {
|
||||
unless ($user->get('ableToBeFriend') && $user->profileIsViewable($session->user)) {
|
||||
my $i18n = WebGUI::International->new($session,"Account_Friends");
|
||||
my $errorMsg = "";
|
||||
if($var->{'can_edit'}) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ sub appendCommonVars {
|
|||
$var->{'view_invitations_url' } = $self->getUrl("module=inbox;do=manageInvitations");
|
||||
$var->{'unread_message_count' } = $inbox->getUnreadMessageCount($user->userId);
|
||||
$var->{'invitation_count' } = $self->getInvitationCount;
|
||||
$var->{'invitations_enabled' } = $user->profileField('ableToBeFriend');
|
||||
$var->{'invitations_enabled' } = $user->get('ableToBeFriend');
|
||||
$var->{'user_invitations_enabled'} = $session->setting->get("inboxInviteUserEnabled");
|
||||
$var->{'invite_friend_url' } = $self->getUrl("module=inbox;do=inviteUser");
|
||||
|
||||
|
|
@ -894,7 +894,7 @@ sub www_inviteUserSave {
|
|||
return $self->www_inviteUser($i18n->get('missing message')) unless $message;
|
||||
|
||||
#Profile Email address check
|
||||
my $email = $session->user->profileField('email');
|
||||
my $email = $session->user->get('email');
|
||||
unless ($email) {
|
||||
return $self->www_inviteUser($i18n->get('no email'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ sub appendCommonVars {
|
|||
$self->SUPER::appendCommonVars($var);
|
||||
|
||||
$var->{'edit_profile_url' } = $self->getUrl("module=profile;do=edit");
|
||||
$var->{'invitations_enabled' } = $user->profileField('ableToBeFriend');
|
||||
$var->{'invitations_enabled' } = $user->get('ableToBeFriend');
|
||||
$var->{'profile_category_loop'} = [];
|
||||
|
||||
#Append the categories
|
||||
|
|
@ -244,7 +244,7 @@ sub getExtrasStyle {
|
|||
|
||||
return $errorStyle if $field->getId ~~ $fieldErrors;
|
||||
return "" unless ($field->isRequired);
|
||||
return $requiredStyle unless($self->session->user->profileField($field->getId) || $fieldValue);
|
||||
return $requiredStyle unless($self->session->user->get($field->getId) || $fieldValue);
|
||||
return $requiredStyleOff;
|
||||
}
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ sub www_edit {
|
|||
foreach my $field (@{ $category->getFields( { editable => 1 } ) }) {
|
||||
my $fieldId = $field->getId;
|
||||
my $fieldLabel = $field->getLabel;
|
||||
my $fieldForm = $field->formField({ extras=>$self->getExtrasStyle($field,\@errorFields,$user->profileField($fieldId)) });
|
||||
my $fieldForm = $field->formField({ extras=>$self->getExtrasStyle($field,\@errorFields,$user->get($fieldId)) });
|
||||
my $fieldRequired = $field->isRequired;
|
||||
my $fieldExtras = $field->getExtras;
|
||||
my $fieldViewable = $field->isViewable;
|
||||
|
|
@ -472,7 +472,7 @@ sub www_view {
|
|||
|
||||
$self->appendCommonVars($var);
|
||||
|
||||
my $privacySetting = $user->profileField('publicProfile') || 'none';
|
||||
my $privacySetting = $user->get('publicProfile') || 'none';
|
||||
$var->{"profile_privacy_$privacySetting"} = "true";
|
||||
|
||||
$var->{'acceptsPrivateMessages'}
|
||||
|
|
@ -501,7 +501,7 @@ sub www_view {
|
|||
my $fieldId = $field->getId;
|
||||
my $fieldLabel = $field->getLabel;
|
||||
my $fieldValue = $field->formField(undef,2,$user);
|
||||
my $fieldRaw = $user->profileField($fieldId);;
|
||||
my $fieldRaw = $user->get($fieldId);;
|
||||
#Create a seperate template var for each field
|
||||
my $fieldBase = 'profile_field_'.$fieldId;
|
||||
$var->{$fieldBase.'_label' } = $fieldLabel;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue