--- loncom/interface/Attic/londropadd.pm 2003/11/07 21:04:37 1.90
+++ loncom/interface/Attic/londropadd.pm 2003/12/12 18:04:38 1.94
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.90 2003/11/07 21:04:37 matthew Exp $
+# $Id: londropadd.pm,v 1.94 2003/12/12 18:04:38 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -146,7 +146,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(<
+ + $Text{'populate'} + END } @@ -207,10 +211,7 @@ sub print_upload_manager_header { &mt('Total number of records found in file: [_1].',$distotal). "\n". "
Enrolling '.$ENV{'form.cuname'}." \@ ". + $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/)) { @@ -616,12 +635,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=''; @@ -654,41 +673,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', @@ -697,6 +719,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); } @@ -710,22 +740,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 = 'Starting Date | '. + $result .= '||
'.&mt('Starting Date').' | '. ''.$startform.' | '. ''.$dateDefault.' | '."
Ending Date | '. + $result .= '||
'.&mt('Ending Date').' | '. ''.$endform.' | '. ''.$perpetual.' | '."
Username: | +|
---|---|
$lt{'usr'}: | |
Domain: | +|
$lt{'dom'}: | $domform |
- + |
First Name: | +|
---|---|
$lt{'fn'}: | |
Middle Name: | +|
$lt{'mn'}: | |
Last Name: | +|
$lt{'ln'}: | |
Generation: | +|
$lt{'gen'}: | |
Home Server: | +|
$lt{'hs'}: | $homeserver_form |
First Name: | +||||
---|---|---|---|---|
$lt{'fn'}: | ||||
Middle Name: | +||||
$lt{'mn'}: | ||||
Last Name: | +||||
$lt{'ln'}: | ||||
Generation: | +||||
$lt{'gen'}: |
- username + $lt{'usrn'} | - domain + $lt{'dom'} | ID | - student name + $lt{'sn'} | - section + $lt{'sec'} |
---|