--- loncom/interface/lonpopulate.pm 2006/03/15 22:11:04 1.41
+++ loncom/interface/lonpopulate.pm 2006/07/27 23:24:19 1.44
@@ -1,5 +1,5 @@
# automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.41 2006/03/15 22:11:04 albertel Exp $
+# $Id: lonpopulate.pm,v 1.44 2006/07/27 23:24:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -32,6 +32,7 @@ use Apache::loncommon;
use Apache::lonhtmlcommon;
use Apache::lonlocal;
use Apache::loncoursedata;
+use Apache::longroup;
use Apache::Constants qw(:common :http REDIRECT);
use Time::Local;
use LONCAPA::Enrollment;
@@ -299,7 +300,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 settings" to enable or disable automatic import of photos for registered students in your course.
+
Use "Student photo settings" to enable or disable automatic import of photos for registered students in your course.
@@ -478,8 +479,13 @@ ENDTWO
} elsif ($action eq "notify") {
my $notifycount = 0;
my @notified = split(/,/,$enrollvar{notifylist});
- foreach (@notified) {
- unless ($_ eq '') { $notifycount ++; }
+ my @domcoord;
+ my @showdom;
+ for (my $i=0; $i<@notified; $i++) {
+ if ($notified[$i] !~ /:/) {
+ $notified[$i] =~ s/\@/:/;
+ }
+ unless ($notified[$i] eq '') { $notifycount ++; }
}
my $noteset = '';
if ($notifycount) {
@@ -487,7 +493,15 @@ ENDTWO
} else {
$noteset = "OFF";
}
-
+ 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);
+ if (!grep/^$uname:$udom$/,@domcoord) {
+ push(@domcoord,$uname.':'.$udom);
+ }
+ }
+ }
$r->print("
+
+
+
+
+
");
} elsif ($action eq "crosslist") {
my @xlists;
@@ -637,42 +675,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 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/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
+
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.
@@ -785,36 +822,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 store 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.
@@ -881,16 +913,22 @@ 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'};
+ }
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 eq $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')).'
');
@@ -919,7 +957,7 @@ your changes.
');
} else {
- if ($env{'user.name'} eq $enrollvar{'courseowner'}) {
+ if ($user eq $enrollvar{'courseowner'}) {
$r->print('
'.
@@ -937,7 +975,7 @@ your changes.
$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).'
+&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).'
@@ -1133,6 +1171,44 @@ END
}
}
+sub notifier_tables {
+ my ($role,$lt,$users,$status,$notifystate,$pname,$notifyshow) = @_;
+ my $output = &Apache::loncommon::start_data_table();
+ $output .= &Apache::loncommon::start_data_table_header_row();
+ $output .= "
not enabled as no course coordinators were selected as recipients. ";
+ $response = &mt('Notification of enrollment changes was not enabled as no [_1]s were selected as recipients. ',&Apache::lonnet::plaintext('cc'));
}
} else {
if ($currcount) {
@@ -1644,14 +1720,14 @@ sub print_crosslistings_menu () {
if (@currxlists > 0) {
for (my $i=0; $i<@currxlists; $i++) {
my $xlist = "cross_".$i;
- my $gp = "gp_".$i;
+ my $lc_sec = "lcsec_".$i;
if ( exists($env{"form.$xlist"}) ) {
my $xlistentry = '';
if ($currxlists[$i] =~ m/^([^:]+)/) {
$xlistentry = $1.':';
}
- if ( exists($env{"form.$gp"}) ) {
- $xlistentry .= $env{"form.$gp"};
+ if ( exists($env{"form.$lc_sec"}) ) {
+ $xlistentry .= $env{"form.$lc_sec"};
}
push @xlists,$xlistentry;
$crosscount ++;
@@ -1674,8 +1750,8 @@ sub print_crosslistings_menu () {
if ($crosscount > 0) {
$response .= "The $crosscount courses listed below remain crosslisted with this LON-CAPA course, and 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.
\n";
+ my ($xlist,$lc_sec) = split/:/,$_;
+ $response .= "
$xlist - ID: $lc_sec
\n";
}
$response .= "
\n";
}
@@ -1684,27 +1760,25 @@ sub print_crosslistings_menu () {
my $numcross = $env{'form.numcross'};
if ($numcross > 0) {
my @bgcolors=("#eeeeee","#cccccc");
- $response .= qq(You indicated that you wish to add an additional $numcross crosslisting(s). For each new crosslisting enter the insititutional course section code (e.g., fs03zol101001, for section 001 of zol101 for fs03 semester), and the LON-CAPA section/group ID you wish to assign to students who will be enrolled in your LON-CAPA class as a result of their registration in the crosslisted course section. The LON-CAPA section/group ID can be left blank, if you do not wish to tie a section/group ID to this crosslisting. The institutional course section code should only contain letters and/or numbers, and must be consistent with the scheme adopted by your Domain Coordinator to map course codes (and section numbers) to your institution\'s student information system.