[LON-CAPA-cvs] cvs: loncom /interface lonwhatsnew.pm

raeburn raeburn at source.lon-capa.org
Tue Mar 5 17:51:49 EST 2013


raeburn		Tue Mar  5 22:51:49 2013 EDT

  Modified files:              
    /loncom/interface	lonwhatsnew.pm 
  Log:
  - Bug 6638.
    - As nohist_rolelog.db keys include timestamp and process number, numerical 
      sort should not be used (process number is variable number of digits).
  
  
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.110 loncom/interface/lonwhatsnew.pm:1.111
--- loncom/interface/lonwhatsnew.pm:1.110	Thu Dec 13 22:03:24 2012
+++ loncom/interface/lonwhatsnew.pm	Tue Mar  5 22:51:48 2013
@@ -1,5 +1,5 @@
 #
-# $Id: lonwhatsnew.pm,v 1.110 2012/12/13 22:03:24 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.111 2013/03/05 22:51:48 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,15 +1345,13 @@
     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;
-                        }
-                    }
+                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'};




More information about the LON-CAPA-cvs mailing list