-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.
-
+
-
-
+
+
");
} elsif ($action eq "setdates") {
@@ -412,7 +427,7 @@ Note: Any students added manually by cou
}
my $dateshow;
if ( ($oldendshow eq '') && ($oldstartshow eq '') ) {
- $dateshow = " Warning. Currently NO first enrollment or last enrollment dates are set. You must use this menu to set a start date and an end date if you plan to utilise automated adds and/or drops in this course.\n";
+ $dateshow = " Warning. Currently NO first enrollment or last enrollment dates are set. You must use this menu to set a start date and an end date if you plan to utilise automated adds and/or drops in this course.\n";
} else {
$dateshow = "Currently: First enrollment: $oldstartshow, Last enrollment: $oldendshow\n";
}
@@ -466,12 +481,12 @@ Note: Any students added manually by cou
-
-
+
+
ENDTWO
} elsif ($action eq "notify") {
my $notifycount = 0;
my @notified = split(/,/,$enrollvar{notifylist});
- foreach (@notified) {
- unless ($_ eq '') { $notifycount ++; }
+ my (@domcoord,@showdom,@olddomcoord,@futuredomcoord);
+ for (my $i=0; $i<@notified; $i++) {
+ if ($notified[$i] !~ /:/) {
+ $notified[$i] =~ s/\@/:/;
+ }
+ unless ($notified[$i] eq '') { $notifycount ++; }
}
my $noteset = '';
if ($notifycount) {
@@ -500,7 +519,29 @@ ENDTWO
} else {
$noteset = "OFF";
}
-
+ my $now = time;
+ my %dompersonnel = &Apache::lonnet::get_domain_roles($dom,['dc']);
+ foreach my $server (keys(%dompersonnel)) {
+ foreach my $user (sort(keys(%{$dompersonnel{$server}}))) {
+ my ($trole,$uname,$udom,$runame,$rudom,$rsec) = split(/:/,$user);
+ my ($end,$start) = split(':',$dompersonnel{$server}{$user});
+ if (($end eq '') || ($end == 0) || ($end > $now)) {
+ if ($start > $now) {
+ if (!grep(/^\Q$uname\E:\Q$udom\E$/,@futuredomcoord)) {
+ push(@futuredomcoord,$uname.':'.$udom);
+ }
+ } else {
+ if (!grep(/^\Q$uname\E:\Q$udom\E$/,@domcoord)) {
+ push(@domcoord,$uname.':'.$udom);
+ }
+ }
+ } else {
+ if (!grep(/^\Q$uname\E:\Q$udom\E$/,@olddomcoord)) {
+ push(@olddomcoord,$uname.':'.$udom);
+ }
+ }
+ }
+ }
$r->print("
+
+
+
+
+
");
} elsif ($action eq "crosslist") {
my @xlists;
@@ -650,42 +731,37 @@ 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/group ID assigned in your LON-CAPA course for a crosslisted course, enter the new section/group ID in the appropriate textbox. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group 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/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/group textbox and enter the new value. The LON-CAPA section/group ID can be left (or set to) empty, if you do not wish to tie a section/group ID to this section. To add a new section, check the 'Enrollment in this course?' checkbox, and enter the desired LON-CAPA section/groupID 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.
-
-
+
+
");
} else {
@@ -798,36 +877,31 @@ 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/group designation used for this section in LON-CAPA, delete the current value in the LON-CAPA section/groupID 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.
-
- ");
+ $r->print(&Apache::loncommon::end_data_table());
} else {
$r->print("
Currently no sections of $realm ($enrollvar{coursecode}) are contributing enrollment to the LON-CAPA class roster.
@@ -850,12 +924,12 @@ your changes.
@@ -876,15 +950,15 @@ your changes.
Automatic import of student photos from institutional data repository:
");
- if ($enrollvar{showphotos}) {
+ if ($enrollvar{showphoto}) {
$r->print("
- Yes
- No
+
+
");
} else {
$r->print("
- Yes
- No
+
+
");
}
$r->print('
@@ -893,17 +967,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 $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 ($env{'user.name'} eq $enrollvar{'courseowner'}) {
+ if (&user_is_courseowner($enrollvar{'courseowner'})) {
$r->print('
'.
-&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 Course Coordinators can choose to automatically import student photos into this course.').'
+&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')).'
');
@@ -914,7 +988,7 @@ your changes.
$r->print('
'.
-&mt('There was a problem determining whether course owner permission is required in order for a course coordinator to have access to student photos in this domain.').' '.&mt('As a result you will not be able to configure access to student photos at this time').'
+&mt('There was a problem determining whether course owner permission is required in order for a course coordinator to have access to student photos in this domain.').' '.&mt('As a result you will not be able to configure access to student photos at this time').'
@@ -926,13 +1000,13 @@ your changes.
'.
-&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.').'
');
} else {
- if ($env{'user.name'} eq $enrollvar{'courseowner'}) {
+ if (&user_is_courseowner($enrollvar{'courseowner'})) {
$r->print('
'.
@@ -943,10 +1017,17 @@ your changes.
} else {
my ($ownername,$owneremail) = &get_ownerinfo($dom,
$enrollvar{'courseowner'});
+ my $emailstr;
+ if ($owneremail) {
+ $emailstr = "(e-mail: $owneremail)";
+ }
$r->print('
-
'.
-&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 (e-mail: [_1]) to visit the "Student photos" page in the Automated Enrollment Manager to indicate acceptance of these conditions of use',$owneremail).'
+
'
+ .&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)
+ .'
Add any students currently included in institutional classlist(s) but not enrolled in your LON-CAPA course.
- Yes No
+
+
Expire students previously added by nightly enrollment process, but no longer listed in institutional classlist(s).
- Yes
- No
+
+
@@ -1006,7 +1088,7 @@ Note: Any students previously added manu
-
+
@@ -1021,16 +1103,21 @@ Note: Any students previously added manu
$$tasktitleref{$action}
");
- if ($enrollvar{'showphotos'}) {
- my ($update,$commentary) = &Apache::lonnet::auto_photochoice(
- $crs,$dom);
- $r->print(' '.$commentary.'
+ if ($enrollvar{'showphoto'}) {
+ my ($update,$commentary) = &Apache::lonnet::auto_photochoice($crs,
+ $dom);
+ if ($update) {
+ $r->print(' '.$commentary.'
');
+ } else {
+ $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'}.'');
}
@@ -1057,21 +1144,40 @@ onclick="javascript:document.photoupdate
if (! exists($env{'form.sortby'})) {
$env{'form.sortby'} = 'username';
}
- if ($env{'form.Status'} !~ /^(Any|Expired|Active)$/) {
+ if ($env{'form.Status'} !~ /^(Any|Expired|Active|Future)$/) {
$env{'form.Status'} = 'Active';
}
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 $crstype =&Apache::loncommon::course_type();
+ my ($permission,$allowed) = &Apache::lonuserutils::get_permission('course',$crstype);
+ 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.')."
+