--- loncom/interface/Attic/londropadd.pm 2004/01/15 19:27:05 1.99
+++ loncom/interface/Attic/londropadd.pm 2004/05/12 20:04:57 1.109
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.99 2004/01/15 19:27:05 matthew Exp $
+# $Id: londropadd.pm,v 1.109 2004/05/12 20:04:57 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,9 +42,7 @@ use Apache::lonlocal;
###############################################################
###############################################################
sub header {
- my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager').
- &Apache::loncommon::help_open_faq(9).
- &Apache::loncommon::help_open_bug('Instructor Interface');
+ my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager');
my $title = &mt('LON-CAPA Enrollment Manager');
return(<
@@ -701,7 +699,7 @@ sub enroll_single_student {
$ENV{'form.csec'}=~s/\W//g;
#
# We do the dates first because the action of making them the defaul
- # in the course is entirely seperate from the action of enrolling the
+ # in the course is entirely separate from the action of enrolling the
# student. Also, a failure in setting the dates as default is not fatal
# to the process of enrolling / modifying a student.
my ($startdate,$enddate) = &get_dates_from_form();
@@ -1102,7 +1100,7 @@ sub print_drop_menu {
# ============================================== view classlist
sub print_html_classlist {
- my $r=shift;
+ my ($r,$mode) = @_;
if (! exists($ENV{'form.sortby'})) {
$ENV{'form.sortby'} = 'username';
}
@@ -1110,32 +1108,58 @@ sub print_html_classlist {
$ENV{'form.Status'} = 'Active';
}
my $status_select = &Apache::lonhtmlcommon::StatusOptions
- ($ENV{'form.Status'},'studentform');
+ ($ENV{'form.Status'});
+ my $cid=$ENV{'request.course.id'};
+ my $cdom=$ENV{'course.'.$cid.'.domain'};
+ my $cnum=$ENV{'course.'.$cid.'.num'};
+ #
+ # List course personnel
+ my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum);
+ $r->print('
');
my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();
if (! defined($classlist)) {
$r->print(&mt('There are no students currently enrolled.')."\n");
@@ -1144,40 +1168,37 @@ END
if ($ENV{'form.action'} eq 'modifystudent') {
&show_class_list($r,'view','modify','modifystudent',
$ENV{'form.Status'},$classlist,$keylist);
- } else {
+ } elsif (! defined($mode) || $mode eq '') {
&show_class_list($r,'view','aboutme','classlist',
$ENV{'form.Status'},$classlist,$keylist);
+ } elsif ($mode eq 'csv' || $mode eq 'excel') {
+ &show_class_list($r,$mode,'nolink','csv',
+ $ENV{'form.Status'},$classlist,$keylist);
}
}
}
-# ============================================== view classlist
-sub print_formatted_classlist {
- my $r=shift;
- my $mode = shift;
- my $cid=$ENV{'request.course.id'};
- my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();
- if (! defined($classlist)) {
- $r->print(&mt('There are no students currently enrolled.')."\n");
- } else {
- &show_class_list($r,$mode,'nolink','csv',
- $ENV{'form.Status'},$classlist,$keylist);
- }
-}
-
# =================================================== Show student list to drop
sub show_class_list {
my ($r,$mode,$linkto,$action,$statusmode,$classlist,$keylist)=@_;
my $cid=$ENV{'request.course.id'};
#
# Variables for excel output
- my ($excel_workbook, $excel_sheet, $excel_filename,$row);
+ my ($excel_workbook, $excel_sheet, $excel_filename,$row,$format);
+ #
+ # Variables for csv output
+ my ($CSVfile,$CSVfilename);
#
my $sortby = $ENV{'form.sortby'};
if ($sortby !~ /^(username|domain|section|fullname|id)$/) {
$sortby = 'username';
}
# Print out header
+ $r->print(<
+
+END
if ($mode eq 'view') {
if ($linkto eq 'aboutme') {
$r->print(&mt('Select a user name to view the users personal page.'));
@@ -1191,13 +1212,12 @@ sub show_class_list {
'sec' => "section",
);
$r->print(<