version 1.132, 2005/11/15 22:06:50
|
version 1.138, 2006/03/21 18:34:23
|
Line 43 use Apache::lonlocal;
|
Line 43 use Apache::lonlocal;
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
sub header { |
sub header { |
my $html=&Apache::lonxml::xmlbegin(); |
my $start_page=&Apache::loncommon::start_page('Enrollment Manager'); |
my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager'); |
|
my $title = &mt('LON-CAPA Enrollment Manager'); |
|
return(<<ENDHEAD); |
return(<<ENDHEAD); |
$html |
$start_page |
<head> |
|
<title>$title</title> |
|
</head> |
|
$bodytag |
|
<form method="post" enctype="multipart/form-data" |
<form method="post" enctype="multipart/form-data" |
action="/adm/dropadd" name="studentform"> |
action="/adm/dropadd" name="studentform"> |
ENDHEAD |
ENDHEAD |
Line 1258 sub show_class_list {
|
Line 1252 sub show_class_list {
|
if ($sortby !~ /^(username|domain|section|fullname|id|start|end|type)$/) { |
if ($sortby !~ /^(username|domain|section|fullname|id|start|end|type)$/) { |
$sortby = 'username'; |
$sortby = 'username'; |
} |
} |
|
if (! exists($env{'form.displayphotos'})) { |
|
$env{'form.displayphotos'} = 'off'; |
|
} |
|
my $displayphotos = $env{'form.displayphotos'}; |
|
|
# Print out header |
# Print out header |
unless ($mode eq 'autoenroll') { |
unless ($mode eq 'autoenroll') { |
$r->print(<<END); |
$r->print(<<END); |
Line 1266 END
|
Line 1265 END
|
} |
} |
$r->print(<<END); |
$r->print(<<END); |
<input type="hidden" name="sortby" value="$sortby" /> |
<input type="hidden" name="sortby" value="$sortby" /> |
|
<input type="hidden" name="displayphotos" value="$displayphotos" /> |
END |
END |
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll') { |
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll') { |
if ($linkto eq 'aboutme') { |
if ($linkto eq 'aboutme') { |
Line 1280 END
|
Line 1280 END
|
'sec' => "section", |
'sec' => "section", |
'start' => "start date", |
'start' => "start date", |
'end' => "end date", |
'end' => "end date", |
'type' => "enroll type/action" |
'type' => "enroll type/action", |
|
'photo' => "photo", |
); |
); |
unless ($mode eq 'autoenroll') { |
unless ($mode eq 'autoenroll') { |
$r->print(<<END); |
$r->print(<<END); |
Line 1288 END
|
Line 1289 END
|
<input type="hidden" name="sdom" value="" /> |
<input type="hidden" name="sdom" value="" /> |
END |
END |
} |
} |
|
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
|
$r->print(' |
|
<script type="text/javascript"> |
|
function photowindow(photolink) { |
|
var title = "Photo_Viewer"; |
|
var options = "scrollbars=1,resizable=1,menubar=0"; |
|
options += ",width=240,height=240"; |
|
stdeditbrowser = open(photolink,title,options,"1"); |
|
stdeditbrowser.focus(); |
|
} |
|
</script> |
|
'); |
|
} |
$r->print(" |
$r->print(" |
<p> |
<p> |
<table border=2> |
<table border=2> |
Line 1318 END
|
Line 1332 END
|
</th><th> |
</th><th> |
<a href="javascript:document.studentform.sortby.value='end';document.studentform.submit();">$lt{'end'}</a> |
<a href="javascript:document.studentform.sortby.value='end';document.studentform.submit();">$lt{'end'}</a> |
</th> |
</th> |
</tr> |
|
END |
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(' <th>'."\n".' '. |
|
'<a href="javascript:document.studentform.displayphotos.value='. |
|
"'".$photochg."'".';document.studentform.submit();">'. |
|
$photo_options{$photochg}.'</a> '.$lt{'photo'}."\n". |
|
' </th>'."\n"); |
|
} |
|
$r->print(" </tr>\n"); |
} elsif ($mode eq 'csv') { |
} elsif ($mode eq 'csv') { |
# |
# |
# Open a file |
# Open a file |
Line 1457 END
|
Line 1486 END
|
<td>$section</td> |
<td>$section</td> |
<td>$start</td> |
<td>$start</td> |
<td>$end</td> |
<td>$end</td> |
</tr> |
|
END |
END |
|
if ($env{'course.'.$env{'request.course.id'}. |
|
'.internal.showphoto'}) { |
|
if ($displayphotos eq 'on') { |
|
my $imgurl = |
|
&Apache::lonnet::retrievestudentphoto($domain, |
|
$username,'gif', |
|
'thumbnail'); |
|
|
|
$r->print(' <td align="right"><a href="javascript:photowindow('."'".&Apache::lonnet::studentphoto($domain,$username,'jpg')."'".')"><img src="'.$imgurl.'" border="1"></a></td>'); |
|
} else { |
|
$r->print(' <td> </td> '); |
|
} |
|
} |
|
$r->print(' </tr> '); |
} elsif ($mode eq 'csv') { |
} elsif ($mode eq 'csv') { |
next if (! defined($CSVfile)); |
next if (! defined($CSVfile)); |
# no need to bother with $linkto |
# no need to bother with $linkto |
Line 1538 sub print_modify_student_form {
|
Line 1580 sub print_modify_student_form {
|
'<p>'. |
'<p>'. |
&mt('Unable to retrieve environment data for').' '.$sname. |
&mt('Unable to retrieve environment data for').' '.$sname. |
&mt('in domain').' '.$sdom.'</p><p>'. |
&mt('in domain').' '.$sdom.'</p><p>'. |
&mt('Please contact your LON-CAPA administrator regarding this situation.').'</p></body></html>'); |
&mt('Please contact your LON-CAPA administrator regarding this situation.').'</p>'.&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
# determine the students starting and ending times and section |
# determine the students starting and ending times and section |
Line 1627 $lt{'disn'}
|
Line 1669 $lt{'disn'}
|
<p>$current_date_description</p> |
<p>$current_date_description</p> |
<p>$date_table</p> |
<p>$date_table</p> |
<input type="submit" value="$lt{'sm'}" /> |
<input type="submit" value="$lt{'sm'}" /> |
</body></html> |
|
END |
END |
|
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 1636 END
|
Line 1678 END
|
# modify a single students section |
# modify a single students section |
# |
# |
sub modify_single_student { |
sub modify_single_student { |
my $r = shift; |
my ($r) = @_; |
# |
# |
# Remove non alphanumeric values from the section |
# Remove non alphanumeric values from the section |
$env{'form.section'} =~ s/\W//g; |
$env{'form.section'} =~ s/\W//g; |
Line 1778 END
|
Line 1820 END
|
<input type="hidden" name="sortby" value="$sortby" /> |
<input type="hidden" name="sortby" value="$sortby" /> |
<input type="hidden" name="Status" value="$status" /> |
<input type="hidden" name="Status" value="$status" /> |
<a href="javascript:document.studentform.submit();">$Masd</a> |
<a href="javascript:document.studentform.submit();">$Masd</a> |
</body></html> |
|
END |
END |
|
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
|
|
Line 2008 sub print_first_courselist_upload_form {
|
Line 2050 sub print_first_courselist_upload_form {
|
$str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
$str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV", |
&mt("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 .= &Apache::loncommon::end_page(); |
$r->print($str); |
$r->print($str); |
return; |
return; |
} |
} |
Line 2064 sub upfile_drop_add {
|
Line 2106 sub upfile_drop_add {
|
if (! exists($home_servers{$desiredhost})) { |
if (! exists($home_servers{$desiredhost})) { |
$r->print('<font color="#ff0000">'.&mt('Error').'</font>'. |
$r->print('<font color="#ff0000">'.&mt('Error').'</font>'. |
&mt('Invalid home server specified')); |
&mt('Invalid home server specified')); |
$r->print("</body>\n</html>\n"); |
$r->print(&Apache::loncommon::end_page()); |
return; |
return; |
} |
} |
} |
} |
Line 2436 sub handler {
|
Line 2478 sub handler {
|
} |
} |
# |
# |
# Finish up |
# Finish up |
$r->print('</form></body></html>'); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|