--- loncom/interface/lonmodifycourse.pm 2003/12/28 18:27:49 1.3
+++ loncom/interface/lonmodifycourse.pm 2003/12/30 15:46:18 1.5
@@ -418,6 +418,7 @@ $disp_table
ENDDOCUMENT
&print_footer($r);
+ return;
}
sub modify_course {
@@ -552,7 +553,6 @@ sub modify_course {
my $course_check = &localenroll::validate_courseID($course_id);
if ($course_check eq 'ok') {
my $outcome = &localenroll::new_course($course_id,$newattr{'courseowner'});
- my $outcome = 'ok';
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.
");
}
@@ -563,7 +563,19 @@ sub modify_course {
$warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $sec because this is not a valid section entry.
");
}
}
- }
+ } elsif ($changeowner) {
+ foreach my $sec (@sections) {
+ if ($sec =~ m/^(.+):/) {
+ my $course_id = $newattr{'coursecode'}.$1;
+ my $outcome = &localenroll::new_course($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.
");
+ }
+ } else {
+ $warning .= &mt("If automatic enrollment is enabled for LON-CAPA course: ").$description.&mt(", automated enrollment may fail for ").$newattr{'coursecode'}.&mt(" - section $sec because this is not a valid section entry.
");
+ }
+ }
+ }
} else {
$warning .= &mt("As no section numbers are currently listed for LON-CAPA course: ").$description.&mt(", automated enrollment will not occur for any sections of coursecode: ").$newattr{'coursecode'}."
";
}
@@ -660,32 +672,30 @@ $bodytag
ENDTHIS
+ return;
}
sub print_footer {
- my $r = shift;
- $r->print(<print(<