version 1.90, 2003/11/07 21:04:37
|
version 1.92, 2003/12/08 21:01:03
|
Line 146 sub print_main_menu {
|
Line 146 sub print_main_menu {
|
'enrollone' => 'Enroll a single student', |
'enrollone' => 'Enroll a single student', |
'modify' => 'Modify student data', |
'modify' => 'Modify student data', |
'view' => 'View Class List', |
'view' => 'View Class List', |
'drop' => 'Drop Students'); |
'drop' => 'Drop Students', |
|
'populate' => 'Automated Enrollment Manager'); |
|
|
$r->print(<<END); |
$r->print(<<END); |
<p> |
<p> |
Line 169 sub print_main_menu {
|
Line 170 sub print_main_menu {
|
<font size="+1"> |
<font size="+1"> |
<a href="/adm/dropadd?action=drop">$Text{'drop'}</a> |
<a href="/adm/dropadd?action=drop">$Text{'drop'}</a> |
</font> |
</font> |
</p> |
</p><p> |
|
<font size="+1"> |
|
<a href="/adm/populate">$Text{'populate'}</a> |
|
</font> |
END |
END |
} |
} |
|
|
Line 237 sub javascript_validations {
|
Line 241 sub javascript_validations {
|
my %param = ( formname => 'studentform', |
my %param = ( formname => 'studentform', |
kerb_def_dom => $krbdefdom ); |
kerb_def_dom => $krbdefdom ); |
$authheader = &Apache::loncommon::authform_header(%param); |
$authheader = &Apache::loncommon::authform_header(%param); |
|
} elsif ($mode eq 'createcourse') { |
|
my %param = ( formname => 'ccrs', |
|
kerb_def_dom => $krbdefdom ); |
|
$authheader = &Apache::loncommon::authform_header(%param); |
} |
} |
|
|
my %alert = &Apache::lonlocal::texthash |
my %alert = &Apache::lonlocal::texthash |
(username => 'You need to specify the username field.', |
(username => 'You need to specify the username field.', |
authen => 'You must choose an authentication type.', |
authen => 'You must choose an authentication type.', |
Line 256 function verify_message (vf,founduname,f
|
Line 265 function verify_message (vf,founduname,f
|
END |
END |
my $auth_checks = (<<END); |
my $auth_checks = (<<END); |
var foundatype=0; |
var foundatype=0; |
|
END |
|
unless ($mode eq 'createcourse') { |
|
$auth_checks .= (<<END); |
if (founduname==0) { |
if (founduname==0) { |
alert('$alert{'username'}'); |
alert('$alert{'username'}'); |
return; |
return; |
} |
} |
|
END |
|
} |
|
$auth_checks .= (<<END); |
// alert('current.radiovalue = '+current.radiovalue); |
// alert('current.radiovalue = '+current.radiovalue); |
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
if (current.radiovalue == null || current.radiovalue == 'nochange') { |
// They did not check any of the login radiobuttons. |
// They did not check any of the login radiobuttons. |
Line 289 END
|
Line 304 END
|
} |
} |
} |
} |
END |
END |
my $optional_checks = (<<END); |
my $optional_checks = ''; |
|
if ($mode eq 'createcourse') { |
|
$optional_checks = (<<END); |
|
vf.submit(); |
|
} |
|
END |
|
} else { |
|
$optional_checks = (<<END); |
var message=''; |
var message=''; |
if (foundname==0) { |
if (foundname==0) { |
message='$alert{'name'}'; |
message='$alert{'name'}'; |
Line 323 END
|
Line 345 END
|
vf.submit(); |
vf.submit(); |
} |
} |
} |
} |
|
|
END |
END |
|
} |
my $result = $function_name; |
my $result = $function_name; |
if ($mode eq 'auth') { |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) { |
$result .= $auth_checks; |
$result .= $auth_checks; |
} |
} |
$result .= $optional_checks; |
$result .= $optional_checks; |
if ($mode eq 'auth') { |
if ( ($mode eq 'auth') || ($mode eq 'createcourse') ) { |
$result .= $authheader; |
$result .= $authheader; |
} |
} |
return $result; |
return $result; |
Line 674 sub enroll_single_student {
|
Line 696 sub enroll_single_student {
|
} |
} |
|
|
sub setup_date_selectors { |
sub setup_date_selectors { |
my ($starttime,$endtime) = @_; |
my ($starttime,$endtime,$mode) = @_; |
if (! defined($starttime)) { |
if (! defined($starttime)) { |
$starttime = time; |
$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'})) { |
'.default_enrollment_start_date'})) { |
$starttime = $ENV{'course.'.$ENV{'request.course.id'}. |
$starttime = $ENV{'course.'.$ENV{'request.course.id'}. |
'.default_enrollment_start_date'}; |
'.default_enrollment_start_date'}; |
|
} |
} |
} |
} |
} |
if (! defined($endtime)) { |
if (! defined($endtime)) { |
$endtime = time+(6*30*24*60*60); # 6 months from now, approx |
$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'})) { |
'.default_enrollment_end_date'})) { |
$endtime = $ENV{'course.'.$ENV{'request.course.id'}. |
$endtime = $ENV{'course.'.$ENV{'request.course.id'}. |
'.default_enrollment_end_date'}; |
'.default_enrollment_end_date'}; |
|
} |
} |
} |
} |
} |
my $startdateform = &Apache::lonhtmlcommon::date_setter('studentform', |
my $startdateform = &Apache::lonhtmlcommon::date_setter('studentform', |
Line 697 sub setup_date_selectors {
|
Line 723 sub setup_date_selectors {
|
my $enddateform = &Apache::lonhtmlcommon::date_setter('studentform', |
my $enddateform = &Apache::lonhtmlcommon::date_setter('studentform', |
'enddate', |
'enddate', |
$endtime); |
$endtime); |
|
if ($mode eq 'createcourse') { |
|
$startdateform = &Apache::lonhtmlcommon::date_setter('ccrs', |
|
'startdate', |
|
$starttime); |
|
$enddateform = &Apache::lonhtmlcommon::date_setter('ccrs', |
|
'enddate', |
|
$endtime); |
|
} |
return ($startdateform,$enddateform); |
return ($startdateform,$enddateform); |
} |
} |
|
|
Line 710 sub get_dates_from_form {
|
Line 744 sub get_dates_from_form {
|
} |
} |
|
|
sub date_setting_table { |
sub date_setting_table { |
my ($starttime,$endtime) = @_; |
my ($starttime,$endtime,$mode) = @_; |
my ($startform,$endform)=&setup_date_selectors($starttime,$endtime); |
my ($startform,$endform)=&setup_date_selectors($starttime,$endtime,$mode); |
my $dateDefault = '<nobr>'. |
my $dateDefault = '<nobr>'. |
'<input type="checkbox" name="makedatesdefault" />'. |
'<input type="checkbox" name="makedatesdefault" />'. |
' make these dates the default for future enrollment'; |
' make these dates the default for future enrollment'; |
|
if ($mode eq 'createcourse') { |
|
$dateDefault = ' '; |
|
} |
my $perpetual = '<nobr><input type="checkbox" name="no_end_date"'; |
my $perpetual = '<nobr><input type="checkbox" name="no_end_date"'; |
if (defined($endtime) && $endtime == 0) { |
if (defined($endtime) && $endtime == 0) { |
$perpetual .= ' checked'; |
$perpetual .= ' checked'; |
Line 939 END
|
Line 976 END
|
# ========================================================= Menu Phase Two Drop |
# ========================================================= Menu Phase Two Drop |
sub print_drop_menu { |
sub print_drop_menu { |
my $r=shift; |
my $r=shift; |
$r->print("<h3>Drop Students</h3>"); |
$r->print("<h3>".&mt('Drop Students')."</h3>"); |
my $cid=$ENV{'request.course.id'}; |
my $cid=$ENV{'request.course.id'}; |
my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); |
my ($classlist,$keylist) = &Apache::loncoursedata::get_classlist(); |
if (! defined($classlist)) { |
if (! defined($classlist)) { |
Line 1058 END
|
Line 1095 END
|
$r->print('"'.join('","',("username","domain","ID","student name", |
$r->print('"'.join('","',("username","domain","ID","student name", |
"section","status")).'"'."\n"); |
"section","status")).'"'."\n"); |
} else { |
} else { |
$r->print('"'.join('","',("username","domain","ID","student name", |
$r->print('"'.join('","',(&mt("username"),"domain","ID","student name", |
"section")).'"'."\n"); |
"section")).'"'."\n"); |
} |
} |
} elsif ($mode eq 'excel') { |
} elsif ($mode eq 'excel') { |
Line 1477 END
|
Line 1514 END
|
<tr> |
<tr> |
<th> </th> |
<th> </th> |
<th>username</th> |
<th>username</th> |
<th>domain</th> |
<th>domaind</th> |
<th>ID</th> |
<th>ID</th> |
<th>student name</th> |
<th>student name</th> |
<th>section</th> |
<th>section</th> |
Line 1485 END
|
Line 1522 END
|
END |
END |
|
|
} else { |
} else { |
|
my $wordusername=&mt('username'); |
|
my $worddomain=&mt('domain'); |
|
my $wordstudentname=&mt('student name'); |
|
my $wordsection=&mt('section'); |
$r->print(<<END); |
$r->print(<<END); |
<table border=2> |
<table border=2> |
<tr><th> </th> |
<tr><th> </th> |
<th> |
<th> |
<a href="/adm/dropadd?action=$action&sortby=username">username</a> |
<a href="/adm/dropadd?action=$action&sortby=username">$wordusername</a> |
</th><th> |
</th><th> |
<a href="/adm/dropadd?action=$action&sortby=domain">domain</a> |
<a href="/adm/dropadd?action=$action&sortby=domain">$worddomain</a> |
</th><th> |
</th><th> |
<a href="/adm/dropadd?action=$action&sortby=id">ID</a> |
<a href="/adm/dropadd?action=$action&sortby=id">ID</a> |
</th><th> |
</th><th> |
<a href="/adm/dropadd?action=$action&sortby=fullname">student name</a> |
<a href="/adm/dropadd?action=$action&sortby=fullname">$wordstudentname</a> |
</th><th> |
</th><th> |
<a href="/adm/dropadd?action=$action&sortby=section">section</a> |
<a href="/adm/dropadd?action=$action&sortby=section">$wordsection</a> |
</th> |
</th> |
</tr> |
</tr> |
END |
END |
Line 1541 END
|
Line 1582 END
|
END |
END |
} |
} |
$r->print('</table><br>'); |
$r->print('</table><br>'); |
|
my $DropStudents=&mt('Drop Students'); |
|
my $CheckAll=&mt('check all'); |
|
my $UncheckAll=&mt('uncheck all'); |
$r->print(<<"END"); |
$r->print(<<"END"); |
</p><p> |
</p><p> |
<input type="button" value="check all" onclick="javascript:checkAll(document.studentform.droplist)"> |
<input type="button" value="$CheckAll" onclick="javascript:checkAll(document.studentform.droplist)"> |
<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.studentform.droplist)"> |
<input type="button" value="$UncheckAll" onclick="javascript:uncheckAll(document.studentform.droplist)"> |
<p><input type=submit value="Drop Students"></p> |
<p><input type=submit value="$DropStudents"></p> |
END |
END |
return; |
return; |
} |
} |
Line 1567 sub print_first_courselist_upload_form {
|
Line 1611 sub print_first_courselist_upload_form {
|
$str .= '<input type="checkbox" name="noFirstLine" /> '. |
$str .= '<input type="checkbox" name="noFirstLine" /> '. |
&mt('Ignore First Line')."</p>\n"; |
&mt('Ignore First Line')."</p>\n"; |
$str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List", |
$str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List", |
"How do I create a class list from a spreadsheet"). |
&mt("How do I create a class list from a spreadsheet")). |
"<br />\n"; |
"<br />\n"; |
$str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
$str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
"How do I create a CSV file from a spreadsheet"). |
&mt("How do I create a CSV file from a spreadsheet")). |
"<br />\n"; |
"<br />\n"; |
$str .= "</body>\n</html>\n"; |
$str .= "</body>\n</html>\n"; |
$r->print($str); |
$r->print($str); |