- + |
ENDONE
foreach my $task (@{$tasksref}) {
if ($task eq $action) {
@@ -272,9 +272,7 @@ ENDONE
$r->print("
|
- - | - | "); + | ");
}
###############################################################
@@ -429,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"; } @@ -508,8 +506,7 @@ ENDTWO } elsif ($action eq "notify") { my $notifycount = 0; my @notified = split(/,/,$enrollvar{notifylist}); - my @domcoord; - my @showdom; + my (@domcoord,@showdom,@olddomcoord,@futuredomcoord); for (my $i=0; $i<@notified; $i++) { if ($notified[$i] !~ /:/) { $notified[$i] =~ s/\@/:/; @@ -522,12 +519,26 @@ 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); - if (!grep(/^$uname:$udom$/,@domcoord)) { - push(@domcoord,$uname.':'.$udom); + 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); + } } } } @@ -565,7 +576,6 @@ ENDTWO my %pname; my %notifystate; my %status; - my $now = time; foreach my $person (sort(keys(%coursepersonnel))) { my $match = 0; my ($role,$user,$usec) = ($person =~ /^([^:]+):([^:]+:[^:]+):([^:]*)/); @@ -601,6 +611,7 @@ ENDTWO usnm => 'username:domain', coac => 'Course Access', curn => 'Current notification status', + doms => 'Domain Coordinator status', notf => 'Notification?', ntac => 'Notification active', ntin => 'Notification inactive', @@ -630,7 +641,7 @@ ENDTWO if (grep(/^$viewer$/,@domcoord)) { $showalldc = 1; } - foreach my $dc (@domcoord) { + foreach my $dc (@domcoord,@futuredomcoord) { if (!grep(/^$dc$/,@ccs)) { if (grep(/^$dc$/,@notified)) { $notifystate{$dc} = 1; @@ -645,6 +656,16 @@ 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(" @@ -662,8 +683,8 @@ ENDTWO |
"); - $r->print(¬ifier_tables('dc',\%lt,\@showdom,\%status,\%notifystate, - \%pname,\$notifyshow)); + $r->print(¬ifier_tables('dc',\%lt,\@showdom,\%status,\%notifystate,\%pname, + \$notifyshow,\@olddomcoord,\@futuredomcoord)); $r->print(" | $$lt{name} | $$lt{usnm} | "; - if ($role eq 'cc') { + if ($role eq 'dc') { + $output .= "$$lt{doms} | "; + } elsif ($role eq 'cc') { $output .= "$$lt{coac} | "; } $output .= "$$lt{curn} | @@ -1246,7 +1271,19 @@ sub notifier_tables { $output .= ''.$$pname{$$users[$i]}.' | '. ''.$$users[$i].' | '; - if ($role eq 'cc') { + if ($role eq 'dc') { + $output .= ''; + if ((ref($olddomcoord) eq 'ARRAY') && (ref($futuredomcoord) eq 'ARRAY')) { + if (grep(/^\Q$users->[$i]\E$/,@{$olddomcoord})) { + $output .= &mt('expired'); + } elsif (grep(/^\Q$users->[$i]\E$/,@{$futuredomcoord})) { + $output .= &mt('future'); + } else { + $output .= &mt('active'); + } + } + $output .= ' | '; + } elsif ($role eq 'cc') { $output .= ''.$$status{$$users[$i]}.' | '; } $output .= '';
@@ -1295,7 +1332,7 @@ sub print_accessdate_table {
);
my $dateshow;
if ( ($oldendshow eq '') && ($oldstartshow eq '') ) {
- $dateshow = " ".&mt('Warning').". ".$lt{'cuno'}." "; + $dateshow = " ".&mt('Warning').". ".$lt{'cuno'}." "; if ($action eq 'setaccess') { $dateshow .= $lt{'ifyo'}."\n"; } elsif ($action eq 'updatenow') { @@ -1475,7 +1512,7 @@ sub print_chgsettings_response { } if ($autoadds || $autodrops) { $warning = &warning_message($dom,$crs,$action); - $warn_prefix = " Warning. Although you indicated that nightly "; + $warn_prefix = " Warning. Although you indicated that nightly "; $warn_suffix = " should be enabled, additional action is required. "; } if ($autoadds) { @@ -1573,7 +1610,7 @@ sub print_setdates_response { } } $warning = &warning_message($dom,$crs,$action); - $warn_prefix = " Warning. Although you set a start and end date for auto-enrollment, additional action is required. "; + $warn_prefix = " Warning. Although you set a start and end date for auto-enrollment, additional action is required. "; unless ($warning eq '') { $response .= $warn_prefix.$warning; } @@ -1672,7 +1709,7 @@ start and end access dates for this cour } } $warning = &warning_message($dom,$crs,$action); - $warn_prefix = " Warning. Although you have set default first and last access dates for students who are added via automatic enrollment, additional action is required. "; + $warn_prefix = " Warning. Although you have set default first and last access dates for students who are added via automatic enrollment, additional action is required. "; unless ($warning eq '') { $response .= $warn_prefix.$warning; } @@ -1980,7 +2017,7 @@ sub print_crosslistings_response () { if (@allxlists > 0) { $warning = &warning_message($dom,$crs,$action); - $warn_prefix = " Warning. Although you have selected crosslisted courses to contribute enrollment to this course, additional action is required. "; + $warn_prefix = " Warning. Although you have selected crosslisted courses to contribute enrollment to this course, additional action is required. "; unless ($warning eq '') { $response .= $warn_prefix.$warning; } @@ -2118,7 +2155,7 @@ sections which contribute to enrollment if ($seccount > 0) { $warning = &warning_message($dom,$crs,$action); - $warn_prefix = " Warning. Although you have selected sections to contribute enrollment to this course, additional action is required. "; + $warn_prefix = " Warning. Although you have selected sections to contribute enrollment to this course, additional action is required. "; unless ($warning eq '') { $response .= $warn_prefix.$warning; } @@ -2289,7 +2326,7 @@ sub print_sections_response () { if (@allsections > 0) { $warning = &warning_message($dom,$crs,$action); - $warn_prefix = " Warning. Although you have selected sections to contribute enrollment to this course, additional action is required. "; + $warn_prefix = " Warning. Although you have selected sections to contribute enrollment to this course, additional action is required. "; unless ($warning eq '') { $response .= $warn_prefix.$warning; } |
---|