--- loncom/interface/Attic/londropadd.pm 2003/11/06 20:04:06 1.88 +++ loncom/interface/Attic/londropadd.pm 2003/12/28 01:30:50 1.97 @@ -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.97 2003/12/28 01:30:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,11 +25,6 @@ # # http://www.lon-capa.org/ # -# (Handler to set parameters for assessments -# -# (Handler to resolve ambiguous file locations -# -# (TeX Content Handler # ############################################################### ############################################################## @@ -146,7 +141,8 @@ sub print_main_menu { 'enrollone' => 'Enroll a single student', 'modify' => 'Modify student data', 'view' => 'View Class List', - 'drop' => 'Drop Students'); + 'drop' => 'Drop Students', + 'populate' => 'Automated Enrollment Manager'); $r->print(< @@ -169,12 +165,20 @@ sub print_main_menu { $Text{'drop'} -

+

+ + $Text{'populate'} + END } ############################################################### ############################################################### +sub hidden_input { + my ($name,$value) = @_; + return ''."\n"; +} + sub print_upload_manager_header { my ($r,$datatoken,$distotal,$krbdefdom)=@_; my $javascript; @@ -193,7 +197,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,59 +206,126 @@ 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', + my ($mode,$krbdefdom,$curr_authtype,$curr_authfield)=@_; + my $authheader; + if ($mode eq 'auth') { + my %param = ( formname => 'studentform', + kerb_def_dom => $krbdefdom ); + $authheader = &Apache::loncommon::authform_header(%param); + } elsif ($mode eq 'createcourse') { + my %param = ( formname => 'ccrs', kerb_def_dom => $krbdefdom ); - my $authheader = &Apache::loncommon::authform_header(%param); - my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); - return (< 'cmod', + kerb_def_dom => $krbdefdom, + mode => 'modifycourse', + curr_authtype => $curr_authtype, + curr_autharg => $curr_authfield ); + $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 =(<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; @@ -540,24 +616,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))); } @@ -565,7 +645,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 @@ -580,8 +661,8 @@ sub enroll_single_student { $r->print(&make_dates_default($startdate,$enddate)); } - $r->print('

Enrolling Student

'); - $r->print('

Enrolling '.$ENV{'form.cuname'}." \@ ". + $r->print('

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

'); + $r->print('

'.&mt('Enrolling').' '.$ENV{'form.cuname'}." \@ ". $ENV{'form.lcdomain'}.'

'); if (($ENV{'form.cuname'})&&($ENV{'form.cuname'}!~/\W/)&& ($ENV{'form.lcdomain'})&&($ENV{'form.lcdomain'}!~/\W/)) { @@ -593,12 +674,12 @@ sub enroll_single_student { } else { my %home_servers =&Apache::loncommon::get_library_servers($domain); if (! exists($home_servers{$desiredhost})) { - $r->print('Error:'. - 'Invalid home server specified'); + $r->print(''.&mt('Error').':'. + &mt('Invalid home server specified')); return; } } - $r->print(" with server $desiredhost :") if (defined($desiredhost)); + $r->print(" ".&mt('with server')." $desiredhost :") if (defined($desiredhost)); # End of home server selection logic my $amode=''; my $genpwd=''; @@ -631,41 +712,44 @@ sub enroll_single_student { $desiredhost); if ($login_result =~ /^ok/) { $r->print($login_result); - $r->print("

If active, the new role will be available ". - "when the student next logs in to LON-CAPA.

"); + $r->print("

".&mt('If active, the new role will be available when the student next logs in to LON-CAPA.')."

"); } else { - $r->print("unable to enroll: ".$login_result); + $r->print(&mt('unable to enroll').": ".$login_result); } } else { - $r->print('

ERROR '); + $r->print('

'.&mt('ERROR').' '); if ($amode =~ /^krb/) { - $r->print('Missing Kerberos domain information. '); + $r->print(&mt('Missing Kerberos domain information.').' '); } else { - $r->print('Invalid login mode or password. '); + $r->print(&mt('Invalid login mode or password.').' '); } - $r->print('Unable to enroll '.$ENV{'form.cuname'}.'.

'); + $r->print(''.&mt('Unable to enroll').' '.$ENV{'form.cuname'}.'.

