version 1.43, 2003/12/09 00:43:47
|
version 1.44, 2003/12/11 02:42:38
|
Line 49 use Apache::lonratedt;
|
Line 49 use Apache::lonratedt;
|
use Apache::londocs; |
use Apache::londocs; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::londropadd; |
use Apache::londropadd; |
|
use lib '/home/httpd/lib/perl'; |
|
use localenroll; |
|
|
# ================================================ Get course directory listing |
# ================================================ Get course directory listing |
|
|
Line 498 ENDENHEAD
|
Line 500 ENDENHEAD
|
# |
# |
# Set environment (will override cloned, if existing) |
# Set environment (will override cloned, if existing) |
# |
# |
|
my @affiliates = (); # Used to accumulate sections and crosslistings |
if ($ENV{'form.crsid'}) { |
if ($ENV{'form.crsid'}) { |
$cenv{'courseid'}=$ENV{'form.crsid'}; |
$cenv{'courseid'}=$ENV{'form.crsid'}; |
} |
} |
Line 506 ENDENHEAD
|
Line 509 ENDENHEAD
|
} |
} |
if ($ENV{'form.crssections'}) { |
if ($ENV{'form.crssections'}) { |
$cenv{'internal.sectionnums'}=$ENV{'form.crssections'}; |
$cenv{'internal.sectionnums'}=$ENV{'form.crssections'}; |
|
my @sections = (); |
|
if ($cenv{'internal.sectionnums'} =~ m/,/) { |
|
@sections = split/,/,$cenv{'internal.sectionnums'}; |
|
} else { |
|
$sections[0] = $cenv{'internal.sectionnums'}; |
|
} |
|
if (@sections > 0) { |
|
foreach (@sections) { |
|
my ($sec,$gp) = split/:/,$_; |
|
push @affiliates,$ENV{'form.crscode'}.$sec; |
|
} |
|
} |
} |
} |
if ($ENV{'form.crsxlist'}) { |
if ($ENV{'form.crsxlist'}) { |
$cenv{'internal.crosslistings'}=$ENV{'form.crsxlist'}; |
$cenv{'internal.crosslistings'}=$ENV{'form.crsxlist'}; |
|
my @xlists = (); |
|
if ($cenv{'internal.crosslistings'} =~ m/,/) { |
|
@xlists = split/,/,$cenv{'internal.crosslistings'}; |
|
} else { |
|
$xlists[0] = $cenv{'internal.crosslistings'}; |
|
} |
|
if (@xlists > 0) { |
|
foreach (@xlists) { |
|
my ($xl,$gp) = split/:/,$_; |
|
push @affiliates,$xl; |
|
} |
|
} |
} |
} |
if ($ENV{'form.autoadds'}) { |
if ($ENV{'form.autoadds'}) { |
$cenv{'internal.autoadds'}=$ENV{'form.autoadds'}; |
$cenv{'internal.autoadds'}=$ENV{'form.autoadds'}; |
Line 523 ENDENHEAD
|
Line 550 ENDENHEAD
|
} |
} |
if ($ccuname) { |
if ($ccuname) { |
$cenv{'internal.courseowner'} = $ccuname; |
$cenv{'internal.courseowner'} = $ccuname; |
|
} else { |
|
$cenv{'internal.courseowner'} = $ENV{'user.name'}; |
|
} |
|
if (@affiliates > 0) { |
|
my @badclasses = (); |
|
foreach my $class (@affiliates) { |
|
my $addcheck = &localenroll::new_course($class,$cenv{'internal.courseowner'}); |
|
unless ($addcheck eq 'ok') { |
|
print STDERR "$class - $cenv{'internal.courseowner'} - $addcheck\n"; |
|
push @badclasses, $class; |
|
} |
|
} |
|
if (@badclasses > 0) { |
|
$r->print('<font color="red">'. |
|
"The courses listed below were included as sections or crosslistings affiliated with your new LON-CAPA course. If automated course roster updates are enabled for this class, these particular sections/crosslistings will not contribute towards enrollment, because the user identified as the course owner for this LON-CAPA course ($cenv{'internal.courseowner'}) - does not have rights to access enrollment in these classes (as determined by your instititution's policies on access to official classlists).<br/><ul>\n"); |
|
foreach (@badclasses) { |
|
$r->print("<li>$_</li>\n"); |
|
} |
|
$r->print ("</ul><br/><br/></font>\n"); |
|
} |
} |
} |
my $startdate = &Apache::lonhtmlcommon::get_date_from_form('startdate'); |
my $startdate = &Apache::lonhtmlcommon::get_date_from_form('startdate'); |
my $enddate = &Apache::lonhtmlcommon::get_date_from_form('enddate'); |
my $enddate = &Apache::lonhtmlcommon::get_date_from_form('enddate'); |