--- loncom/interface/Attic/londropadd.pm 2003/11/06 22:49:59 1.89 +++ loncom/interface/Attic/londropadd.pm 2003/11/07 21:04:37 1.90 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.89 2003/11/06 22:49:59 matthew Exp $ +# $Id: londropadd.pm,v 1.90 2003/11/07 21:04:37 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -500,52 +500,53 @@ sub print_upload_manager_footer { my $locform = &Apache::loncommon::authform_local(%param); my $domform = &domain_form($defdom); my $date_table = &date_setting_table(); - $r->print(< - - -

Login Type

-

Note: this will not take effect if the user already exists

-

-$krbform -

-

-$intform -

-

-$locform -

-

LON-CAPA Domain for Students

-LON-CAPA domain: $domform

-

Starting and Ending Dates

-

-$date_table -

-

Full Update

- Full update -(also print list of users not enrolled anymore)

-

ID/Student Number

- -Disable ID/Student Number Safeguard and Force Change of Conflicting IDs -(only do if you know what you are doing)

-
-Note: for large courses, this operation may be time consuming. -ENDPICK + my $Str = "\n"; + $Str .= &hidden_input('nfields',$i); + $Str .= &hidden_input('keyfields',$keyfields); + $Str .= '

'.&mt('Login Type')."

\n"; + $Str .= "

\n". + &mt('Note: this will not take effect if the user already exists'). + "

\n"; + $Str .= $krbform."\n

\n". + $intform."\n

\n". + $locform."\n

\n"; + $Str .= '

'.&mt('LON-CAPA Domain for Students')."

\n"; + $Str .= "

\n".&mt('LON-CAPA domain: [_1]',$domform)."\n

\n"; + $Str .= "

".&mt('Starting and Ending Dates')."

\n"; + $Str .= "

\n".$date_table."

\n"; + $Str .= "

".&mt('Full Update')."

\n"; + $Str .= ''. + ' '.&mt('Full update (also print list of users not enrolled anymore)'). + "

\n"; + $Str .= "

".&mt('Student Number')."

\n"; + $Str .= "

\n".''; + $Str .= &mt('Disable ID/Student Number Safeguard and Force Change '. + 'of Conflicting IDs (only do if you know what you are doing)'). + "\n

\n"; + $Str .= ''."
\n"; + $Str .= &mt('Note: for large courses, this operation may be time '. + 'consuming'); + $r->print($Str); + return; } -# ======================================================= Menu Phase Two Upload +############################################################### +############################################################### sub print_upload_manager_form { my $r=shift; my $firstLine; my $datatoken; if (!$ENV{'form.datatoken'}) { - $datatoken=&Apache::loncommon::upfile_store($r); + $datatoken=&Apache::loncommon::upfile_store($r); } else { - $datatoken=$ENV{'form.datatoken'}; - &Apache::loncommon::load_tmp_file($r); + $datatoken=$ENV{'form.datatoken'}; + &Apache::loncommon::load_tmp_file($r); } my @records=&Apache::loncommon::upfile_record_sep(); - if($ENV{'form.noFirstLine'}){$firstLine=shift(@records);} + if($ENV{'form.noFirstLine'}){ + $firstLine=shift(@records); + } my $total=$#records; my $distotal=$total+1; my $today=time; @@ -557,24 +558,28 @@ sub print_upload_manager_form { my $i; my $keyfields; if ($total>=0) { - my @d=(['username','Username'], - ['names','Last Name, First Names'], - ['fname','First Name'], - ['mname','Middle Names/Initials'], - ['lname','Last Name'], - ['gen','Generation'], - ['id','ID/Student Number'], - ['sec','Group/Section'], - ['ipwd','Initial Password'], - ['email','EMail Address']); + my @field=(['username',&mt('Username')], + ['names',&mt('Last Name, First Names')], + ['fname',&mt('First Name')], + ['mname',&mt('Middle Names/Initials')], + ['lname',&mt('Last Name')], + ['gen',&mt('Generation')], + ['id',&mt('ID/Student Number')], + ['sec',&mt('Group/Section')], + ['ipwd',&mt('Initial Password')], + ['email',&mt('EMail Address')]); if ($ENV{'form.upfile_associate'} eq 'reverse') { &Apache::loncommon::csv_print_samples($r,\@records); - $i=&Apache::loncommon::csv_print_select_table($r,\@records,\@d); - foreach (@d) { $keyfields.=$_->[0].','; } + $i=&Apache::loncommon::csv_print_select_table($r,\@records, + \@field); + foreach (@field) { + $keyfields.=$_->[0].','; + } chop($keyfields); } else { - unshift(@d,['none','']); - $i=&Apache::loncommon::csv_samples_select_table($r,\@records,\@d); + unshift(@field,['none','']); + $i=&Apache::loncommon::csv_samples_select_table($r,\@records, + \@field); my %sone=&Apache::loncommon::record_sep($records[0]); $keyfields=join(',',sort(keys(%sone))); } @@ -582,7 +587,8 @@ sub print_upload_manager_form { &print_upload_manager_footer($r,$i,$keyfields,$defdom,$today,$halfyear); } -# ======================================================= Enroll single student +############################################################### +############################################################### sub enroll_single_student { my $r=shift; # Remove non alphanumeric values from section