fixed: #4174: UserList template show links that should be hidden

This commit is contained in:
Yung Han Khoe 2008-10-10 15:08:56 +00:00
parent 421392f134
commit a47c5b406d
3 changed files with 25 additions and 6 deletions

View file

@ -32,6 +32,8 @@
- fixed #8776: duplicate does not duplicate keywords - fixed #8776: duplicate does not duplicate keywords
- rfe: Thingy: export extra rows, meta data (SDH Consulting Group) - rfe: Thingy: export extra rows, meta data (SDH Consulting Group)
- rfe: Thingy: Max entries per user (SDH Consulting Group) - rfe: Thingy: Max entries per user (SDH Consulting Group)
- fixed: #4174: UserList template show links that should be hidden (Yung Han
Khoe)
7.6.0 7.6.0
- added: users may now customize the post received page for the CS - added: users may now customize the post received page for the CS

View file

@ -50,16 +50,28 @@ Returns an array ref that contains tmpl_vars for the Alphabet Search.
sub getAlphabetSearchLoop { sub getAlphabetSearchLoop {
my $self = shift; my $self = shift;
my $fieldName = shift || 'lastName'; my $fieldName = shift;
my $alphabet = shift; my $alphabet = shift;
my (@alphabet, @alphabetLoop); my (@alphabet, @alphabetLoop);
return [] if $fieldName eq 'disableAlphabetSearch';
$alphabet ||= "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"; $alphabet ||= "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";
@alphabet = split(/,/,$alphabet); @alphabet = split(/,/,$alphabet);
foreach my $letter (@alphabet){ foreach my $letter (@alphabet){
my $htmlEncodedLetter = encode_entities($letter); my $htmlEncodedLetter = encode_entities($letter);
my $searchURL = "?searchExact_".$fieldName."=".$letter."%25"; my $searchURL = "?searchExact_".$fieldName."=".$letter."%25";
my $hasResults = $self->session->db->quickScalar("select if (" my $hasResults;
."(select count(*) from userProfileData where ".$fieldName." like '".$letter."%')<>0, 1, 0)"); my $users = $self->session->db->read("select userId from userProfileData where lastName like '".$letter."%'");
while (my $user = $users->hashRef){
my $showGroupId = $self->get("showGroupId");
if ($showGroupId eq '0' || ($showGroupId && $self->isInGroup($showGroupId,$user->{userId}))){
unless ($self->get("hideGroupId") ne '0' && $self->isInGroup($self->get("hideGroupId"),$user->{userId})){
$hasResults = 1;
last;
}
}
}
push @alphabetLoop, { push @alphabetLoop, {
alphabetSearch_loop_label => $htmlEncodedLetter || $letter, alphabetSearch_loop_label => $htmlEncodedLetter || $letter,
alphabetSearch_loop_hasResults => $hasResults, alphabetSearch_loop_hasResults => $hasResults,
@ -162,6 +174,9 @@ sub definition {
my $label = WebGUI::Operation::Shared::secureEval($session,$field->{label}); my $label = WebGUI::Operation::Shared::secureEval($session,$field->{label});
$profileFields{$field->{fieldName}} = $label; $profileFields{$field->{fieldName}} = $label;
} }
my %alphabetSearchFieldOptions;
tie %alphabetSearchFieldOptions, 'Tie::IxHash';
%alphabetSearchFieldOptions = ('disableAlphabetSearch'=>'Disable Alphabet Search',%profileFields);
tie %properties, 'Tie::IxHash'; tie %properties, 'Tie::IxHash';
%properties = ( %properties = (
@ -206,7 +221,7 @@ sub definition {
fieldType=>"selectBox", fieldType=>"selectBox",
defaultValue=>"lastName", defaultValue=>"lastName",
tab=>"display", tab=>"display",
options=>\%profileFields, options=>\%alphabetSearchFieldOptions,
label=>$i18n->get("alphabetSearchField label"), label=>$i18n->get("alphabetSearchField label"),
hoverHelp=>$i18n->get('alphabetSearchField description'), hoverHelp=>$i18n->get('alphabetSearchField description'),
}, },

View file

@ -150,8 +150,10 @@ seperated values|,
}, },
'alphabetSearchField description' => { 'alphabetSearchField description' => {
message => q|Select the profile field in which the alphabet search will be done.|, message => q|Select the profile field in which the alphabet search will be done. You can disable
lastUpdated => 1081514049 the aplhapbet search function by selecting 'Disable Alphabet Search'. This will improve the performance of the
User List.|,
lastUpdated => 1223651066
}, },
'Profile not public message' => { 'Profile not public message' => {