--- loncom/interface/lonmodifycourse.pm 2003/12/31 18:32:23 1.6
+++ loncom/interface/lonmodifycourse.pm 2004/06/09 17:01:55 1.8
@@ -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};
}
}
@@ -425,7 +425,6 @@ sub modify_course {
my ($r,$tasklongref,$typeref) = @_;
my $dom = $ENV{'user.domain'};
my $crs = $ENV{'form.course'};
-
unless ( &check_course($dom,$crs) eq 'ok' ) {
&print_header($r,$tasklongref);
my $reply = "
".&mt("The LON-CAPA course selected was not a valid course for this domain");
@@ -549,10 +548,10 @@ sub modify_course {
if ($changecode) {
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 $inst_course_id = $newattr{'coursecode'}.$1;
+ my $course_check = &Apache::lonnet::auto_validate_courseID($crs,$dom,$inst_course_id);
+ if ($course_check eq 'ok') {
+ my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$inst_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.
");
}
@@ -566,8 +565,8 @@ sub modify_course {
} elsif ($changeowner) {
foreach my $sec (@sections) {
if ($sec =~ m/^(.+):/) {
- my $course_id = $newattr{'coursecode'}.$1;
- my $outcome = &localenroll::new_course($course_id,$newattr{'courseowner'});
+ my $inst_course_id = $newattr{'coursecode'}.$1;
+ my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$inst_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 +581,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($crs,$dom,$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.
");
}
@@ -594,7 +593,7 @@ sub modify_course {
}
} else {
foreach my $attr (@params) {
- $nochgresponse .= "