--- loncom/interface/Attic/londropadd.pm 2005/04/19 03:58:23 1.129
+++ loncom/interface/Attic/londropadd.pm 2007/06/04 11:36:46 1.161
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.129 2005/04/19 03:58:23 matthew Exp $
+# $Id: londropadd.pm,v 1.161 2007/06/04 11:36:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -39,19 +39,15 @@ use Apache::Constants qw(:common :http R
use Spreadsheet::WriteExcel;
use Apache::lonstathelpers();
use Apache::lonlocal;
+use Apache::longroup;
+use LONCAPA();
###############################################################
###############################################################
sub header {
- my $html=&Apache::lonxml::xmlbegin();
- my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager');
- my $title = &mt('LON-CAPA Enrollment Manager');
+ my $start_page=&Apache::loncommon::start_page('Enrollment Manager');
return(<
-$title
-
-$bodytag
+$start_page
\n";
+ "\n";
$Str .= "
".&mt('Student Number')."
\n";
- $Str .= "
\n".'';
+ $Str .= "
\n".'
\n";
- $Str .= '\n
\n";
+ $Str .= ''." \n";
$Str .= &mt('Note: for large courses, this operation may be time '.
'consuming');
@@ -685,7 +713,7 @@ sub print_upload_manager_form {
['lname',&mt('Last Name'), $env{'form.lname_choice'}],
['gen', &mt('Generation'), $env{'form.gen_choice'}],
['id', &mt('ID/Student Number'),$env{'form.id_choice'}],
- ['sec', &mt('Group/Section'), $env{'form.sec_choice'}],
+ ['sec', &mt('Section'), $env{'form.sec_choice'}],
['ipwd', &mt('Initial Password'),$env{'form.ipwd_choice'}],
['email',&mt('EMail Address'), $env{'form.email_choice'}]);
if ($env{'form.upfile_associate'} eq 'reverse') {
@@ -726,15 +754,19 @@ sub enroll_single_student {
$r->print('
");
}
sub setup_date_selectors {
@@ -852,16 +885,17 @@ sub date_setting_table {
my ($starttime,$endtime,$mode) = @_;
my ($startform,$endform)=&setup_date_selectors($starttime,$endtime,$mode);
my $dateDefault = ''.
- ' '.
- &mt('make these dates the default for future enrollment');
+ '';
if ($mode eq 'create_enrolldates' || $mode eq 'create_defaultdates') {
$dateDefault = ' ';
}
- my $perpetual = '';
+ $perpetual.= ' /> '.&mt('no ending date').'';
if ($mode eq 'create_enrolldates') {
$perpetual = ' ';
}
@@ -889,7 +923,8 @@ sub make_dates_default {
$result .= "Set default start and end dates for course ";
#
# Refresh the course environment
- &Apache::lonnet::coursedescription($env{'request.course.id'});
+ &Apache::lonnet::coursedescription($env{'request.course.id'},
+ {'freshen_cache' => 1});
} else {
$result .= &mt('Unable to set default dates for course').":".$put_result.
' ';
@@ -915,11 +950,11 @@ sub get_student_username_domain_form {
$lt{'eos'}
-
$lt{'usr'}:
+
:
-
$lt{'dom'}:
+
:
$domform
-
+
@@ -936,10 +971,8 @@ sub print_enroll_single_student_form {
my $r=shift;
$r->print("
".&mt('Enroll One Student')."
");
#
- my $username = $env{'form.cuname'};
- my $domain = $env{'form.cudomain'};
- $username=~s/\W//gs;
- $domain=~s/\W//gs;
+ my $username = &LONCAPA::clean_username($env{'form.cuname'});
+ my $domain = &LONCAPA::clean_domain($env{'form.cudomain'});
my $home = &Apache::lonnet::homeserver($username,$domain);
# $new_user flags whether we are creating a new user or using an old one
my $new_user = 1;
@@ -965,7 +998,7 @@ sub print_enroll_single_student_form {
#
# Set up domain selection form
my $homeserver_form = '';
- my %servers = &Apache::loncommon::get_library_servers($domain);
+ my %servers = &Apache::lonnet::get_servers($domain,'library');
$homeserver_form = '