'); } } else { - $r->print('Invalid username or domain'); + $r->print(&mt('Invalid username or domain')); } } sub setup_date_selectors { - my ($starttime,$endtime) = @_; + my ($starttime,$endtime,$mode) = @_; if (! defined($starttime)) { $starttime = time; - if (exists($ENV{'course.'.$ENV{'request.course.id'}. + unless ($mode eq 'createcourse') { + if (exists($ENV{'course.'.$ENV{'request.course.id'}. '.default_enrollment_start_date'})) { - $starttime = $ENV{'course.'.$ENV{'request.course.id'}. + $starttime = $ENV{'course.'.$ENV{'request.course.id'}. '.default_enrollment_start_date'}; + } } } if (! defined($endtime)) { $endtime = time+(6*30*24*60*60); # 6 months from now, approx - if (exists($ENV{'course.'.$ENV{'request.course.id'}. + unless ($mode eq 'createcourse') { + if (exists($ENV{'course.'.$ENV{'request.course.id'}. '.default_enrollment_end_date'})) { - $endtime = $ENV{'course.'.$ENV{'request.course.id'}. + $endtime = $ENV{'course.'.$ENV{'request.course.id'}. '.default_enrollment_end_date'}; + } } } my $startdateform = &Apache::lonhtmlcommon::date_setter('studentform', @@ -674,6 +758,14 @@ sub setup_date_selectors { my $enddateform = &Apache::lonhtmlcommon::date_setter('studentform', 'enddate', $endtime); + if ($mode eq 'createcourse') { + $startdateform = &Apache::lonhtmlcommon::date_setter('ccrs', + 'startdate', + $starttime); + $enddateform = &Apache::lonhtmlcommon::date_setter('ccrs', + 'enddate', + $endtime); + } return ($startdateform,$enddateform); } @@ -687,22 +779,25 @@ sub get_dates_from_form { } sub date_setting_table { - my ($starttime,$endtime) = @_; - my ($startform,$endform)=&setup_date_selectors($starttime,$endtime); + my ($starttime,$endtime,$mode) = @_; + my ($startform,$endform)=&setup_date_selectors($starttime,$endtime,$mode); my $dateDefault = ''. - ''. - ' make these dates the default for future enrollment'; + ' '. + &mt('make these dates the default for future enrollment'); + if ($mode eq 'createcourse') { + $dateDefault = ' '; + } my $perpetual = ''; + $perpetual.= ' /> '.&mt('no ending date').''; my $result = ''; $result .= "\n"; - $result .= ''. + $result .= ''. ''. ''."\n"; - $result .= ''. + $result .= ''. ''. ''."\n"; $result .= "
Starting Date
'.&mt('Starting Date').''.$startform.''.$dateDefault.'
Ending Date
'.&mt('Ending Date').''.$endform.''.$perpetual.'
\n"; @@ -723,7 +818,7 @@ sub make_dates_default { # Refresh the course environment &Apache::lonnet::coursedescription($ENV{'request.course.id'}); } else { - $result .= "Unable to set default dates for course:".$put_result. + $result .= &mt('Unable to set default dates for course').":".$put_result. '
'; } return $result; @@ -736,18 +831,24 @@ sub get_student_username_domain_form { my $r = shift; my $domform = &Apache::loncommon::select_dom_form ($ENV{'course.'.$ENV{'request.course.id'}.'.domain'},'cudomain',0); + my %lt=&Apache::lonlocal::texthash( + 'eos' => "Enroll One Student", + 'usr' => "Username", + 'dom' => "Domain", + 'been' => "Begin Enrollment", + ); $r->print(< -

Enroll One Student

+

$lt{'eos'}

- + - +
Username:
$lt{'usr'}:
Domain:
$lt{'dom'}: $domform
  - +
