--- loncom/interface/Attic/londropadd.pm 2003/11/06 20:04:06 1.88 +++ loncom/interface/Attic/londropadd.pm 2003/11/06 22:49:59 1.89 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.88 2003/11/06 20:04:06 matthew Exp $ +# $Id: londropadd.pm,v 1.89 2003/11/06 22:49:59 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -175,6 +175,11 @@ END ############################################################### ############################################################### +sub hidden_input { + my ($name,$value) = @_; + return ''."\n"; +} + sub print_upload_manager_header { my ($r,$datatoken,$distotal,$krbdefdom)=@_; my $javascript; @@ -193,7 +198,7 @@ sub print_upload_manager_header { } else { $javascript=&upload_manager_javascript_forward_associate(); } - my $javascript_validations=&javascript_validations($krbdefdom); + my $javascript_validations=&javascript_validations('auth',$krbdefdom); my $checked=(($ENV{'form.noFirstLine'})?' checked="1"':''); $r->print('

'.&mt('Uploading Class List')."

\n". "
\n". @@ -202,47 +207,63 @@ sub print_upload_manager_header { &mt('Total number of records found in file: [_1].',$distotal). "\n". "


\n"); - $r->print(< - - - - - - -Ignore First Line - - -
- -ENDPICK + $r->print(&mt('Enter as many fields as you can. '. + 'The system will inform you and bring you back to '. + 'this page if the data selected is insufficient to '. + 'enroll students in your class.')."
\n"); + $r->print(&hidden_input('action','upload'). + &hidden_input('state','got_file'). + &hidden_input('associate',''). + &hidden_input('datatoken',$datatoken). + &hidden_input('fileupload',$ENV{'form.fileupload'}). + &hidden_input('upfiletype',$ENV{'form.upfiletype'}). + &hidden_input('upfile_associate',$ENV{'form.upfile_associate'})); + $r->print(''); + $r->print(''. + &mt('Ignore First Line')); + $r->print("
\n". + ''); } ############################################################### ############################################################### sub javascript_validations { - my ($krbdefdom)=@_; - my %param = ( formname => 'studentform', - kerb_def_dom => $krbdefdom ); - my $authheader = &Apache::loncommon::authform_header(%param); - my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); - return (< 'studentform', + kerb_def_dom => $krbdefdom ); + $authheader = &Apache::loncommon::authform_header(%param); + } + my %alert = &Apache::lonlocal::texthash + (username => 'You need to specify the username field.', + authen => 'You must choose an authentication type.', + krb => 'You need to specify the Kerberos domain.', + ipass => 'You need to specify the initial password.', + name => 'The optional name field was not specified.', + snum => 'The optional student number field was not specified.', + section => 'The optional section or group field was not specified.', + email => 'The optional email address field was not specified.', + continue => 'Continue enrollment?', + ); + +# my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); + my $function_name =(< 'document.studentform', kerb_def_dom => $krbdefdom, kerb_def_auth => $krbdef @@ -823,7 +840,7 @@ END } else { # User already exists. Do not worry about authentication my %uenv = &Apache::lonnet::dump('environment',$domain,$username); - $javascript_validations = &javascript_validations_without_auth(); + $javascript_validations = &javascript_validations('noauth'); $user_data_html = <User Data for $username\@$domain