[LON-CAPA-cvs] cvs: loncom /interface lonuserutils.pm
raeburn
raeburn@source.lon-capa.org
Wed, 18 Nov 2009 21:32:41 -0000
raeburn Wed Nov 18 21:32:41 2009 EDT
Modified files:
/loncom/interface lonuserutils.pm
Log:
- Use appropriate course type in call to lonnet::courseiddump() in domain context.
- No action selector or "Select" column in domain context (course/community roles)
- no modification of roles for multiple users in this context.
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.104 loncom/interface/lonuserutils.pm:1.105
--- loncom/interface/lonuserutils.pm:1.104 Thu Nov 12 15:58:22 2009
+++ loncom/interface/lonuserutils.pm Wed Nov 18 21:32:41 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.104 2009/11/12 15:58:22 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.105 2009/11/18 21:32:41 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1956,13 +1956,17 @@
my $coursefilter = $env{'form.coursepick'};
my $cdom = $env{'request.role.domain'};
my %courses;
+ my $crssrch = 'Course';
+ if ($env{'form.roletype'} eq 'community') {
+ $crssrch = 'Community';
+ }
if ($coursefilter eq 'all') {
%courses = &Apache::lonnet::courseiddump($cdom,'.','.','.','.','.',
- undef,undef,'Course');
+ undef,undef,$crssrch);
} elsif ($coursefilter eq 'category') {
my $instcode = &instcode_from_coursefilter();
%courses = &Apache::lonnet::courseiddump($cdom,'.','.',$instcode,'.','.',
- undef,undef,'Course');
+ undef,undef,$crssrch);
} elsif ($coursefilter eq 'specific') {
if ($env{'form.coursetotal'} > 1) {
my @course_ids = split(/&&/,$env{'form.courselist'});
@@ -2147,7 +2151,7 @@
} elsif ($context eq 'domain') {
if ($setting eq 'community') {
$crstype = 'Community';
- } elsif ($crstype eq 'course') {
+ } elsif ($setting eq 'course') {
$crstype = 'Course';
}
}
@@ -2298,7 +2302,11 @@
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll' || $mode eq 'pickauthor') {
if ($mode ne 'autoenroll' && $mode ne 'pickauthor') {
if ($permission->{'cusr'}) {
- $actionselect = &select_actions($context,$setting,$statusmode,$formname);
+ unless (($context eq 'domain') &&
+ (($setting eq 'course') || ($setting eq 'community'))) {
+ $actionselect =
+ &select_actions($context,$setting,$statusmode,$formname);
+ }
}
$r->print(<<END);
<input type="hidden" name="srchby" value="uname" />
@@ -2392,11 +2400,7 @@
<th><a href=\"javascript:document.$formname.sortby.value='type';document.$formname.submit();\">$lt{'type'}</a></th>
";
} else {
- if ($mode eq 'pickauthor') {
- $output .= "\n".'<th> </th>'."\n";
- } else {
- $output .= "\n".'<th>'.&mt('Count').'</th>'."\n";
- }
+ $output .= "\n".'<th> </th>'."\n";
if ($actionselect) {
$output .= '<th>'.&mt('Select').'</th>'."\n";
}