--- loncom/interface/lonpopulate.pm 2010/01/22 13:20:04 1.62.4.2
+++ loncom/interface/lonpopulate.pm 2009/07/17 22:24:08 1.64
@@ -1,5 +1,5 @@
# automated enrollment configuration handler
-# $Id: lonpopulate.pm,v 1.62.4.2 2010/01/22 13:20:04 raeburn Exp $
+# $Id: lonpopulate.pm,v 1.64 2009/07/17 22:24:08 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -508,7 +508,8 @@ ENDTWO
} elsif ($action eq "notify") {
my $notifycount = 0;
my @notified = split(/,/,$enrollvar{notifylist});
- my (@domcoord,@showdom,@olddomcoord,@futuredomcoord);
+ my @domcoord;
+ my @showdom;
for (my $i=0; $i<@notified; $i++) {
if ($notified[$i] !~ /:/) {
$notified[$i] =~ s/\@/:/;
@@ -521,26 +522,12 @@ 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);
- }
+ if (!grep(/^$uname:$udom$/,@domcoord)) {
+ push(@domcoord,$uname.':'.$udom);
}
}
}
@@ -578,6 +565,7 @@ ENDTWO
my %pname;
my %notifystate;
my %status;
+ my $now = time;
foreach my $person (sort(keys(%coursepersonnel))) {
my $match = 0;
my ($role,$user,$usec) = ($person =~ /^([^:]+):([^:]+:[^:]+):([^:]*)/);
@@ -613,7 +601,6 @@ ENDTWO
usnm => 'username:domain',
coac => 'Course Access',
curn => 'Current notification status',
- doms => 'Domain Coordinator status',
notf => 'Notification?',
ntac => 'Notification active',
ntin => 'Notification inactive',
@@ -643,7 +630,7 @@ ENDTWO
if (grep(/^$viewer$/,@domcoord)) {
$showalldc = 1;
}
- foreach my $dc (@domcoord,@futuredomcoord) {
+ foreach my $dc (@domcoord) {
if (!grep(/^$dc$/,@ccs)) {
if (grep(/^$dc$/,@notified)) {
$notifystate{$dc} = 1;
@@ -658,16 +645,6 @@ ENDTWO
push(@showdom,$dc);
}
}
- foreach my $olddc (@olddomcoord) {
- if (grep(/^$olddc$/,@notified)) {
- if (!grep(/^\Q$olddc\E$/,@ccs)) {
- $notifystate{$olddc} = 1;
- my ($dcname,$dcdom) = split(/:/,$olddc);
- $pname{$olddc} = &Apache::loncommon::plainname($dcname,$dcdom);
- push(@showdom,$olddc);
- }
- }
- }
my $showdomnum = scalar(@showdom);
if ($showdomnum) {
$r->print("
@@ -685,8 +662,8 @@ ENDTWO
");
- $r->print(¬ifier_tables('dc',\%lt,\@showdom,\%status,\%notifystate,\%pname,
- \$notifyshow,\@olddomcoord,\@futuredomcoord));
+ $r->print(¬ifier_tables('dc',\%lt,\@showdom,\%status,\%notifystate,
+ \%pname,\$notifyshow));
$r->print("
|
");
@@ -1155,8 +1132,7 @@ onclick="javascript:document.photoupdate
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);
+ 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'}) {
@@ -1192,14 +1168,14 @@ onclick="javascript:document.photoupdate
if ($autocount > 0) {
$cellcount ++;
$r->print(<