version 1.22, 2007/12/22 00:39:52
|
version 1.24, 2007/12/22 03:38:26
|
Line 1479 sub gather_userinfo {
|
Line 1479 sub gather_userinfo {
|
($userdata{'username'},$userdata{'domain'},$userdata{'role'}) = |
($userdata{'username'},$userdata{'domain'},$userdata{'role'}) = |
split(/:/,$item); |
split(/:/,$item); |
($userdata{'start'},$userdata{'end'})=split(/:/,$rolehash->{$item}); |
($userdata{'start'},$userdata{'end'})=split(/:/,$rolehash->{$item}); |
&build_user_record(\%userdata,$userinfo,$indexhash,$item,$userlist); |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
|
$item,$userlist); |
} elsif ($context eq 'course') { |
} elsif ($context eq 'course') { |
my $viewablesec = &viewable_section($permission); |
my $viewablesec = &viewable_section($permission); |
($userdata{'username'},$userdata{'domain'},$userdata{'role'}, |
($userdata{'username'},$userdata{'domain'},$userdata{'role'}, |
Line 1488 sub gather_userinfo {
|
Line 1489 sub gather_userinfo {
|
if (($viewablesec ne '') && ($userdata{'section'} ne '')) { |
if (($viewablesec ne '') && ($userdata{'section'} ne '')) { |
next if ($viewablesec ne $userdata{'section'}); |
next if ($viewablesec ne $userdata{'section'}); |
} |
} |
&build_user_record(\%userdata,$userinfo,$indexhash,$item,$userlist); |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
|
$item,$userlist); |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
if ($env{'form.roletype'} eq 'domain') { |
if ($env{'form.roletype'} eq 'domain') { |
($userdata{'role'},$userdata{'username'},$userdata{'domain'}) = |
($userdata{'role'},$userdata{'username'},$userdata{'domain'}) = |
split(/:/,$item); |
split(/:/,$item); |
($userdata{'end'},$userdata{'start'})=split(/:/,$rolehash->{$item}); |
($userdata{'end'},$userdata{'start'})=split(/:/,$rolehash->{$item}); |
&build_user_record(\%userdata,$userinfo,$indexhash,$item,$userlist); |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
|
$item,$userlist); |
} elsif ($env{'form.roletype'} eq 'author') { |
} elsif ($env{'form.roletype'} eq 'author') { |
if (ref($rolehash->{$item}) eq 'HASH') { |
if (ref($rolehash->{$item}) eq 'HASH') { |
$userdata{'extent'} = $item; |
$userdata{'extent'} = $item; |
Line 1503 sub gather_userinfo {
|
Line 1506 sub gather_userinfo {
|
($userdata{'start'},$userdata{'end'}) = |
($userdata{'start'},$userdata{'end'}) = |
split(/:/,$rolehash->{$item}{$key}); |
split(/:/,$rolehash->{$item}{$key}); |
my $uniqid = $key.':'.$item; |
my $uniqid = $key.':'.$item; |
&build_user_record(\%userdata,$userinfo,$indexhash,$uniqid,$userlist); |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
|
$uniqid,$userlist); |
} |
} |
} |
} |
} elsif ($env{'form.roletype'} eq 'course') { |
} elsif ($env{'form.roletype'} eq 'course') { |
Line 1518 sub gather_userinfo {
|
Line 1522 sub gather_userinfo {
|
my $space = ', '; |
my $space = ', '; |
if ($format eq 'html' || $format eq 'view') { |
if ($format eq 'html' || $format eq 'view') { |
$spanstart = '<span class="LC_nobreak">'; |
$spanstart = '<span class="LC_nobreak">'; |
if ($permission->{'cusr'}) { |
# FIXME: actions on courses disabled for now |
if ($numcids > 1) { |
# if ($permission->{'cusr'}) { |
$spanstart .= '<input type="radio" name="'.$item.'" value="'.$cid.'" />'; |
# if ($numcids > 1) { |
} else { |
# $spanstart .= '<input type="radio" name="'.$item.'" value="'.$cid.'" />'; |
$spanstart .= '<input type="hidden" name="'.$item.'" value="'.$cid.'" />'; |
# } else { |
} |
# $spanstart .= '<input type="hidden" name="'.$item.'" value="'.$cid.'" />'; |
} |
# } |
|
# } |
$spanend = '</span><br />'; |
$spanend = '</span><br />'; |
$space = ', '; |
$space = ', '; |
} |
} |
Line 1538 sub gather_userinfo {
|
Line 1543 sub gather_userinfo {
|
} |
} |
} |
} |
} |
} |
&build_user_record(\%userdata,$userinfo,$indexhash,$item,$userlist); |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
|
$item,$userlist); |
} |
} |
} |
} |
} |
} |
Line 1546 sub gather_userinfo {
|
Line 1552 sub gather_userinfo {
|
} |
} |
|
|
sub build_user_record { |
sub build_user_record { |
my ($userdata,$userinfo,$indexhash,$record_key,$userlist) = @_; |
my ($context,$userdata,$userinfo,$indexhash,$record_key,$userlist) = @_; |
next if ($userdata->{'start'} eq '-1' && $userdata->{'end'} eq '-1'); |
next if ($userdata->{'start'} eq '-1' && $userdata->{'end'} eq '-1'); |
&process_date_info($userdata); |
if (!(($context eq 'domain') && ($env{'form.roletype'} eq 'course'))) { |
|
&process_date_info($userdata); |
|
} |
my $username = $userdata->{'username'}; |
my $username = $userdata->{'username'}; |
my $domain = $userdata->{'domain'}; |
my $domain = $userdata->{'domain'}; |
if (ref($userinfo->{$username.':'.$domain}) eq 'HASH') { |
if (ref($userinfo->{$username.':'.$domain}) eq 'HASH') { |
$userdata->{'fullname'} = |
$userdata->{'fullname'} = $userinfo->{$username.':'.$domain}{'fullname'}; |
$userinfo->{$username.':'.$domain}{'fullname'}; |
|
$userdata->{'id'} = $userinfo->{$username.':'.$domain}{'id'}; |
$userdata->{'id'} = $userinfo->{$username.':'.$domain}{'id'}; |
} else { |
} else { |
&aggregate_user_info($domain,$username,$userinfo); |
&aggregate_user_info($domain,$username,$userinfo); |
Line 1972 END
|
Line 1979 END
|
my $results_description; |
my $results_description; |
if ($mode ne 'autoenroll') { |
if ($mode ne 'autoenroll') { |
$results_description = &results_header_row($rolefilter,$statusmode, |
$results_description = &results_header_row($rolefilter,$statusmode, |
$context,$permission); |
$context,$permission,$mode); |
$r->print('<b>'.$results_description.'</b><br />'); |
$r->print('<b>'.$results_description.'</b><br />'); |
} |
} |
my ($output,$actionselect); |
my ($output,$actionselect); |
Line 2367 sub select_actions {
|
Line 2374 sub select_actions {
|
chgsec => "Change section associated with user roles", |
chgsec => "Change section associated with user roles", |
); |
); |
my ($output,$options,%choices); |
my ($output,$options,%choices); |
|
# FIXME Disable actions for now for roletype=course in domain context |
|
if ($context eq 'domain' && $setting eq 'course') { |
|
return; |
|
} |
if ($statusmode eq 'Any') { |
if ($statusmode eq 'Any') { |
$options .= ' |
$options .= ' |
<option value="chgdates">'.$lt{'chgdates'}.'</option>'; |
<option value="chgdates">'.$lt{'chgdates'}.'</option>'; |
Line 2628 sub section_picker {
|
Line 2639 sub section_picker {
|
} |
} |
|
|
sub results_header_row { |
sub results_header_row { |
my ($rolefilter,$statusmode,$context,$permission) = @_; |
my ($rolefilter,$statusmode,$context,$permission,$mode) = @_; |
my ($description,$showfilter); |
my ($description,$showfilter); |
if ($rolefilter ne 'Any') { |
if ($rolefilter ne 'Any') { |
$showfilter = $rolefilter; |
$showfilter = $rolefilter; |
} |
} |
if ($context eq 'course') { |
if ($context eq 'course') { |
$description = &mt('Course - ').$env{'course.'.$env{'request.course.id'}.'.description'}.': '; |
if ($mode eq 'csv' || $mode eq 'excel') { |
|
$description = &mt('Course - ').$env{'course.'.$env{'request.course.id'}.'.description'}.': '; |
|
} |
if ($statusmode eq 'Expired') { |
if ($statusmode eq 'Expired') { |
$description .= &mt('Users in course with expired [_1] roles',$showfilter); |
$description .= &mt('Users in course with expired [_1] roles',$showfilter); |
} elsif ($statusmode eq 'Future') { |
} elsif ($statusmode eq 'Future') { |