--- loncom/interface/lonuserutils.pm 2013/12/09 18:47:18 1.158 +++ loncom/interface/lonuserutils.pm 2013/12/09 21:33:32 1.159 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.158 2013/12/09 18:47:18 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.159 2013/12/09 21:33:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1637,7 +1637,7 @@ sub print_userlist { return; } my ($indexhash,$keylist) = &make_keylist_array(); - my (%userlist,%userinfo,$clearcoursepick); + my (%userlist,%userinfo,$clearcoursepick,$needauthorquota,$needauthorusage); if (($context eq 'domain') && ($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')) { @@ -1709,6 +1709,12 @@ sub print_userlist { \%cstr_roles,$permission); } elsif ($context eq 'domain') { if ($env{'form.roletype'} eq 'domain') { + if (grep(/^authorusage$/,@cols)) { + $needauthorusage = 1; + } + if (grep(/^authorquota$/,@cols)) { + $needauthorquota = 1; + } %dom_roles = &Apache::lonnet::get_domain_roles($env{'request.role.domain'}); foreach my $key (keys(%dom_roles)) { if (ref($dom_roles{$key}) eq 'HASH') { @@ -1821,7 +1827,7 @@ sub print_userlist { } else { ($usercount) = &show_users_list($r,$context,$env{'form.output'}, $permission,$env{'form.Status'},\%userlist, - $keylist,'',$showcredits); + $keylist,'',$showcredits,$needauthorquota,$needauthorusage); } if (!$usercount) { $r->print('
' @@ -1991,7 +1997,7 @@ sub get_cols_array { push(@cols,'photo'); } if ($context eq 'domain') { - push (@cols,'extent'); + push (@cols,('authorusage','authorquota','extent')); } } return @cols; @@ -2027,6 +2033,8 @@ sub column_checkboxes { if (($env{'form.roletype'} eq 'course') || ($env{'form.roletype'} eq 'community')) { $disabledchk{'status'} = 1; + $disabledchk{'authorusage'} = 1; + $disabledchk{'authorquota'} = 1; } elsif ($env{'form.roletype'} eq 'domain') { $disabledchk{'extent'} = 1; } @@ -2078,7 +2086,11 @@ sub column_checkboxes { if (($env{'form.roletype'} eq 'domain') || ($env{'form.roletype'} eq '')) { $style = ' style="display: none;"'; } - } + } elsif (($cols[$i] eq 'authorusage') || ($cols[$i] eq 'authorquota')) { + if ($env{'form.roletype'} ne 'domain') { + $style = ' style="display: none;"'; + } + } $output .= '