--- loncom/interface/loncreateuser.pm 2014/05/31 15:55:18 1.401
+++ loncom/interface/loncreateuser.pm 2016/02/17 19:15:48 1.408
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.401 2014/05/31 15:55:18 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.408 2016/02/17 19:15:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2244,8 +2244,8 @@ sub personal_data_display {
'';
$rowcount ++;
$output .= &Apache::lonhtmlcommon::row_closure(1);
- my $upassone = '';
- my $upasstwo = '';
+ my $upassone = '';
+ my $upasstwo = '';
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'*',
'LC_pick_box_title',
'LC_oddrow_value')."\n".
@@ -3044,7 +3044,7 @@ sub update_user_data {
my %newenvhash;
foreach my $key (keys(%changed)) {
if (($key eq 'official') || ($key eq 'unofficial')
- || ($key eq 'community')) {
+ || ($key eq 'community') || ($key eq 'textbook')) {
$newenvhash{'environment.requestcourses.'.$key} =
$changeHash{'requestcourses.'.$key};
if ($changeHash{'requestcourses.'.$key}) {
@@ -3110,7 +3110,7 @@ sub update_user_data {
\%newsettingstext);
if ($env{'form.cid'} ne $userenv{'id'}) {
&Apache::lonnet::idput($env{'form.ccdomain'},
- ($env{'form.ccuname'} => $env{'form.cid'}));
+ {$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids');
if (($recurseid) &&
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
my $idresult =
@@ -3625,7 +3625,7 @@ sub update_roles {
my @rolechanges;
my %disallowed;
$r->print('
'.&mt('Modifying Roles').'
');
- foreach my $key (keys (%env)) {
+ foreach my $key (keys(%env)) {
next if (! $env{$key});
next if ($key eq 'form.action');
# Revoke roles
@@ -3807,7 +3807,7 @@ sub update_roles {
} else {
my %curr_groups =
&Apache::longroup::coursegroups($one,$two);
- foreach my $sec (sort {$a cmp $b} keys %sections) {
+ foreach my $sec (sort {$a cmp $b} keys(%sections)) {
if (($sec eq 'none') || ($sec eq 'all') ||
exists($curr_groups{$sec})) {
$disallowed{$sec} = $url;
@@ -3853,7 +3853,7 @@ sub update_roles {
my %curr_groups =
&Apache::longroup::coursegroups($one,$two);
my $emptysec = 0;
- foreach my $sec (sort {$a cmp $b} keys %sections) {
+ foreach my $sec (sort {$a cmp $b} keys(%sections)) {
$sec =~ s/\W//g;
if ($sec ne '') {
if (($sec eq 'none') || ($sec eq 'all') ||
@@ -3893,7 +3893,7 @@ sub update_roles {
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context));
} else {
my $emptysec = 0;
- foreach my $sec (sort {$a cmp $b} keys %sections) {
+ foreach my $sec (sort {$a cmp $b} keys(%sections)) {
if ($sec ne '') {
my $securl = $url.'/'.$sec;
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context));
@@ -5544,6 +5544,7 @@ sub print_selfenroll_menu {
butn => 'but no user types have been checked.',
wilf => "Please uncheck 'activate' or check at least one type.",
);
+ &js_escape(\%alerts);
my $selfenroll_js = <<"ENDSCRIPT";
function update_types(caller,num) {
var delidx = getIndexByName('selfenroll_delete');
@@ -5745,6 +5746,12 @@ ENDSCRIPT
$cathash = $domconfig{'coursecategories'}{'cats'};
$cattype{'auth'} = $domconfig{'coursecategories'}{'auth'};
$cattype{'unauth'} = $domconfig{'coursecategories'}{'unauth'};
+ if ($cattype{'auth'} eq '') {
+ $cattype{'auth'} = 'std';
+ }
+ if ($cattype{'unauth'} eq '') {
+ $cattype{'unauth'} = 'std';
+ }
} else {
$cathash = {};
$cattype{'auth'} = 'std';
@@ -7310,13 +7317,13 @@ sub course_level_table {
((($role eq 'cc') || ($role eq 'co')) && ($isowner))) {
$table .= &course_level_row($protectedcourse,$role,$area,$domain,
$plrole,\%sections_count,\%lt,
- $defaultcredits,$crstype);
+ $showcredits,$defaultcredits,$crstype);
} elsif ($env{'request.course.sec'} ne '') {
if (&Apache::lonnet::allowed('c'.$role,$thiscourse.'/'.
$env{'request.course.sec'})) {
$table .= &course_level_row($protectedcourse,$role,$area,$domain,
$plrole,\%sections_count,\%lt,
- $defaultcredits,$crstype);
+ $showcredits,$defaultcredits,$crstype);
}
}
}
@@ -7325,7 +7332,8 @@ sub course_level_table {
next if ($crstype eq 'Community' && $customroles{$cust} =~ /bre\&S/);
my $role = 'cr_cr_'.$env{'user.domain'}.'_'.$env{'user.name'}.'_'.$cust;
$table .= &course_level_row($protectedcourse,$role,$area,$domain,
- $cust,\%sections_count,\%lt);
+ $cust,\%sections_count,\%lt,
+ $showcredits,$defaultcredits,$crstype);
}
}
}
@@ -7339,7 +7347,11 @@ sub course_level_table {
&Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
''.$lt{'act'}.' | '.$lt{'rol'}.' | '."\n".
-''.$lt{'ext'}.' | '.$lt{'crd'}.' | '."\n".
+''.$lt{'ext'}.' | '."\n";
+ if ($showcredits) {
+ $result .= $lt{'crd'}.' | ';
+ }
+ $result .=
''.$lt{'grs'}.' | '.$lt{'sta'}.' | '."\n".
''.$lt{'end'}.' | '.
&Apache::loncommon::end_data_table_header_row().
@@ -7350,14 +7362,14 @@ $table.
sub course_level_row {
my ($protectedcourse,$role,$area,$domain,$plrole,$sections_count,
- $lt,$defaultcredits,$crstype) = @_;
+ $lt,$showcredits,$defaultcredits,$crstype) = @_;
my $creditem;
my $row = &Apache::loncommon::start_data_table_row().
' | '."\n".
' '.$plrole.' | '."\n".
' '.$area.' Domain: '.$domain.' | '."\n";
- if (($role eq 'st') && ($crstype eq 'Course')) {
+ if (($showcredits) && ($role eq 'st') && ($crstype eq 'Course')) {
$row .=
' | ';
@@ -7446,8 +7458,8 @@ sub course_level_dc {
my $plrole=&Apache::lonnet::plaintext($role);
$otheritems .= ' ';
}
- if ( keys %customroles > 0) {
- foreach my $cust (sort keys %customroles) {
+ if ( keys(%customroles) > 0) {
+ foreach my $cust (sort(keys(%customroles))) {
my $custrole='cr_cr_'.$env{'user.domain'}.
'_'.$env{'user.name'}.'_'.$cust;
$otheritems .= ' ';