--- loncom/interface/Attic/londropadd.pm 2007/10/11 02:16:25 1.172
+++ loncom/interface/Attic/londropadd.pm 2008/11/17 15:48:46 1.175
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to drop and add students in courses
#
-# $Id: londropadd.pm,v 1.172 2007/10/11 02:16:25 albertel Exp $
+# $Id: londropadd.pm,v 1.175 2008/11/17 15:48:46 jms Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -26,8 +26,23 @@
# http://www.lon-capa.org/
#
#
-###############################################################
-##############################################################
+
+=head1 NAME
+
+Apache::londropadd
+
+=head1 SYNOPSIS
+
+drop & add students
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 SUBROUTINES
+
+=over
+
+=cut
package Apache::londropadd;
@@ -42,8 +57,6 @@ use Apache::lonlocal;
use Apache::longroup;
use LONCAPA();
-###############################################################
-###############################################################
sub header {
my ($jscript,$loaditems) = @_;
my $start_page;
@@ -59,9 +72,14 @@ $start_page
ENDHEAD
}
-###############################################################
-###############################################################
-# Drop student from all sections of a course, except optional $csec
+=pod
+
+=item modifystudent()
+
+ Drop student from all sections of a course, except optional $csec
+
+=cut
+
sub modifystudent {
my ($udom,$unam,$courseid,$csec,$desiredhost)=@_;
# if $csec is undefined, drop the student from all the courses matching
@@ -104,9 +122,14 @@ sub modifystudent {
return $result;
}
-###############################################################
-###############################################################
-# build a domain and server selection form
+=pod
+
+=item domain_form()
+
+ build a domain and server selection form
+
+=cut
+
sub domain_form {
my ($defdom) = @_;
# Set up domain and server selection forms
@@ -135,9 +158,14 @@ sub domain_form {
return $result;
}
-###############################################################
-###############################################################
-# Menu Phase One
+=pod
+
+=item print_main_menu()
+
+ Menu Phase One
+
+=cut
+
sub print_main_menu {
my ($r,$permission)=@_;
#
@@ -224,13 +252,15 @@ sub print_main_menu {
return;
}
-###############################################################
-###############################################################
+
+
sub hidden_input {
my ($name,$value) = @_;
return ''."\n";
}
+
+
sub print_upload_manager_header {
my ($r,$datatoken,$distotal,$krbdefdom)=@_;
my $javascript;
@@ -291,8 +321,10 @@ sub print_upload_manager_header {
$javascript."\n".$javascript_validations.'');
}
-###############################################################
-###############################################################
+
+
+
+
sub javascript_validations {
my ($mode,$krbdefdom,$curr_authtype,$curr_authfield,$domain)=@_;
my $authheader;
@@ -423,7 +455,7 @@ END
}
END
} else {
- $section_checks = §ion_check_js();
+ $section_checks = &Apache::lonuserutils::section_check_js();
$optional_checks = (<print(&make_dates_default($startdate,$enddate));
+ $r->print(&Apache::lonuserutils::make_dates_default($startdate,
+ $enddate));
}
$r->print('
'.&mt('Enrolling Student').'
');
@@ -806,7 +845,7 @@ sub enroll_single_student {
$env{'form.lcdomain'});
if ((($amode) && ($genpwd)) || ($home ne 'no_host')) {
# Clean out any old roles the student has in this class.
- &modifystudent($env{'form.lcdomain'},$env{'form.cuname'},
+ &Apache::lonuserutils::modifystudent($env{'form.lcdomain'},$env{'form.cuname'},
$env{'request.course.id'},$env{'form.csec'},
$desiredhost);
my $login_result = &Apache::lonnet::modifystudent
@@ -960,9 +999,14 @@ sub make_dates_default {
return $result;
}
-##
-## Single student enrollment routines (some of them)
-##
+=pod
+
+=item get_student_username_domain_form()
+
+ Single student enrollment routines (some of them)
+
+=cut
+
sub get_student_username_domain_form {
my ($r,$elements,$response,$srch,$forcenewuser) = @_;
my $loaditems = {
@@ -1066,7 +1110,8 @@ sub print_enroll_single_student_form {
my ($krbdef,$krbdefdom) =
&Apache::loncommon::get_kerberos_defaults($ccdomain);
$javascript_validations =
- &javascript_validations('auth',$krbdefdom,undef,undef,$ccdomain);
+ &Apache::lonuserutils::javascript_validations('auth',$krbdefdom,
+ undef,undef,$ccdomain);
my %param = ( formname => 'document.studentform',
kerb_def_dom => $krbdefdom,
kerb_def_auth => $krbdef
@@ -1132,7 +1177,7 @@ END
} else {
# User already exists. Do not worry about authentication
my %uenv = &Apache::lonnet::dump('environment',$ccdomain,$ccuname);
- $javascript_validations = &javascript_validations('noauth');
+ $javascript_validations = &Apache::lonuserutils::javascript_validations('noauth');
my %lt=&Apache::lonlocal::texthash(
'udf' => "User Data for",
'fn' => "First Name",
@@ -1158,7 +1203,7 @@ END
END
}
- my $date_table = &date_setting_table();
+ my $date_table = &Apache::lonuserutils::date_setting_table();
# Print it all out
my %lt=&Apache::lonlocal::texthash(
'cd' => "Course Data",
@@ -1247,7 +1292,14 @@ END
return;
}
-# ========================================================= Menu Phase Two Drop
+=pod
+
+=item print_drop_menu()
+
+ Menu Phase Two Drop
+
+=cut
+
sub print_drop_menu {
my $r=shift;
$r->print("
".&mt('Drop Students')."
");
@@ -1262,7 +1314,15 @@ sub print_drop_menu {
return;
}
-# ============================================== view classlist
+
+=pod
+
+=item print_html_classlist()
+
+ view classlist
+
+=cut
+
sub print_html_classlist {
my ($r,$mode,$permission) = @_;
if (! exists($env{'form.sortby'})) {
@@ -1352,7 +1412,15 @@ sub print_html_classlist {
}
}
-# =================================================== Show student list to drop
+
+=pod
+
+=item show_class_list()
+
+ Show student list to drop
+
+=cut
+
sub show_class_list {
my ($r,$mode,$linkto,$statusmode,$classlist,$keylist)=@_;
my $cid=$env{'request.course.id'};
@@ -1510,9 +1578,9 @@ END
time.'_'.rand(1000000000).'.csv';
unless ($CSVfile = Apache::File->new('>/home/httpd'.$CSVfilename)) {
$r->log_error("Couldn't open $CSVfilename for output $!");
- $r->print("Problems occured in writing the csv file. ".
- "This error has been logged. ".
- "Please alert your LON-CAPA administrator.");
+ $r->print(&mt('Problems occurred in writing the csv file. '
+ .'This error has been logged. '
+ .'Please alert your LON-CAPA administrator.'));
$CSVfile = undef;
}
#
@@ -1754,9 +1822,14 @@ END
}
-#
-# print out form for modification of a single students data
-#
+=pod
+
+=item print_modify_student_form()
+
+ print out form for modification of a single students data
+
+=cut
+
sub print_modify_student_form {
my $r = shift();
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
@@ -1807,7 +1880,8 @@ sub print_modify_student_form {
&Apache::lonlocal::locallocaltime($endtime)).' ';
}
- my $date_table = &date_setting_table($starttime,$endtime);
+ my $date_table =
+ &Apache::lonuserutils::date_setting_table($starttime,$endtime);
#
if (! exists($env{'form.Status'}) ||
$env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) {
@@ -1829,7 +1903,7 @@ sub print_modify_student_form {
'sm' => "Submit Modifications",
);
# Check if section name is valid
- my $section_check = §ion_check_js();
+ my $section_check = &Apache::lonuserutils::section_check_js();
$r->print(<<"END");