From 3dc01af30ab1b9883c1a5612427c2cf9ffdc6d8f Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Fri, 30 May 2008 21:16:13 +0000 Subject: [PATCH] Added overridePublicEmail and overridePublicProfile settings to UserList --- lib/WebGUI/Asset/Wobject/UserList.pm | 22 ++++++++++++++++++++-- lib/WebGUI/i18n/English/Asset_UserList.pm | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/UserList.pm b/lib/WebGUI/Asset/Wobject/UserList.pm index 6eb8cd3a3..d194606a4 100644 --- a/lib/WebGUI/Asset/Wobject/UserList.pm +++ b/lib/WebGUI/Asset/Wobject/UserList.pm @@ -232,6 +232,20 @@ sub definition { label=>$i18n->get('sort by'), hoverHelp=>$i18n->get('sort by description'), }, + overridePublicEmail=>{ + fieldType=>"yesNo", + defaultValue=>"0", + tab=>"display", + label=>$i18n->get("overridePublicEmail label"), + hoverHelp=>$i18n->get('overridePublicEmail description'), + }, + overridePublicProfile=>{ + fieldType=>"yesNo", + defaultValue=>"0", + tab=>"display", + label=>$i18n->get("overridePublicProfile label"), + hoverHelp=>$i18n->get('overridePublicProfile description'), + }, ); push(@{$definition}, { @@ -499,11 +513,15 @@ sub view { $p->setDataByArrayRef(\@visibleUsers); my $users = $p->getPageData($paginatePage); foreach my $user (@$users){ - if ($user->{publicProfile} eq "1" || ($user->{publicProfile} eq "" && $defaultPublicProfile eq "1")){ + if ($self->get('overridePublicProfile') || $user->{publicProfile} eq "1" || ($user->{publicProfile} eq "" && $defaultPublicProfile eq "1")){ my (@profileFieldValues); my %userProperties; my $emailNotPublic; - $emailNotPublic = 1 if ($user->{publicEmail} eq "0" || ($user->{publicEmail} eq "" && $defaultPublicEmail ne "1")); + 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, { diff --git a/lib/WebGUI/i18n/English/Asset_UserList.pm b/lib/WebGUI/i18n/English/Asset_UserList.pm index cac9a56fb..9a13958c0 100644 --- a/lib/WebGUI/i18n/English/Asset_UserList.pm +++ b/lib/WebGUI/i18n/English/Asset_UserList.pm @@ -89,6 +89,29 @@ will be available as named tmpl_vars|, lastUpdated => 1081514049 }, + 'overridePublicEmail label' => { + message => q|Override Email Public|, + lastUpdated => 1081514049 + }, + + 'overridePublicEmail description' => { + message => q|If set to Yes then the 'Make email address public' setting in the user profile +settings will be ignored. The User List will always show email addresses.|, + lastUpdated => 1081514049 + }, + + 'overridePublicProfile label' => { + message => q|Override Profile Public|, + lastUpdated => 1081514049 + }, + + 'overridePublicProfile description' => { + message => q|If set to Yes then the 'Make profile public' setting in the user profile settings will +be ignored. The User List will show every users profile.|, + lastUpdated => 1081514049 + }, + + 'alphabet' => { message => q|The alphabet that is used for the alphabet search. This is a string of comma seperated values|,