--- loncom/interface/lonpopulate.pm 2006/08/10 21:46:40 1.47
+++ loncom/interface/lonpopulate.pm 2008/12/11 14:55:15 1.57
@@ -1,5 +1,5 @@
# automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.47 2006/08/10 21:46:40 albertel Exp $
+# $Id: lonpopulate.pm,v 1.57 2008/12/11 14:55:15 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,6 +33,7 @@ use Apache::lonhtmlcommon;
use Apache::lonlocal;
use Apache::loncoursedata;
use Apache::longroup;
+use Apache::lonuserutils;
use Apache::Constants qw(:common :http REDIRECT);
use Time::Local;
use LONCAPA::Enrollment;
@@ -207,9 +208,9 @@ sub print_mainbox {
}
my $page = '';
if ($action eq "information") {
- $page = "Automated Enrollment";
+ $page = "".&mt("Automated Enrollment")."";
} else {
- $page = 'Automated Enrollment';
+ $page = ''.&mt('Automated Enrollment').'';
if ($reply) {
if ($action eq "newcross") {
$action = "crosslist";
@@ -221,14 +222,16 @@ sub print_mainbox {
$page .= " -> ".$$tasklongref{$action}."";
}
}
+ my $usrmang = &mt('User Management');
+ my $autenrl = &mt('Automated Enrollment Manager');
$r->print(<
@@ -397,7 +400,7 @@ ENDTWO
- $realm -> Enrollment Manager -> $page
+ $realm -> $usrmang -> $page
- Automated Enrollment Manager
+ $autenrl
@@ -673,7 +676,7 @@ ENDTWO
if ((@ccs + @showdom) > $notifycount) {
$r->print(&mt("Check the checkbox(es) to initiate notification for people not currently informed of roster changes from the nightly enrollment update.
-Note: Any students added manually by course coordinators using the Enrollment Manager will be unaffected by the nightly removal process if you choose to enable it.
+Note: Any students added manually by course coordinators using the User Manager will be unaffected by the nightly removal process if you choose to enable it.
"));
}
- $r->print(&mt("Click 'Go' to store your changes.")."
+ $r->print(&mt("Click 'Go' to save your changes.")."
@@ -793,8 +796,7 @@ ENDTWO
@@ -707,7 +710,7 @@ ENDTWO
");
if ($cross_str > 0) {
$r->print("
- Currently, this LON-CAPA course is crosslisted with $cross_str course section(s). Students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each crosslisting, leave the checkbox checked if you want registered students in that course to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you wish to change the section ID assigned in your LON-CAPA course for a crosslisted course, enter the new section ID in the appropriate textbox. The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this crosslisting. If you wish to add new crosslisted courses, enter the number of new courses to add in the textbox at the bottom of the page. You will provide information about each of the new crosslistings on a subsequent page. Click 'Go' to store your changes.
+ Currently, this LON-CAPA course is crosslisted with $cross_str course section(s). Students enrolling in these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each crosslisting, leave the checkbox checked if you want registered students in that course to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you wish to change the section ID assigned in your LON-CAPA course for a crosslisted course, enter the new section ID in the appropriate textbox. The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this crosslisting. If you wish to add new crosslisted courses, enter the number of new courses to add in the textbox at the bottom of the page. You will provide information about each of the new crosslistings on a subsequent page. Click 'Go' to save your changes.
-
For each section, check the checkbox if you want registered students in that section to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you want to change the section ID designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section ID textbox and enter the new value. The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this section. To add a new section, check the 'Enrollment in this course?' checkbox, and enter the desired LON-CAPA section ID in the appropriate textbox. Click 'Go' to store
-your changes.
+ For each section, check the checkbox if you want registered students in that section to be included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise uncheck it. If you want to change the section ID designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section ID textbox and enter the new value. The LON-CAPA section ID can be left (or set to) empty, if you do not wish to tie a section ID to this section. To add a new section, check the 'Enrollment in this course?' checkbox, and enter the desired LON-CAPA section ID in the appropriate textbox. Click 'Go' to save your changes.
@@ -854,7 +856,7 @@ your changes.
if (@currsections) {
my $secshow = @currsections;
$r->print("
- Currently, this LON-CAPA course incorporates enrollment from $secshow sections. Students enrolling in any of these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each section, uncheck the checkbox if you want registered students in that section to cease being included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise leave it checked. If you want to change the section ID designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section ID textbox and enter the new value. If you wish to add new course section, enter the number of new sections to add in the textbox at the bottom of the page. You will provide information about each of the new sections on a subsequent page. Click 'Go' to store your changes.
+ Currently, this LON-CAPA course incorporates enrollment from $secshow sections. Students enrolling in any of these course sections will be automatically added to the class roster for the course, if you have chosen to enable a nightly automated enrollment update. For each section, uncheck the checkbox if you want registered students in that section to cease being included in the student roster for LON-CAPA course: $realm ($enrollvar{coursecode}); otherwise leave it checked. If you want to change the section ID designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section ID textbox and enter the new value. If you wish to add new course section, enter the number of new sections to add in the textbox at the bottom of the page. You will provide information about each of the new sections on a subsequent page. Click 'Go' to save your changes.
@@ -944,23 +946,17 @@ your changes.
');
my ($result,$perm_reqd)=&Apache::lonnet::auto_photo_permission($crs,$dom);
my $can_enable = 1;
- my $institution = $Apache::lonnet::domaindescription{$dom};
- my $user;
- if ($enrollvar{'courseowner'} =~ /^[^:]+:[^:]+$/) {
- $user = $env{'user.name'}.':'.$env{'user.domain'};
- } else {
- $user = $env{'user.name'};
- }
+ my $institution = &Apache::lonnet::domain($dom,'description');
if ($result eq 'ok') {
if ($perm_reqd eq 'yes') {
if (!($enrollvar{'photopermission'} eq 'yes')) {
$can_enable = 0;
} else {
- if ($user eq $enrollvar{'courseowner'}) {
+ if (&user_is_courseowner($enrollvar{'courseowner'})) {
$r->print('
');
@@ -983,13 +979,13 @@ your changes.
'.
-&mt('Previously the owner of this course agreed to the conditions of use of digital student photos required by [_1].', $institution).'
'.&mt('As a result [_1]s can choose to automatically import student photos into this course.',&Apache::lonnet::plaintext('cc')).'
'.&mt('As a result [_1]s can choose to automatically import student photos into this course.',&Apache::lonnet::plaintext('cc')).'
');
} else {
- if ($user eq $enrollvar{'courseowner'}) {
+ if (&user_is_courseowner($enrollvar{'courseowner'})) {
$r->print('
'.
-&mt('Note: if you enable automatic import of student photos, your course will automatically have access to photos stored by your institution for officially registered students, via a conduit established by your LON-CAPA domain coordinator.').'
+&mt('Note: if you enable automatic import of student photos, your course will automatically have access to photos saved by your institution for officially registered students, via a conduit established by your LON-CAPA domain coordinator.').'
'.
@@ -1006,8 +1002,11 @@ your changes.
}
$r->print('
-
@@ -1095,7 +1094,8 @@ onclick="javascript:document.photoupdate
');
} else {
- $r->print(&mt('Update of photos via the Automated Enrollment Manager is unavailable in this domain.').''.
-&mt('The policies of your institution ([_1]) require that the course owner ([_2]) must indicate acceptance of the conditions of use of digital photos of registered students, before they may be made available for use in a course.',$institution,$ownername).'
'.&mt('Please direct the course owner [_1] to visit the "Student photos" page in the Automated Enrollment Manager to indicate acceptance of these conditions of use.',$emailstr).'
+ '
+ .&mt('The policies of your institution ([_1]) require that the course owner ([_2]) must indicate acceptance of the conditions of use of digital photos of registered students, before they may be made available for use in a course.',$institution,$ownername)
+ .'
'
+ .&mt('Please direct the course owner [_1] to visit the "Student photos" page in the Automated Enrollment Manager to indicate acceptance of these conditions of use.',$emailstr)
+ .'
');
+ $r->print(&mt('Update of photos via the Automated Enrollment Manager is unavailable in this domain.')
+ .'
');
}
} else {
$r->print('Update of photos is unavailable, as import of student photos is currently disabled.
Enable this first via: '.$$tasktitleref{'photos'}.'');
@@ -1128,16 +1128,34 @@ onclick="javascript:document.photoupdate
}
my $status_select = &Apache::lonhtmlcommon::StatusOptions($env{'form.Status'});
# Get current classlist
- my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();
+ my %userlist;
+ my ($indexhash,$keylist) = &Apache::lonuserutils::make_keylist_array();
+ my $classlist = &Apache::loncoursedata::get_classlist();
+ my $secidx = &Apache::loncoursedata::CL_SECTION();
+ my ($permission,$allowed) = &Apache::lonuserutils::get_permission();
+ foreach my $student (keys(%{$classlist})) {
+ if (exists($permission->{'view_section'})) {
+ if ($classlist->{$student}[$secidx] ne $permission->{'view_section'}) {
+ next;
+ } else {
+ $userlist{$student} = $classlist->{$student};
+ }
+ } else {
+ $userlist{$student} = $classlist->{$student};
+ }
+ }
+
if (! defined($classlist)) {
- $r->print(&mt('There are no students either currently or previously enrolled.').
- "\n");
+ $r->print(&mt('There are no students either currently or previously enrolled.')."
+
+ \n");
} else {
$r->print(&mt('Student Status: [_1]',$status_select)."\n");
$r->print(''.
"\n