--- loncom/interface/loncreatecourse.pm 2004/09/25 17:52:03 1.68 +++ loncom/interface/loncreatecourse.pm 2004/12/07 01:31:17 1.73 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.68 2004/09/25 17:52:03 matthew Exp $ +# $Id: loncreatecourse.pm,v 1.73 2004/12/07 01:31:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,7 +38,6 @@ use Apache::londocs; use Apache::lonlocal; use Apache::londropadd; use lib '/home/httpd/lib/perl'; -use localenroll; # ================================================ Get course directory listing @@ -139,6 +138,9 @@ sub copydb { my %newcrsdata= &Apache::lonnet::coursedescription($newcrsid); my %data=&Apache::lonnet::dump ($which,$origcrsdata{'domain'},$origcrsdata{'num'}); + foreach my $key (keys(%data)) { + if ($key=~/^internal./) { delete($data{$key}); } + } return &Apache::lonnet::put ($which,\%data,$newcrsdata{'domain'},$newcrsdata{'num'}); } @@ -204,7 +206,9 @@ sub copyresourcedb { sub copyuserfiles { my ($origcrsid,$newcrsid)=@_; foreach (&crsdirlist($origcrsid,'userfiles')) { - ©file($origcrsid,$newcrsid,$_); + if ($_ !~m|^scantron_|) { + ©file($origcrsid,$newcrsid,$_); + } } } # ========================================================== Copy all userfiles @@ -252,7 +256,7 @@ sub print_course_creation_page { ($ENV{'request.role.domain'},'clonedomain'). &Apache::loncommon::selectcourse_link ('ccrs','clonecourse','clonedomain'); - my $coursebrowserjs=&Apache::loncommon::coursebrowser_javascript(); + my $coursebrowserjs=&Apache::loncommon::coursebrowser_javascript($ENV{'request.role.domain'}); my $starttime = time; my $endtime = time+(6*30*24*60*60); # 6 months from now, approx my $enroll_table = &Apache::londropadd::date_setting_table($starttime,$endtime,'create_enrolldates'); @@ -612,7 +616,8 @@ ENDENHEAD $cdescr,$curl, $ENV{'form.course_home'}, $ENV{'form.nonstandard'}, - $ENV{'form.crscode'}); + $ENV{'form.crscode'}, + $ENV{'form.ccuname'}); # Note: The testing routines depend on this being output; see # Utils::Course. This needs to at least be output as a comment @@ -686,9 +691,8 @@ ENDENHEAD my ($sec,$gp) = split/:/,$item; my $class = $ENV{'form.crscode'}.$sec; my $addcheck = &Apache::lonnet::auto_new_course($crsunum,$crsudom,$class,$cenv{'internal.courseowner'}); - if ($addcheck eq 'ok') { - $cenv{'internal.sectionnums'} .= $item.','; - } else { + $cenv{'internal.sectionnums'} .= $item.','; + unless ($addcheck eq 'ok') { push @badclasses, $class; } } @@ -709,9 +713,8 @@ ENDENHEAD foreach my $item (@xlists) { my ($xl,$gp) = split/:/,$item; my $addcheck = &Apache::lonnet::auto_new_course($crsunum,$crsudom,$xl,$cenv{'internal.courseowner'}); - if ($addcheck eq 'ok') { - $cenv{'internal.crosslistings'} .= $item.','; - } else { + $cenv{'internal.crosslistings'} .= $item.','; + unless ($addcheck eq 'ok') { push @badclasses, $xl; } } @@ -731,7 +734,7 @@ ENDENHEAD } if (@badclasses > 0) { my %lt=&Apache::lonlocal::texthash( - 'tclb' => 'The courses listed below have not been 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', + 'tclb' => 'The courses listed below were included as sections or crosslistings affiliated with your new LON-CAPA course. However, 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', 'dnhr' => 'does not have rights to access enrollment in these classes', 'adby' => 'as determined by the policies of your institution on access to official classlists' );