version 1.220, 2023/12/07 04:47:00
|
version 1.222, 2024/08/31 20:02:12
|
Line 2183 sub print_userlist {
|
Line 2183 sub print_userlist {
|
if (! exists($env{'form.sortby'})) { |
if (! exists($env{'form.sortby'})) { |
$env{'form.sortby'} = 'username'; |
$env{'form.sortby'} = 'username'; |
} |
} |
|
my ($showstart,$showend); |
|
if (($env{'form.Status'} eq '') && ($env{'form.phase'} eq '') && |
|
($env{'form.showrole'} eq '') && ($context eq 'course') && |
|
($env{'request.course.id'} ne '') && |
|
($env{'course.'.$env{'request.course.id'}.'.internal.coursecode'} ne '')) { |
|
my $now = time; |
|
my $startaccess = $env{'course.'.$env{'request.course.id'}.'.default_enrollment_start_date'}; |
|
my $endaccess = $env{'course.'.$env{'request.course.id'}.'.default_enrollment_end_date'}; |
|
if (($startaccess) && ($startaccess > $now)) { |
|
$env{'form.Status'} = 'Future'; |
|
$showstart = 1; |
|
} |
|
if (($endaccess ne '') && ($endaccess != 0) && ($endaccess < $now)) { |
|
$env{'form.Status'} = 'Expired'; |
|
undef($showstart); |
|
$showend = 1; |
|
} |
|
} |
if ($env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) { |
if ($env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) { |
$env{'form.Status'} = 'Active'; |
$env{'form.Status'} = 'Active'; |
} |
} |
Line 2250 sub print_userlist {
|
Line 2268 sub print_userlist {
|
$r->print(§ion_group_filter($cnum,$cdom)); |
$r->print(§ion_group_filter($cnum,$cdom)); |
} |
} |
$r->print('</div><div class="LC_left_float">'. |
$r->print('</div><div class="LC_left_float">'. |
&column_checkboxes($context,$mode,$formname,$showcredits). |
&column_checkboxes($context,$mode,$formname,$showcredits,$showstart,$showend). |
'</div>'); |
'</div>'); |
if ($env{'form.phase'} eq '') { |
if ($env{'form.phase'} eq '') { |
$r->print('<br clear="all" />'. |
$r->print('<br clear="all" />'. |
Line 2661 sub get_cols_array {
|
Line 2679 sub get_cols_array {
|
} |
} |
|
|
sub column_checkboxes { |
sub column_checkboxes { |
my ($context,$mode,$formname,$showcredits) = @_; |
my ($context,$mode,$formname,$showcredits,$showstart,$showend) = @_; |
my @cols = &get_cols_array($context,$mode,$showcredits); |
my @cols = &get_cols_array($context,$mode,$showcredits); |
my @showncols = &Apache::loncommon::get_env_multiple('form.showcol'); |
my @showncols = &Apache::loncommon::get_env_multiple('form.showcol'); |
my (%disabledchk,%unchecked); |
my (%disabledchk,%unchecked); |
Line 2674 sub column_checkboxes {
|
Line 2692 sub column_checkboxes {
|
if ($showcredits) { |
if ($showcredits) { |
$unchecked{'credits'} = 1; |
$unchecked{'credits'} = 1; |
} |
} |
} elsif ($context eq 'domain') { |
my %curr_groups = &Apache::longroup::coursegroups(); |
|
unless (keys(%curr_groups)) { |
|
$unchecked{'groups'} = 1; |
|
} |
|
} elsif ($context eq 'domain') { |
$unchecked{'extent'} = 1; |
$unchecked{'extent'} = 1; |
} |
} |
$unchecked{'start'} = 1; |
if ($showstart) { |
$unchecked{'end'} = 1; |
$unchecked{'lastlogin'} = 1; |
|
} else { |
|
$unchecked{'start'} = 1; |
|
} |
|
unless ($showend) { |
|
$unchecked{'end'} = 1; |
|
} |
} else { |
} else { |
if ($env{'form.Status'} ne 'Any') { |
if ($env{'form.Status'} ne 'Any') { |
$disabledchk{'status'} = 1; |
$disabledchk{'status'} = 1; |
Line 2816 sub gather_userinfo {
|
Line 2844 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}); |
|
next if (($userdata{'username'} eq '') && ($userdata{'domain'} eq '')); |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
&build_user_record($context,\%userdata,$userinfo,$indexhash, |
$item,$userlist); |
$item,$userlist); |
} elsif ($context eq 'course') { |
} elsif ($context eq 'course') { |
Line 3494 END
|
Line 3523 END
|
# 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); |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
map { $camanagers{$_.':ca'} = 1; } split(/,/,$env{'environment.authormanagers'}); |
my $authormanagers; |
|
if ($env{'request.role'} =~ m{^(?:ca|aa)\./($match_domain)/($match_username)$}) { |
|
my %envhash = &Apache::lonnet::userenvironment($1,$2,'authormanagers'); |
|
$authormanagers = $envhash{'authormanagers'}; |
|
} else { |
|
$authormanagers = $env{'environment.authormanagers'}; |
|
} |
|
if ($authormanagers ne '') { |
|
map { $camanagers{$_.':ca'} = 1; } split(/,/,$authormanagers); |
|
} |
} |
} |
# 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. |
Line 4422 sub results_header_row {
|
Line 4460 sub results_header_row {
|
$description .= ' ('.$constraint.')'; |
$description .= ' ('.$constraint.')'; |
} |
} |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
|
my ($auname,$audom); |
|
if ($env{'request.role'} =~ m{^(?:ca|aa)\./($match_domain)/($match_username)$}) { |
|
($audom,$auname) = ($1,$2); |
|
} else { |
|
($audom,$auname) = ($env{'user.domain'},$env{'user.name'}); |
|
} |
$description = |
$description = |
&mt('Author space for [_1]' |
&mt('Author space for [_1]' |
,'<span class="LC_cusr_emph">' |
,'<span class="LC_cusr_emph">' |
.&Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}) |
.&Apache::loncommon::plainname($auname,$audom) |
.'</span>') |
.'</span>') |
.': '; |
.': '; |
if ($statusmode eq 'Expired') { |
if ($statusmode eq 'Expired') { |
Line 6646 sub can_modify_userinfo {
|
Line 6690 sub can_modify_userinfo {
|
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['usermodification'], |
&Apache::lonnet::get_dom('configuration',['usermodification'], |
$dom); |
$dom); |
|
if (($context eq 'author') && |
|
($env{'request.role'} =~ m{^(ca|aa)\./$match_domain/$match_username$})) { |
|
$context = 'coauthor'; |
|
} |
my %canmodify; |
my %canmodify; |
if (ref($fields) eq 'ARRAY') { |
if (ref($fields) eq 'ARRAY') { |
foreach my $field (@{$fields}) { |
foreach my $field (@{$fields}) { |