--- loncom/interface/lonuserutils.pm 2008/01/05 15:19:32 1.43 +++ loncom/interface/lonuserutils.pm 2008/01/17 00:14:49 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.43 2008/01/05 15:19:32 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.48 2008/01/17 00:14:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1307,8 +1307,10 @@ sub print_userlist { } $r->rflush(); if ($context eq 'course') { - my $classlist = &Apache::loncoursedata::get_classlist(); - %userlist = %{$classlist}; + if (($env{'form.showrole'} eq 'st') || ($env{'form.showrole'} eq 'Any')) { + my $classlist = &Apache::loncoursedata::get_classlist(); + %userlist = %{$classlist}; + } if ($env{'form.showrole'} ne 'st') { my $showroles; if ($env{'form.showrole'} ne 'Any') { @@ -1465,9 +1467,9 @@ sub section_group_filter { all => 'all', none => 'none', ); - my ($output,@options); + my $output; foreach my $item (@filters) { - my $markup; + my ($markup,@options); if ($env{'form.'.$name{$item}} eq '') { $env{'form.'.$name{$item}} = 'all'; } @@ -1788,6 +1790,8 @@ sub make_keylist_array { $index->{'email'} = &Apache::loncoursedata::CL_PERMANENTEMAIL(); $index->{'role'} = &Apache::loncoursedata::CL_ROLE(); $index->{'extent'} = &Apache::loncoursedata::CL_EXTENT(); + $index->{'photo'} = &Apache::loncoursedata::CL_PHOTO(); + $index->{'thumbnail'} = &Apache::loncoursedata::CL_THUMBNAIL(); foreach my $key (keys(%{$index})) { $keylist->[$index->{$key}] = $key; } @@ -1996,9 +2000,14 @@ function username_display_launch(usernam document.studentform.action.value = 'singleuser'; document.studentform.submit(); } - else { + if (target == 'aboutme') { document.location.href = '/adm/'+domain+'/'+username+'/aboutme'; } + if (target == 'aboutmewin') { + var url = '/adm/'+domain+'/'+username+'/aboutme'; + var options = 'height=600,width=800,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'; + aboutmewin = window.open(url,'',options,1); + } } $date_sec_selector @@ -2032,6 +2041,7 @@ END 'ac' => "Action to take for selected users", 'link' => "Behavior of username links", 'aboutme' => "Display a user's personal page", + 'aboutmewin' => "Display a user's personal page in a new window", 'modify' => "Modify a user's information", ); if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { @@ -2088,25 +2098,23 @@ END END $output = '
';
- my @linkdests = ('aboutme');
+ my @linkdests = ('aboutme','aboutmewin');
if ($permission->{'cusr'}) {
- push (@linkdests,'modify');
- $output .= ''.$lt{'link'}.': ';
- my $usernamelink = $env{'form.usernamelink'};
- if ($usernamelink eq '') {
- $usernamelink = 'aboutme';
- }
- foreach my $item (@linkdests) {
- my $checkedstr = '';
- if ($item eq $usernamelink) {
- $checkedstr = ' checked="checked" ';
- }
- $output .= ' ';
+ unshift (@linkdests,'modify');
+ }
+ $output .= ''.$lt{'link'}.': ';
+ my $usernamelink = $env{'form.usernamelink'};
+ if ($usernamelink eq '') {
+ $usernamelink = 'aboutme';
+ }
+ foreach my $item (@linkdests) {
+ my $checkedstr = '';
+ if ($item eq $usernamelink) {
+ $checkedstr = ' checked="checked" ';
}
- $output .= '
';
- } else {
- $output .= &mt("Click on a username to view the user's personal page.").'
';
+ $output .= ' ';
}
+ $output .= '
';
if ($actionselect) {
$output .= <<"END";
$lt{'ac'}: $actionselect