--- loncom/interface/lonmodifycourse.pm 2003/12/30 15:46:18 1.5
+++ loncom/interface/lonmodifycourse.pm 2004/06/08 22:09:44 1.7
@@ -197,7 +197,7 @@ all settings except course code, course
} else {
$enrollvar{$1} = localtime($settings{$item});
}
- } else {
+ } elsif ($1 eq "courseowner" || $1 eq "authtype" || $1 eq "autharg" || $1 eq "sectionnums" || $1 eq "coursecode") {
$enrollvar{$1} = $settings{$item};
}
}
@@ -222,7 +222,7 @@ all settings except course code, course
}
}
unless ( (grep/^$enrollvar{'courseowner'}$/,@local_ccs) || ($enrollvar{'courseowner'} eq '') ) {
- push @local_ccs, $enrollvar{'coursecode'};
+ push @local_ccs, $enrollvar{'courseowner'};
$pname{$enrollvar{'courseowner'}} = &Apache::loncommon::plainname($enrollvar{'courseowner'},$dom);
$active_cc = &LONCAPA::Enrollment::check_user_status($dom,$enrollvar{'coursecode'},$dom,$course,'cc');
if ($active_cc eq 'ok') {
@@ -279,7 +279,7 @@ all settings except course code, course
$$typeref{$key} |
$enrollvar{$key} |
";
- $iter ++;
+ $iter ++;
}
$disp_table .= "
@@ -425,6 +425,8 @@ sub modify_course {
my ($r,$tasklongref,$typeref) = @_;
my $dom = $ENV{'user.domain'};
my $crs = $ENV{'form.course'};
+ my $homeserver = &Apache::lonnet::homeserver($crs,$dom);
+ my $server = $Apache::lonnet::perlvar{'lonHostID'};
unless ( &check_course($dom,$crs) eq 'ok' ) {
&print_header($r,$tasklongref);
@@ -550,9 +552,9 @@ sub modify_course {
foreach my $sec (@sections) {
if ($sec =~ m/^(.+):/) {
my $course_id = $newattr{'coursecode'}.$1;
- my $course_check = &localenroll::validate_courseID($course_id);
- if ($course_check eq 'ok') {
- my $outcome = &localenroll::new_course($course_id,$newattr{'courseowner'});
+ my $course_check = &Apache::lonnet::auto_validate_courseID($homeserver,$course_id);
+ if ($course_check eq 'ok') {
+ my $outcome = &Apache::lonnet::auto_new_course($homeserver,$course_id,$newattr{'courseowner'});
unless ($outcome eq 'ok') {
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $outcome.
");
}
@@ -567,7 +569,7 @@ sub modify_course {
foreach my $sec (@sections) {
if ($sec =~ m/^(.+):/) {
my $course_id = $newattr{'coursecode'}.$1;
- my $outcome = &localenroll::new_course($course_id,$newattr{'courseowner'});
+ my $outcome = &Apache::lonnet::auto_new_course($homeserver,$course_id,$newattr{'courseowner'});
unless ($outcome eq 'ok') {
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $1 for the following reason: $outcome.
");
}
@@ -582,7 +584,7 @@ sub modify_course {
if ( (@xlists > 0) && ($changeowner) ) {
foreach my $xlist (@xlists) {
if ($xlist =~ m/^(.+):/) {
- my $outcome = &localenroll::new_course($1,$newattr{'courseowner'});
+ my $outcome = &Apache::lonnet::auto_new_course($homeserver,$1,$newattr{'courseowner'});
unless ($outcome eq 'ok') {
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for crosslisted class: ").$1.&mt(" for the following reason: $outcome.
");
}