--- loncom/interface/lonpopulate.pm 2006/05/18 01:08:51 1.43
+++ 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.43 2006/05/18 01:08:51 raeburn Exp $
+# $Id: lonpopulate.pm,v 1.44 2006/07/27 23:24:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -479,6 +479,8 @@ ENDTWO
} elsif ($action eq "notify") {
my $notifycount = 0;
my @notified = split(/,/,$enrollvar{notifylist});
+ my @domcoord;
+ my @showdom;
for (my $i=0; $i<@notified; $i++) {
if ($notified[$i] !~ /:/) {
$notified[$i] =~ s/\@/:/;
@@ -491,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;
@@ -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) {
@@ -2287,8 +2363,12 @@ function agreement_result(caller) {
';
} else {
- my ($ownername,$owneremail) = &get_oenerinfo($dom,$courseowner);
- $response = &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);
+ my ($ownername,$owneremail) = &get_ownerinfo($dom,$courseowner);
+ my $emailstr;
+ if ($owneremail) {
+ $emailstr = "(e-mail: $owneremail)";
+ }
+ $response = &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);
}
&print_reply($r,$response,$$tasktitleref{$action});
}
@@ -2426,11 +2506,19 @@ function photowindow(photolink) {
sub get_ownerinfo {
my ($dom,$owner) = @_;
- my ($ownername,$owneremail);
+ my ($ownername,$owneremail,$own_uname,$own_udom);
if ($owner) {
- $ownername=&Apache::loncommon::plainname($owner,$dom,'firstname');
+ if ($owner =~ /^([^:]+):([^:]+)$/) {
+ $own_uname = $1;
+ $own_udom = $2;
+ } else {
+ $own_uname = $owner;
+ $own_udom = $dom;
+ }
+ $ownername=&Apache::loncommon::plainname($own_uname,$own_udom,
+ 'firstname');
my %ownerinfo = &Apache::lonnet::get('environment',['permanentemail'],
- $dom,$owner);
+ $own_udom,$own_uname);
$owneremail = $ownerinfo{'permanentemail'};
}
return ($ownername,$owneremail);