version 1.224, 2025/01/13 00:57:39
|
version 1.225, 2025/01/13 01:00:58
|
Line 3518 END
|
Line 3518 END
|
Future => 'Future', |
Future => 'Future', |
Expired => 'Expired', |
Expired => 'Expired', |
); |
); |
my (%crslogins,%camanagers); |
my (%crslogins,%camanagers,%othdoms); |
if ($context eq 'course') { |
if ($context eq 'course') { |
# If this is for a single course get last course "log-in". |
# If this is for a single course get last course "log-in". |
%crslogins=&Apache::lonnet::dump('nohist_crslastlogin',$cdom,$cnum); |
%crslogins=&Apache::lonnet::dump('nohist_crslastlogin',$cdom,$cnum); |
Line 3536 END
|
Line 3536 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. |
|
# Compare user's domain with $env{'request.role.dom'}, and if |
|
# different add to the domains for which to retrieve data on |
|
# viewable user information, by institutional status, for users |
|
# from "other" domains. |
foreach my $user (keys(%{$userlist})) { |
foreach my $user (keys(%{$userlist})) { |
if ($user eq '' ) { |
if ($user eq '' ) { |
delete($userlist->{$user}); |
delete($userlist->{$user}); |
Line 3666 END
|
Line 3670 END
|
$userlist->{$user}->[$index{'authorquota'}] = sprintf("%.2f",$disk_quota); |
$userlist->{$user}->[$index{'authorquota'}] = sprintf("%.2f",$disk_quota); |
} |
} |
} |
} |
|
unless ($env{'request.role.domain'} eq $udom) { |
|
$othdoms{$udom} = 1; |
|
} |
$usercount ++; |
$usercount ++; |
} |
} |
my $autocount = 0; |
my $autocount = 0; |
Line 3707 END
|
Line 3714 END
|
$disabled = ' disabled="disabled"'; |
$disabled = ' disabled="disabled"'; |
} |
} |
} |
} |
|
my (%shownfields_by_dom,%checkshown); |
|
if (keys(%othdoms)) { |
|
my @userinfo = ('firstname','middlename','lastname','generation', |
|
'permanentemail','id'); |
|
foreach my $dom (keys(%othdoms)) { |
|
my %shownfields = &get_othdom_shownfields($dom,\@userinfo); |
|
$shownfields_by_dom{$dom} = \%shownfields; |
|
} |
|
foreach my $item (@userinfo) { |
|
if ($item eq 'id') { |
|
if (grep(/^\Q$item\E$/,@cols)) { |
|
$checkshown{$item} = 1; |
|
} |
|
} elsif ($item eq 'permamentemail') { |
|
if (grep(/^email$/,@cols)) { |
|
$checkshown{$item} = 1; |
|
} |
|
} elsif (grep(/^fullname$/,@cols)) { |
|
$checkshown{$item} = 1; |
|
} |
|
} |
|
} |
foreach my $user (@sorted_users) { |
foreach my $user (@sorted_users) { |
my %in; |
my %in; |
my $sdata = $userlist->{$user}; |
my $sdata = $userlist->{$user}; |
$rowcount ++; |
$rowcount ++; |
foreach my $item (@{$keylist}) { |
foreach my $item (@{$keylist}) { |
$in{$item} = $sdata->[$index{$item}]; |
$in{$item} = $sdata->[$index{$item}]; |
} |
} |
if (grep(/^clicker$/,@cols)) { |
if ((grep(/^clicker$/,@cols)) || (keys(%checkshown) && (exists($othdoms{$in{'domain'}})))) { |
my $clickers = (&Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers'))[1]; |
my %info = &Apache::lonnet::userenvironment($in{'domain'},$in{'username'},'clickers','inststatus', |
if ($clickers!~/\w/) { $clickers='-'; } |
'firstname','middlename','lastname','generation'); |
$in{'clicker'} = $clickers; |
if (grep(/^clicker$/,@cols)) { |
|
if ($info{'clickers'} !~/\w/) { $info{'clickers'} = '-'; } |
|
$in{'clicker'} = $info{'clickers'}; |
|
} |
|
if (keys(%checkshown) && exists($othdoms{$in{'domain'}})) { |
|
my @statuses; |
|
if ($info{'inststatus'} ne '') { |
|
@statuses = split(/:/,$info{'inststatus'}); |
|
} else { |
|
@statuses = ('default'); |
|
} |
|
if (ref($shownfields_by_dom{$in{'domain'}}) eq 'HASH') { |
|
my (%shown,$rebuildname,%names); |
|
foreach my $type (@statuses) { |
|
if (ref($shownfields_by_dom{$in{'domain'}}{$type}) eq 'HASH') { |
|
foreach my $key (keys(%{$shownfields_by_dom{$in{'domain'}}{$type}})) { |
|
$shown{$key} = 1; |
|
} |
|
} |
|
} |
|
foreach my $item ('id','permanentemail') { |
|
if ($checkshown{$item} && !$shown{$item}) { |
|
if ($item eq 'permanentemail') { |
|
$in{'email'} = &mt('not shown'); |
|
} else { |
|
$in{$item} = &mt('not shown'); |
|
} |
|
} |
|
} |
|
foreach my $item ('firstname','middlename','lastname','generation') { |
|
if ($checkshown{$item} && !$shown{$item}) { |
|
$rebuildname = 1; |
|
} else { |
|
$names{$item} = $info{$item}; |
|
} |
|
} |
|
if ($rebuildname) { |
|
$in{'fullname'} = &Apache::lonnet::format_name($names{'firstname'}, |
|
$names{'middlename'}, |
|
$names{'lastname'}, |
|
$names{'generation'},'lastname'); |
|
} |
|
} |
|
} |
} |
} |
my $role = $in{'role'}; |
my $role = $in{'role'}; |
$in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}],$crstype); |
$in{'role'}=&Apache::lonnet::plaintext($sdata->[$index{'role'}],$crstype); |
Line 3842 END
|
Line 3914 END
|
if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') { |
if ($env{'form.showrole'} eq 'st' || $env{'form.showrole'} eq 'Any') { |
$r->print('<td>'.$in{'clicker'}.'</td>'); |
$r->print('<td>'.$in{'clicker'}.'</td>'); |
} else { |
} else { |
$r->print('<td> </td>'."\n"); |
$r->print('<td> </td>'."\n"); |
} |
} |
} |
} |
} elsif (($item eq 'authorquota') || ($item eq 'authorusage')) { |
} elsif (($item eq 'authorquota') || ($item eq 'authorusage')) { |
$r->print('<td align="right">'.$in{$item}.'</td>'."\n"); |
$r->print('<td align="right">'.$in{$item}.'</td>'."\n"); |
Line 7896 sub adhoc_staff {
|
Line 7968 sub adhoc_staff {
|
return $output; |
return $output; |
} |
} |
|
|
|
sub get_othdom_shownfields { |
|
my ($dom,$userinfo) = @_; |
|
return unless (ref($userinfo) eq 'ARRAY'); |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
|
my @insttypes; |
|
if (ref($domdefaults{'inststatustypes'}) eq 'HASH') { |
|
@insttypes = keys(%{$domdefaults{'inststatustypes'}}); |
|
} |
|
push(@insttypes,'default'); |
|
my %shownfields; |
|
if (ref($domdefaults{'privacyothdom'}) eq 'HASH') { |
|
%shownfields = %{$domdefaults{'privacyothdom'}}; |
|
} else { |
|
foreach my $type (@insttypes) { |
|
foreach my $field (@{$userinfo}) { |
|
$shownfields{$type}{$field} = 1; |
|
} |
|
} |
|
} |
|
return %shownfields; |
|
} |
|
|
1; |
1; |
|
|