From e085eff6af8b4a90dfc736f5e1200ddaa64b1c0b Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Mon, 1 Dec 2008 10:11:24 +0000 Subject: [PATCH] fixed UserList --- docs/changelog/7.x.x.txt | 1 + ...oot_import_userlist_default-userlist.wgpkg | Bin 0 -> 1458 bytes ...erlist-with-multiple-search-keywords.wgpkg | Bin 0 -> 1441 bytes ...userlist-with-search-field-selection.wgpkg | Bin 0 -> 1440 bytes lib/WebGUI/Asset/Wobject/UserList.pm | 34 ++++++++---------- lib/WebGUI/Help/Asset_UserList.pm | 4 +-- lib/WebGUI/i18n/English/Asset_UserList.pm | 24 ++++++------- 7 files changed, 30 insertions(+), 33 deletions(-) create mode 100644 docs/upgrades/packages-7.6.5/root_import_userlist_default-userlist.wgpkg create mode 100644 docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-multiple-search-keywords.wgpkg create mode 100644 docs/upgrades/packages-7.6.5/root_import_userlist_userlist-with-search-field-selection.wgpkg 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 0000000000000000000000000000000000000000..61addbc0f66a2c21bd7862f334986c5e52591045 GIT binary patch literal 1458 zcmV;j1x@-NiwFP!000001ML`TZ`(H1pZhBW4{J7{wIv^Q<9Y_tv{?frS(-TQj%)@k z(KZ{IR7uLNJM_Qr@lg_G$4;{%S%IPY;7EM;!FQxqx&O!a{Z6}GsrY`-X$O@`vtu8x z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P%jdrKiauRXmMd%AV^LrQB;^1(y0sal6c8BRW5L0HX zH*JMZk6JyQzZ#h)p>ch!iDFYeYDcSx{_)M zkzfgO-{Qz__toI|=(<~(IuhYk?$VV_kEzT}>*nAJn1upiySts;-FBx@GTEf7*=u0L z%G{L)q_k?nB1OWhJY`B7mYRyiAve>i^+pL~8kLz3E!XP-q&$?%1k-w5Z%roI!q|Qu z4c`BLuy;0j!>9gL`}E>Hjb6KeGIhRGu&=FiK&x_Rm6vA74P2QwWe0BBtF8zdL3{T} zt7H~L5N=ea-hO+0`tkAG$bJA`eiT3c_5Gr1*7;8lKHbHC3%>FA=7Db>_&<5z MAENMv-T)W?0Qp(c0{{R3 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c8084d8f56837f0b89f9376b6abaca32a924cf67 GIT binary patch literal 1441 zcmV;S1z!3eiwFP!000001MOICa~d}g=5v0<4KuCNnHcVP34u^%VkeG0u~Rp;o4&YZ z#GL@ehjf*65Yowi?`n0Njx!{#$8Ns(KENUEKKm~1QmfqmkX(BstST)e znb4}&^Zxkr2`(j4Bvfifm03kHLm5g+G>!I_X0_U^BC*+siPEn=CPKpQ3*_Nx9Ov6m zWg79TNji#|n$pPea=LiWcqA4G>bniK zQdDP5hX0r;eLhQK%zE=tFe#NWf=eNEoz0AG^%QtOefP4vV0yYcOJmKFnC>b{WH{Zu zqRWMlk#eRmb;zQKazqS@>!(s^p_hquPr>?$6lro4y^5H&Tn)#jDJZ>iX*%X6k< zYH6oI0ZQX~zYdGYwg%)ts0t-ZG-znaP@GXED(v(Vuf72VaYu5s=iYJ<>-qyBXD0eo zmSjLek6BC)7>%Q$$=0`IM&V^d<3Z1JZm}?qLPJ6g`Wxh}0ctj*zYG2az?@j-7peiRO;3R&$!y*sez4K(} zg(<_~ssML>cn-N2ZHxL1;Z13Bi0KW4SWj)%8uy4dm2?dDxCpI2Teg#n&-RX*d+C z;AY-6~CXWF8)8*n4dG& z52XVJ3&JKc-1u-`lMsxQ1~;3GTG)*PONz}(q|h6AqpgiM&dxNGoA_eIKe zjj5BY&9%f4o9FkwW5~M))03JCc3ZVX(m4~UIt5Iq^zUcT5)1vjaNHG%fylJygRjtW zXwVSQS_4{@8VT1mGd`t~=?fVjNHIGll5*Qx7rO44aSD>L_NRnTw#`r{B4T3((~+64f=1(6&}ets&zwZ;wQ=_%n_r-L z(^GFXg1~iSMiB4%2$Ibczc6YCt&Rg_%1jw153F3bqpn!;R%p;E#6}MH3+|dxp5j<= zE0xSxnBtUHB?;Uz^Ws>Dv)UQ^WOZtEy9F;KM1u7wbBoh^y~Fd9R5zVEBCJr zsZ713V*)u|HWH`TENr;f?RL7|cBfHrgh_2Pd_nV@IdMbq7^Hr9wMwtT7^tRVal}pk zZ@p32G8eb$+%4)V=q^H(hjN)<36%BLWRlIg{@$DO#o5K{H)pClT%3GRZ$?LZKRXbn z&Xx*>$}$34wQ^Q*-iM6AX@67B;GYERt_T|N?_aA~NI8fgR9~jvetUfSY4`o)S$lr< v+q?OG6z~4}_o8b4iTM2J^IiPW@qqE*fd>yfc;LYUYaaL)@iAF%02%-QU(?$d literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..9a96fba880db79c97ce897fb696153efbf08792d GIT binary patch literal 1440 zcmV;R1z-9fiwFP!000001MOJPlWId0xVEH|S;`)64}yfp2I>AjT+@FliQcyT z@9qx1cN*`t6p!QyX#Anu-B|yAztgMKf2Rve0c7*(pQoySEzM5QfH&?_Mm&2FlbOF`A8rs_DVIzm4fMP5@9U69#LL83J^ znUIw~VcJ~G6OO32zdGJ}syHfFQko{4+t`{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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' => {