fixed UserList

This commit is contained in:
Yung Han Khoe 2008-12-01 10:11:24 +00:00
parent 51c133fa1e
commit e085eff6af
7 changed files with 30 additions and 33 deletions

View file

@ -14,6 +14,7 @@
- fixed #9112: Thingy View Thing screen doesn't preserve newlines - fixed #9112: Thingy View Thing screen doesn't preserve newlines
- fixed #9155: purpose of "headblock" duplicates "extra head tags" - fixed #9155: purpose of "headblock" duplicates "extra head tags"
- fixed: Improve Thingy navigation. - fixed: Improve Thingy navigation.
- fixed #9126: UserList is completely broken in 7.6.4 (Yung Han Khoe)
7.6.4 7.6.4
- Survey now will show progress and time limit. - Survey now will show progress and time limit.

View file

@ -434,7 +434,7 @@ sub view {
} }
# Query user profile data. Exclude the visitor account and users that have been deactivated. # Query user profile data. Exclude the visitor account and users that have been deactivated.
$sql = "select distinct users.userId, users.userName, userProfileData.publicProfile, userProfileData.publicEmail "; $sql = "select distinct users.userId, users.userName, userProfileData.publicProfile ";
# Include remaining profile fields in the query # Include remaining profile fields in the query
foreach my $profileField (@profileFields){ foreach my $profileField (@profileFields){
$sql .= ", userProfileData.$profileField->{fieldName}"; $sql .= ", userProfileData.$profileField->{fieldName}";
@ -534,26 +534,17 @@ sub view {
$p->setDataByArrayRef(\@visibleUsers); $p->setDataByArrayRef(\@visibleUsers);
my $users = $p->getPageData($paginatePage); my $users = $p->getPageData($paginatePage);
foreach my $user (@$users){ foreach my $user (@$users){
if ($self->get('overridePublicProfile') || $user->{publicProfile} eq "1" || ($user->{publicProfile} eq "" && $defaultPublicProfile eq "1")){ my $userObject = WebGUI::User->new($self->session,$user->{userId});
if ($self->get('overridePublicProfile') || $userObject->profileIsViewable($userObject)){
my (@profileFieldValues); my (@profileFieldValues);
my %userProperties; my %userProperties;
my $emailNotPublic;
if ($user->{publicEmail} eq "0" || ($user->{publicEmail} eq "" && $defaultPublicEmail ne "1")){
unless ($self->get('overridePublicEmail')){
$emailNotPublic = 1;
}
}
foreach my $profileField (@profileFields){ foreach my $profileField (@profileFields){
if ($profileField->{fieldName} eq "email" && $emailNotPublic){ # Assign field name
push (@profileFieldValues, { my $profileFieldName = $profileField->{fieldName};
"profile_emailNotPublic"=>1, $profileFieldName =~ s/ /_/g;
}); $profileFieldName =~ s/\./_/g;
}
else { if ($userObject->canViewField($profileField->{fieldName},$self->session->user)){
# Assign field name
my $profileFieldName = $profileField->{fieldName};
$profileFieldName =~ s/ /_/g;
$profileFieldName =~ s/\./_/g;
# Assign value # Assign value
my $value = $user->{$profileField->{fieldName}}; my $value = $user->{$profileField->{fieldName}};
# Assign default value if not available # Assign default value if not available
@ -577,8 +568,13 @@ sub view {
$userProperties{'user_profile_'.$profileFieldName.'_value'} = $value; $userProperties{'user_profile_'.$profileFieldName.'_value'} = $value;
} }
} }
else{
push (@profileFieldValues, {
"profile_notPublic"=>1,
});
$userProperties{'user_profile_'.$profileFieldName.'_notPublic'} = 1;
}
} }
$userProperties{"user_profile_emailNotPublic"} = $emailNotPublic;
$userProperties{"user_id"} = $user->{userId}; $userProperties{"user_id"} = $user->{userId};
$userProperties{"user_name"} = $user->{userName}; $userProperties{"user_name"} = $user->{userName};
$userProperties{"user_profile_loop"} = \@profileFieldValues; $userProperties{"user_profile_loop"} = \@profileFieldValues;

View file

@ -54,11 +54,11 @@ our $HELP = {
{ 'name' => 'user_name' }, { 'name' => 'user_name' },
{ 'name' => 'user_id' }, { 'name' => 'user_id' },
{ 'name' => 'user_profile_PROFILEFIELDNAME_value' }, { 'name' => 'user_profile_PROFILEFIELDNAME_value' },
{ 'name' => 'user_profile_PROFILEFIELDNAME_notPublic' },
{ 'name' => 'user_profile_PROFILEFIELDNAME_file' }, { 'name' => 'user_profile_PROFILEFIELDNAME_file' },
{ 'name' => 'user_profile_emailNotPublic' },
{ 'name' => 'user_profile_loop', { 'name' => 'user_profile_loop',
'variables' => [ 'variables' => [
{ 'name' => 'profile_emailNotPublic' }, { 'name' => 'profile_notPublic' },
{ 'name' => 'profile_value' }, { 'name' => 'profile_value' },
{ 'name' => 'profile_file' }, { 'name' => 'profile_file' },
], ],

View file

@ -165,9 +165,9 @@ User List.|,
lastUpdated => 1081514049 lastUpdated => 1081514049
}, },
'Email not public message' => { 'Field not public message' => {
message => q|Email not public|, message => q|Field not public|,
lastUpdated => 1081514049 lastUpdated => 1228125347
}, },
'id label' => { 'id label' => {
@ -329,6 +329,12 @@ be searched or not. This will only have an effect if the limitSearch tmpl_var is
lastUpdated => 1081514049 lastUpdated => 1081514049
}, },
'user_profile_PROFILEFIELDNAME_notPublic' => {
message => q|A conditional which is true if the profile field with the name PROFILEFIELDNAME is not
public, example <tmpl_var user_profile_firstName_notPublic>|,
lastUpdated => 1228125347
},
'user_profile_PROFILEFIELDNAME_value' => { 'user_profile_PROFILEFIELDNAME_value' => {
message => q|The value of the profile field with the name PROFILEFIELDNAME in the users user message => q|The value of the profile field with the name PROFILEFIELDNAME in the users user
profile. Example <tmpl_var user_profile_firstName_value>|, profile. Example <tmpl_var user_profile_firstName_value>|,
@ -342,20 +348,14 @@ an image.|,
lastUpdated => 1081514049 lastUpdated => 1081514049
}, },
'user_profile_emailNotPublic' => {
message => q|A conditional that is true if the users email address is not public.|,
lastUpdated => 1081514049
},
'user_profile_loop' => { 'user_profile_loop' => {
message => q|A loop containing the users profile fields.|, message => q|A loop containing the users profile fields.|,
lastUpdated => 1081514049 lastUpdated => 1081514049
}, },
'profile_emailNotPublic' => { 'profile_notPublic' => {
message => q|A conditional that is true if the users email address is not public. It will only be message => q|A conditional that is true for each field that is not public.|,
true for the 'email' profile field.|, lastUpdated => 1228125347
lastUpdated => 1081514049
}, },
'profile_value' => { 'profile_value' => {