version 1.7, 2004/06/08 22:09:44
|
version 1.8, 2004/06/09 17:01:55
|
Line 425 sub modify_course {
|
Line 425 sub modify_course {
|
my ($r,$tasklongref,$typeref) = @_; |
my ($r,$tasklongref,$typeref) = @_; |
my $dom = $ENV{'user.domain'}; |
my $dom = $ENV{'user.domain'}; |
my $crs = $ENV{'form.course'}; |
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' ) { |
unless ( &check_course($dom,$crs) eq 'ok' ) { |
&print_header($r,$tasklongref); |
&print_header($r,$tasklongref); |
my $reply = "<br/>".&mt("The LON-CAPA course selected was not a valid course for this domain"); |
my $reply = "<br/>".&mt("The LON-CAPA course selected was not a valid course for this domain"); |
Line 551 sub modify_course {
|
Line 548 sub modify_course {
|
if ($changecode) { |
if ($changecode) { |
foreach my $sec (@sections) { |
foreach my $sec (@sections) { |
if ($sec =~ m/^(.+):/) { |
if ($sec =~ m/^(.+):/) { |
my $course_id = $newattr{'coursecode'}.$1; |
my $inst_course_id = $newattr{'coursecode'}.$1; |
my $course_check = &Apache::lonnet::auto_validate_courseID($homeserver,$course_id); |
my $course_check = &Apache::lonnet::auto_validate_courseID($crs,$dom,$inst_course_id); |
if ($course_check eq 'ok') { |
if ($course_check eq 'ok') { |
my $outcome = &Apache::lonnet::auto_new_course($homeserver,$course_id,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$inst_course_id,$newattr{'courseowner'}); |
unless ($outcome eq '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.<br/>"); |
$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.<br/>"); |
} |
} |
Line 568 sub modify_course {
|
Line 565 sub modify_course {
|
} elsif ($changeowner) { |
} elsif ($changeowner) { |
foreach my $sec (@sections) { |
foreach my $sec (@sections) { |
if ($sec =~ m/^(.+):/) { |
if ($sec =~ m/^(.+):/) { |
my $course_id = $newattr{'coursecode'}.$1; |
my $inst_course_id = $newattr{'coursecode'}.$1; |
my $outcome = &Apache::lonnet::auto_new_course($homeserver,$course_id,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$inst_course_id,$newattr{'courseowner'}); |
unless ($outcome eq '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.<br/>"); |
$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.<br/>"); |
} |
} |
Line 584 sub modify_course {
|
Line 581 sub modify_course {
|
if ( (@xlists > 0) && ($changeowner) ) { |
if ( (@xlists > 0) && ($changeowner) ) { |
foreach my $xlist (@xlists) { |
foreach my $xlist (@xlists) { |
if ($xlist =~ m/^(.+):/) { |
if ($xlist =~ m/^(.+):/) { |
my $outcome = &Apache::lonnet::auto_new_course($homeserver,$1,$newattr{'courseowner'}); |
my $outcome = &Apache::lonnet::auto_new_course($crs,$dom,$1,$newattr{'courseowner'}); |
unless ($outcome eq 'ok') { |
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.<br/>"); |
$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.<br/>"); |
} |
} |
Line 596 sub modify_course {
|
Line 593 sub modify_course {
|
} |
} |
} else { |
} else { |
foreach my $attr (@params) { |
foreach my $attr (@params) { |
$nochgresponse .= "<li>$$typeref{$attr} ".&mt("still set to \"").$currattr{$attr}."\".</li>"; |
$nochgresponse .= "<li>$$typeref{$attr} ".&mt("still set to")." \"".$currattr{$attr}."\".</li>"; |
} |
} |
} |
} |
|
|