version 1.42, 2008/01/05 05:22:42
|
version 1.47, 2008/01/07 03:00:00
|
Line 1307 sub print_userlist {
|
Line 1307 sub print_userlist {
|
} |
} |
$r->rflush(); |
$r->rflush(); |
if ($context eq 'course') { |
if ($context eq 'course') { |
my $classlist = &Apache::loncoursedata::get_classlist(); |
if (($env{'form.showrole'} eq 'st') || ($env{'form.showrole'} eq 'Any')) { |
my $secidx = &Apache::loncoursedata::CL_SECTION(); |
my $classlist = &Apache::loncoursedata::get_classlist(); |
my $viewablesec = &viewable_section($permission); |
%userlist = %{$classlist}; |
foreach my $student (keys(%{$classlist})) { |
} |
my $section = $classlist->{$student}[$secidx]; |
if ($env{'form.showrole'} ne 'st') { |
if ($viewablesec ne '') { |
my $showroles; |
if ($section ne $viewablesec) { |
if ($env{'form.showrole'} ne 'Any') { |
next; |
$showroles = [$env{'form.showrole'}]; |
} else { |
|
$userlist{$student} = $classlist->{$student}; |
|
} |
|
} else { |
} else { |
$userlist{$student} = $classlist->{$student}; |
$showroles = undef; |
} |
} |
|
my $withsec = 1; |
|
my $hidepriv = 1; |
|
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef, |
|
\@statuses,$showroles,undef,$withsec,$hidepriv); |
|
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo, |
|
\%advrolehash,$permission); |
} |
} |
my $showroles; |
|
if ($env{'form.showrole'} ne 'Any') { |
|
$showroles = [$env{'form.showrole'}]; |
|
} else { |
|
$showroles = undef; |
|
} |
|
my $withsec = 1; |
|
my $hidepriv = 1; |
|
my %advrolehash = &Apache::lonnet::get_my_roles($cnum,$cdom,undef, |
|
\@statuses,$showroles,undef,$withsec,$hidepriv); |
|
&gather_userinfo($context,$format,\%userlist,$indexhash,\%userinfo, |
|
\%advrolehash,$permission); |
|
} else { |
} else { |
my (%cstr_roles,%dom_roles); |
my (%cstr_roles,%dom_roles); |
if ($context eq 'author') { |
if ($context eq 'author') { |
Line 1476 sub section_group_filter {
|
Line 1467 sub section_group_filter {
|
all => 'all', |
all => 'all', |
none => 'none', |
none => 'none', |
); |
); |
my ($output,@options); |
my $output; |
foreach my $item (@filters) { |
foreach my $item (@filters) { |
my $markup; |
my ($markup,@options); |
if ($env{'form.'.$name{$item}} eq '') { |
if ($env{'form.'.$name{$item}} eq '') { |
$env{'form.'.$name{$item}} = 'all'; |
$env{'form.'.$name{$item}} = 'all'; |
} |
} |
Line 1799 sub make_keylist_array {
|
Line 1790 sub make_keylist_array {
|
$index->{'email'} = &Apache::loncoursedata::CL_PERMANENTEMAIL(); |
$index->{'email'} = &Apache::loncoursedata::CL_PERMANENTEMAIL(); |
$index->{'role'} = &Apache::loncoursedata::CL_ROLE(); |
$index->{'role'} = &Apache::loncoursedata::CL_ROLE(); |
$index->{'extent'} = &Apache::loncoursedata::CL_EXTENT(); |
$index->{'extent'} = &Apache::loncoursedata::CL_EXTENT(); |
|
$index->{'photo'} = &Apache::loncoursedata::CL_PHOTO(); |
|
$index->{'thumbnail'} = &Apache::loncoursedata::CL_THUMBNAIL(); |
foreach my $key (keys(%{$index})) { |
foreach my $key (keys(%{$index})) { |
$keylist->[$index->{$key}] = $key; |
$keylist->[$index->{$key}] = $key; |
} |
} |
Line 2251 END
|
Line 2244 END
|
} |
} |
|
|
# Done with header lines in all formats |
# Done with header lines in all formats |
|
|
my %index; |
my %index; |
my $i; |
my $i; |
foreach my $idx (@$keylist) { |
foreach my $idx (@$keylist) { |
Line 2272 END
|
Line 2264 END
|
# Get groups, role, permanent e-mail so we can sort on them if |
# Get groups, role, permanent e-mail so we can sort on them if |
# necessary. |
# necessary. |
foreach my $user (keys(%{$userlist})) { |
foreach my $user (keys(%{$userlist})) { |
|
if ($user eq '' ) { |
|
delete($userlist->{$user}); |
|
next; |
|
} |
if ($context eq 'domain' && $user eq $env{'request.role.domain'}.'-domainconfig:'.$env{'request.role.domain'}) { |
if ($context eq 'domain' && $user eq $env{'request.role.domain'}.'-domainconfig:'.$env{'request.role.domain'}) { |
delete($userlist->{$user}); |
delete($userlist->{$user}); |
next; |
next; |
Line 2317 END
|
Line 2313 END
|
} |
} |
if ($mode ne 'autoenroll') { |
if ($mode ne 'autoenroll') { |
my $section = $userlist->{$user}->[$index{'section'}]; |
my $section = $userlist->{$user}->[$index{'section'}]; |
|
if (($env{'request.course.sec'} ne '') && |
|
($section ne $env{'request.course.sec'})) { |
|
if ($role eq 'st') { |
|
delete($userlist->{$user}); |
|
next; |
|
} |
|
} |
if ($secfilter eq 'none') { |
if ($secfilter eq 'none') { |
if ($section ne '') { |
if ($section ne '') { |
delete($userlist->{$user}); |
delete($userlist->{$user}); |
Line 2339 END
|
Line 2342 END
|
next; |
next; |
} |
} |
} |
} |
|
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
|
if (($displayphotos eq 'on') && ($role eq 'st')) { |
|
$userlist->{$user}->[$index{'photo'}] = |
|
&Apache::lonnet::retrievestudentphoto($udom,$uname,'jpg'); |
|
$userlist->{$user}->[$index{'thumbnail'}] = |
|
&Apache::lonnet::retrievestudentphoto($udom,$uname, |
|
'gif','thumbnail'); |
|
} |
|
} |
} |
} |
} |
} |
my %emails = &Apache::loncommon::getemails($uname,$udom); |
my %emails = &Apache::loncommon::getemails($uname,$udom); |
Line 2470 END
|
Line 2482 END
|
$r->print(' <td> </td> '); |
$r->print(' <td> </td> '); |
} |
} |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
if ($displayphotos eq 'on' && $sdata->[$index{'role'}] eq 'st') { |
if ($displayphotos eq 'on' && $role eq 'st' && $in{'photo'} ne '') { |
my $imgurl = |
$r->print(' <td align="right"><a href="javascript:photowindow('."'".$in{'photo'}."'".')"><img src="'.$in{'thumbnail'}.'" border="1"></a></td>'); |
&Apache::lonnet::retrievestudentphoto($in{'domain'},$in{'username'}, |
|
'gif','thumbnail'); |
|
$r->print(' <td align="right"><a href="javascript:photowindow('."'".&Apache::lonnet::studentphoto($in{'domain'},$in{'username'},'jpg')."'".')"><img src="'.$imgurl.'" border="1"></a></td>'); |
|
} else { |
} else { |
$r->print(' <td> </td> '); |
$r->print(' <td> </td> '); |
} |
} |