version 1.134, 2006/02/07 05:08:32
|
version 1.139, 2006/04/22 01:06:48
|
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 172 sub print_main_menu {
|
Line 166 sub print_main_menu {
|
permission => &Apache::lonnet::auto_run($cnum,$cdom), |
permission => &Apache::lonnet::auto_run($cnum,$cdom), |
url => '/adm/populate', |
url => '/adm/populate', |
}, |
}, |
# { text => 'Create a new group', |
{ text => 'Create a new group', |
# help => 'Course_Create_Group', |
help => 'Course_Create_Group', |
# permission => $grp_manage_permission, |
permission => $grp_manage_permission, |
# url => '/adm/coursegroups?refpage=enrl&action=create', |
url => '/adm/coursegroups?refpage=enrl&action=create', |
# }, |
}, |
# { text => 'Modify an existing group', |
{ text => 'Modify an existing group', |
# help => 'Course_Modify_Group', |
help => 'Course_Modify_Group', |
# permission => $grp_manage_permission, |
permission => $grp_manage_permission, |
# url => '/adm/coursegroups?refpage=enrl&action=modify', |
url => '/adm/coursegroups?refpage=enrl&action=modify', |
# }, |
}, |
# { text => 'Delete an existing group', |
{ text => 'Delete an existing group', |
# help => 'Course_Delete_Group', |
help => 'Course_Delete_Group', |
# permission => $grp_manage_permission, |
permission => $grp_manage_permission, |
# url => '/adm/coursegroups?refpage=enrl&action=delete', |
url => '/adm/coursegroups?refpage=enrl&action=delete', |
# }, |
}, |
# { text => 'Enter an existing group', |
{ text => 'Enter an existing group', |
# help => 'Course_Display_Group', |
help => 'Course_Display_Group', |
# permission => $grp_view_permission, |
permission => $grp_view_permission, |
# url => '/adm/coursegroups?refpage=enrl&action=view', |
url => '/adm/coursegroups?refpage=enrl&action=view', |
# }, |
}, |
); |
); |
my $menu_html = ''; |
my $menu_html = ''; |
foreach my $menu_item (@menu) { |
foreach my $menu_item (@menu) { |
Line 1187 sub print_html_classlist {
|
Line 1181 sub print_html_classlist {
|
$env{'form.output'} = 'html'; |
$env{'form.output'} = 'html'; |
} |
} |
# |
# |
$r->print('<br /><table border="2">'); |
$r->print('<br />'.&Apache::loncommon::start_data_table()); |
foreach my $role (sort keys %coursepersonnel) { |
foreach my $role (sort keys %coursepersonnel) { |
next if ($role =~ /^\s*$/); |
next if ($role =~ /^\s*$/); |
$r->print('<tr><td>'.$role.'</td><td>'); |
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td>'.$role.'</td><td>'); |
foreach my $user (split(',',$coursepersonnel{$role})) { |
foreach my $user (split(',',$coursepersonnel{$role})) { |
my ($puname,$pudom)=split(':',$user); |
my ($puname,$pudom)=split(':',$user); |
$r->print(' '.&Apache::loncommon::aboutmewrapper( |
$r->print(' '.&Apache::loncommon::aboutmewrapper( |
Line 1198 sub print_html_classlist {
|
Line 1193 sub print_html_classlist {
|
$pudom), |
$pudom), |
$puname,$pudom)); |
$puname,$pudom)); |
} |
} |
$r->print('</td></tr>'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print('</table>'); |
$r->print(&Apache::loncommon::end_data_table()); |
# |
# |
# Interface output |
# Interface output |
$r->print('<input type="hidden" name="action" value="'. |
$r->print('<input type="hidden" name="action" value="'. |
Line 1295 END
|
Line 1290 END
|
<input type="hidden" name="sdom" value="" /> |
<input type="hidden" name="sdom" value="" /> |
END |
END |
} |
} |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphotos'}) { |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
$r->print(' |
$r->print(' |
<script type="text/javascript"> |
<script type="text/javascript"> |
function photowindow(photolink) { |
function photowindow(photolink) { |
Line 1310 function photowindow(photolink) {
|
Line 1305 function photowindow(photolink) {
|
} |
} |
$r->print(" |
$r->print(" |
<p> |
<p> |
<table border=2> |
".&Apache::loncommon::start_data_table()." |
<tr> |
<tr> |
"); |
"); |
if ($mode eq 'autoenroll') { |
if ($mode eq 'autoenroll') { |
Line 1339 function photowindow(photolink) {
|
Line 1334 function photowindow(photolink) {
|
<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> |
END |
END |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphotos'}) { |
if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) { |
my %photo_options = &Apache::lonlocal::texthash ( |
my %photo_options = &Apache::lonlocal::texthash( |
'on' => 'Show', |
'on' => 'Show', |
'off' => 'Hide', |
'off' => 'Hide', |
); |
); |
Line 1445 END
|
Line 1440 END
|
} else { |
} else { |
$end = &Apache::lonlocal::locallocaltime($end); |
$end = &Apache::lonlocal::locallocaltime($end); |
} |
} |
$r->print("<tr>\n "); |
$r->print(&Apache::loncommon::start_data_table_row()); |
if ($mode eq 'autoenroll') { |
if ($mode eq 'autoenroll') { |
my $lockedtype = $sdata->[$index{'lockedtype'}]; |
my $lockedtype = $sdata->[$index{'lockedtype'}]; |
$studentcount++; |
$studentcount++; |
Line 1494 END
|
Line 1489 END
|
<td>$end</td> |
<td>$end</td> |
END |
END |
if ($env{'course.'.$env{'request.course.id'}. |
if ($env{'course.'.$env{'request.course.id'}. |
'.internal.showphotos'}) { |
'.internal.showphoto'}) { |
if ($displayphotos eq 'on') { |
if ($displayphotos eq 'on') { |
my $imgurl = &Apache::lonnet::retrievestudentphoto($domain, |
my $imgurl = |
$username,'gif','thumbnail'); |
&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>'); |
$r->print(' <td align="right"><a href="javascript:photowindow('."'".&Apache::lonnet::studentphoto($domain,$username,'jpg')."'".')"><img src="'.$imgurl.'" border="1"></a></td>'); |
} else { |
} else { |
$r->print(' <td> </td> '); |
$r->print(' <td> </td> '); |
} |
} |
} |
} |
$r->print(' </tr> '); |
$r->print(&Apache::loncommon::end_data_table_row()); |
} 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 1544 END
|
Line 1541 END
|
} |
} |
} |
} |
if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') { |
if ($mode eq 'view' || $mode eq 'html' || $mode eq 'autoenroll') { |
$r->print('</table><br>'); |
$r->print(&Apache::loncommon::end_data_table().'<br />'); |
} elsif ($mode eq 'excel') { |
} elsif ($mode eq 'excel') { |
$excel_workbook->close(); |
$excel_workbook->close(); |
$r->print('<p><a href="'.$excel_filename.'">'. |
$r->print('<p><a href="'.$excel_filename.'">'. |
Line 1584 sub print_modify_student_form {
|
Line 1581 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 1673 $lt{'disn'}
|
Line 1670 $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 1682 END
|
Line 1679 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 1824 END
|
Line 1821 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 1928 my %lt=&Apache::lonlocal::texthash('usrn
|
Line 1925 my %lt=&Apache::lonlocal::texthash('usrn
|
'end' => "end date", |
'end' => "end date", |
); |
); |
if ($nosort) { |
if ($nosort) { |
|
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(<<END); |
$r->print(<<END); |
<table border=2> |
|
<tr> |
<tr> |
<th> </th> |
<th> </th> |
<th>$lt{'usrn'}</th> |
<th>$lt{'usrn'}</th> |
Line 1943 my %lt=&Apache::lonlocal::texthash('usrn
|
Line 1940 my %lt=&Apache::lonlocal::texthash('usrn
|
END |
END |
|
|
} else { |
} else { |
|
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(<<END); |
$r->print(<<END); |
<table border=2> |
|
<tr><th> </th> |
<tr><th> </th> |
<th> |
<th> |
<a href="/adm/dropadd?action=$action&sortby=username">$lt{'usrn'}</a> |
<a href="/adm/dropadd?action=$action&sortby=username">$lt{'usrn'}</a> |
Line 2004 END
|
Line 2001 END
|
my $status = $sdata->[$index{'status'}]; |
my $status = $sdata->[$index{'status'}]; |
next if ($status ne 'Active'); |
next if ($status ne 'Active'); |
# |
# |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<tr> |
|
<td><input type="checkbox" name="droplist" value="$student"></td> |
<td><input type="checkbox" name="droplist" value="$student"></td> |
<td>$username</td> |
<td>$username</td> |
<td>$domain</td> |
<td>$domain</td> |
Line 2014 END
|
Line 2011 END
|
<td>$section</td> |
<td>$section</td> |
<td>$start</td> |
<td>$start</td> |
<td>$end</td> |
<td>$end</td> |
</tr> |
|
END |
END |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print('</table><br>'); |
$r->print(&Apache::loncommon::end_data_table().'<br />'); |
%lt=&Apache::lonlocal::texthash( |
%lt=&Apache::lonlocal::texthash( |
'dp' => "Drop Students", |
'dp' => "Drop Students", |
'ca' => "check all", |
'ca' => "check all", |
Line 2054 sub print_first_courselist_upload_form {
|
Line 2051 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 2110 sub upfile_drop_add {
|
Line 2107 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 2482 sub handler {
|
Line 2479 sub handler {
|
} |
} |
# |
# |
# Finish up |
# Finish up |
$r->print('</form></body></html>'); |
$r->print('</form>'.&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|