--- loncom/interface/Attic/londropadd.pm 2005/04/19 03:58:23 1.129
+++ loncom/interface/Attic/londropadd.pm 2006/05/18 01:08:51 1.143
@@ -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.143 2006/05/18 01:08:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -39,19 +39,14 @@ use Apache::Constants qw(:common :http R
use Spreadsheet::WriteExcel;
use Apache::lonstathelpers();
use Apache::lonlocal;
+use Apache::longroup;
###############################################################
###############################################################
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(<
\n".''; + $Str .= "
\n".'
\n"; - $Str .= '\n
\n";
+ $Str .= ''."
$krbform
@@ -1056,7 +1078,7 @@ END
# Print it all out
my %lt=&Apache::lonlocal::texthash(
'cd' => "Course Data",
- 'gs' => "Group/Section",
+ 'gs' => "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",
@@ -1067,7 +1089,7 @@ END
+ ');
+ }
$r->print("
-
\n";
$Str .= &mt('Note: for large courses, this operation may be time '.
'consuming');
@@ -685,7 +705,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') {
@@ -852,16 +872,16 @@ sub date_setting_table {
my ($starttime,$endtime,$mode) = @_;
my ($startform,$endform)=&setup_date_selectors($starttime,$endtime,$mode);
my $dateDefault = '
";
#
# 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.
'
';
@@ -986,6 +1007,7 @@ sub print_enroll_single_student_form {
'psam' => "Please select an authentication mechanism",
'mail' => "Email Address"
);
+ my $authhelp=&Apache::loncommon::help_open_topic('Auth_Options');
$user_data_html = <
@@ -1003,7 +1025,7 @@ sub print_enroll_single_student_form {
$lt{'pswd'}
-$lt{'psam'}
+$lt{'psam'}$authhelp
+".&Apache::loncommon::start_data_table()."
");
if ($mode eq 'autoenroll') {
@@ -1292,9 +1345,26 @@ END
$lt{'start'}
END
+ if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {
+ my %photo_options = &Apache::lonlocal::texthash(
+ 'on' => 'Show',
+ 'off' => 'Hide',
+ );
+ my $photochg = 'on';
+ if ($displayphotos eq 'on') {
+ $photochg = 'off';
+ }
+ $r->print('
$lt{'end'}
+
+ $lt{'grp'}
- '."\n".' '.
+ ''.
+ $photo_options{$photochg}.' '.$lt{'photo'}."\n".
+ ' '."\n");
+ }
+ $r->print(" \n");
} elsif ($mode eq 'csv') {
#
# Open a file
@@ -1317,12 +1387,13 @@ END
print $CSVfile '"'.join('","',map {
&Apache::loncommon::csv_translate(&mt($_))
} ("username","domain","ID","student name",
- "section","start date","end date","status")).'"'."\n";
+ "section","start date","end date","status","active groups"))
+ .'"'."\n";
} else {
print $CSVfile '"'.join('","',map {
&Apache::loncommon::csv_translate(&mt($_))
} ("username","domain","ID","student name",
- "section","start date","end date")).'"'."\n";
+ "section","start date","end date","active groups")).'"'."\n";
}
} elsif ($mode eq 'excel') {
# Create the excel spreadsheet
@@ -1337,7 +1408,8 @@ END
#
$excel_sheet->write($row++,0,["username","domain","ID",
"student name","section",
- "start date","end date","status"],
+ "start date","end date","status",
+ "active groups"],
$format->{'bold'});
}
#
@@ -1347,6 +1419,7 @@ END
foreach (@$keylist) {
$index{$_} = $i++;
}
+ $index{'groups'} = scalar(@{$keylist});
my $index = $index{$sortby};
my $second = $index{'username'};
my $third = $index{'domain'};
@@ -1364,9 +1437,14 @@ END
my $lockcount = 0;
foreach my $student (@Sorted_Students) {
my $sdata = $classlist->{$student};
+ my $groups = $classgroups->{$student};
my $username = $sdata->[$index{'username'}];
my $domain = $sdata->[$index{'domain'}];
my $section = $sdata->[$index{'section'}];
+ my $active_groups;
+ if (ref($groups->{active}) eq 'HASH') {
+ $active_groups = join(', ',keys(%{$groups->{'active'}}));
+ }
my $name = $sdata->[$index{'fullname'}];
my $id = $sdata->[$index{'id'}];
my $status = $sdata->[$index{'status'}];
@@ -1385,22 +1463,22 @@ END
} else {
$end = &Apache::lonlocal::locallocaltime($end);
}
- $r->print("\n ");
+ $r->print(&Apache::loncommon::start_data_table_row());
if ($mode eq 'autoenroll') {
my $lockedtype = $sdata->[$index{'lockedtype'}];
$studentcount++;
my $cellentry;
if ($type eq 'auto') {
- $cellentry = ''.&mt('auto').' Change';
+ $cellentry = ''.&mt('auto').' ';
$autocount ++;
} else {
- $cellentry = '
');
+ $r->print(&Apache::loncommon::end_data_table().'
');
} elsif ($mode eq 'excel') {
$excel_workbook->close();
$r->print('