Added overridePublicEmail and overridePublicProfile settings to UserList

This commit is contained in:
Yung Han Khoe 2008-05-30 21:16:13 +00:00
parent 9446ed4e32
commit 3dc01af30a
2 changed files with 43 additions and 2 deletions

View file

@ -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, {

View file

@ -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|,