--- loncom/interface/lonuserutils.pm 2013/03/01 04:55:34 1.150
+++ loncom/interface/lonuserutils.pm 2013/09/26 17:46:42 1.156
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.150 2013/03/01 04:55:34 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.156 2013/09/26 17:46:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -642,7 +642,7 @@ sub upload_manager_javascript_forward_as
$numbuttons ++;
}
if (!$can_assign->{'int'}) {
- my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n'
+ my $warning = &mt('You may not specify an initial password for each user, as this is only available when new users use LON-CAPA internal authentication.').'\n'.
&mt('Your current role does not have rights to create users with that authentication type.');
$auth_update = <<"END";
// Currently the initial password field is only supported for internal auth
@@ -1578,10 +1578,6 @@ sub print_userlist {
@statuses = ('future');
}
-# if ($context eq 'course') {
-# $r->print(&display_adv_courseroles());
-# }
- #
# Interface output
$r->print('
'."\n");
return;
@@ -1678,7 +1674,7 @@ sub print_userlist {
$r->print('
'.&mt('Searching ...').'
');
}
} else {
- $r->print('
'.&mt('Searching ...').'
');
+ $r->print('
'.&mt('Searching ...').'
');
}
$r->rflush();
if ($context eq 'course') {
@@ -1992,7 +1988,7 @@ sub get_cols_array {
}
if (($context eq 'course') && ($mode ne 'autoenroll') &&
($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'})) {
- push(@cols,'photos');
+ push(@cols,'photo');
}
if ($context eq 'domain') {
push (@cols,'extent');
@@ -2123,7 +2119,7 @@ sub get_column_names {
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
$lt{'extent'} = &mt('course(s): description, section(s), status');
} elsif ($context eq 'domain' && $env{'form.roletype'} eq 'community') {
- $lt{'extent'} = &mt('communities: description, section(s), status');
+ $lt{'extent'} = &mt('community(s): description, section(s), status');
} elsif (($context eq 'author') ||
($context eq 'domain' && $env{'form.roletype'} eq 'author')) {
$lt{'extent'} = &mt('author');
@@ -2380,29 +2376,6 @@ sub instcode_from_coursefilter {
return $instcode;
}
-sub display_adv_courseroles {
- my $output;
- #
- # List course personnel
- my %coursepersonnel =
- &Apache::lonnet::get_course_adv_roles($env{'request.course.id'});
- #
- $output = '
'.&Apache::loncommon::start_data_table();
- foreach my $role (sort(keys(%coursepersonnel))) {
- next if ($role =~ /^\s*$/);
- $output .= &Apache::loncommon::start_data_table_row().
- ''.$role.' | ';
- foreach my $user (split(',',$coursepersonnel{$role})) {
- my ($puname,$pudom)=split(':',$user);
- $output .= ' '.&Apache::loncommon::aboutmewrapper(
- &Apache::loncommon::plainname($puname,$pudom),
- $puname,$pudom);
- }
- $output .= ' | '.&Apache::loncommon::end_data_table_row();
- }
- $output .= &Apache::loncommon::end_data_table();
-}
-
sub make_keylist_array {
my ($index,$keylist);
$index->{'domain'} = &Apache::loncoursedata::CL_SDOM();
@@ -2495,7 +2468,9 @@ sub show_users_list {
if ($mode eq 'pickauthor') {
@sortable = ('username','fullname','email','status');
}
- if (!grep(/^\Q$sortby\E$/,@sortable)) {
+ my %is_sortable;
+ map { $is_sortable{$_} => 1; } @sortable;
+ unless ($is_sortable{$sortby}) {
$sortby = 'username';
}
my $setting = $env{'form.roletype'};
@@ -2739,7 +2714,13 @@ END
}
}
foreach my $item (@cols) {
- $output .= "$lt{$item} | \n";
+ $output .= "";
+ if ($is_sortable{$item}) {
+ $output .= "$lt{$item}";
+ } else {
+ $output .= $lt{$item};
+ }
+ $output .= " | \n";
}
my %role_types = &role_type_names();
$output .= &Apache::loncommon::end_data_table_header_row();
@@ -4645,7 +4626,7 @@ sub upfile_drop_add {
# Get current classlist
my $classlist = &Apache::loncoursedata::get_classlist();
if (! defined($classlist)) {
- $r->print(''.
+ $r->print(''."\n");
@@ -4768,7 +4749,7 @@ sub print_drop_menu {
$heading = &mt("Drop Students");
}
$r->print(''.$heading.'
'."\n".
- '