--- loncom/interface/Attic/londropadd.pm 2003/02/13 21:35:50 1.64 +++ loncom/interface/Attic/londropadd.pm 2003/06/20 18:34:52 1.67 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.64 2003/02/13 21:35:50 albertel Exp $ +# $Id: londropadd.pm,v 1.67 2003/06/20 18:34:52 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -213,6 +213,7 @@ sub javascript_validations { my %param = ( formname => 'studentform', kerb_def_dom => $krbdefdom ); my $authheader = &Apache::loncommon::authform_header(%param); + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); return (<print($login_result); @@ -650,6 +650,24 @@ sub print_enroll_single_student_form { my $locform = &Apache::loncommon::authform_local(%param); # Set up domain selection form my $domform = &domain_form($defdom); + my $starttime = 'now'; + if (exists($ENV{'course.'.$ENV{'request.course.id'}. + '.default_enrollment_start_date'})) { + $starttime = $ENV{'course.'.$ENV{'request.course.id'}. + '.default_enrollment_start_date'}; + } + my $endtime = time+(6*30*24*60*60); # 6 months from now, approx + if (exists($ENV{'course.'.$ENV{'request.course.id'}. + '.default_enrollment_end_date'})) { + $endtime = $ENV{'course.'.$ENV{'request.course.id'}. + '.default_enrollment_end_date'}; + } + my $startdateform = &Apache::lonhtmlcommon::date_setter('studentform', + 'startdate', + $starttime); + my $enddateform = &Apache::lonhtmlcommon::date_setter('studentform', + 'enddate', + $endtime); # Print it all out $r->print(< @@ -722,13 +740,10 @@ $locform

-Set Starting Date -

-Set Ending Date + + + +
Starting Date$startdateform
Ending Date$enddateform

ID/Student Number

@@ -1086,10 +1101,8 @@ sub modify_single_student { my $section = $ENV{'form.section'}; my $courseid = $ENV{'request.course.id'}; my $sid = $ENV{'form.id'}; - my $starttime = &Apache::lonhtmlcommon::get_date_from_form('startdate', - time); - my $endtime = &Apache::lonhtmlcommon::get_date_from_form('enddate', - time); + my $starttime = &Apache::lonhtmlcommon::get_date_from_form('startdate'); + my $endtime = &Apache::lonhtmlcommon::get_date_from_form('enddate'); my $displayable_starttime = localtime($starttime); my $displayable_endtime = localtime($endtime); #