diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index da2974d5f..08f821046 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,6 +14,7 @@ - fixed #9112: Thingy View Thing screen doesn't preserve newlines - fixed #9155: purpose of "headblock" duplicates "extra head tags" - fixed: Improve Thingy navigation. + - fixed #9126: UserList is completely broken in 7.6.4 (Yung Han Khoe) 7.6.4 - Survey now will show progress and time limit. diff --git a/docs/upgrades/packages-7.6.5/root_import_userlist_default-userlist.wgpkg b/docs/upgrades/packages-7.6.5/root_import_userlist_default-userlist.wgpkg new file mode 100644 index 000000000..61addbc0f Binary files /dev/null and b/docs/upgrades/packages-7.6.5/root_import_userlist_default-userlist.wgpkg differ diff --git a/docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-multiple-search-keywords.wgpkg b/docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-multiple-search-keywords.wgpkg new file mode 100644 index 000000000..c8084d8f5 Binary files /dev/null and b/docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-multiple-search-keywords.wgpkg differ diff --git a/docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-search-field-selection.wgpkg b/docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-search-field-selection.wgpkg new file mode 100644 index 000000000..9a96fba88 Binary files /dev/null and b/docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-search-field-selection.wgpkg differ diff --git a/lib/WebGUI/Asset/Wobject/UserList.pm b/lib/WebGUI/Asset/Wobject/UserList.pm index 1d24e0bf6..15c75620e 100644 --- a/lib/WebGUI/Asset/Wobject/UserList.pm +++ b/lib/WebGUI/Asset/Wobject/UserList.pm @@ -434,7 +434,7 @@ sub view { } # 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 foreach my $profileField (@profileFields){ $sql .= ", userProfileData.$profileField->{fieldName}"; @@ -534,26 +534,17 @@ sub view { $p->setDataByArrayRef(\@visibleUsers); my $users = $p->getPageData($paginatePage); 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 %userProperties; - my $emailNotPublic; - if ($user->{publicEmail} eq "0" || ($user->{publicEmail} eq "" && $defaultPublicEmail ne "1")){ - unless ($self->get('overridePublicEmail')){ - $emailNotPublic = 1; - } - } foreach my $profileField (@profileFields){ - if ($profileField->{fieldName} eq "email" && $emailNotPublic){ - push (@profileFieldValues, { - "profile_emailNotPublic"=>1, - }); - } - else { - # Assign field name - my $profileFieldName = $profileField->{fieldName}; - $profileFieldName =~ s/ /_/g; - $profileFieldName =~ s/\./_/g; + # Assign field name + my $profileFieldName = $profileField->{fieldName}; + $profileFieldName =~ s/ /_/g; + $profileFieldName =~ s/\./_/g; + + if ($userObject->canViewField($profileField->{fieldName},$self->session->user)){ # Assign value my $value = $user->{$profileField->{fieldName}}; # Assign default value if not available @@ -577,8 +568,13 @@ sub view { $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_name"} = $user->{userName}; $userProperties{"user_profile_loop"} = \@profileFieldValues; diff --git a/lib/WebGUI/Help/Asset_UserList.pm b/lib/WebGUI/Help/Asset_UserList.pm index db7546deb..2b0b6bbc4 100644 --- a/lib/WebGUI/Help/Asset_UserList.pm +++ b/lib/WebGUI/Help/Asset_UserList.pm @@ -54,11 +54,11 @@ our $HELP = { { 'name' => 'user_name' }, { 'name' => 'user_id' }, { 'name' => 'user_profile_PROFILEFIELDNAME_value' }, + { 'name' => 'user_profile_PROFILEFIELDNAME_notPublic' }, { 'name' => 'user_profile_PROFILEFIELDNAME_file' }, - { 'name' => 'user_profile_emailNotPublic' }, { 'name' => 'user_profile_loop', 'variables' => [ - { 'name' => 'profile_emailNotPublic' }, + { 'name' => 'profile_notPublic' }, { 'name' => 'profile_value' }, { 'name' => 'profile_file' }, ], diff --git a/lib/WebGUI/i18n/English/Asset_UserList.pm b/lib/WebGUI/i18n/English/Asset_UserList.pm index cf465d322..76c608cb9 100644 --- a/lib/WebGUI/i18n/English/Asset_UserList.pm +++ b/lib/WebGUI/i18n/English/Asset_UserList.pm @@ -165,9 +165,9 @@ User List.|, lastUpdated => 1081514049 }, - 'Email not public message' => { - message => q|Email not public|, - lastUpdated => 1081514049 + 'Field not public message' => { + message => q|Field not public|, + lastUpdated => 1228125347 }, 'id label' => { @@ -329,6 +329,12 @@ be searched or not. This will only have an effect if the limitSearch tmpl_var is 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' => { message => q|The value of the profile field with the name PROFILEFIELDNAME in the users user profile. Example <tmpl_var user_profile_firstName_value>|, @@ -342,20 +348,14 @@ an image.|, 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' => { message => q|A loop containing the users profile fields.|, lastUpdated => 1081514049 }, - 'profile_emailNotPublic' => { - message => q|A conditional that is true if the users email address is not public. It will only be -true for the 'email' profile field.|, - lastUpdated => 1081514049 + 'profile_notPublic' => { + message => q|A conditional that is true for each field that is not public.|, + lastUpdated => 1228125347 }, 'profile_value' => {