--- loncom/interface/Attic/londropadd.pm 2007/10/09 17:33:57 1.171 +++ loncom/interface/Attic/londropadd.pm 2007/10/22 22:16:38 1.173 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.171 2007/10/09 17:33:57 raeburn Exp $ +# $Id: londropadd.pm,v 1.173 2007/10/22 22:16:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -423,7 +423,7 @@ END } END } else { - $section_checks = §ion_check_js(); + $section_checks = &Apache::lonuserutils::section_check_js(); $optional_checks = (<print(&make_dates_default($startdate,$enddate)); + $r->print(&Apache::lonuserutils::make_dates_default($startdate, + $enddate)); } $r->print('

'.&mt('Enrolling Student').'

'); @@ -806,7 +807,7 @@ sub enroll_single_student { $env{'form.lcdomain'}); if ((($amode) && ($genpwd)) || ($home ne 'no_host')) { # Clean out any old roles the student has in this class. - &modifystudent($env{'form.lcdomain'},$env{'form.cuname'}, + &Apache::lonuserutils::modifystudent($env{'form.lcdomain'},$env{'form.cuname'}, $env{'request.course.id'},$env{'form.csec'}, $desiredhost); my $login_result = &Apache::lonnet::modifystudent @@ -1066,7 +1067,8 @@ sub print_enroll_single_student_form { my ($krbdef,$krbdefdom) = &Apache::loncommon::get_kerberos_defaults($ccdomain); $javascript_validations = - &javascript_validations('auth',$krbdefdom,undef,undef,$ccdomain); + &Apache::lonuserutils::javascript_validations('auth',$krbdefdom, + undef,undef,$ccdomain); my %param = ( formname => 'document.studentform', kerb_def_dom => $krbdefdom, kerb_def_auth => $krbdef @@ -1132,7 +1134,7 @@ END } else { # User already exists. Do not worry about authentication my %uenv = &Apache::lonnet::dump('environment',$ccdomain,$ccuname); - $javascript_validations = &javascript_validations('noauth'); + $javascript_validations = &Apache::lonuserutils::javascript_validations('noauth'); my %lt=&Apache::lonlocal::texthash( 'udf' => "User Data for", 'fn' => "First Name", @@ -1158,7 +1160,7 @@ END END } - my $date_table = &date_setting_table(); + my $date_table = &Apache::lonuserutils::date_setting_table(); # Print it all out my %lt=&Apache::lonlocal::texthash( 'cd' => "Course Data", @@ -1807,7 +1809,8 @@ sub print_modify_student_form { &Apache::lonlocal::locallocaltime($endtime)).'
'; } - my $date_table = &date_setting_table($starttime,$endtime); + my $date_table = + &Apache::lonuserutils::date_setting_table($starttime,$endtime); # if (! exists($env{'form.Status'}) || $env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) { @@ -1829,7 +1832,7 @@ sub print_modify_student_form { 'sm' => "Submit Modifications", ); # Check if section name is valid - my $section_check = §ion_check_js(); + my $section_check = &Apache::lonuserutils::section_check_js(); $r->print(<<"END"); '; + &Apache::loncreateuser::restore_prev_selections(); + my $srch; + foreach my $item (@search) { + $srch->{$item} = $env{'form.'.$item}; + } + if ($env{'form.state'} eq 'gotusername') { - my $srch; - foreach my $item (@search) { - $srch->{$item} = $env{'form.'.$item}; - } if ($env{'form.phase'} eq 'get_user_info') { my ($currstate,$response,$forcenewuser,$results) = &Apache::loncreateuser::user_search_result($srch); @@ -2811,7 +2820,7 @@ sub handler { &print_enroll_single_student_form($r,$jscript,$ccuname, $ccdomain,$srch); } else { - &get_student_username_domain_form($r,$elements); + &get_student_username_domain_form($r,$elements,undef,$srch); } } elsif ($env{'form.state'} eq 'enrolling') { $r->print(&header($jscript)); @@ -2832,7 +2841,7 @@ sub handler { 'Course_Add_Student')); &enroll_single_student($r,\@search); } else { - &get_student_username_domain_form($r,$elements); + &get_student_username_domain_form($r,$elements,undef,$srch); } } elsif ($env{'form.action'} eq 'classlist' && $permission->{'view'}) { $r->print(&header());