END @@ -756,7 +857,7 @@ END sub print_enroll_single_student_form { my $r=shift; - $r->print("

Enroll One Student

"); + $r->print("

".&mt('Enroll One Student')."

"); # my $username = $ENV{'form.cuname'}; my $domain = $ENV{'form.cudomain'}; @@ -774,7 +875,7 @@ sub print_enroll_single_student_form { # Set up authentication forms my ($krbdef,$krbdefdom) = &Apache::loncommon::get_kerberos_defaults($domain); - $javascript_validations=&javascript_validations($krbdefdom); + $javascript_validations=&javascript_validations('auth',$krbdefdom); my %param = ( formname => 'document.studentform', kerb_def_dom => $krbdefdom, kerb_def_auth => $krbdef @@ -795,22 +896,32 @@ sub print_enroll_single_student_form { $homeserver_form .= "\n"; # # + my %lt=&Apache::lonlocal::texthash( + 'udf' => "User Data for", + 'fn' => "First Name", + 'mn' => "Middle Name", + 'ln' => "Last Name", + 'gen' => "Generation", + 'hs' => "Home Server", + 'pswd' => "Password", + 'psam' => "Please select an authentication mechanism", + ); $user_data_html = <User Data for $username\@$domain +

$lt{'udf'} $username\@$domain

- + - + - + - + - +
First Name:
$lt{'fn'}:
Middle Name:
$lt{'mn'}:
Last Name:
$lt{'ln'}:
Generation:
$lt{'gen'}:
Home Server:
$lt{'hs'}: $homeserver_form
-

Password

-Please select an authentication mechanism +

$lt{'pswd'}

+$lt{'psam'}

$krbform @@ -823,24 +934,31 @@ 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'); + my %lt=&Apache::lonlocal::texthash( + 'udf' => "User Data for", + 'fn' => "First Name", + 'mn' => "Middle Name", + 'ln' => "Last Name", + 'gen' => "Generation", + ); $user_data_html = <User Data for $username\@$domain +

$lt{'udf'} $username\@$domain

- + - + - + - + @@ -849,6 +967,13 @@ END } my $date_table = &date_setting_table(); # Print it all out + my %lt=&Apache::lonlocal::texthash( + 'cd' => "Course Data", + 'gs' => "Group/Section", + 'idsn' => "ID/Student Number", + 'disn' => "Disable ID/Student Number Safeguard and Force Change of Conflicting IDs (only do if you know what you are doing)", + 'eas' => "Enroll as student", + ); $r->print(< @@ -893,21 +1018,20 @@ function clearpwd(vf) { $user_data_html -

Course Data

+

$lt{'cd'}

-

Group/Section: +

$lt{'gs'}:

$date_table

-

ID/Student Number

+

$lt{'idsn'}

-ID/Student Number: +$lt{'idsn'}:

-Disable ID/Student Number Safeguard and Force Change of Conflicting IDs -(only do if you know what you are doing) +$lt{'disn'}

- +

END return; @@ -916,11 +1040,11 @@ END # ========================================================= Menu Phase Two Drop sub print_drop_menu { my $r=shift; - $r->print("

Drop Students

"); + $r->print("

".&mt('Drop Students')."

"); my $cid=$ENV{'request.course.id'}; my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); if (! defined($classlist)) { - $r->print("There are no students currently enrolled.\n"); + $r->print(&mt('There are no students currently enrolled.')."\n"); return; } # Print out the available choices @@ -939,29 +1063,34 @@ sub print_html_classlist { } my $status_select = &Apache::lonhtmlcommon::StatusOptions ($ENV{'form.Status'},'studentform'); + my $CCL=&mt('Current Class List'); $r->print(<

-Current Class List +$CCL       END if ($ENV{'form.action'} ne 'modifystudent') { + my %lt=&Apache::lonlocal::texthash( + 'ef' => "Excel format", + 'ss' => "Student Status", + ); $r->print(< CSV format          -Excel format +$lt{'ef'}       -Student Status: +$lt{'ss'}: END } $r->print($status_select."

\n"); my $cid=$ENV{'request.course.id'}; my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist(); if (! defined($classlist)) { - $r->print("There are no students currently enrolled.\n"); + $r->print(&mt('There are no students currently enrolled.')."\n"); } else { # Print out the available choices if ($ENV{'form.action'} eq 'modifystudent') { @@ -981,7 +1110,7 @@ sub print_formatted_classlist { my $cid=$ENV{'request.course.id'}; my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist(); if (! defined($classlist)) { - $r->print("There are no students currently enrolled.\n"); + $r->print(&mt('There are no students currently enrolled.')."\n"); } else { &show_class_list($r,$mode,'nolink','csv', $ENV{'form.Status'},$classlist,$keylist); @@ -1003,10 +1132,16 @@ sub show_class_list { # Print out header if ($mode eq 'view') { if ($linkto eq 'aboutme') { - $r->print('Select a user name to view the users personal page.'); + $r->print(&mt('Select a user name to view the users personal page.')); } elsif ($linkto eq 'modify') { - $r->print('Select a user name to modify the students information'); + $r->print(&mt('Select a user name to modify the students information')); } + my %lt=&Apache::lonlocal::texthash( + 'usrn' => "username", + 'dom' => "domain", + 'sn' => "student name", + 'sec' => "section", + ); $r->print(< @@ -1015,28 +1150,29 @@ sub show_class_list {

First Name:
$lt{'fn'}:
Middle Name:
$lt{'mn'}:
Last Name:
$lt{'ln'}:
Generation:
$lt{'gen'}:
END } elsif ($mode eq 'csv') { if($statusmode eq 'Expired') { - $r->print('"Students with expired roles"'); + $r->print(&mt('Students with expired roles')); } if ($statusmode eq 'Any') { - $r->print('"'.join('","',("username","domain","ID","student name", - "section","status")).'"'."\n"); + $r->print('"'.join('","',(&mt("username"),&mt("domain"),"ID", + &mt("student name"),&mt("section"),&mt("status"))). + '"'."\n"); } else { - $r->print('"'.join('","',("username","domain","ID","student name", - "section")).'"'."\n"); + $r->print('"'.join('","',(&mt("username"),&mt("domain"),"ID", + &mt("student name"),&mt("section"))).'"'."\n"); } } elsif ($mode eq 'excel') { # Create the excel spreadsheet @@ -1128,7 +1264,7 @@ END } elsif ($mode eq 'excel') { $excel_workbook->close(); $r->print('

'. - 'Your Excel spreadsheet is ready for download.

'."\n"); + &mt('Your Excel spreadsheet').' '.&mt('is ready for download').'.

'."\n"); } } @@ -1150,18 +1286,17 @@ sub print_modify_student_form { $sdom, $sname); my ($tmp) = keys(%info); if ($tmp =~ /^(con_lost|error|no_such_host)/i) { - $r->print('Error'. + $r->print(''.&mt('Error').''. '

'. - 'Unable to retrieve environment data for '.$sname. - 'in domain '.$sdom.'

'. - 'Please contact your LON-CAPA administrator '. - 'regarding this situation.

'); + &mt('Unable to retrieve environment data for').' '.$sname. + &mt('in domain').' '.$sdom.'

'. + &mt('Please contact your LON-CAPA administrator regarding this situation.').'

'); return; } # determine the students starting and ending times and section my ($starttime,$endtime,$section) = &get_enrollment_data($sname,$sdom); if ($starttime =~ /^error/) { - $r->print('

Error

'); + $r->print('

'&mt('Error').'

'); $r->print('

'.$starttime.'

'); return; } @@ -1172,11 +1307,24 @@ sub print_modify_student_form { $ENV{'form.Status'} !~ /^(Any|Expired|Active)$/) { $ENV{'form.Status'} = 'crap'; } - # Make sure student is enrolled in course + # Make sure student is enrolled in course + my %lt=&Apache::lonlocal::texthash( + 'mef' => "Modify Enrollment for", + 'odcc' => "Only domain coordinators can change a users password.", + 'sn' => "Student Name", + 'fn' => "First", + 'mn' => "Middle", + 'ln' => "Last", + 'gen' => "Generation", + 'sid' => "Student ID", + 'disn' => "Disable ID/Student Number Safeguard and Force Change of Conflicting IDs (only do if you know what you are doing)", + 'sec' => "Section", + 'sm' => "Submit Modifications", + ); $r->print(< -Only domain coordinators can change a users password. +$lt{'odcc'}

@@ -1186,12 +1334,12 @@ Only domain coordinators can change a us -

Modify Enrollment for $info{'firstname'} $info{'middlename'} +

$lt{'mef'} $info{'firstname'} $info{'middlename'} $info{'lastname'} $info{'generation'}, $sname\@$sdom

-Student Name +$lt{'sn'}

- username + $lt{'usrn'} - domain + $lt{'dom'} ID - student name + $lt{'sn'} - section + $lt{'sec'}
- +
FirstMiddleLastGeneration
$lt{'fn'}$lt{'mn'}$lt{'ln'}$lt{'gen'}
@@ -1199,16 +1347,15 @@ $info{'lastname'} $info{'generation'}, $

-Student ID: +$lt{'sid'}:

-Disable ID/Student Number Safeguard and Force Change of Conflicting IDs -(only do if you know what you are doing) +$lt{'disn'}

-Section: +$lt{'sec'}:

$date_table

- + END return; @@ -1246,8 +1393,7 @@ sub modify_single_student { $ENV{'request.course.id'}); my ($tmp) = keys(%old); if ($tmp =~ /^(con_lost|error|no_such_host)/i) { - $r->print("There was an error determining the environment values ". - " for $slogin \@ $sdom."); + $r->print(&mt('There was an error determining the environment values for')." $slogin \@ $sdom."); return; } undef $tmp; @@ -1266,36 +1412,49 @@ sub modify_single_student { # check for forceid override if ((defined($old{'id'})) && ($old{'id'} ne '') && ($sid ne $old{'id'}) && (! exists($ENV{'form.forceid'}))) { - $r->print("You changed the students id ". - " but did not disable the ID change safeguard.". - " The students id will not be changed."); + $r->print("".&mt('You changed the students id but did not disable the ID change safeguard. The students id will not be changed.').""); $sid = $old{'id'}; } # # talk to the user about what we are going to do + my %lt=&Apache::lonlocal::texthash( + 'mdu' => "Modifying data for user", + 'si' => "Student Information", + 'fd' => "Field", + 'ov' => "Old Value", + 'nv' => "New Value", + 'fn' => "First name", + 'mn' => "Middle name", + 'ln' => "Last name", + 'gen' => "Generation", + 'sec' => "Section", + 'ri' => "Role Information", + 'st' => "Start Time", + 'et' => "End Time", + ); $r->print(<Modifying data for user $slogin \@ $sdom -

Student Information

+

$lt{'mdu'} $slogin \@ $sdom

+

$lt{'si'}

- - - + + + - + - + - + - + @@ -1303,15 +1462,15 @@ sub modify_single_student { - +
Field Old Value New Value $lt{'fd'} $lt{'ov'} $lt{'nv'}
First name $lt{'fn'} $old{'firstname'} $firstname
Middle name $lt{'mn'} $old{'middlename'} $middlename
Last name $lt{'ln'} $old{'lastname'} $lastname
Generation $lt{'gen'} $old{'generation'} $generation
$old{'id'} $sid
Section $lt{'sec'} $old{'section'} $section
-

Role Information

+

$lt{'ri'}

- - + +
Start Time: $displayable_starttime
End Time: $displayable_endtime
$lt{'st'}: $displayable_starttime
$lt{'et'}: $displayable_endtime

END @@ -1322,36 +1481,32 @@ END $ENV{'request.course.id'}, $section,undef); if ($modify_section_results !~ /^ok/) { - $r->print("An error occured during the attempt to change the ". - "section for this student.
"); + $r->print(&mt('An error occured during the attempt to change the section for this student.')."
"); } my $roleresults = &Apache::lonnet::modifystudent ($sdom,$slogin,$sid,undef,undef,$firstname,$middlename,$lastname, $generation,$section,$endtime,$starttime,$ENV{'form.forceid'}); if ($roleresults eq 'refused' ) { - $r->print("Your request to change the role information for this ". - "student was refused. You do not appear to have ". - "sufficient authority to change student information."); + $r->print(&mt('Your request to change the role information for this student was refused. You do not appear to have sufficient authority to change student information.')); } elsif ($roleresults !~ /ok/) { - $r->print("An error occurred during the attempt to change the role". - " information for this student.
". - "The error reported was ". + $r->print(&mt('An error occurred during the attempt to change the role information for this student.')."
". + &mt('The error reported was')." ". $roleresults); &Apache::lonnet::logthis("londropadd:failed attempt to modify student". " data for ".$slogin." \@ ".$sdom." by ". $ENV{'user.name'}." \@ ".$ENV{'user.domain'}. ":".$roleresults); } else { # everything is okay! - $r->print("Student information updated successfully.
". - "The student must log out and log in again to see ". - "these changes."); + $r->print(&mt('Student information updated successfully.')."
". + &mt('The student must log out and log in again to see these changes.')); } + my $Masd=&mt('Modify another students data'); $r->print(<

-Modify another students data +$Masd END return; @@ -1449,32 +1604,44 @@ function uncheckAll(field) { END if ($nosort) { + my %lt=&Apache::lonlocal::texthash( + 'usrn' => "username", + 'dom' => "domain", + 'sn' => "student name", + 'sec' => "section", + ); $r->print(<   - username - domain + $lt{'usrn'} + $lt{'dom'} ID - student name - section + $lt{'sn'} + $lt{'sec'} END } else { + my %lt=&Apache::lonlocal::texthash( + 'usrn' => "username", + 'dom' => "domain", + 'sn' => "student name", + 'sec' => "section", + ); $r->print(<   - username + $lt{'usrn'} - domain + $lt{'dom'} ID - student name + $lt{'sn'} - section + $lt{'sec'} END @@ -1518,11 +1685,16 @@ END END } $r->print('
'); + my %lt=&Apache::lonlocal::texthash( + 'dp' => "Drop Students", + 'ca' => "check all", + 'ua' => "uncheck all", + ); $r->print(<<"END");

-   - -

+   + +

END return; } @@ -1544,10 +1716,10 @@ sub print_first_courselist_upload_form { $str .= ' '. &mt('Ignore First Line')."

\n"; $str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List", - "How do I create a class list from a spreadsheet"). + &mt("How do I create a class list from a spreadsheet")). "
\n"; $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV", - "How do I create a CSV file from a spreadsheet"). + &mt("How do I create a CSV file from a spreadsheet")). "
\n"; $str .= "\n\n"; $r->print($str);