@@ -245,8 +243,8 @@ ENDTHIS
sub print_navmenu {
my ($r,$tasksref,$tasklongref) = @_;
my $action = "information";
- if (exists($ENV{'form.action'}) ) {
- $action = $ENV{'form.action'};
+ if (exists($env{'form.action'}) ) {
+ $action = $env{'form.action'};
}
$r->print(<
@@ -284,8 +282,8 @@ ENDONE
sub print_main_frame {
my ($r,$realm,$dom,$crs,$tasktitleref) = @_;
my $action = "information";
- if (exists($ENV{'form.action'}) ) {
- $action = $ENV{'form.action'};
+ if (exists($env{'form.action'}) ) {
+ $action = $env{'form.action'};
}
# Get course settings
@@ -331,7 +329,7 @@ sub print_main_frame {
Use "Section settings" to make changes to the choice of sections included for enrollment in your LON-CAPA course.
-
Use "Student photos" to enable or disable automatic upload of student photos to your course.
+
Use "Student photo settings" to enable or disable automatic import of photos for registered students in your course.
@@ -339,6 +337,10 @@ sub print_main_frame {
+
Use "Update student photos" to import your institution's most current digital photos for registered students in your course.
+
+
+
Use "View students and change type" to display the current course roster, and (optionally) change enrollment type for selected students from 'auto' to 'manual' and vice versa.
-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") {
@@ -481,12 +483,12 @@ Note: Any students added manually by cou
-
-
+
+
ENDTWO
} elsif ($action eq "notify") {
- my @notified = ();
- if ($enrollvar{notifylist} =~ m/,/) {
- @notified = split/,/,$enrollvar{notifylist};
- } else {
- @notified = $enrollvar{notifylist};
- }
my $notifycount = 0;
- foreach (@notified) {
- unless ($_ eq '') { $notifycount ++; }
+ my @notified = split(/,/,$enrollvar{notifylist});
+ 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) {
@@ -520,7 +521,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 = ();
- if ($enrollvar{crosslistings} =~ m/,/) {
- @xlists = split/,/,$enrollvar{crosslistings};
- } elsif ($enrollvar{crosslistings} ne '') {
- $xlists[0] = $enrollvar{crosslistings};
+ my @xlists;
+ if ($enrollvar{crosslistings} ne '') {
+ @xlists = split(/,/,$enrollvar{crosslistings});
}
my $cross_str = @xlists;
$r->print("
@@ -672,42 +733,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 {
@@ -825,36 +879,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.
@@ -877,12 +926,12 @@ your changes.
@@ -903,40 +952,105 @@ 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("
+ $r->print('
+ ');
+ my ($result,$perm_reqd)=&Apache::lonnet::auto_photo_permission($crs,$dom);
+ my $can_enable = 1;
+ 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_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 [_1]s can choose to automatically import student photos into this course.',&Apache::lonnet::plaintext('cc')).'
+
+
+ ');
+ }
+ }
+ }
+ } else {
+ $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').'
-
-Note: if you enable automatic import of student photos, your course will automatically have access to photos stored by your institution for all 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.').'
'.
+&mt('[_1] requires a course owner to indicate acceptance of conditions of use of digital student photos before enabling automatic import into a course. If you choose to enable import of photos you will be prompted for your agreement on the next page.',$institution).'
+
+
+ ');
+ } 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 [_1] to visit the "Student photos" page in the Automated Enrollment Manager to indicate acceptance of these conditions of use.',$emailstr)
+ .'
");
+ 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'}.'');
+ }
+ $r->print('