[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonwhatsnew.pm
raeburn
raeburn at source.lon-capa.org
Tue Mar 5 18:42:38 EST 2013
raeburn Tue Mar 5 23:42:38 2013 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface lonwhatsnew.pm
Log:
- For 2.11
- Backport 1.111, 1.112.
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.105.2.4 loncom/interface/lonwhatsnew.pm:1.105.2.5
--- loncom/interface/lonwhatsnew.pm:1.105.2.4 Thu Dec 13 22:09:33 2012
+++ loncom/interface/lonwhatsnew.pm Tue Mar 5 23:42:37 2013
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.105.2.4 2012/12/13 22:09:33 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.105.2.5 2013/03/05 23:42:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -532,28 +532,33 @@
$headings{'crslogin'} = &mt('Last login for users in last 24 hours');
}
- my $now = time;
+ my ($now,$starttime,$activatedstart,$expiredstart,$crsloginstart);
+ $now = time;
+
if ($timediff{'versions'} == -1) {
- $timediff{'versions'} = time;
+ $starttime = 0;
+ } else {
+ $starttime = $now - $timediff{'versions'};
}
- my $starttime = $now - $timediff{'versions'};
if ($timediff{'newroles'} == -1) {
- $timediff{'newroles'} = time;
+ $activatedstart = 0;
+ } else {
+ $activatedstart = $now - $timediff{'newroles'};
}
- my $activatedstart = $now - $timediff{'newroles'};
if ($timediff{'oldroles'} == -1) {
- $timediff{'oldroles'} = time;
+ $expiredstart = 0;
+ } else {
+ $expiredstart = $now - $timediff{'oldroles'};
}
- my $expiredstart = $now - $timediff{'oldroles'};
if ($timediff{'crslogin'} == -1) {
- $timediff{'crslogin'} = time;
+ $crsloginstart = 0;
+ } else {
+ $crsloginstart = $now - $timediff{'crslogin'};
}
- my $crsloginstart = $now - $timediff{'crslogin'};
-
my $countunread = $display_settings{$cid.':countunread'};
unless (defined($countunread)) {
$countunread = 'on';
@@ -1340,28 +1345,26 @@
my (%stucounted,%advcounted);
my $activatedcount = 0;
if (keys(%changes) > 0) {
- foreach my $chg (sort { $b <=> $a } (keys(%changes))) {
+ foreach my $chg (keys(%changes)) {
if (ref($changes{$chg}) eq 'HASH') {
- my $timestamp = $changes{$chg}{'exe_time'};
- if ($timestamp) {
- if ($rolechgtime > 0) {
- if ($timestamp < $rolechgtime) {
- last;
- }
- }
+ next if ($changes{$chg}{'delflag'});
+ if ($rolechgtime > 0) {
+ next if ($changes{$chg}{'exe_time'} < $rolechgtime);
+ }
+ if ($changes{$chg}{'exe_time'}) {
+ my $timestamp = $changes{$chg}{'exe_time'};
if (ref($changes{$chg}{'logentry'}) eq 'HASH') {
- next if ($changes{$chg}{'delflag'});
- my $start = $changes{$chg}{'logentry'}{'start'};
my $end = $changes{$chg}{'logentry'}{'end'};
- my $section = $changes{$chg}{'logentry'}{'section'};
- my $role = $changes{$chg}{'logentry'}{'role'};
- my $uname = $changes{$chg}{'uname'};
- my $udom = $changes{$chg}{'udom'};
next if ($end && $end <= $now);
+ my $start = $changes{$chg}{'logentry'}{'start'};
+ next if ($start >= $timestamp);
+ my $section = $changes{$chg}{'logentry'}{'section'};
if (($viewablesec ne '') && ($section ne '')) {
next if ($viewablesec ne $section);
}
- next if ($start >= $timestamp);
+ my $role = $changes{$chg}{'logentry'}{'role'};
+ my $uname = $changes{$chg}{'uname'};
+ my $udom = $changes{$chg}{'udom'};
if ($role eq 'st') {
$stucounted{$uname.':'.$udom.':'.$section} = $start.':'.$end;
} else {
More information about the LON-CAPA-cvs
mailing list